diff options
author | cvs2svn | 2002-09-03 10:21:43 +0000 |
---|---|---|
committer | cvs2svn | 2002-09-03 10:21:43 +0000 |
commit | e5b92511cc1d6d6c9bac8bace92c2ae952c11a73 (patch) | |
tree | e002e7d5f48aabdf3a2ee8846b041e2a9e3777d6 | |
parent | 25b2d3565b38115cccc3b73fb113ca39c4c2947a (diff) | |
download | eclipse.platform.ui-e5b92511cc1d6d6c9bac8bace92c2ae952c11a73.tar.gz eclipse.platform.ui-e5b92511cc1d6d6c9bac8bace92c2ae952c11a73.tar.xz eclipse.platform.ui-e5b92511cc1d6d6c9bac8bace92c2ae952c11a73.zip |
This commit was manufactured by cvs2svn to create tag 'v20020309'.v20020309
Sprout from master 2002-08-26 12:50:09 UTC cknaus <cknaus> 'fixed 17901'
Cherrypick from master 2002-09-03 10:21:42 UTC kmaetzel <kmaetzel> 'release notes':
bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/AbstractInformationControlManager.java
bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/JFaceTextMessages.properties
bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/contentassist/AdditionalInfoController.java
bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/source/CompositeRuler.java
bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/source/LineNumberRulerColumn.java
bundles/org.eclipse.ui/Eclipse UI Text Editor/org/eclipse/ui/texteditor/BasicMarkerUpdater.java
bundles/org.eclipse.ui/buildnotes_text.html
bundles/org.eclipse.ui/buildnotes_text_2_0.html
Delete:
bundles/org.eclipse.ui.win32/.classpath
bundles/org.eclipse.ui.win32/.cvsignore
bundles/org.eclipse.ui.win32/.project
bundles/org.eclipse.ui.win32/about.html
bundles/org.eclipse.ui.win32/build.properties
bundles/org.eclipse.ui.win32/fragment.xml
bundles/org.eclipse.ui.win32/src/org/eclipse/ui/internal/editorsupport/win32/OleEditor.java
examples/org.eclipse.ui.examples.multipageeditor/.classpath
examples/org.eclipse.ui.examples.multipageeditor/.cvsignore
examples/org.eclipse.ui.examples.multipageeditor/.project
examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/MessageUtil.java
examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/MultiPageContributor.java
examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/MultiPageEditorExample.java
examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/messages.properties
examples/org.eclipse.ui.examples.multipageeditor/about.html
examples/org.eclipse.ui.examples.multipageeditor/build.properties
examples/org.eclipse.ui.examples.multipageeditor/doc-html/hglegal.htm
examples/org.eclipse.ui.examples.multipageeditor/doc-html/ngibmcpy.gif
examples/org.eclipse.ui.examples.multipageeditor/doc-html/ui_multipageeditor_ex.html
examples/org.eclipse.ui.examples.multipageeditor/icons/copy.gif
examples/org.eclipse.ui.examples.multipageeditor/plugin.properties
examples/org.eclipse.ui.examples.multipageeditor/plugin.xml
examples/org.eclipse.ui.examples.propertysheet/.classpath
examples/org.eclipse.ui.examples.propertysheet/.cvsignore
examples/org.eclipse.ui.examples.propertysheet/.project
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/Address.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/Birthday.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/EmailAddress.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/EmailAddressValidator.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/GroupElement.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/IUserConstants.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/MessageUtil.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/Name.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/OrganizationElement.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/PopupMenuActionDelegate.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/PropertySheetContentOutlinePage.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/PropertySheetPlugin.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/StreetAddress.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/UserEditor.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/UserElement.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/UserFileParser.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/messages.properties
examples/org.eclipse.ui.examples.propertysheet/HelpContexts.xml
examples/org.eclipse.ui.examples.propertysheet/about.html
examples/org.eclipse.ui.examples.propertysheet/build.properties
examples/org.eclipse.ui.examples.propertysheet/doc-html/hglegal.htm
examples/org.eclipse.ui.examples.propertysheet/doc-html/ngibmcpy.gif
examples/org.eclipse.ui.examples.propertysheet/doc-html/ui_propertysheet_ex.html
examples/org.eclipse.ui.examples.propertysheet/doc.zip
examples/org.eclipse.ui.examples.propertysheet/icons/obj16/usereditor.gif
examples/org.eclipse.ui.examples.propertysheet/plugin.properties
examples/org.eclipse.ui.examples.propertysheet/plugin.xml
examples/org.eclipse.ui.examples.readmetool/.classpath
examples/org.eclipse.ui.examples.readmetool/.cvsignore
examples/org.eclipse.ui.examples.readmetool/.project
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AdaptableList.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddReadmeMarkerAction.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddSentenceResolution.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DefaultSectionsParser.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DirtyStateContribution.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/EditorActionDelegate.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeConstants.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeFileParser.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElement.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElementProperties.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MessageUtil.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/PopupMenuActionDelegate.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlineDragListener.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlinePage.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationPage.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationWizard.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeDropActionDelegate.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditor.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditorActionBarContributor.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage2.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeImages.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeMarkerResolutionGenerator.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeModelFactory.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePlugin.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePreferencePage.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeSectionsView.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/SectionsDialog.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ViewActionDelegate.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/WindowActionDelegate.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/messages.properties
examples/org.eclipse.ui.examples.readmetool/HelpContexts.xml
examples/org.eclipse.ui.examples.readmetool/about.html
examples/org.eclipse.ui.examples.readmetool/build.properties
examples/org.eclipse.ui.examples.readmetool/doc-html/hglegal.htm
examples/org.eclipse.ui.examples.readmetool/doc-html/ngibmcpy.gif
examples/org.eclipse.ui.examples.readmetool/doc-html/ui_readmetool_ex.html
examples/org.eclipse.ui.examples.readmetool/doc.zip
examples/org.eclipse.ui.examples.readmetool/doc/hglegal.htm
examples/org.eclipse.ui.examples.readmetool/doc/ngibmcpy.gif
examples/org.eclipse.ui.examples.readmetool/doc/org_eclipse_ui_examples_readmetool.html
examples/org.eclipse.ui.examples.readmetool/doc/org_eclipse_ui_examples_readmetool_sectionParser.html
examples/org.eclipse.ui.examples.readmetool/icons/ctool16/action1.gif
examples/org.eclipse.ui.examples.readmetool/icons/ctool16/action2.gif
examples/org.eclipse.ui.examples.readmetool/icons/ctool16/action3.gif
examples/org.eclipse.ui.examples.readmetool/icons/ctool16/openbrwsr.gif
examples/org.eclipse.ui.examples.readmetool/icons/dtool16/action1.gif
examples/org.eclipse.ui.examples.readmetool/icons/dtool16/action2.gif
examples/org.eclipse.ui.examples.readmetool/icons/dtool16/action3.gif
examples/org.eclipse.ui.examples.readmetool/icons/dtool16/openbrwsr.gif
examples/org.eclipse.ui.examples.readmetool/icons/etool16/action1.gif
examples/org.eclipse.ui.examples.readmetool/icons/etool16/action2.gif
examples/org.eclipse.ui.examples.readmetool/icons/etool16/action3.gif
examples/org.eclipse.ui.examples.readmetool/icons/etool16/openbrwsr.gif
examples/org.eclipse.ui.examples.readmetool/icons/obj16/editor.gif
examples/org.eclipse.ui.examples.readmetool/icons/obj16/newreadme_wiz.gif
examples/org.eclipse.ui.examples.readmetool/icons/obj16/usereditor.gif
examples/org.eclipse.ui.examples.readmetool/icons/view16/sections.gif
examples/org.eclipse.ui.examples.readmetool/icons/wizban/newreadme_wiz.gif
examples/org.eclipse.ui.examples.readmetool/plugin.properties
examples/org.eclipse.ui.examples.readmetool/plugin.xml
tests/org.eclipse.ui.tests/.classpath
tests/org.eclipse.ui.tests/.cvsignore
tests/org.eclipse.ui.tests/.project
tests/org.eclipse.ui.tests/Benchmark Tests/org/eclipse/ui/tests/benchmarks/OpenCloseTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/preferences/FontPreferenceTestCase.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AbstractTreeViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AllTests.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/CheckboxTableViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/CheckboxTreeViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ITestModelListener.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ListViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/StructuredItemViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/StructuredSelectionTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/StructuredViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TableTreeViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TableViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestElement.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestLabelProvider.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModel.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelChange.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelContentProvider.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TreeViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddChildAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddElementAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddFilterAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddSiblingAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ChangeChildLabelAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ChangeInputLabelAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ChangeLabelAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ClearSelectionAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/CreateModelAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/DeleteAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/DeleteChildrenAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/DeleteSiblingsAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ExpandAllAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/Filter.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/FlushInputAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ResetFilterAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ResetSorterAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/SetLabelProviderAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/SetSorterAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/Sorter.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestBrowser.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestBrowserAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestCheckboxTree.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestList.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestSelectionAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTable.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTableTree.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTableTreeLabelProvider.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTree.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/WorldChangedAction.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Component Tests.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Export.txt
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Import.txt
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Navigator.txt
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Outline.txt
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Preferences.txt
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/PropertiesDialog.txt
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/PropertiesView.txt
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Tasks.txt
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/TextEditor.txt
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/WelcomeEditor.txt
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/WorkbenchAction.txt
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/WorkbenchLayout.txt
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Bookmarks View.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/File System Export.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/File System Import.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Navigator View.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/New File Wizard.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/New Folder Wizard.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/New Project Wizard.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Outline View.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Persistence.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Preferences.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Properties Dialog.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Properties View.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Tasks View.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Test Scenarios.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Text Editor
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Welcome Editor.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Window Actions.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Window Layout.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/ZIP Export.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/ZIP Import.html
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/SelectionProviderView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/TestPlugin.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/UiTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptableDecoratorTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptableResourceWrapper.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptableTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptedResourceNavigator.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/NullLabelDecorator.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/ResourceAction.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/TestAdaptableContentProvider.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/TestAdaptableWorkbenchAdapter.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/TestNavigatorActionGroup.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ApiTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IActionBarsTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IActionDelegateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IActionFilterTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IConstants.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorActionBarContributorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorActionDelegateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorDescriptorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorLauncherTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorPartTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorRegistryTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorSiteTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IFileEditorMappingTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPageListenerTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPageServiceTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPerspectiveDescriptorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPerspectiveListenerTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPerspectiveRegistryTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ISelectionServiceTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IViewActionDelegateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IViewPartTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IViewSiteTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchPageTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchPartSiteTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchPartTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchWindowActionDelegateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchWindowTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkingSetManagerTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkingSetTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListContentProvider.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListElement.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListElementActionFilter.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockAction.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockActionDelegate.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorActionBarContributor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorActionDelegate.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorPart.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockPartListener.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockPropertyListener.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockSelectionProvider.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockViewActionDelegate.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockViewPart.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkbenchPart.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkbenchWindowActionDelegate.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkingSetPage.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkingSetTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/PlatformUITest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionCreateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionPerspective.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionRestoreTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ImportOperationTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/tests.ini
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/DataTransferMessagesCopy.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/DataTransferTestStub.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/EnableTestPreferencePage.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/NavigatorTestStub.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/PreferenceDialogWrapper.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/PropertyDialogWrapper.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/ResourceMessagesCopy.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/ResourceNavigatorMessagesCopy.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/TaskListTestStub.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/TextEditorTestStub.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIAutomatedSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogs.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogsAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIEditWorkingSetWizardAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIInteractiveSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIMessageDialogs.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIMessageDialogsAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UINewWorkingSetWizardAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIPreferences.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIPreferencesAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWizards.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWizardsAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWorkingSetWizardsAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ActionExpressionTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ActionSetExpressionTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/EditorActionBarsTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedSourceViewer.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedTextEditor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedTextSelection.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedTextSelectionActionFilter.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/InternalTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/PopupMenuExpressionTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/TextSelectionActionExpressionTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/AbstractNavigatorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/DecoratorTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/NavigatorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/NavigatorTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/ResourceNavigatorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/TestDecoratorContributor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/propertysheet/PropertySheetAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/propertysheet/PropertySheetTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ActivateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/CloseEditorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/HideViewTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/OpenEditorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ShowViewTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ZoomTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ZoomTestSuite.java
tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/AccessibilityTestPass.java
tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/FailureDialog.java
tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/FocusTestPass.java
tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/IDialogTestPass.java
tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/SizingTestPass.java
tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/VerifyDialog.java
tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/ActionUtil.java
tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/ArrayUtil.java
tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/CallHistory.java
tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/DialogCheck.java
tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/EmptyPerspective.java
tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/FileUtil.java
tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/UITestCase.java
tests/org.eclipse.ui.tests/about.html
tests/org.eclipse.ui.tests/build.properties
tests/org.eclipse.ui.tests/doc/Introduction.html
tests/org.eclipse.ui.tests/doc/JUnitPractices.html
tests/org.eclipse.ui.tests/icons/anything.gif
tests/org.eclipse.ui.tests/icons/mockeditorpart1.gif
tests/org.eclipse.ui.tests/icons/mockeditorpart2.gif
tests/org.eclipse.ui.tests/icons/view.gif
tests/org.eclipse.ui.tests/plugin.xml
tests/org.eclipse.ui.tests/test.xml
tests/org.eclipse.ui.tests/uiSniff
tests/org.eclipse.ui.tests/uiSniff.bat
350 files changed, 1092 insertions, 28116 deletions
diff --git a/bundles/org.eclipse.ui.win32/.classpath b/bundles/org.eclipse.ui.win32/.classpath deleted file mode 100644 index 8e2273a6356..00000000000 --- a/bundles/org.eclipse.ui.win32/.classpath +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/> - <classpathentry kind="src" path="/org.eclipse.ui"/> - <classpathentry kind="src" path="/org.eclipse.swt"/> - <classpathentry kind="src" path="/org.eclipse.core.resources"/> - <classpathentry kind="src" path="/org.eclipse.core.runtime"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/bundles/org.eclipse.ui.win32/.cvsignore b/bundles/org.eclipse.ui.win32/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/bundles/org.eclipse.ui.win32/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/bundles/org.eclipse.ui.win32/.project b/bundles/org.eclipse.ui.win32/.project deleted file mode 100644 index d0876c2fa15..00000000000 --- a/bundles/org.eclipse.ui.win32/.project +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.ui.win32</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.core.resources</project>
- <project>org.eclipse.core.runtime</project>
- <project>org.eclipse.swt</project>
- <project>org.eclipse.ui</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.ui.win32/about.html b/bundles/org.eclipse.ui.win32/about.html deleted file mode 100644 index 9db411aab99..00000000000 --- a/bundles/org.eclipse.ui.win32/about.html +++ /dev/null @@ -1,30 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> -<html> -<head> -<title>About</title> -<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1"> -</head> -<body lang="EN-US"> -<h2>About This Content</h2> - -<p>20th June, 2002</p> -<h3>License</h3> -<p>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 <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>. -For purposes of the CPL, "Program" will mean the Content.</p> - -<h3>Contributions</h3> - -<p>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.</p> - -<p>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.</p> - -</body> -</html>
\ No newline at end of file diff --git a/bundles/org.eclipse.ui.win32/build.properties b/bundles/org.eclipse.ui.win32/build.properties deleted file mode 100644 index 1c4c96d1b36..00000000000 --- a/bundles/org.eclipse.ui.win32/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.workbenchwin32.jar=src/ -src.includes=about.html -bin.includes=fragment.xml,fragment.properties,*.jar
\ No newline at end of file diff --git a/bundles/org.eclipse.ui.win32/fragment.xml b/bundles/org.eclipse.ui.win32/fragment.xml deleted file mode 100644 index b497027db48..00000000000 --- a/bundles/org.eclipse.ui.win32/fragment.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<fragment - id="org.eclipse.ui.win32" - name="%Win32Fragment.fragmentName" - version="2.0.0" - provider-name="%Plugin.providerName" - plugin-id="org.eclipse.ui" - plugin-version="2.0.0"> - - <runtime> - <library name="workbenchwin32.jar"> - <export name="*"/> - </library> - </runtime> - - -</fragment> diff --git a/bundles/org.eclipse.ui.win32/src/org/eclipse/ui/internal/editorsupport/win32/OleEditor.java b/bundles/org.eclipse.ui.win32/src/org/eclipse/ui/internal/editorsupport/win32/OleEditor.java deleted file mode 100644 index 4cce7d639e7..00000000000 --- a/bundles/org.eclipse.ui.win32/src/org/eclipse/ui/internal/editorsupport/win32/OleEditor.java +++ /dev/null @@ -1,611 +0,0 @@ -package org.eclipse.ui.internal.editorsupport.win32; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.util.Vector; - -import org.eclipse.core.resources.*; -import org.eclipse.core.runtime.*; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.dialogs.*; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.JFaceColors; -import org.eclipse.jface.viewers.*; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.ole.win32.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.ui.*; -import org.eclipse.ui.actions.WorkspaceModifyOperation; -import org.eclipse.ui.dialogs.SaveAsDialog; -import org.eclipse.ui.internal.WorkbenchMessages; -import org.eclipse.ui.internal.WorkbenchPage; -import org.eclipse.ui.part.EditorPart; -import org.eclipse.ui.part.FileEditorInput; - -/** - */ -public class OleEditor extends EditorPart { - - /** - * The resource listener updates the receiver when - * a change has occured. - */ - private IResourceChangeListener resourceListener = - new IResourceChangeListener() { - - /* - * @see IResourceChangeListener#resourceChanged(IResourceChangeEvent) - */ - public void resourceChanged(IResourceChangeEvent event) { - IResourceDelta mainDelta = event.getDelta(); - if(mainDelta == null) - return; - IResourceDelta affectedElement = - mainDelta.findMember(resource.getFullPath()); - if (affectedElement != null) - try { - processDelta(affectedElement); - } catch (CoreException exception) { - //Failed so close the receiver - getSite().getPage().closeEditor(OleEditor.this, true); - } - } - - /* - * Process the delta for the receiver - */ - private boolean processDelta(final IResourceDelta delta) throws CoreException { - - Runnable changeRunnable = null; - - switch (delta.getKind()) { - case IResourceDelta.REMOVED : - if ((IResourceDelta.MOVED_TO & delta.getFlags()) != 0) { - changeRunnable = new Runnable() { - public void run() { - IPath path = delta.getMovedToPath(); - IFile newFile = delta.getResource().getWorkspace().getRoot().getFile(path); - if (newFile != null) { - sourceChanged(newFile); - } - } - }; - } else { - changeRunnable = new Runnable() { - public void run() { - sourceDeleted = true; - getSite().getPage().closeEditor(OleEditor.this, true); - } - }; - - } - - break; - } - - if (changeRunnable != null) - update(changeRunnable); - - return true; // because we are sitting on files anyway - } - - }; - - private OleFrame clientFrame; - private OleClientSite clientSite; - private File source; - private IFile resource; - private Image oleTitleImage; - //The sourceDeleted flag makes sure that the receiver is not - //dirty when shutting down - boolean sourceDeleted = false; - //The sourceChanged flag indicates whether or not the save from the ole component - //can be used or if the input changed - boolean sourceChanged = false; - - /** - * Keep track of whether we have an active client so we do not - * deactivate multiple times - */ - private boolean clientActive = false; - - /** - * Keep track of whether we have activated OLE or not as some applications - * will only allow single activations. - */ - private boolean oleActivated = false; - - private IPartListener partListener = new IPartListener() { - public void partActivated(IWorkbenchPart part) { - activateClient(part); - } - public void partBroughtToTop(IWorkbenchPart part) { - } - public void partClosed(IWorkbenchPart part) { - } - public void partOpened(IWorkbenchPart part) { - } - public void partDeactivated(IWorkbenchPart part) { - deactivateClient(part); - } - }; - - private static final String FILE_PROMPTER_TITLE = - WorkbenchMessages.getString("OleEditor.renameTitle"); //$NON-NLS-1$ - //$NON-NLS-1$ - private static final String FILE_PROMPTER_MESSAGE = - WorkbenchMessages.getString("OleEditor.renameMessage"); //$NON-NLS-1$ - //$NON-NLS-1$ - private static final String RENAME_ERROR_TITLE = - WorkbenchMessages.getString("OleEditor.errorSaving"); //$NON-NLS-1$ - //$NON-NLS-1$ - private static final String OLE_EXCEPTION_TITLE = - WorkbenchMessages.getString("OleEditor.oleExceptionTitle"); //$NON-NLS-1$ - //$NON-NLS-1$ - private static final String OLE_EXCEPTION_MESSAGE = - WorkbenchMessages.getString("OleEditor.oleExceptionMessage"); //$NON-NLS-1$ - //$NON-NLS-1$ - private static final String SAVE_ERROR_TITLE = - WorkbenchMessages.getString("OleEditor.savingTitle"); //$NON-NLS-1$ - //$NON-NLS-1$ - private static final String SAVE_ERROR_MESSAGE = - WorkbenchMessages.getString("OleEditor.savingMessage"); //$NON-NLS-1$ - //$NON-NLS-1$ - /** - * Return a new ole editor. - */ - public OleEditor() { - } - - private void activateClient(IWorkbenchPart part) { - if (part == this) { - oleActivate(); - this.clientActive = true; - } - } - /** - * createPartControl method comment. - */ - public void createPartControl(Composite parent) { - - // Create a frame. - clientFrame = new OleFrame(parent, SWT.CLIP_CHILDREN); - clientFrame.setBackground( - JFaceColors.getBannerBackground(clientFrame.getDisplay())); - - initializeWorkbenchMenus(); - - // Set the input file. - IEditorInput input = getEditorInput(); - if (input instanceof IFileEditorInput) { - setResource(((IFileEditorInput) input).getFile()); - resource.getWorkspace().addResourceChangeListener(resourceListener); - } - - createClientSite(); - } - - /** - * Create the client site for the reciever - */ - - private void createClientSite() { - //If there was an OLE Error or nothing has been created yet - if (clientFrame == null || clientFrame.isDisposed()) - return; - // Create a OLE client site. - clientSite = new OleClientSite(clientFrame, SWT.NONE, source); - clientSite.setBackground( - JFaceColors.getBannerBackground(clientFrame.getDisplay())); - - } - - private void deactivateClient(IWorkbenchPart part) { - //Check the client active flag. Set it to false when we have deactivated - //to prevent multiple deactivations. - if (part == this && clientActive) { - if(clientSite != null) - clientSite.deactivateInPlaceClient(); - this.clientActive = false; - this.oleActivated = false; - } - } - /** - * Display an error dialog with the supplied title and message. - */ - private void displayErrorDialog(String title, String message) { - Shell parent = null; - if(getClientSite() != null) - parent = getClientSite().getShell(); - MessageDialog.openError(parent, title, message); - } - /** - * @see IWorkbenchPart#dispose - */ - public void dispose() { - if (resource != null) - resource.getWorkspace().removeResourceChangeListener(resourceListener); - - //can dispose the title image because it was created in init - if (oleTitleImage != null) { - oleTitleImage.dispose(); - oleTitleImage = null; - } - - if (getSite() != null && getSite().getPage() != null) - getSite().getPage().removePartListener(partListener); - - } - /** - * Print this object's contents - */ - public void doPrint() { - if(clientSite == null) - return; - BusyIndicator.showWhile(clientSite.getDisplay(), new Runnable() { - public void run() { - clientSite.exec(OLE.OLECMDID_PRINT, OLE.OLECMDEXECOPT_PROMPTUSER, null, null); - // note: to check for success: above == SWTOLE.S_OK - } - }); - } - /** - * Save the viewer's contents to the source file system file - */ - public void doSave(final IProgressMonitor monitor) { - if(clientSite == null) - return; - BusyIndicator.showWhile(clientSite.getDisplay(), new Runnable() { - public void run() { - - //Do not try and use the component provided save if the source has - //changed in Eclipse - if (!sourceChanged) { - int result = clientSite.queryStatus(OLE.OLECMDID_SAVE); - if ((result & OLE.OLECMDF_ENABLED) != 0) { - result = - clientSite.exec(OLE.OLECMDID_SAVE, OLE.OLECMDEXECOPT_PROMPTUSER, null, null); - if (result == OLE.S_OK) { - try { - resource.refreshLocal(resource.DEPTH_ZERO, monitor); - } catch (CoreException ex) { - } - return; - } else { - displayErrorDialog( - OLE_EXCEPTION_TITLE, - OLE_EXCEPTION_MESSAGE + String.valueOf(result)); - return; - } - } - } - if (saveFile(source)) { - try { - resource.refreshLocal(resource.DEPTH_ZERO, monitor); - } catch (CoreException ex) { - } - } else - displayErrorDialog(SAVE_ERROR_TITLE, SAVE_ERROR_MESSAGE + source.getName()); - } - }); - } - /** - * Save the viewer's contents into the provided resource. - */ - public void doSaveAs() { - if(clientSite == null) - return; - WorkspaceModifyOperation op = saveNewFileOperation(); - Shell shell = clientSite.getShell(); - try { - new ProgressMonitorDialog(shell).run(false, true, op); - } catch (InterruptedException interrupt) { - //Nothing to reset so do nothing - } catch (InvocationTargetException invocationException) { - MessageDialog.openError( - shell, - RENAME_ERROR_TITLE, - invocationException.getTargetException().getMessage()); - } - - } - /** - * Answer self's client site - * - * @return org.eclipse.swt.ole.win32.OleClientSite - */ - public OleClientSite getClientSite() { - return clientSite; - } - /** - * Answer the file system representation of self's input element - * - * @return java.io.File - */ - public File getSourceFile() { - return source; - } - /* (non-Javadoc) - * Sets the cursor and selection state for this editor to the passage defined - * by the given marker. - * - * @see IEditorPart - */ - public void gotoMarker(IMarker marker) { - } - - private void handleWord() { - OleAutomation dispInterface = new OleAutomation(clientSite); - // Get Application - int[] appId = dispInterface.getIDsOfNames(new String[]{"Application"}); - if (appId != null) { - Variant pVarResult = dispInterface.getProperty(appId[0]); - if (pVarResult != null) { - OleAutomation application = pVarResult.getAutomation(); - int[] dispid = application.getIDsOfNames(new String[] {"DisplayScrollBars"}); - if (dispid != null) { - Variant rgvarg = new Variant(true); - boolean result = application.setProperty(dispid[0], rgvarg); - } - application.dispose(); - } - } - dispInterface.dispose(); - } - - /* (non-Javadoc) - * Initializes the editor when created from scratch. - * - * This method is called soon after part construction and marks - * the start of the extension lifecycle. At the end of the - * extension lifecycle <code>shutdown</code> will be invoked - * to terminate the lifecycle. - * - * @param container an interface for communication with the part container - * @param input The initial input element for the editor. In most cases - * it is an <code>IFile</code> but other types are acceptable. - * @see IWorkbenchPart#shutdown - */ - public void init(IEditorSite site, IEditorInput input) - throws PartInitException { - // Check input. - if (!(input instanceof IFileEditorInput)) - throw new PartInitException( - WorkbenchMessages.format("OleEditor.invalidInput", new Object[] { input })); //$NON-NLS-1$ - //$NON-NLS-1$ - - // Save input. - setSite(site); - setInput(input); - - // Update titles. - setTitle(input.getName()); - setTitleToolTip(input.getToolTipText()); - ImageDescriptor desc = input.getImageDescriptor(); - if (desc != null) { - oleTitleImage = desc.createImage(); - setTitleImage(oleTitleImage); - } - - // Listen for part activation. - site.getPage().addPartListener(partListener); - - } - /** - * Initialize the workbench menus for proper merging - */ - protected void initializeWorkbenchMenus() { - //If there was an OLE Error or nothing has been created yet - if (clientFrame == null || clientFrame.isDisposed()) - return; - // Get the browser menubar. If one does not exist then - // create it. - Shell shell = clientFrame.getShell(); - Menu menuBar = shell.getMenuBar(); - if (menuBar == null) { - menuBar = new Menu(shell, SWT.BAR); - shell.setMenuBar(menuBar); - } - - // Swap the file and window menus. - MenuItem[] windowMenu = new MenuItem[1]; - MenuItem[] fileMenu = new MenuItem[1]; - Vector containerItems = new Vector(); - - IWorkbenchWindow window = getSite().getWorkbenchWindow(); - - for (int i = 0; i < menuBar.getItemCount(); i++) { - MenuItem item = menuBar.getItem(i); - String id = ""; //$NON-NLS-1$ - if (item.getData() instanceof IMenuManager) - id = ((IMenuManager) item.getData()).getId(); - if (id.equals(IWorkbenchActionConstants.M_FILE)) - fileMenu[0] = item; - else if (id.equals(IWorkbenchActionConstants.M_WINDOW)) - windowMenu[0] = item; - else { - if (window.isApplicationMenu(id)) { - containerItems.addElement(item); - } - } - } - MenuItem[] containerMenu = new MenuItem[containerItems.size()]; - containerItems.copyInto(containerMenu); - clientFrame.setFileMenus(fileMenu); - clientFrame.setContainerMenus(containerMenu); - clientFrame.setWindowMenus(windowMenu); - } - /* (non-Javadoc) - * Returns whether the contents of this editor have changed since the last save - * operation. As this is an external editor and we have no way of knowing return true - * if there is something to save to. - * - * @see IEditorPart - */ - public boolean isDirty() { - /*Return only if we have a clientSite which is dirty - as this can be asked before anything is opened*/ - return this.clientSite != null; - } - /* (non-Javadoc) - * Returns whether the "save as" operation is supported by this editor. We assume we - * can always save a file whether it will be via OLE or not. - * - * @see IEditorPart - */ - public boolean isSaveAsAllowed() { - return true; - } - /** - * Since we don't know when a change has been made, always answer true - */ - public boolean isSaveNeeded() { - //Answer false if it was not opened and true only if it is dirty - return getClientSite() != null && isDirty(); - } - /** - * Save the supplied file using the SWT API. - * @param file java.io.File - */ - private boolean saveFile(File file) { - - File tempFile = new File(file.getAbsolutePath() + ".tmp"); //$NON-NLS-1$ - file.renameTo(tempFile); - boolean saved = false; - if (OLE.isOleFile(file) || usesStorageFiles(clientSite.getProgramID())) { - saved = clientSite.save(file, true); - } else { - saved = clientSite.save(file, false); - } - - if (saved) { - // save was successful so discard the backup - tempFile.delete(); - return true; - } else { - // save failed so restore the backup - tempFile.renameTo(file); - return false; - } - } - /** - * Save the new File using the client site. - */ - private WorkspaceModifyOperation saveNewFileOperation() { - - return new WorkspaceModifyOperation() { - public void execute(final IProgressMonitor monitor) throws CoreException { - SaveAsDialog dialog = new SaveAsDialog(clientFrame.getShell()); - IFileEditorInput input = (IFileEditorInput)getEditorInput(); - IFile sFile = input.getFile(); - dialog.setOriginalFile(sFile); - dialog.open(); - - IPath newPath = dialog.getResult(); - if(newPath == null) - return; - - if (dialog.getReturnCode() == dialog.OK) { - String projectName = newPath.segment(0); - newPath = newPath.removeFirstSegments(1); - IProject project = resource.getWorkspace().getRoot().getProject(projectName); - newPath = project.getLocation().append(newPath); - File newFile = newPath.toFile(); - if (saveFile(newFile)) { - IFile newResource = resource.getWorkspace().getRoot().getFileForLocation(newPath); - if (newResource != null) { - sourceChanged(newResource); - newResource.refreshLocal(IResource.DEPTH_ZERO, monitor); - } - } else { - displayErrorDialog(SAVE_ERROR_TITLE, SAVE_ERROR_MESSAGE + newFile.getName()); - return; - } - } - } - }; - - } - /** - * Asks the part to take focus within the workbench. - */ - public void setFocus() {} - - /** - * Make ole active so that the controls are rendered. - */ - private void oleActivate() { - //If there was an OLE Error or nothing has been created yet - if (clientSite == null || clientFrame == null || clientFrame.isDisposed()) - return; - - if (!oleActivated) { - clientSite.doVerb(OLE.OLEIVERB_SHOW); - oleActivated = true; - String progId = clientSite.getProgramID(); - if (progId != null && progId.startsWith("Word.Document")) { //$NON-NLS-1$ - handleWord(); - } - } - } - - /** - * Set the file resource that this object is displaying - */ - protected void setResource(IFile file) { - resource = file; - source = new File(file.getLocation().toOSString()); - } - /** - * See if it is one of the known types that use OLE Storage. - */ - private static boolean usesStorageFiles(String progID) { - return (progID != null && (progID.startsWith("Word.", 0) //$NON-NLS-1$ - || progID.startsWith("MSGraph", 0) //$NON-NLS-1$ - || progID.startsWith("PowerPoint", 0) //$NON-NLS-1$ - || progID.startsWith("Excel", 0))); //$NON-NLS-1$ - } - - /** - * The source has changed to the newFile. Update - * editors and set any required flags - */ - private void sourceChanged(IFile newFile) { - - FileEditorInput newInput = new FileEditorInput(newFile); - setInput(newInput); - setResource(newFile); - sourceChanged = true; - setTitle(newInput.getName()); - - } - - /* - * See IEditorPart.isSaveOnCloseNeeded() - */ - public boolean isSaveOnCloseNeeded() { - return !sourceDeleted && super.isSaveOnCloseNeeded(); - } - - /** - * Posts the update code "behind" the running operation. - * - * @param runnable the update code - */ - private void update(Runnable runnable) { - IWorkbench workbench = PlatformUI.getWorkbench(); - IWorkbenchWindow[] windows = workbench.getWorkbenchWindows(); - if (windows != null && windows.length > 0) { - Display display = windows[0].getShell().getDisplay(); - display.asyncExec(runnable); - } else - runnable.run(); - } - -}
\ No newline at end of file diff --git a/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/AbstractInformationControlManager.java b/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/AbstractInformationControlManager.java index 279f65879c6..6e0305c50c0 100644 --- a/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/AbstractInformationControlManager.java +++ b/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/AbstractInformationControlManager.java @@ -238,6 +238,7 @@ abstract public class AbstractInformationControlManager { * @param enforceAsMaximalSize indicates whether the constraints describe the maximal allowed size of the control
*/
public void setSizeConstraints(int widthInChar, int heightInChar, boolean enforceAsMinimalSize, boolean enforceAsMaximalSize) {
+ fSizeConstraints= null; fWidthConstraint= widthInChar;
fHeightConstraint= heightInChar;
fEnforceAsMinimalSize= enforceAsMinimalSize;
diff --git a/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/JFaceTextMessages.properties b/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/JFaceTextMessages.properties index cfdd4f09902..8b5a85d485c 100644 --- a/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/JFaceTextMessages.properties +++ b/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/JFaceTextMessages.properties @@ -25,6 +25,4 @@ InfoPopup.info_delay_timer_name=AdditionalInfo Delay ContentAssistant.assist_delay_timer_name=AutoAssist Delay
-LineNumberRulerColumn.prefix_placeholder=..
-
AbstractHoverInformationControlManager.hover.restarter=Hover Restart Delay
diff --git a/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/contentassist/AdditionalInfoController.java b/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/contentassist/AdditionalInfoController.java index 2540cd47ca8..4b7803ab969 100644 --- a/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/contentassist/AdditionalInfoController.java +++ b/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/contentassist/AdditionalInfoController.java @@ -16,6 +16,7 @@ import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Table;
@@ -77,7 +78,6 @@ class AdditionalInfoController extends AbstractInformationControlManager impleme fDelay= delay;
setAnchor(ANCHOR_RIGHT);
setFallbackAnchors(new Anchor[] { ANCHOR_LEFT, ANCHOR_BOTTOM, ANCHOR_RIGHT });
- setSizeConstraints(50, 10, true, false);
}
/*
@@ -214,6 +214,19 @@ class AdditionalInfoController extends AbstractInformationControlManager impleme setInformation(information, area);
}
}
+ + /* + * @see org.eclipse.jface.text.AbstractInformationControlManager#computeSizeConstraints(Control, IInformationControl) + */ + protected Point computeSizeConstraints(Control subjectControl, IInformationControl informationControl) { + Point sizeConstraint= super.computeSizeConstraints(subjectControl, informationControl); + Point size= subjectControl.getSize(); + if (sizeConstraint.x < size.x) + sizeConstraint.x= size.x; + if (sizeConstraint.y < size.y) + sizeConstraint.y= size.y; + return sizeConstraint; + } }
diff --git a/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java b/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java index 6980a972868..332354ff7f1 100644 --- a/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java +++ b/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java @@ -18,6 +18,8 @@ import java.util.List; import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.ControlEvent; +import org.eclipse.swt.events.ControlListener; import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.events.VerifyEvent;
@@ -42,7 +44,9 @@ import org.eclipse.jface.text.ITextViewer; *
* @see org.eclipse.jface.text.contentassist.ICompletionProposal
*/
-class CompletionProposalPopup implements IContentAssistListener {
+class CompletionProposalPopup implements IContentAssistListener { + + private static Point fgProposalShellSize;
private ITextViewer fViewer;
private ContentAssistant fContentAssistant;
@@ -59,7 +63,7 @@ class CompletionProposalPopup implements IContentAssistListener { private int fInvocationOffset;
private int fFilterOffset;
- private String fLineDelimiter= null;
+ private String fLineDelimiter;
/** @@ -149,13 +153,31 @@ class CompletionProposalPopup implements IContentAssistListener { return;
Control control= fViewer.getTextWidget();
- fProposalShell= new Shell(control.getShell(), SWT.NO_TRIM | SWT.ON_TOP);
+ fProposalShell= new Shell(control.getShell(), SWT.ON_TOP | SWT.RESIZE ); fProposalTable= new Table(fProposalShell, SWT.H_SCROLL | SWT.V_SCROLL);
-
- int height= fProposalTable.getItemHeight() * 10;
- fProposalShell.setSize(302, height + 2);
- fProposalTable.setSize(300, height);
- fProposalTable.setLocation(1, 1);
+ + fProposalTable.setLocation(0, 0); + fAdditionalInfoController.setSizeConstraints(50, 10, true, false); + + if (fgProposalShellSize == null) { + int height= fProposalTable.getItemHeight() * 10; + fgProposalShellSize= new Point(306, height + 6); + } + fProposalShell.setSize(fgProposalShellSize.x, fgProposalShellSize.y);
+ fProposalTable.setSize(fgProposalShellSize.x - 6, fgProposalShellSize.y - 6);
+ + fProposalShell.addControlListener(new ControlListener() { + + public void controlMoved(ControlEvent e) {} + + public void controlResized(ControlEvent e) { + fgProposalShellSize= fProposalShell.getSize(); + fProposalTable.setSize(fgProposalShellSize.x - 6, fgProposalShellSize.y - 6); + // resets the cached resize constraints + fAdditionalInfoController.setSizeConstraints(50, 10, true, false); + } + }); +
fProposalShell.setBackground(control.getDisplay().getSystemColor(SWT.COLOR_BLACK));
diff --git a/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/source/CompositeRuler.java b/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/source/CompositeRuler.java index f991c6c5bfd..aee091f6049 100644 --- a/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/source/CompositeRuler.java +++ b/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/source/CompositeRuler.java @@ -290,7 +290,8 @@ public final class CompositeRuler implements IVerticalRuler, IVerticalRulerExten * * @param clazz the listener type * @param listener the listener object - */ private void removeListener(Class clazz, SWTEventListener listener) { + */ + private void removeListener(Class clazz, SWTEventListener listener) { int length= fCachedListeners.size(); for (int i= 0; i < length; i++) { ListenerInfo info= (ListenerInfo) fCachedListeners.get(i); diff --git a/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/source/LineNumberRulerColumn.java b/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/source/LineNumberRulerColumn.java index a0d62a6dbbb..ceba38b3ad9 100644 --- a/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/source/LineNumberRulerColumn.java +++ b/bundles/org.eclipse.ui/Eclipse JFace Text/org/eclipse/jface/text/source/LineNumberRulerColumn.java @@ -38,6 +38,7 @@ import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextListener; import org.eclipse.jface.text.ITextViewer; +import org.eclipse.jface.text.ITextViewerExtension; import org.eclipse.jface.text.IViewportListener; import org.eclipse.jface.text.TextEvent; @@ -70,6 +71,12 @@ public final class LineNumberRulerColumn implements IVerticalRulerColumn { if (!event.getViewerRedrawState()) return; + if (computeNumberOfDigits()) { + computeIndentations(); + layout(); + return; + } + if (fSensitiveToTextChanges || event.getDocumentEvent() == null) { if (fCanvas != null && !fCanvas.isDisposed()) { Display d= fCanvas.getDisplay(); @@ -85,9 +92,6 @@ public final class LineNumberRulerColumn implements IVerticalRulerColumn { } }; - /** Maximal number of digits visible in the ruler column. */ - private final static int MAXDIGITS= 5; - /** This column's parent ruler */ private CompositeRuler fParentRuler; /** Cached text viewer */ @@ -112,15 +116,14 @@ public final class LineNumberRulerColumn implements IVerticalRulerColumn { private Color fForeground; /** The background color */ private Color fBackground; - /** Digit place holder for line number exceeding the MAXDIGITS length */ - private String fDigitPlaceHolder; + /** Cached number of displayed digits */ + private int fCachedNumberOfDigits= -1; /** * Constructs a new vertical ruler column. */ public LineNumberRulerColumn() { - fDigitPlaceHolder= JFaceTextMessages.getString("LineNumberRulerColumn.prefix_placeholder"); //$NON-NLS-1$ } /** @@ -168,7 +171,48 @@ public final class LineNumberRulerColumn implements IVerticalRulerColumn { public int getWidth() { return fIndentation[0]; } + + /** + * Computes the number of digits to be displayed. Returns + * <code>true</code> if the number of digits changed compared + * to the previous call of this method. If the method is called + * for the first time, the return value is also <code>true</code>. + * + * @return the number of digits to be displayed + */ + protected boolean computeNumberOfDigits() { + + IDocument document= fCachedTextViewer.getDocument(); + int lines= document == null ? 0 : document.getNumberOfLines(); + + int digits= 2; + while (lines > Math.pow(10, digits) -1) { + ++digits; + } + if (fCachedNumberOfDigits != digits) { + fCachedNumberOfDigits= digits; + return true; + } + + return false; + } + + /** + * Layouts the enclosing viewer to adapt the layout to changes of the + * size of the individual components. + */ + protected void layout() { + if (fCachedTextViewer instanceof ITextViewerExtension) { + ITextViewerExtension extension= (ITextViewerExtension) fCachedTextViewer; + Control control= extension.getControl(); + if (control instanceof Composite && !control.isDisposed()) { + Composite composite= (Composite) control; + composite.layout(true); + } + } + } + /** * Computes the indentations for the given font and stores them in * <code>fIndentation</code>. @@ -180,13 +224,13 @@ public final class LineNumberRulerColumn implements IVerticalRulerColumn { gc.setFont(fCanvas.getFont()); NumberFormat nf= NumberFormat.getInstance(); - fIndentation= new int[MAXDIGITS + 1]; + fIndentation= new int[fCachedNumberOfDigits + 1]; - double number= Math.pow(10, MAXDIGITS) - 1; + double number= Math.pow(10, fCachedNumberOfDigits) - 1; Point p= gc.stringExtent(nf.format(number)); fIndentation[0]= p.x; - for (int i= 1; i <= MAXDIGITS; i++) { + for (int i= 1; i <= fCachedNumberOfDigits; i++) { number= Math.pow(10, i) - 1; p= gc.stringExtent(nf.format(number)); fIndentation[i]= fIndentation[0] - p.x; @@ -253,6 +297,7 @@ public final class LineNumberRulerColumn implements IVerticalRulerColumn { if (fFont != null) fCanvas.setFont(fFont); + computeNumberOfDigits(); computeIndentations(); return fCanvas; } @@ -384,17 +429,8 @@ public final class LineNumberRulerColumn implements IVerticalRulerColumn { break; String s= Integer.toString(line + 1); - int length= s.length(); - if (length <= MAXDIGITS) { - int indentation= fIndentation[s.length()]; - gc.drawString(nf.format(line + 1), indentation, y); - } else { - StringBuffer buffer= new StringBuffer(); - buffer.append(s.substring(length - MAXDIGITS, length)); - if (MAXDIGITS >= 2) - buffer.replace(0, 2, fDigitPlaceHolder); - gc.drawString(buffer.toString(), 0, y); - } + int indentation= fIndentation[s.length()]; + gc.drawString(nf.format(line + 1), indentation, y); } } @@ -422,6 +458,7 @@ public final class LineNumberRulerColumn implements IVerticalRulerColumn { fFont= font; if (fCanvas != null && !fCanvas.isDisposed()) { fCanvas.setFont(fFont); + computeNumberOfDigits(); computeIndentations(); } } diff --git a/bundles/org.eclipse.ui/Eclipse UI Text Editor/org/eclipse/ui/texteditor/BasicMarkerUpdater.java b/bundles/org.eclipse.ui/Eclipse UI Text Editor/org/eclipse/ui/texteditor/BasicMarkerUpdater.java index 0f1fbe485be..ae734185f7f 100644 --- a/bundles/org.eclipse.ui/Eclipse UI Text Editor/org/eclipse/ui/texteditor/BasicMarkerUpdater.java +++ b/bundles/org.eclipse.ui/Eclipse UI Text Editor/org/eclipse/ui/texteditor/BasicMarkerUpdater.java @@ -57,26 +57,29 @@ public final class BasicMarkerUpdater implements IMarkerUpdater { if (position.isDeleted())
return false;
- boolean changed= false;
+ boolean offsetsInitialized= false;
+ boolean offsetsChanged= false;
int markerStart= MarkerUtilities.getCharStart(marker);
int markerEnd= MarkerUtilities.getCharEnd(marker);
if (markerStart != -1 && markerEnd != -1) {
+ offsetsInitialized= true;
+
int offset= position.getOffset();
if (markerStart != offset) {
MarkerUtilities.setCharStart(marker, offset);
- changed= true;
+ offsetsChanged= true;
}
offset += position.getLength();
if (markerEnd != offset) {
MarkerUtilities.setCharEnd(marker, offset);
- changed= true;
+ offsetsChanged= true;
}
}
- if (changed && MarkerUtilities.getLineNumber(marker) != -1) {
+ if (!offsetsInitialized || (offsetsChanged && MarkerUtilities.getLineNumber(marker) != -1)) {
try {
// marker line numbers are 1-based
MarkerUtilities.setLineNumber(marker, document.getLineOfOffset(position.getOffset()) + 1);
diff --git a/bundles/org.eclipse.ui/buildnotes_text.html b/bundles/org.eclipse.ui/buildnotes_text.html index 7a7f510be48..ff6a0261b71 100644 --- a/bundles/org.eclipse.ui/buildnotes_text.html +++ b/bundles/org.eclipse.ui/buildnotes_text.html @@ -2,7 +2,7 @@ <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
+ <meta name="GENERATOR" content="Mozilla/4.76 [en] (Windows NT 5.0; U) [Netscape]">
<meta name="Author" content="IBM">
<title>Eclipse Platform Release Notes - Desktop</title>
</head>
@@ -12,960 +12,38 @@ Eclipse Platform Build Notes</h1>
<h1>
-Text Editor Support (including JFace Text)</h1>
+Platform Text</h1>
-<p><br>Eclipse SDK Build 20020601
+<p><br>Eclipse SDK Build 20020903
<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-Introduced the concept of setRedraw(boolean) on text viewers. See ITextViewerExtension.setRedraw(boolean).
-This allows to avoid any UI updating while manipulating the viewer's document.
-While redraw == false, the viewer selection is still available, i.e. setSelectedRange
-and getSelectedRange can be used and always refer to the actual state of
-the viewer's document. However, no selection change event and no view port
-changes are sent out. TextEvent (See ITextListener) has been extented to
-carry the viewer's redraw flag.</li>
-
-<li>
-Introduced the concept of a "sequential rewrite mode" on documents.
-See IDocumentExtension. This informs a document about an upcoming sequence
-of non-overlapping consecutive replace commands. If capable the document
-can use this information to operate on an optimized text store. In JFace
-Text, Document operates on a SequentialRewriteTextStore during this period.</li>
-
-<li>
-Reworked text shifting, line delimiter conversion, and find/replace to
-use the newly introduced concepts.</li>
-
-<li>
-Reworked the reactivation behavior of text hovers.</li>
-
-<li>
-Pushed text hover information computation in a background thread.</li>
-
-<li>
-Reactivated and extended the concept of widget token management. See IWidgetTokenOwner,
-IWidgetTokenKeeper.</li>
-
-<li>
-Extended text operations so that they can externally be enabled/disabled.
-See ITextOperationTargetExtension. Currently, this is only used for content
-assist in the source viewer. All other text operations ignore the enable
-flag.</li>
-
-<li>
-Improved incremental search behavior.</li>
-
-<li>
-Further code cleanup.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-See bugzilla.
-<p>
-<hr WIDTH="100%">
-<br>Eclipse SDK Build 20020517
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-The ruler context menu action are initialized correctly when invoked over
-keyboard shortcut. (Ctrl+W)</li>
-
-<li>
-Added delete line actions ([Esc 0] Ctrl+K with emacs key bindings) to text
-editor</li>
-
-<li>
-Added support for setting/clearing/swapping a mark (emacs style selection)</li>
-
-<li>
-Code Cleanup</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-See bugzilla.
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020514
-<h2>
-Breaking API changes</h2>
-IVerticalRulerInfo.addMouseListener/removeMouseListener have been removed
-again. The vertical ruler now provides a control that shares its listeners
-with its children.
-<p>IDocumentProviderExtension.getStatus(Object element) returns an IStatus
-connected with the given element. The status can be used to relate any
-relevant kind of status information with an element for which a provider
-manages a document.
-<h2>
-Other highlights</h2>
-Introduced a StatusTextEditor. The status text editor checks the status
-flag managed for its input element by the editor' document provider. If
-the status is not-OK, a different control is shown. By default an InfoForm
-is shown. Subclasses can change what is shown or subclass InfoForm.
-<p>StorageDocumentProvider and FileDocumentProvider honor the workbench's
-encoding settings. In addition, encoding support is provided by standard
-text editor. File can be viewed using different encodings. Save always
-uses the workbench's encoding setting. Custom editors can leverage the
-support by including the EncodingActionGroup into their menus. The encoding
-support uses the newly introduced status text editor.
-<p>Text hover timeout when typing has been improved. It's now always 1500ms.
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-See bugzilla.
-<br>
-<p>
-<hr WIDTH="100%">
-<br>
-<br>
-<p>Eclipse SDK Build 20020508
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-The context menu of the vertical ruler can be opened with Ctrl+W when using
-the default key binding. Accelerator for the emac's key binding is still
-to be defined.</li>
-
-<li>
-Added support for composite vertical ruler. See CompositeVerticalRuler.
-A composite vertical ruler is configured with ruler columns. Two ruler
-columns are provided by default: AnnotationRulerColumn and LineNumberRulerColumn.</li>
-
-<li>
-Performance changes to the reconciling mechanism in JFace Text.</li>
-
-<li>
-Changes in handling read only files: All modifying text actions are disabled
-by default.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#15071 convert line delimiters - one os missing
-<br>
-<p>
-<hr WIDTH="100%">
-<br>
-<p>Eclipse SDK Build 20020430
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-Introduced the concepts of state dependent actions, i.e. actions which
-change their enabling state depending on whether the editor's input is
-read only or not.</li>
-
-<li>
-Added line delimiter conversion actions for DOS, UNIX and Mac.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-
-<p><br>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020423
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
+What's new</h2>
<ul>
<li>
-Viewport clipping in the vertical ruler</li>
+Adaptable line number ruler width</li>
<li>
-Improved painting of range indicator</li>
+Resizable content assist proposal popup</li>
<li>
-Fixed problem in position handling in AbstractDocument</li>
-
-<li>
-Improved handling of delete in GapTextStore</li>
-
-<li>
-Changes in partition parsing: Introduced the concept of a partition token
-scanner which can resume scanning in the middle of token range.
-The basic assumption is that partition delimiters don't contain line delimiters.
-Partition token scanners can be built with rules implementing IPredicateRule.
-A predicate rule can start evaluation between their start and end sequence.
-PatternRule has been adapted.</li>
+Pre 2.0 build notes have been moved to buildnotes_text_2_0.html</li>
</ul>
<h2>
Known deficiencies</h2>
-<h2>
-Problem reports closed</h2>
-
-<p><br>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020418
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
<ul>
<li>
-Added method <i>undelete</i> to Position.</li>
-
-<li>
-AbstractMarkerAnnotationModel better supports heterogenous sets of annotations.</li>
+Size of content assist proposal popup is not persisted over session boundaries</li>
<li>
-DefaultUndoManager causes selection changes when executing undo/redo to
-ensure correct enabling/disabling of selection dependent actions.</li>
+Size of content assist proposal popup is not editor type specific</li>
</ul>
<h2>
-Known deficiencies</h2>
-
-<h2>
Problem reports closed</h2>
-<p><br>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020411
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-Enabled annotation models for more fine grained change notification</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#13358 incremental find: displays little squares after you press 'delete'
-<br>#13283 Find/Replace: Close button too small
-<br>#13459 Typing tab with selection in middle of line shifts right
-<p>
-<hr WIDTH="100%">
-<br>
-<br>
-<p>Eclipse SDK Build 20020409
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-Added support for external contribution of ruler actions. I.e. plugins
-can contribute actions to the context menu of an editor's vertical ruler
-by specifying those actions in their plugin.xml file.</li>
-
-<li>
-In the default key binding Ctrl+ArrowUp and Ctrl+ArrowDown are bound to
-scroll a single line without moving the cursor.</li>
-
-<li>
-AnnotationModel is be used from several threads.</li>
-
-<li>
-TextViewer implements ITextViewerExtensions which supports the stacking
-of VerifyKeyListeners. A listener that is prepended to the list of verify
-key listeners can take over the control over all key strokes not bound
-as menu item accelerators.</li>
-
-<li>
-The scheme according to which an editor calls Workspace.validateEdit has
-been reworked.</li>
-
-<li>
-The editor hooks to the Revert action in the File menu.</li>
-
-<li>
-AbstractTextEditor supports property dependent actions similar to selection
-or content dependent actions.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#11215 Editor task creation actions should use TaskPropertiesDialog
-<br># 9761 Line has to be selected from beginning when using the 'Tab'
-<br>#10806 call validateEdit() again before any further changes
-<br>#11480 READ/WRITE not updated on focus change
-<br>#12901 P2 Find/Replace should keep last selection highlighted
-<p>
-<hr WIDTH="100%">
-<br>
-<p>Eclipse SDK Build 20020402
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-fixed a problem in the TextViewer's handleDipose method</li>
-
-<li>
-AbstractMarkerAnnotationModel can now deal with a heterogenous set of annotations</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-
-<p><br>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020326
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-Enabled key binding support</li>
-
-<li>
-dialog-less incremental search (improvements)</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-
-<p><br>
-<hr WIDTH="100%">
-<br>
-<p>Eclipse SDK Build 20020318
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-All find operations can be limited to a scope using the find replace dialog.
-Multi-line selections serve as scope.</li>
-
-<li>
-Emacs-like incremental search (CTRL-J) is now part of AbstractTextEditor.</li>
-
-<li>
-Preparations for key binding support</li>
-
-<br> </ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#2280 Undo does not jump to undone location (1GEK1G5)
-<br>#7381 Search results block hover help for problems
-<br>#7954 Content assist off the edge of the display
-<br>#10141 Shift Left/Right disabled unless selection is "full lines".
-<br>#11047 Index out of bounds on text hover
-<br>#11148 Syntax coloring lost on revert
-<br>#11377 Code assist leaks threads
-<br>#11433 NPE opening editor when some plugins disabled
-<br>
-<br>
-<p>
-<hr WIDTH="100%">
-<br>
-<p>Eclipse SDK Build 20020312
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-All editors based on AbstractTextEditor now support <i>Find Next</i> and
-<i>Find
-Previous. </i>Both actions are selection aware, i.e. having a word selected
-when invoking <i>Find Next </i>searches for the next appearance of the
-selected word.</li>
-
-<li>
-A first cut of incremental search is implemented accessible via the Find/Replace
-dialog.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#5191 EC DCR: Add keyboard accelerator for "Find Next"
-<br>#5710 Emacs-like isearch (aka "incremental search")
-<br>#10489 Indention a template results in NPE
-<br>#2698 Opening Default Text Editor not showing right icon in the file
-tab (1GI7GK2)
-<br>#7954 Content assist off the edge of the display
-<br>#9964 nor P3 Syntax highlight and comments bug
-<br>#11047 nor P2 Index out of bounds on text hover
-<br>
-<p>
-<hr WIDTH="100%">
-<br>
-<p>Eclipse SDK Build 20020305
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#8652 ctl-space doesn't wrk for content assist in Java editor when
-<br>#8910 @link-tag in Javadoc display broken
-<br>#9576 Method argument hints not as smart as code assist
-<br>#10315 Syntax highlighting glitch
-<br>#10422 Incorrect syntax highlighting for comments
-<br>#10721 Syntax highlighting lost in Java editor after replace with r
-<br>
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020212
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-Added IContextInformationExtension to support context information positions
-not equal to completion position (related to #4366).</li>
-
-<li>
-Added preference store keys for system default background/foreground colors
-(related to #5811).</li>
-
-<li>
-Reworked handling of read-only resources and state changes of resources.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#2635 Find should remember last string if selection empty (1GHFMYL
-<br>#5380 Error hover doesn't appear
-<br>#7483 NPE during revert in Java editor
-<br>#2575 [JFace Text] BUG - org.eclipse.ui.texteditor inconsistency (1GGLRU6)
-<br>#5969 Find dialog placement needs improvement
-<br>#5811 Pref to set editor background color
-<br>#5819 Code formatter doesn't work well with else if on next line
-<br>
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020129
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#5819 Code formatter doesn't work well with else if on next line
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020122
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#4324 EC: Find/replace gets stuck in infinite loop (1GLCBZE)
-<br>#3736 DCR: Go to line - would be nice to show valid range (1GEHSDX)
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020115
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#4335 Find/Replace should come up with first history entry (1GEL5NS)
-<br>#4338 Find/change history is never pruned (1GHDUJW)
-<br>#4342 TextViewer.setTopIndex doesn't take horizontal scrollbar into
-account (1GIFYC7)
-<br>#4343 Text hidden inserted by code assist (1GJ9PGK)
-<br>#6701 Code assist: java hint not properly aligned
-<br>#6379 StatusLine 'Writeable' is not readable
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020108
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#3833 Javadoc hover appears under code assist window (1GF0K3T)
-<br>#4363 Two Java Doc hovers
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20011218
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#1614 Current line in Debugger should start at center of source ed
-<br>#5000 Context menu IDs not fully qualified
-<br>#5959 Text editor: SEVERE - Revert should be undoable
-<br>#6075 NPE while editing in compare view
-<br>#6318 F2 window accessability issues
-<br>#4367 Argument hover doesn't work for nested method call
-<br>#4964 Automatic Code Assist needs to be smarter
-<br>#4966 Automatic Code Assist needs to be smarter #2
-<br>#4967 Automatic Code Assist needs to be smarter #3
-<br>#4968 Automatic Code Assist needs to be smarter #4
-<br>#4969 Automatic Code Assist needs to be smarter #5
-<br>#4999 Automatic Code Assist needs to be smarter #7
-<br>#6589 ctrl+insert, shift+insert incorrectly flips the insert/overw
-<br>#3467 Horizontal scrolling when stepping through errors (1GE6AF1)
-<br>#4041 out of sync error message after copying resources (1GGR6VZ)
-<br>#6699 Save should not flush undo stack
-<br>#4071 Format option loses place in editor (1GHQFU6)
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20011211
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#1614 Current line in Debugger should start at center of source editor
-(1GETH7J)
-<br>#3467 Horizontal scrolling when stepping through errors (1GE6AF1)
-<p>
-<hr WIDTH="100%">
-<br>
-<p>Eclipse SDK Build 20011206
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-Support for read-only but modifiable resources in editors. For this reason
-AbstractTextEditor now calls validateState if its document provider also
-implement IDocumentProviderExtension. The calls are issued:
-<ul>
-<li>
-when an editor is marked dirty</li>
-
-<li>
-when an editor saves its document to its input</li>
-
-<li>
-when a dirty resource is moved (if allowed)</li>
-</ul>
-Calling validateState may cause changes to the isModifiable and isReadOnly
-properties of the editor's input.
-<br>FileDocumentProvider implements validateState by calling IWorkspace.validateEdit
-on the input file.
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20011204
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-Perparations for supporting the concept of read-only but modifiable resources
-in editors.
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#6203 SEVERE: typing in java editor causes OutOfMemoryError in JDK 1.4
-<br>#6263 Extra closing braces inserted
-<p>
-<hr WIDTH="100%">
-<br>
-<p>Eclipse SDK Build 20011127
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-An BasicTextEditorActionContributor now contributes three status fields
-into the window's status line. Each field is dedicated to show information
-of a particular category. The categories are defined in ITextEditorActionConstants.
-A new interface ITextEditorExtension has been introduced. On activation,
-implementing editors of this interface are informed about the status fields
-they can use to publish status information. AbstractTextEditor implements
-ITextEditorExtension. Subclasses of AbstractTextEditor can get access to
-the editor's current status fields using the method getStatusField(String
-category). By default, AbstractTextEditor publishes the following information:
-cursor position, input mode, reade only state of its input. Subclasses
-may change this behavior by overriding updateStatusField(String category)
-or callers of this method.</li>
-
-<li>
-The default text editor uses the feature described above and now provides
-status information.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#4071 Format option loses place in editor (1GHQFU6)
-<br>#6168 code assist preference (auto complete) does
-not work
-<br>#6087 NPE closing content assist from DisplayView
-on exit
-<br>#6013 Repeatable Java editor hang in 200111115
-<br>#4947 No indication of Insert/Overwrite mode
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20011120
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-Change to AbstractHoverInformationControlManager to reset the hover location
-on a time basis.</li>
-
-<li>
-Added configuration method to ContentAssistant to automatically insert
-a single proposal.</li>
-
-<li>
-Behavioral configuration methods such as enableAutoInsert, enableAutoActivation,
-and setAutoActivationDelay can now be called when after the content assistant
-has been installed.</li>
-
-<li>
-Context information popup recomputes size after style information has been
-applied.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#2569 [JFace Text] Content assist list truncated (1GG1W9B)
-<br>#2904 [JFace Text] PropagatingFontFieldEditor has
-moved (1GKKL13)
-<br>#1824 [JFace Text] 50 reconciling threads for 4 editors
-opened (1GFXMV8)
-<br>
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20011101
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-introduction of setDocumentContent(IDocument, IEditorInput) on StorageDocumentProvider.</li>
-
-<li>
-introduction of IDocumentExtension (see JavaDoc)</li>
-
-<li>
-AbstractDocument implements IDocumentExtension</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-Instances of DefaultInformationControl are wider than necessary.
-<h2>
-Problem reports fixed</h2>
-
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 206
-<h2>
-Breaking API changes</h2>
-Corrected spelling of "anchor" in AbstractInformationControlManager
-and its subclasses.
-<h2>
-Other highlights</h2>
-
-<h2>
-Known deficiencies</h2>
-Instances of DefaultInformationControl are wider than necessary.
-<h2>
-Problem reports fixed</h2>
-<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=5066">#5066
-Code Assist: Thread created / not removed</a>
-<br><a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=5120">#5120
-Empty popup doc in java editor</a>
-<br><a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=3473">#3473
-mnemonics (1GF25DN)</a>
-<p>
-<hr WIDTH="100%">
-<br>
-<p>Eclipse SDK Build 204
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-For more information about the following issue please see JavaDoc of the
-classes
-<ul>
-<li>
-Several improvements of the new hover infrastructure, such as customizable
-SWT styles.</li>
-
-<li>
-Improved look of the content assist window.</li>
-
-<li>
-Content assist supports customizable completion characters, i.e. each completion
-proposal can specify which characters trigger its insertion.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-Instances of DefaultInformationControl are wider than necessary.
-<h2>
-Problem reports fixed</h2>
-
-<p><br>
-<hr WIDTH="100%">
-<br>
-<p>Eclipse SDK Build 203
-<h2>
-Breaking API changes</h2>
- package: org.eclipse.jface.text
-<br> interface: IHoverInfoPresenter
-<br> change: removed interface
-<br> change type: breaking API change for implementers of IHoverInfoPresenter
-<h2>
-Other highlights</h2>
-For more information about the following issue please see JavaDoc of the
-classes
-<ul>
-<li>
-Complete rework of hover popups (previously a package private mechanism
-hidden from clients). There is now the concept of an IInformationControl
-and an IInformationControlCreator. Everywhere where floating windows are
-used to present some kind of information, now IInformationControl is used.
-More precise, the according component is equiped with an IInformationControlCreator
-and creates the IInformationControl instance when needed. So clients can
-set an IInformationControlCreator on a TextViewer and a SourceViewer. They
-use it to create the text hover window and the annotation bar hover
-window respectively. DefaultInformationControl is a StyledText-based
-default implementation of IInformationControl. Clients may implement IInformationControl
-directly and inject their custom information control creator.</li>
-
-<li>
-AbstractInformationControlManager and its subclasses abstractly implement
-the process of providing a SWT control with support for floating information
-windows. This covers layout, positioning, content, and visibility of the
-floating window. They offer a broad customization space such as layout
-strategies, colors, etc.</li>
-
-<li>
-TextViewer hovers, annotation bar hovers, additional info on completion
-proposals in the content assistant, etc. benefit from the new infrastructure.
-UI improvements are especially visible in the layout behavior.</li>
-
-<li>
-Introduced the concept of an information presenter. An information presenter
-shows information on a context derivved subject on request. See IInformationPresenter
-for details as well as SourceViewer and SourceViewerConfiguration for how
-to use it.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-Instances of DefaultInformationControl are wider than necessary.
-<h2>
-Problem reports fixed</h2>
-
-<p><br>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 200
-<h2>
-Breaking API changes</h2>
- package: org.eclipse.jface.text
-<br> interface: ITextViewer
-<br> change: added method public void invalidateTextPresentation(
-)
-<br> change type: breaking API change for implementers of ITextViewer
-<p> package: org.eclipse.jface.text
-<br> interface: ITextViewer
-<br> change: added method public void setDefaultPrefixes(String[]
-defaultPrefixes, String contentType)
-<br> change type: breaking API change for implementers of ITextViewer
-<p> package: org.eclipse.jface.text
-<br> interface: ITextViewer
-<br> change: removed method void setDefaultPrefix(String
-defaultPrefix, String contentType)
-<br> change type: breaking API change for implementers of ITextViewer
-<p> package: org.eclipse.jface.text.rules
-<br> class: RuleBasedDamagerRepairer
-<br> change: deprecated constructor public RuleBasedDamagerRepairer(RuleBasedScanner
-scanner, TextAttribute defaultTextAttribute)
-<br> change type: breaking API change for clients of RuleBasedDamagerRepairer
-<h2>
-Other highlights</h2>
-For more information about the following issue please see JavaDoc of the
-classes
-<ul>
-<li>
-IContextInformationValidator implementers may also implement IContextInformationPresenter
-to style context information</li>
-
-<li>
-ITextHover implementers may also implement IHoverInfoPresenter to style
-hover information</li>
-
-<li>
-PropagatingFontFieldEditor has been introduced</li>
-
-<li>
-MonoReconciler has been introduced to support partition independent reconciling</li>
-
-<li>
-Token has been reimplemented, supports setData method now</li>
-
-<li>
-RuleBasedScanner now supports public void setDefaultReturnToken(IToken
-defaultReturnToken). This token is returned if no rule can fire.</li>
-
-<li>
-TextPresentation now supports public static void applyTextPresentation(TextPresentation
-presentation, StyledText text)</li>
-
-<li>
-BasicMarkerUpdater has been marked as final</li>
-
-<li>
-SelectMarkerRulerAction has been introduced</li>
-
-<li>
-WorkbenchChainedTextFontFieldEditor has been introduced</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports fixed</h2>
-1GJ65EW: ITPSRCEDIT:WINNT - ResourceMarkerAnnotaionModel: unnecessary fireModelChange
-<br>1GIYR3X: ITPSRCEDIT:ALL - NL: word select (double click) in Java comments
-<br>1GGYYWK: ITPJUI:ALL - Dismissing editor with code assist up causes
-lots of Internal Errors
-<br>1GEUOZ9: ITPJUI:ALL - Confusing UI for multiline Bookmarks and Tasks
-<br>1GII2RZ: ITPJUI:WINNT - AssertionFailed Ex. in Java editor
-<br>1GIYQ9K: ITPUI:WINNT - StyledText swallows Shift+TAB
-<br>1GIJZOO: ITPSRCEDIT:ALL - Gotodialog's edit field has no initial focus
+<blockquote>See bugzilla.</blockquote>
</body>
</html>
diff --git a/bundles/org.eclipse.ui/buildnotes_text_2_0.html b/bundles/org.eclipse.ui/buildnotes_text_2_0.html new file mode 100644 index 00000000000..d787d60f04a --- /dev/null +++ b/bundles/org.eclipse.ui/buildnotes_text_2_0.html @@ -0,0 +1,971 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> + <meta name="Author" content="IBM"> + <title>Eclipse Platform Release Notes - Desktop</title> +</head> +<body> + +<h1> +Eclipse Platform Build Notes</h1> + +<h1> +Text Editor Support (including JFace Text)</h1> + +<p><br>Eclipse SDK Build 20020601 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<ul> +<li> +Introduced the concept of setRedraw(boolean) on text viewers. See ITextViewerExtension.setRedraw(boolean). +This allows to avoid any UI updating while manipulating the viewer's document. +While redraw == false, the viewer selection is still available, i.e. setSelectedRange +and getSelectedRange can be used and always refer to the actual state of +the viewer's document. However, no selection change event and no view port +changes are sent out. TextEvent (See ITextListener) has been extented to +carry the viewer's redraw flag.</li> + +<li> +Introduced the concept of a "sequential rewrite mode" on documents. +See IDocumentExtension. This informs a document about an upcoming sequence +of non-overlapping consecutive replace commands. If capable the document +can use this information to operate on an optimized text store. In JFace +Text, Document operates on a SequentialRewriteTextStore during this period.</li> + +<li> +Reworked text shifting, line delimiter conversion, and find/replace to +use the newly introduced concepts.</li> + +<li> +Reworked the reactivation behavior of text hovers.</li> + +<li> +Pushed text hover information computation in a background thread.</li> + +<li> +Reactivated and extended the concept of widget token management. See IWidgetTokenOwner, +IWidgetTokenKeeper.</li> + +<li> +Extended text operations so that they can externally be enabled/disabled. +See ITextOperationTargetExtension. Currently, this is only used for content +assist in the source viewer. All other text operations ignore the enable +flag.</li> + +<li> +Improved incremental search behavior.</li> + +<li> +Further code cleanup.</li> +</ul> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +See bugzilla. +<p> +<hr WIDTH="100%"> +<br>Eclipse SDK Build 20020517 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<ul> +<li> +The ruler context menu action are initialized correctly when invoked over +keyboard shortcut. (Ctrl+W)</li> + +<li> +Added delete line actions ([Esc 0] Ctrl+K with emacs key bindings) to text +editor</li> + +<li> +Added support for setting/clearing/swapping a mark (emacs style selection)</li> + +<li> +Code Cleanup</li> +</ul> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +See bugzilla. +<p> +<hr WIDTH="100%"> +<p>Eclipse SDK Build 20020514 +<h2> +Breaking API changes</h2> +IVerticalRulerInfo.addMouseListener/removeMouseListener have been removed +again. The vertical ruler now provides a control that shares its listeners +with its children. +<p>IDocumentProviderExtension.getStatus(Object element) returns an IStatus +connected with the given element. The status can be used to relate any +relevant kind of status information with an element for which a provider +manages a document. +<h2> +Other highlights</h2> +Introduced a StatusTextEditor. The status text editor checks the status +flag managed for its input element by the editor' document provider. If +the status is not-OK, a different control is shown. By default an InfoForm +is shown. Subclasses can change what is shown or subclass InfoForm. +<p>StorageDocumentProvider and FileDocumentProvider honor the workbench's +encoding settings. In addition, encoding support is provided by standard +text editor. File can be viewed using different encodings. Save always +uses the workbench's encoding setting. Custom editors can leverage the +support by including the EncodingActionGroup into their menus. The encoding +support uses the newly introduced status text editor. +<p>Text hover timeout when typing has been improved. It's now always 1500ms. +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +See bugzilla. +<br> +<p> +<hr WIDTH="100%"> +<br> +<br> +<p>Eclipse SDK Build 20020508 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<ul> +<li> +The context menu of the vertical ruler can be opened with Ctrl+W when using +the default key binding. Accelerator for the emac's key binding is still +to be defined.</li> + +<li> +Added support for composite vertical ruler. See CompositeVerticalRuler. +A composite vertical ruler is configured with ruler columns. Two ruler +columns are provided by default: AnnotationRulerColumn and LineNumberRulerColumn.</li> + +<li> +Performance changes to the reconciling mechanism in JFace Text.</li> + +<li> +Changes in handling read only files: All modifying text actions are disabled +by default.</li> +</ul> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +#15071 convert line delimiters - one os missing +<br> +<p> +<hr WIDTH="100%"> +<br> +<p>Eclipse SDK Build 20020430 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<ul> +<li> +Introduced the concepts of state dependent actions, i.e. actions which +change their enabling state depending on whether the editor's input is +read only or not.</li> + +<li> +Added line delimiter conversion actions for DOS, UNIX and Mac.</li> +</ul> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> + +<p><br> +<hr WIDTH="100%"> +<p>Eclipse SDK Build 20020423 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<ul> +<li> +Viewport clipping in the vertical ruler</li> + +<li> +Improved painting of range indicator</li> + +<li> +Fixed problem in position handling in AbstractDocument</li> + +<li> +Improved handling of delete in GapTextStore</li> + +<li> +Changes in partition parsing: Introduced the concept of a partition token +scanner which can resume scanning in the middle of token range. +The basic assumption is that partition delimiters don't contain line delimiters. +Partition token scanners can be built with rules implementing IPredicateRule. +A predicate rule can start evaluation between their start and end sequence. +PatternRule has been adapted.</li> +</ul> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> + +<p><br> +<hr WIDTH="100%"> +<p>Eclipse SDK Build 20020418 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<ul> +<li> +Added method <i>undelete</i> to Position.</li> + +<li> +AbstractMarkerAnnotationModel better supports heterogenous sets of annotations.</li> + +<li> +DefaultUndoManager causes selection changes when executing undo/redo to +ensure correct enabling/disabling of selection dependent actions.</li> +</ul> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> + +<p><br> +<hr WIDTH="100%"> +<p>Eclipse SDK Build 20020411 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<ul> +<li> +Enabled annotation models for more fine grained change notification</li> +</ul> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +#13358 incremental find: displays little squares after you press 'delete' +<br>#13283 Find/Replace: Close button too small +<br>#13459 Typing tab with selection in middle of line shifts right +<p> +<hr WIDTH="100%"> +<br> +<br> +<p>Eclipse SDK Build 20020409 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<ul> +<li> +Added support for external contribution of ruler actions. I.e. plugins +can contribute actions to the context menu of an editor's vertical ruler +by specifying those actions in their plugin.xml file.</li> + +<li> +In the default key binding Ctrl+ArrowUp and Ctrl+ArrowDown are bound to +scroll a single line without moving the cursor.</li> + +<li> +AnnotationModel is be used from several threads.</li> + +<li> +TextViewer implements ITextViewerExtensions which supports the stacking +of VerifyKeyListeners. A listener that is prepended to the list of verify +key listeners can take over the control over all key strokes not bound +as menu item accelerators.</li> + +<li> +The scheme according to which an editor calls Workspace.validateEdit has +been reworked.</li> + +<li> +The editor hooks to the Revert action in the File menu.</li> + +<li> +AbstractTextEditor supports property dependent actions similar to selection +or content dependent actions.</li> +</ul> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +#11215 Editor task creation actions should use TaskPropertiesDialog +<br># 9761 Line has to be selected from beginning when using the 'Tab' +<br>#10806 call validateEdit() again before any further changes +<br>#11480 READ/WRITE not updated on focus change +<br>#12901 P2 Find/Replace should keep last selection highlighted +<p> +<hr WIDTH="100%"> +<br> +<p>Eclipse SDK Build 20020402 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<ul> +<li> +fixed a problem in the TextViewer's handleDipose method</li> + +<li> +AbstractMarkerAnnotationModel can now deal with a heterogenous set of annotations</li> +</ul> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> + +<p><br> +<hr WIDTH="100%"> +<p>Eclipse SDK Build 20020326 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<ul> +<li> +Enabled key binding support</li> + +<li> +dialog-less incremental search (improvements)</li> +</ul> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> + +<p><br> +<hr WIDTH="100%"> +<br> +<p>Eclipse SDK Build 20020318 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<ul> +<li> +All find operations can be limited to a scope using the find replace dialog. +Multi-line selections serve as scope.</li> + +<li> +Emacs-like incremental search (CTRL-J) is now part of AbstractTextEditor.</li> + +<li> +Preparations for key binding support</li> + +<br> </ul> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +#2280 Undo does not jump to undone location (1GEK1G5) +<br>#7381 Search results block hover help for problems +<br>#7954 Content assist off the edge of the display +<br>#10141 Shift Left/Right disabled unless selection is "full lines". +<br>#11047 Index out of bounds on text hover +<br>#11148 Syntax coloring lost on revert +<br>#11377 Code assist leaks threads +<br>#11433 NPE opening editor when some plugins disabled +<br> +<br> +<p> +<hr WIDTH="100%"> +<br> +<p>Eclipse SDK Build 20020312 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<ul> +<li> +All editors based on AbstractTextEditor now support <i>Find Next</i> and +<i>Find +Previous. </i>Both actions are selection aware, i.e. having a word selected +when invoking <i>Find Next </i>searches for the next appearance of the +selected word.</li> + +<li> +A first cut of incremental search is implemented accessible via the Find/Replace +dialog.</li> +</ul> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +#5191 EC DCR: Add keyboard accelerator for "Find Next" +<br>#5710 Emacs-like isearch (aka "incremental search") +<br>#10489 Indention a template results in NPE +<br>#2698 Opening Default Text Editor not showing right icon in the file +tab (1GI7GK2) +<br>#7954 Content assist off the edge of the display +<br>#9964 nor P3 Syntax highlight and comments bug +<br>#11047 nor P2 Index out of bounds on text hover +<br> +<p> +<hr WIDTH="100%"> +<br> +<p>Eclipse SDK Build 20020305 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +#8652 ctl-space doesn't wrk for content assist in Java editor when +<br>#8910 @link-tag in Javadoc display broken +<br>#9576 Method argument hints not as smart as code assist +<br>#10315 Syntax highlighting glitch +<br>#10422 Incorrect syntax highlighting for comments +<br>#10721 Syntax highlighting lost in Java editor after replace with r +<br> +<p> +<hr WIDTH="100%"> +<p>Eclipse SDK Build 20020212 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<ul> +<li> +Added IContextInformationExtension to support context information positions +not equal to completion position (related to #4366).</li> + +<li> +Added preference store keys for system default background/foreground colors +(related to #5811).</li> + +<li> +Reworked handling of read-only resources and state changes of resources.</li> +</ul> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +#2635 Find should remember last string if selection empty (1GHFMYL +<br>#5380 Error hover doesn't appear +<br>#7483 NPE during revert in Java editor +<br>#2575 [JFace Text] BUG - org.eclipse.ui.texteditor inconsistency (1GGLRU6) +<br>#5969 Find dialog placement needs improvement +<br>#5811 Pref to set editor background color +<br>#5819 Code formatter doesn't work well with else if on next line +<br> +<p> +<hr WIDTH="100%"> +<p>Eclipse SDK Build 20020129 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +#5819 Code formatter doesn't work well with else if on next line +<p> +<hr WIDTH="100%"> +<p>Eclipse SDK Build 20020122 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +#4324 EC: Find/replace gets stuck in infinite loop (1GLCBZE) +<br>#3736 DCR: Go to line - would be nice to show valid range (1GEHSDX) +<p> +<hr WIDTH="100%"> +<p>Eclipse SDK Build 20020115 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +#4335 Find/Replace should come up with first history entry (1GEL5NS) +<br>#4338 Find/change history is never pruned (1GHDUJW) +<br>#4342 TextViewer.setTopIndex doesn't take horizontal scrollbar into +account (1GIFYC7) +<br>#4343 Text hidden inserted by code assist (1GJ9PGK) +<br>#6701 Code assist: java hint not properly aligned +<br>#6379 StatusLine 'Writeable' is not readable +<p> +<hr WIDTH="100%"> +<p>Eclipse SDK Build 20020108 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +#3833 Javadoc hover appears under code assist window (1GF0K3T) +<br>#4363 Two Java Doc hovers +<p> +<hr WIDTH="100%"> +<p>Eclipse SDK Build 20011218 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +#1614 Current line in Debugger should start at center of source ed +<br>#5000 Context menu IDs not fully qualified +<br>#5959 Text editor: SEVERE - Revert should be undoable +<br>#6075 NPE while editing in compare view +<br>#6318 F2 window accessability issues +<br>#4367 Argument hover doesn't work for nested method call +<br>#4964 Automatic Code Assist needs to be smarter +<br>#4966 Automatic Code Assist needs to be smarter #2 +<br>#4967 Automatic Code Assist needs to be smarter #3 +<br>#4968 Automatic Code Assist needs to be smarter #4 +<br>#4969 Automatic Code Assist needs to be smarter #5 +<br>#4999 Automatic Code Assist needs to be smarter #7 +<br>#6589 ctrl+insert, shift+insert incorrectly flips the insert/overw +<br>#3467 Horizontal scrolling when stepping through errors (1GE6AF1) +<br>#4041 out of sync error message after copying resources (1GGR6VZ) +<br>#6699 Save should not flush undo stack +<br>#4071 Format option loses place in editor (1GHQFU6) +<p> +<hr WIDTH="100%"> +<p>Eclipse SDK Build 20011211 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +#1614 Current line in Debugger should start at center of source editor +(1GETH7J) +<br>#3467 Horizontal scrolling when stepping through errors (1GE6AF1) +<p> +<hr WIDTH="100%"> +<br> +<p>Eclipse SDK Build 20011206 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> +Support for read-only but modifiable resources in editors. For this reason +AbstractTextEditor now calls validateState if its document provider also +implement IDocumentProviderExtension. The calls are issued: +<ul> +<li> +when an editor is marked dirty</li> + +<li> +when an editor saves its document to its input</li> + +<li> +when a dirty resource is moved (if allowed)</li> +</ul> +Calling validateState may cause changes to the isModifiable and isReadOnly +properties of the editor's input. +<br>FileDocumentProvider implements validateState by calling IWorkspace.validateEdit +on the input file. +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> + +<hr WIDTH="100%"> +<p>Eclipse SDK Build 20011204 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> +Perparations for supporting the concept of read-only but modifiable resources +in editors. +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +#6203 SEVERE: typing in java editor causes OutOfMemoryError in JDK 1.4 +<br>#6263 Extra closing braces inserted +<p> +<hr WIDTH="100%"> +<br> +<p>Eclipse SDK Build 20011127 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<ul> +<li> +An BasicTextEditorActionContributor now contributes three status fields +into the window's status line. Each field is dedicated to show information +of a particular category. The categories are defined in ITextEditorActionConstants. +A new interface ITextEditorExtension has been introduced. On activation, +implementing editors of this interface are informed about the status fields +they can use to publish status information. AbstractTextEditor implements +ITextEditorExtension. Subclasses of AbstractTextEditor can get access to +the editor's current status fields using the method getStatusField(String +category). By default, AbstractTextEditor publishes the following information: +cursor position, input mode, reade only state of its input. Subclasses +may change this behavior by overriding updateStatusField(String category) +or callers of this method.</li> + +<li> +The default text editor uses the feature described above and now provides +status information.</li> +</ul> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +#4071 Format option loses place in editor (1GHQFU6) +<br>#6168 code assist preference (auto complete) does +not work +<br>#6087 NPE closing content assist from DisplayView +on exit +<br>#6013 Repeatable Java editor hang in 200111115 +<br>#4947 No indication of Insert/Overwrite mode +<p> +<hr WIDTH="100%"> +<p>Eclipse SDK Build 20011120 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<ul> +<li> +Change to AbstractHoverInformationControlManager to reset the hover location +on a time basis.</li> + +<li> +Added configuration method to ContentAssistant to automatically insert +a single proposal.</li> + +<li> +Behavioral configuration methods such as enableAutoInsert, enableAutoActivation, +and setAutoActivationDelay can now be called when after the content assistant +has been installed.</li> + +<li> +Context information popup recomputes size after style information has been +applied.</li> +</ul> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports closed</h2> +#2569 [JFace Text] Content assist list truncated (1GG1W9B) +<br>#2904 [JFace Text] PropagatingFontFieldEditor has +moved (1GKKL13) +<br>#1824 [JFace Text] 50 reconciling threads for 4 editors +opened (1GFXMV8) +<br> +<p> +<hr WIDTH="100%"> +<p>Eclipse SDK Build 20011101 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> + +<ul> +<li> +introduction of setDocumentContent(IDocument, IEditorInput) on StorageDocumentProvider.</li> + +<li> +introduction of IDocumentExtension (see JavaDoc)</li> + +<li> +AbstractDocument implements IDocumentExtension</li> +</ul> + +<h2> +Known deficiencies</h2> +Instances of DefaultInformationControl are wider than necessary. +<h2> +Problem reports fixed</h2> + +<hr WIDTH="100%"> +<p>Eclipse SDK Build 206 +<h2> +Breaking API changes</h2> +Corrected spelling of "anchor" in AbstractInformationControlManager +and its subclasses. +<h2> +Other highlights</h2> + +<h2> +Known deficiencies</h2> +Instances of DefaultInformationControl are wider than necessary. +<h2> +Problem reports fixed</h2> +<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=5066">#5066 +Code Assist: Thread created / not removed</a> +<br><a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=5120">#5120 +Empty popup doc in java editor</a> +<br><a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=3473">#3473 +mnemonics (1GF25DN)</a> +<p> +<hr WIDTH="100%"> +<br> +<p>Eclipse SDK Build 204 +<h2> +Breaking API changes</h2> + +<h2> +Other highlights</h2> +For more information about the following issue please see JavaDoc of the +classes +<ul> +<li> +Several improvements of the new hover infrastructure, such as customizable +SWT styles.</li> + +<li> +Improved look of the content assist window.</li> + +<li> +Content assist supports customizable completion characters, i.e. each completion +proposal can specify which characters trigger its insertion.</li> +</ul> + +<h2> +Known deficiencies</h2> +Instances of DefaultInformationControl are wider than necessary. +<h2> +Problem reports fixed</h2> + +<p><br> +<hr WIDTH="100%"> +<br> +<p>Eclipse SDK Build 203 +<h2> +Breaking API changes</h2> + package: org.eclipse.jface.text +<br> interface: IHoverInfoPresenter +<br> change: removed interface +<br> change type: breaking API change for implementers of IHoverInfoPresenter +<h2> +Other highlights</h2> +For more information about the following issue please see JavaDoc of the +classes +<ul> +<li> +Complete rework of hover popups (previously a package private mechanism +hidden from clients). There is now the concept of an IInformationControl +and an IInformationControlCreator. Everywhere where floating windows are +used to present some kind of information, now IInformationControl is used. +More precise, the according component is equiped with an IInformationControlCreator +and creates the IInformationControl instance when needed. So clients can +set an IInformationControlCreator on a TextViewer and a SourceViewer. They +use it to create the text hover window and the annotation bar hover +window respectively. DefaultInformationControl is a StyledText-based +default implementation of IInformationControl. Clients may implement IInformationControl +directly and inject their custom information control creator.</li> + +<li> +AbstractInformationControlManager and its subclasses abstractly implement +the process of providing a SWT control with support for floating information +windows. This covers layout, positioning, content, and visibility of the +floating window. They offer a broad customization space such as layout +strategies, colors, etc.</li> + +<li> +TextViewer hovers, annotation bar hovers, additional info on completion +proposals in the content assistant, etc. benefit from the new infrastructure. +UI improvements are especially visible in the layout behavior.</li> + +<li> +Introduced the concept of an information presenter. An information presenter +shows information on a context derivved subject on request. See IInformationPresenter +for details as well as SourceViewer and SourceViewerConfiguration for how +to use it.</li> +</ul> + +<h2> +Known deficiencies</h2> +Instances of DefaultInformationControl are wider than necessary. +<h2> +Problem reports fixed</h2> + +<p><br> +<hr WIDTH="100%"> +<p>Eclipse SDK Build 200 +<h2> +Breaking API changes</h2> + package: org.eclipse.jface.text +<br> interface: ITextViewer +<br> change: added method public void invalidateTextPresentation( +) +<br> change type: breaking API change for implementers of ITextViewer +<p> package: org.eclipse.jface.text +<br> interface: ITextViewer +<br> change: added method public void setDefaultPrefixes(String[] +defaultPrefixes, String contentType) +<br> change type: breaking API change for implementers of ITextViewer +<p> package: org.eclipse.jface.text +<br> interface: ITextViewer +<br> change: removed method void setDefaultPrefix(String +defaultPrefix, String contentType) +<br> change type: breaking API change for implementers of ITextViewer +<p> package: org.eclipse.jface.text.rules +<br> class: RuleBasedDamagerRepairer +<br> change: deprecated constructor public RuleBasedDamagerRepairer(RuleBasedScanner +scanner, TextAttribute defaultTextAttribute) +<br> change type: breaking API change for clients of RuleBasedDamagerRepairer +<h2> +Other highlights</h2> +For more information about the following issue please see JavaDoc of the +classes +<ul> +<li> +IContextInformationValidator implementers may also implement IContextInformationPresenter +to style context information</li> + +<li> +ITextHover implementers may also implement IHoverInfoPresenter to style +hover information</li> + +<li> +PropagatingFontFieldEditor has been introduced</li> + +<li> +MonoReconciler has been introduced to support partition independent reconciling</li> + +<li> +Token has been reimplemented, supports setData method now</li> + +<li> +RuleBasedScanner now supports public void setDefaultReturnToken(IToken +defaultReturnToken). This token is returned if no rule can fire.</li> + +<li> +TextPresentation now supports public static void applyTextPresentation(TextPresentation +presentation, StyledText text)</li> + +<li> +BasicMarkerUpdater has been marked as final</li> + +<li> +SelectMarkerRulerAction has been introduced</li> + +<li> +WorkbenchChainedTextFontFieldEditor has been introduced</li> +</ul> + +<h2> +Known deficiencies</h2> + +<h2> +Problem reports fixed</h2> +1GJ65EW: ITPSRCEDIT:WINNT - ResourceMarkerAnnotaionModel: unnecessary fireModelChange +<br>1GIYR3X: ITPSRCEDIT:ALL - NL: word select (double click) in Java comments +<br>1GGYYWK: ITPJUI:ALL - Dismissing editor with code assist up causes +lots of Internal Errors +<br>1GEUOZ9: ITPJUI:ALL - Confusing UI for multiline Bookmarks and Tasks +<br>1GII2RZ: ITPJUI:WINNT - AssertionFailed Ex. in Java editor +<br>1GIYQ9K: ITPUI:WINNT - StyledText swallows Shift+TAB +<br>1GIJZOO: ITPSRCEDIT:ALL - Gotodialog's edit field has no initial focus + +</body> +</html> diff --git a/examples/org.eclipse.ui.examples.multipageeditor/.classpath b/examples/org.eclipse.ui.examples.multipageeditor/.classpath deleted file mode 100644 index 4845f2d6c56..00000000000 --- a/examples/org.eclipse.ui.examples.multipageeditor/.classpath +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="Eclipse UI Examples MultiPageEditor"/> - <classpathentry kind="src" path="/org.eclipse.ui"/> - <classpathentry kind="src" path="/org.eclipse.swt"/> - <classpathentry kind="src" path="/org.eclipse.core.resources"/> - <classpathentry kind="src" path="/org.eclipse.core.runtime"/> - <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/examples/org.eclipse.ui.examples.multipageeditor/.cvsignore b/examples/org.eclipse.ui.examples.multipageeditor/.cvsignore deleted file mode 100644 index c5e82d74585..00000000000 --- a/examples/org.eclipse.ui.examples.multipageeditor/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin
\ No newline at end of file diff --git a/examples/org.eclipse.ui.examples.multipageeditor/.project b/examples/org.eclipse.ui.examples.multipageeditor/.project deleted file mode 100644 index 2354b639eb1..00000000000 --- a/examples/org.eclipse.ui.examples.multipageeditor/.project +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.ui.examples.multipageeditor</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.ui</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/MessageUtil.java b/examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/MessageUtil.java deleted file mode 100644 index dd14ee4ae17..00000000000 --- a/examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/MessageUtil.java +++ /dev/null @@ -1,51 +0,0 @@ -/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.ui.examples.multipageeditor;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Utility class which helps with managing messages.
- */
-/* package */ class MessageUtil {
-
- private static final String RESOURCE_BUNDLE= "org.eclipse.ui.examples.multipageeditor.messages";//$NON-NLS-1$
-
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private MessageUtil() {
- // prevent instantiation of class
- }
-
- /**
- * Returns the formatted message for the given key in
- * the resource bundle.
- *
- * @param key the resource name
- * @param args the message arguments
- * @return the string
- */
- public static String format(String key, Object[] args) {
- return MessageFormat.format(getString(key),args);
- }
-
- /**
- * Returns the resource object with the given key in
- * the resource bundle. If there isn't any value under
- * the given key, the key is returned, surrounded by '!'s.
- *
- * @param key the resource name
- * @return the string
- */
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-}
diff --git a/examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/MultiPageContributor.java b/examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/MultiPageContributor.java deleted file mode 100644 index d78f61a5d6e..00000000000 --- a/examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/MultiPageContributor.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.eclipse.ui.examples.multipageeditor;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.jface.action.IAction;
-
-/**
- * Manages the installation/deinstallation of global actions for multi-page editors.
- * Responsible for the redirection of global actions to the active editor.
- * Multi-page contributor replaces the contributors for the individual editors in the multi-page editor.
- */
-public class MultiPageContributor extends MultiPageEditorActionBarContributor {
- private IEditorPart activeEditorPart;
-/**
- * Creates a multi-page contributor.
- */
-public MultiPageContributor() {
- super();
-}
-/**
- * Returns the action registed with the given text editor.
- * @return IAction or null if editor is null.
- */
-protected IAction getAction(ITextEditor editor, String actionID) {
- return (editor == null ? null : editor.getAction(actionID));
-}
-/* (non-JavaDoc)
- * Method declared in AbstractMultiPageEditorActionBarContributor.
- */
-
-public void setActivePage(IEditorPart part) {
- if (activeEditorPart == part)
- return;
-
- activeEditorPart = part;
-
- IActionBars actionBars = getActionBars();
- if (actionBars != null) {
-
- ITextEditor editor = (part instanceof ITextEditor) ? (ITextEditor) part : null;
-
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.DELETE, getAction(editor, ITextEditorActionConstants.DELETE));
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.UNDO, getAction(editor, ITextEditorActionConstants.UNDO));
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.REDO, getAction(editor, ITextEditorActionConstants.REDO));
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.CUT, getAction(editor, ITextEditorActionConstants.CUT));
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.COPY, getAction(editor, ITextEditorActionConstants.COPY));
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.PASTE, getAction(editor, ITextEditorActionConstants.PASTE));
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.SELECT_ALL, getAction(editor, ITextEditorActionConstants.SELECT_ALL));
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.FIND, getAction(editor, ITextEditorActionConstants.FIND));
- actionBars.setGlobalActionHandler(IWorkbenchActionConstants.BOOKMARK, getAction(editor, ITextEditorActionConstants.BOOKMARK));
- actionBars.updateActionBars();
- }
-}
-}
diff --git a/examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/MultiPageEditorExample.java b/examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/MultiPageEditorExample.java deleted file mode 100644 index 72d3ca4ddd8..00000000000 --- a/examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/MultiPageEditorExample.java +++ /dev/null @@ -1,202 +0,0 @@ -package org.eclipse.ui.examples.multipageeditor;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ui.*;
-import org.eclipse.ui.editors.text.TextEditor;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.FontDialog;
-import java.io.StringWriter;
-import java.text.Collator;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.StringTokenizer;
-
-/**
- * An example showing how to create a multi-page editor.
- * This example has 3 pages:
- * <ul>
- * <li>page 0 contains a nested text editor.
- * <li>page 1 allows you to change the font used in page 2
- * <li>page 2 shows the words in page 0 in sorted order
- * </ul>
- */
-public class MultiPageEditorExample extends MultiPageEditorPart {
-
- /** The text editor used in page 0. */
- private TextEditor editor;
-
- /** The font chosen in page 1. */
- private Font font;
-
- /** The text widget used in page 2. */
- private StyledText text;
-/**
- * Creates a multi-page editor example.
- */
-public MultiPageEditorExample() {
- super();
-}
-/**
- * Creates page 0 of the multi-page editor,
- * which contains a text editor.
- */
-void createPage0() {
- try {
- editor = new TextEditor();
- int index = addPage(editor, getEditorInput());
- setPageText(index, editor.getTitle());
- }
- catch (PartInitException e) {
- ErrorDialog.openError(getSite().getShell(), MessageUtil.getString("ErrorCreatingNestedEditor"), null, e.getStatus()); //$NON-NLS-1$
- }
-}
-/**
- * Creates page 1 of the multi-page editor,
- * which allows you to change the font used in page 2.
- */
-void createPage1() {
-
- Composite composite = new Composite(getContainer(), SWT.NONE);
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
- layout.numColumns = 2;
-
- Button fontButton = new Button(composite, SWT.NONE);
- GridData gd = new GridData(GridData.BEGINNING);
- gd.horizontalSpan = 2;
- fontButton.setLayoutData(gd);
- fontButton.setText(MessageUtil.getString("ChangeFont")); //$NON-NLS-1$
-
- fontButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- setFont();
- }
- });
-
- int index = addPage(composite);
- setPageText(index, MessageUtil.getString("Properties")); //$NON-NLS-1$
-}
-/**
- * Creates page 2 of the multi-page editor,
- * which shows the sorted text.
- */
-void createPage2() {
- Composite composite = new Composite(getContainer(), SWT.NONE);
- FillLayout layout = new FillLayout();
- composite.setLayout(layout);
- text = new StyledText(composite, SWT.H_SCROLL | SWT.V_SCROLL);
- text.setEditable(false);
-
- int index = addPage(composite);
- setPageText(index, MessageUtil.getString("Preview")); //$NON-NLS-1$
-}
-/**
- * Creates the pages of the multi-page editor.
- */
-protected void createPages() {
- createPage0();
- createPage1();
- createPage2();
-}
-/**
- * Saves the multi-page editor's document.
- */
-public void doSave(IProgressMonitor monitor) {
- getEditor(0).doSave(monitor);
-}
-/**
- * Saves the multi-page editor's document as another file.
- * Also updates the text for page 0's tab, and updates this multi-page editor's input
- * to correspond to the nested editor's.
- */
-public void doSaveAs() {
- IEditorPart editor = getEditor(0);
- editor.doSaveAs();
- setPageText(0, editor.getTitle());
- setInput(editor.getEditorInput());
-}
-/* (non-Javadoc)
- * Method declared on IEditorPart
- */
-public void gotoMarker(IMarker marker) {
- setActivePage(0);
- getEditor(0).gotoMarker(marker);
-}
-/**
- * The <code>MultiPageEditorExample</code> implementation of this method
- * checks that the input is an instance of <code>IFileEditorInput</code>.
- */
-public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException {
- if (!(editorInput instanceof IFileEditorInput))
- throw new PartInitException(MessageUtil.getString("InvalidInput")); //$NON-NLS-1$
- super.init(site, editorInput);
-}
-/* (non-Javadoc)
- * Method declared on IEditorPart.
- */
-public boolean isSaveAsAllowed() {
- return true;
-}
-/**
- * Calculates the contents of page 2 when the it is activated.
- */
-protected void pageChange(int newPageIndex) {
- super.pageChange(newPageIndex);
- if (newPageIndex == 2) {
- sortWords();
- }
-}
-/**
- * Sets the font related data to be applied to the text in page 2.
- */
-void setFont() {
- FontDialog fontDialog = new FontDialog(getSite().getShell());
- fontDialog.setFontData(text.getFont().getFontData()[0]);
- FontData fontData = fontDialog.open();
- if (fontData != null) {
- if (font != null)
- font.dispose();
- font = new Font(text.getDisplay(), fontData);
- text.setFont(font);
- }
-}
-/**
- * Sorts the words in page 0, and shows them in page 2.
- */
-void sortWords() {
-
- String editorText = editor.getDocumentProvider().getDocument(editor.getEditorInput()).get();
-
- StringTokenizer tokenizer = new StringTokenizer(editorText, " \t\n\r\f!@#$%^&*()-_=+`~[]{};:'\",.<>/?|\\"); //$NON-NLS-1$
- ArrayList editorWords = new ArrayList();
- while (tokenizer.hasMoreTokens()) {
- editorWords.add(tokenizer.nextToken());
- }
-
- Collections.sort(editorWords, Collator.getInstance());
- StringWriter displayText = new StringWriter();
- for (int i = 0; i < editorWords.size(); i++) {
- displayText.write(((String) editorWords.get(i)));
- displayText.write("\n"); //$NON-NLS-1$
- }
- text.setText(displayText.toString());
-}
-}
diff --git a/examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/messages.properties b/examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/messages.properties deleted file mode 100644 index a0f968ad940..00000000000 --- a/examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/messages.properties +++ /dev/null @@ -1,5 +0,0 @@ -ErrorCreatingNestedEditor=Error creating nested text editor
-ChangeFont=Change Font...
-InvalidInput=Invalid Input: Must be IFileEditorInput
-Preview=Preview
-Properties=Properties
diff --git a/examples/org.eclipse.ui.examples.multipageeditor/about.html b/examples/org.eclipse.ui.examples.multipageeditor/about.html deleted file mode 100644 index 9db411aab99..00000000000 --- a/examples/org.eclipse.ui.examples.multipageeditor/about.html +++ /dev/null @@ -1,30 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> -<html> -<head> -<title>About</title> -<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1"> -</head> -<body lang="EN-US"> -<h2>About This Content</h2> - -<p>20th June, 2002</p> -<h3>License</h3> -<p>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 <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>. -For purposes of the CPL, "Program" will mean the Content.</p> - -<h3>Contributions</h3> - -<p>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.</p> - -<p>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.</p> - -</body> -</html>
\ No newline at end of file diff --git a/examples/org.eclipse.ui.examples.multipageeditor/build.properties b/examples/org.eclipse.ui.examples.multipageeditor/build.properties deleted file mode 100644 index afa232cfc00..00000000000 --- a/examples/org.eclipse.ui.examples.multipageeditor/build.properties +++ /dev/null @@ -1,11 +0,0 @@ -source.multipageeditor.jar = Eclipse UI Examples MultiPageEditor/
-
-bin.includes = doc-html/,\
- icons/,\
- .options,\
- about.html,\
- plugin.properties,\
- plugin.xml,\
- *.jar
-
-src.includes = about.html
diff --git a/examples/org.eclipse.ui.examples.multipageeditor/doc-html/hglegal.htm b/examples/org.eclipse.ui.examples.multipageeditor/doc-html/hglegal.htm deleted file mode 100644 index b071dbdf45b..00000000000 --- a/examples/org.eclipse.ui.examples.multipageeditor/doc-html/hglegal.htm +++ /dev/null @@ -1,14 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.73 [en] (Win98; U) [Netscape]">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright IBM Corp. 2000, 2001. All Rights Reserved.
-</body>
-</html>
diff --git a/examples/org.eclipse.ui.examples.multipageeditor/doc-html/ngibmcpy.gif b/examples/org.eclipse.ui.examples.multipageeditor/doc-html/ngibmcpy.gif Binary files differdeleted file mode 100644 index 360f8e99891..00000000000 --- a/examples/org.eclipse.ui.examples.multipageeditor/doc-html/ngibmcpy.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.multipageeditor/doc-html/ui_multipageeditor_ex.html b/examples/org.eclipse.ui.examples.multipageeditor/doc-html/ui_multipageeditor_ex.html deleted file mode 100644 index a610d18129c..00000000000 --- a/examples/org.eclipse.ui.examples.multipageeditor/doc-html/ui_multipageeditor_ex.html +++ /dev/null @@ -1,50 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Desktop - Multi-page Editor Example</title>
-</head>
-<body>
-
-<h2>
-<b>Example - Multi-page Editor</b></h2>
-
-<h3>
-Introduction</h3>
-The Multi Page Editor Example adds an editor for files with the .mpe
-extension. It shows how to create an editor that uses multiple pages by
-defining both an editor and a page contributor that can add entries to
-an action bar.
-<h3>
-Running the example</h3>
-To start using the Multi-page Editor Example, create a new file with .mpe
-extension. Select the file, bring up the popup menu, select the Open
-With menu and from the sub-menu select the Multi Page Editor Example menu
-item. You can then select the different editors by selecting the different
-tabs.
-<h4>
-<b>Creating a new mpe file</b></h4>
-Create a new file with file extension .mpe. From the File menu, select
-New and then select Other... from the sub-menu. Click on Simple in
-the wizard, then select
-<br>File in the list on the left. Click on Next to supply the file
-name (make sure the extension is .mpe) and the folder in which the file
-should be contained.
-<br>
-<h3>
-Details</h3>
-The Multi Page Editor Example demonstrates how to create an multi
-page editor with a custom page contributor.
-<p>The Multi Page Editor Example is constructed with two extensions - a
-document contributor (MultiPageContributor) and an editor (MultiPageEditor).
-The document contributor is a subclass of <tt>org.eclipse.ui.part.MultiPageEditorActionBarContributor</tt>
-and defines the actions that are added to an editor when the <tt>setActivePage</tt>
-method is called. The editor is an <tt>org.eclipse.ui.part.MultiPageEditorPart</tt>
-that creates 3 pages whose activation is handled by the <tt>pageChange</tt>
-method that in turn sends <tt>setActivePage</tt>
-to the contributor. These two classes do not refer to each other directly
-- the contributor for the editor is set using the contributorClass tag
-in the plugin.xml
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corp. 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a>
-</body>
-</html>
diff --git a/examples/org.eclipse.ui.examples.multipageeditor/icons/copy.gif b/examples/org.eclipse.ui.examples.multipageeditor/icons/copy.gif Binary files differdeleted file mode 100644 index f962255bc45..00000000000 --- a/examples/org.eclipse.ui.examples.multipageeditor/icons/copy.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.multipageeditor/plugin.properties b/examples/org.eclipse.ui.examples.multipageeditor/plugin.properties deleted file mode 100644 index 6d46d2717a7..00000000000 --- a/examples/org.eclipse.ui.examples.multipageeditor/plugin.properties +++ /dev/null @@ -1,3 +0,0 @@ -Plugin.name = MultiPage Editor Example
-Plugin.providerName = Eclipse.org
-Editors.MultiPageEditorExample = Multi-Page Editor Example
diff --git a/examples/org.eclipse.ui.examples.multipageeditor/plugin.xml b/examples/org.eclipse.ui.examples.multipageeditor/plugin.xml deleted file mode 100644 index 19fa05d7a0c..00000000000 --- a/examples/org.eclipse.ui.examples.multipageeditor/plugin.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ======================================================================= -->
-<!-- The MultiPage Editor Example is a sample plugin which demonstrates the -->
-<!-- implementation of a multi-page editor. -->
-<!-- ======================================================================= -->
-<plugin
- name = "%Plugin.name"
- id = "org.eclipse.ui.examples.multipageeditor"
- version = "2.0.0"
- provider-name = "%Plugin.providerName">
-
- <requires>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.resources"/>
- </requires>
-
- <runtime>
- <library name="multipageeditor.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <extension
- point = "org.eclipse.ui.editors">
- <editor
- id = "org.eclipse.ui.examples.multipageeditor.MultiPageEditorExample"
- name="%Editors.MultiPageEditorExample"
- icon="icons/copy.gif"
- extensions="mpe"
- class="org.eclipse.ui.examples.multipageeditor.MultiPageEditorExample"
- contributorClass="org.eclipse.ui.examples.multipageeditor.MultiPageContributor" >
- </editor>
- </extension>
-</plugin>
diff --git a/examples/org.eclipse.ui.examples.propertysheet/.classpath b/examples/org.eclipse.ui.examples.propertysheet/.classpath deleted file mode 100644 index 912219c9906..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/.classpath +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="Eclipse UI Examples PropertySheet"/> - <classpathentry kind="src" path="/org.eclipse.ui"/> - <classpathentry kind="src" path="/org.eclipse.swt"/> - <classpathentry kind="src" path="/org.eclipse.core.resources"/> - <classpathentry kind="src" path="/org.eclipse.core.runtime"/> - <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/examples/org.eclipse.ui.examples.propertysheet/.cvsignore b/examples/org.eclipse.ui.examples.propertysheet/.cvsignore deleted file mode 100644 index c5e82d74585..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin
\ No newline at end of file diff --git a/examples/org.eclipse.ui.examples.propertysheet/.project b/examples/org.eclipse.ui.examples.propertysheet/.project deleted file mode 100644 index 1fab398484e..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/.project +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.ui.examples.propertysheet</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.core.resources</project>
- <project>org.eclipse.core.runtime</project>
- <project>org.eclipse.swt</project>
- <project>org.eclipse.ui</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/Address.java b/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/Address.java deleted file mode 100644 index 47b2df0cd9c..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/Address.java +++ /dev/null @@ -1,315 +0,0 @@ -package org.eclipse.ui.examples.propertysheet;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.ui.views.properties.*;
-
-/**
- * Example IPropertySource who itself is NOT editable, but whose children are.
- * The values of the children determine the value of the address.
- */
-public class Address implements IPropertySource {
-
- //properties
- private String city;
- private Integer province;
- private String postalCode;
- private StreetAddress street;
-
- //Property unique keys
- public static final String P_ID_STREET = "Address.Street"; //$NON-NLS-1$
- public static final String P_ID_CITY = "Address.City"; //$NON-NLS-1$
- public static final String P_ID_PROVINCE = "Address.Province"; //$NON-NLS-1$
- public static final String P_ID_POSTALCODE = "Address.PostalCode"; //$NON-NLS-1$
-
- //Property display keys
- public static final String P_STREET = MessageUtil.getString("Street"); //$NON-NLS-1$
- public static final String P_CITY = MessageUtil.getString("City"); //$NON-NLS-1$
- public static final String P_PROVINCE = MessageUtil.getString("Province"); //$NON-NLS-1$
- public static final String P_POSTALCODE = MessageUtil.getString("PostalCode"); //$NON-NLS-1$
- public static final String P_DESCRIPTORS = "properties"; //$NON-NLS-1$
-
-
- //default values
- private static final StreetAddress STREET_DEFAULT = new StreetAddress();
- private static final String CITY_DEFAULT = MessageUtil.getString("unspecified_city"); //$NON-NLS-1$
- private static final Integer PROVINCE_DEFAULT = new Integer(0);
- private static final String POSTALCODE_DEFAULT = "A1B2C3"; //$NON-NLS-1$
-
- //
- static private class ProvinceLabelProvider extends LabelProvider {
- public String getText(Object element) {
- String[] provinceValues = new String[] {MessageUtil.getString("British_Columbia"), MessageUtil.getString("Alberta"), MessageUtil.getString("Saskatchewan"), MessageUtil.getString("Manitoba"), MessageUtil.getString("Ontario"), MessageUtil.getString("Quebec"), MessageUtil.getString("Newfoundland"), MessageUtil.getString("Prince_Edward_Island"), MessageUtil.getString("Nova_Scotia"), MessageUtil.getString("New_Brunswick"), MessageUtil.getString("Yukon"), MessageUtil.getString("North_West_Territories"), MessageUtil.getString("Nunavut")}; //$NON-NLS-13$ //$NON-NLS-12$ //$NON-NLS-11$ //$NON-NLS-10$ //$NON-NLS-9$ //$NON-NLS-8$ //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
- return provinceValues[((Integer)element).intValue()];
- }
- }
-
- //
- private static Vector descriptors;
- private static String[] provinceValues;
- static {
- descriptors = new Vector();
- provinceValues = new String[] {MessageUtil.getString("British_Columbia"), MessageUtil.getString("Alberta"), MessageUtil.getString("Saskatchewan"), MessageUtil.getString("Manitoba"), MessageUtil.getString("Ontario"), MessageUtil.getString("Quebec"), MessageUtil.getString("Newfoundland"), MessageUtil.getString("Prince_Edward_Island"), MessageUtil.getString("Nova_Scotia"), MessageUtil.getString("New_Brunswick"), MessageUtil.getString("Yukon"), MessageUtil.getString("North_West_Territories"), MessageUtil.getString("Nunavut")}; //$NON-NLS-13$ //$NON-NLS-12$ //$NON-NLS-11$ //$NON-NLS-10$ //$NON-NLS-9$ //$NON-NLS-8$ //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
- descriptors.addElement(new PropertyDescriptor(P_ID_STREET, P_STREET));
- descriptors.addElement(new TextPropertyDescriptor(P_ID_CITY, P_CITY));
-
-
- //PostalCode
- PropertyDescriptor propertyDescriptor = new TextPropertyDescriptor(P_ID_POSTALCODE, P_POSTALCODE);
- //add custom validator to propertyDescriptor limiting postalcode
- //values to XYXYXY, where X is a letter and Y is a digit
- propertyDescriptor.setValidator(new ICellEditorValidator() {
- public String isValid(Object value) {
- if (value == null)
- return MessageUtil.getString("postal_code_is_incomplete"); //$NON-NLS-1$
-
- //
- String testPostalCode = ((String) value).toUpperCase();
- final int length = testPostalCode.length();
- final char space = ' ';
-
- //removes white space
- StringBuffer postalCodeBuffer = new StringBuffer(6);
- char current;
- for (int i = 0; i < length; i++) {
- current = testPostalCode.charAt(i);
- if (current != space)
- postalCodeBuffer.append(current);
- }
- testPostalCode = postalCodeBuffer.toString();
-
- //check for proper length
- if (testPostalCode.length() != 6) {
- //fail
- return MessageUtil.format("_is_an_invalid_format_for_a_postal_code", new Object[] {testPostalCode}); //$NON-NLS-1$
- }
-
- //check for proper format
- if (
- testPostalCode.charAt(1) < '0' || testPostalCode.charAt(1) > '9' ||
- testPostalCode.charAt(3) < '0' || testPostalCode.charAt(3) > '9' ||
- testPostalCode.charAt(5) < '0' || testPostalCode.charAt(5) > '9' ||
- testPostalCode.charAt(0) < 'A' || testPostalCode.charAt(0) > 'Z' ||
- testPostalCode.charAt(2) < 'A' || testPostalCode.charAt(2) > 'Z' ||
- testPostalCode.charAt(4) < 'A' || testPostalCode.charAt(4) > 'Z'
- ) {
- //fail
- return MessageUtil.format("_is_an_invalid_format_for_a_postal_code", new Object[] {testPostalCode}); //$NON-NLS-1$
- }
-
- //all pass
- return null;
- }
- });
- descriptors.addElement(propertyDescriptor);
-
- //
- ComboBoxPropertyDescriptor desc = new ComboBoxPropertyDescriptor(P_ID_PROVINCE, P_PROVINCE, provinceValues);
- desc.setLabelProvider(new ProvinceLabelProvider());
- descriptors.addElement(desc);
- }
-/**
- * Address Default Constructor
- */
-Address() {
- super();
-}
-/**
- * Creates a new address.
- *
- * @param street the street
- * @param city the city
- * @param province the province
- * @param postalCode has the form XYXYXY: where X is a letter and Y is a digit
- * @exception IllegalArgumentException, if postalcode not in above form
- */
-public Address(StreetAddress street, String city, Integer province, String postalCode) {
- super();
- setStreet(street);
- setCity(city);
- setPostalCode(postalCode);
- setProvince(province);
-}
-/**
- * Returns the city
- */
-private String getCity() {
- if(city == null)
- city = CITY_DEFAULT;
- return city;
-}
-/*
- * Standard Accessor
- */
-private static Vector getDescriptors() {
- return descriptors;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public Object getEditableValue() {
- return this.toString();
-}
-/**
- * Returns the postal code
- */
-private String getPostalCode() {
- if(postalCode == null)
- postalCode = POSTALCODE_DEFAULT;
- return postalCode;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public IPropertyDescriptor[] getPropertyDescriptors() {
- return (IPropertyDescriptor[])getDescriptors().toArray(new IPropertyDescriptor[getDescriptors().size()]);
-}
-/**
- * The <code>Address</code> implementation of this
- * <code>IPropertySource</code> method returns the following properties
- *
- * 1) P_CITY returns java.lang.String
- * 2) P_POSTALCODE returns java.lang.String
- * 3) P_PROVINCE returns java.lang.String
- * 4) P_STREET returns StreetAddress
- */
-public Object getPropertyValue(Object propKey) {
- if (propKey.equals(P_ID_PROVINCE))
- return getProvince();
- if (propKey.equals(P_ID_STREET))
- return getStreet();
- if (propKey.equals(P_ID_CITY))
- return getCity();
- if (propKey.equals(P_ID_POSTALCODE))
- return getPostalCode();
- return null;
-}
-/**
- * Returns the province
- */
-private Integer getProvince() {
- if(province == null)
- province = PROVINCE_DEFAULT;
- return province;
-}
-/**
- * Returns the street
- */
-public StreetAddress getStreet() {
- if(street == null)
- street = STREET_DEFAULT;
- return street;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public boolean isPropertySet(Object property) {
- return false;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public void resetPropertyValue(Object property) {
- if (P_ID_POSTALCODE.equals(property)) {
- setPostalCode(POSTALCODE_DEFAULT);
- return;
- }
- if (P_ID_CITY.equals(property)) {
- setCity(CITY_DEFAULT);
- return;
- }
- if (P_ID_PROVINCE.equals(property)) {
- setProvince(PROVINCE_DEFAULT);
- return;
- };
- if (P_ID_STREET.equals(property)) {
- setStreet(STREET_DEFAULT);
- return;
- }
-}
-/**
- * Sets the city
- */
-private void setCity(String newCity) {
- city = newCity;
-}
-/**
- * Sets the postal code
- */
-private void setPostalCode(String newPostalCode) {
- //validation in ICellEditorValidator registered in PropertyDescriptor
- this.postalCode = newPostalCode.toUpperCase();
-}
-/**
- * The <code>Address</code> implementation of this
- * <code>IPropertySource</code> method
- * defines the following Setable properties
- *
- * 1) P_CITY expects java.lang.String
- * 2) P_POSTALCODE expects java.lang.String
- * 3) P_PROVINCE expects java.lang.String
- * 4) P_STREET expects StreetAddress
- */
-public void setPropertyValue(Object name, Object value) {
- if (P_ID_POSTALCODE.equals(name)) {
- setPostalCode((String) value);
- return;
- }
- if (P_ID_CITY.equals(name)) {
- setCity((String) value);
- return;
- }
- if (P_ID_PROVINCE.equals(name)) {
- setProvince((Integer) value);
- return;
- }
- if (P_ID_STREET.equals(name)) {
- //setStreet((StreetAddress) value);
- return;
- }
-
-}
-/**
- * Sets the province
- */
-private void setProvince(Integer newProvince) {
- province = newProvince;
-}
-/**
- * Sets the street
- */
-private void setStreet(StreetAddress newStreet) {
- street = newStreet;
-}
-/**
- * The value as displayed in the Property Sheet. Will not print default values
- * @return java.lang.String
- */
-public String toString() {
- StringBuffer outStringBuffer = new StringBuffer();
- final String comma_space = ", "; //$NON-NLS-1$
- final String space = " "; //$NON-NLS-1$
- if (!getStreet().equals(STREET_DEFAULT)) {
- outStringBuffer.append(getStreet());
- outStringBuffer.append(comma_space);
- }
- if (!getCity().equals(CITY_DEFAULT)) {
- outStringBuffer.append(getCity());
- outStringBuffer.append(space);
- }
- if (!getProvince().equals(PROVINCE_DEFAULT)) {
- outStringBuffer.append(provinceValues[getProvince().intValue()]);
- }
- if (!getPostalCode().equals(POSTALCODE_DEFAULT)) {
- outStringBuffer.append(comma_space);
- outStringBuffer.append(getPostalCode());
- }
- return outStringBuffer.toString();
-}
-}
diff --git a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/Birthday.java b/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/Birthday.java deleted file mode 100644 index 374fb3e703c..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/Birthday.java +++ /dev/null @@ -1,226 +0,0 @@ -package org.eclipse.ui.examples.propertysheet;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.ui.views.properties.*;
-
-/**
- * Example IPropertySource who itself is NOT editable, but whose children are.
- * The values of the children determine the value of the birthday.
- */
-public class Birthday implements IPropertySource {
-
- //Properties
- private Integer day, month, year;
-
- //Property unique keys
- public static final String P_ID_DAY = "Birthday.day"; //$NON-NLS-1$
- public static final String P_ID_MONTH = "Birthday.month"; //$NON-NLS-1$
- public static final String P_ID_YEAR = "Birthday.year"; //$NON-NLS-1$
-
- //Property display keys
- public static final String P_DAY = MessageUtil.getString("day"); //$NON-NLS-1$
- public static final String P_MONTH = MessageUtil.getString("month"); //$NON-NLS-1$
- public static final String P_YEAR = MessageUtil.getString("year"); //$NON-NLS-1$
-
- //default values
- private static final Integer DAY_DEFAULT = new Integer(1);
- private static final Integer MONTH_DEFAULT = new Integer(1);
- private static final Integer YEAR_DEFAULT = new Integer(2000);
-
- //static date formater
- private static final DateFormat formatter = new SimpleDateFormat("EEEE, MMMM d, yyyy"); //$NON-NLS-1$
-
- static private class DayLabelProvider extends LabelProvider {
- public String getText(Object element) {
- String[] dayValues = new String[] {"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"}; //$NON-NLS-31$ //$NON-NLS-30$ //$NON-NLS-29$ //$NON-NLS-28$ //$NON-NLS-27$ //$NON-NLS-26$ //$NON-NLS-25$ //$NON-NLS-24$ //$NON-NLS-23$ //$NON-NLS-22$ //$NON-NLS-21$ //$NON-NLS-20$ //$NON-NLS-19$ //$NON-NLS-18$ //$NON-NLS-17$ //$NON-NLS-16$ //$NON-NLS-15$ //$NON-NLS-14$ //$NON-NLS-13$ //$NON-NLS-12$ //$NON-NLS-11$ //$NON-NLS-10$ //$NON-NLS-9$ //$NON-NLS-8$ //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
- return dayValues[((Integer)element).intValue()];
- }
- }
-
- static private class MonthLabelProvider extends LabelProvider {
- public String getText(Object element) {
- String[] monthValues = new String[] {MessageUtil.getString("January"), MessageUtil.getString("February"), MessageUtil.getString("March"), MessageUtil.getString("April"), MessageUtil.getString("May"), MessageUtil.getString("June"), MessageUtil.getString("July"), MessageUtil.getString("August"), MessageUtil.getString("September"), MessageUtil.getString("October"), MessageUtil.getString("November"), MessageUtil.getString("December")}; //$NON-NLS-12$ //$NON-NLS-11$ //$NON-NLS-10$ //$NON-NLS-9$ //$NON-NLS-8$ //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
- return monthValues[((Integer)element).intValue()];
- }
- }
-
- //
- private static Vector descriptors;
- static {
- descriptors = new Vector();
-
- ///
- String[] dayValues = new String[] {"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"}; //$NON-NLS-31$ //$NON-NLS-30$ //$NON-NLS-29$ //$NON-NLS-28$ //$NON-NLS-27$ //$NON-NLS-26$ //$NON-NLS-25$ //$NON-NLS-24$ //$NON-NLS-23$ //$NON-NLS-22$ //$NON-NLS-21$ //$NON-NLS-20$ //$NON-NLS-19$ //$NON-NLS-18$ //$NON-NLS-17$ //$NON-NLS-16$ //$NON-NLS-15$ //$NON-NLS-14$ //$NON-NLS-13$ //$NON-NLS-12$ //$NON-NLS-11$ //$NON-NLS-10$ //$NON-NLS-9$ //$NON-NLS-8$ //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
- ComboBoxPropertyDescriptor days = new ComboBoxPropertyDescriptor(P_ID_DAY, P_DAY, dayValues);
- days.setLabelProvider(new DayLabelProvider());
- descriptors.addElement(days);
-
- ///
- String[] monthValues = new String[] {MessageUtil.getString("January"), MessageUtil.getString("February"), MessageUtil.getString("March"), MessageUtil.getString("April"), MessageUtil.getString("May"), MessageUtil.getString("June"), MessageUtil.getString("July"), MessageUtil.getString("August"), MessageUtil.getString("September"), MessageUtil.getString("October"), MessageUtil.getString("November"), MessageUtil.getString("December")}; //$NON-NLS-12$ //$NON-NLS-11$ //$NON-NLS-10$ //$NON-NLS-9$ //$NON-NLS-8$ //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
- ComboBoxPropertyDescriptor months = new ComboBoxPropertyDescriptor(P_ID_MONTH, P_MONTH, monthValues);
- months.setLabelProvider(new MonthLabelProvider());
- descriptors.addElement(months);
-
- ///
- descriptors.addElement(new TextPropertyDescriptor(P_ID_YEAR, P_YEAR));
- }
-/**
- * Address Default Constructor
- */
-Birthday() {
- super();
-}
-/**
- * Convenience Address Constructor
- */
-public Birthday(int day, int month, int year) {
- super();
- setDay(new Integer(day));
- setMonth(new Integer(month));
- setYear(new Integer(year));
-}
-/**
- * Returns the day
- */
-private Integer getDay() {
- if(day == null)
- day = DAY_DEFAULT;
- return day;
-}
-/**
- * Standard Accessor
- */
-private static Vector getDescriptors() {
- return descriptors;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public Object getEditableValue() {
- return this.toString();
-}
-/**
- * Returns the month
- */
-private Integer getMonth() {
- if(month == null)
- month = MONTH_DEFAULT;
- return month;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public IPropertyDescriptor[] getPropertyDescriptors() {
- return (IPropertyDescriptor[])getDescriptors().toArray(new IPropertyDescriptor[getDescriptors().size()]);
-}
-/**
- * The <code>Birthday</code> implementation of this
- * <code>IPropertySource</code> method returns the following properties
- *
- * 1) P_DAY returns java.lang.Integer
- * 2) P_MONTH returns java.lang.Integer
- * 3) P_YEAR returns java.lang.Integer
- * 4) P_STREET returns java.lang.String
- */
-public Object getPropertyValue(Object propKey) {
- if (propKey.equals(P_ID_DAY))
- return new Integer(getDay().intValue() - 1);
- if (propKey.equals(P_ID_MONTH))
- return new Integer(getMonth().intValue() - 1);
- if (propKey.equals(P_ID_YEAR))
- return getYear().toString();
- return null;
-}
-/**
- * Returns the year
- */
-private Integer getYear() {
- if(year == null)
- year = YEAR_DEFAULT;
- return year;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public boolean isPropertySet(Object property) {
- return false;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public void resetPropertyValue(Object property) {
- if (P_ID_DAY.equals(property)) {
- setDay(DAY_DEFAULT);
- return;
- }
- if (P_ID_MONTH.equals(property)) {
- setMonth(MONTH_DEFAULT);
- return;
- }
- if (P_ID_YEAR.equals(property)) {
- setYear(YEAR_DEFAULT);
- return;
- };
-}
-/**
- * Sets the day
- */
-private void setDay(Integer newDay) {
- day = newDay;
-}
-/**
- * Sets the month
- */
-private void setMonth(Integer newMonth) {
- month = newMonth;
-}
-/**
- * The <code>Birthday</code> implementation of this
- * <code>IPropertySource</code> method
- * defines the following Setable properties
- *
- * 1) P_DAY expects java.lang.Integer
- * 2) P_MONTH expects java.lang.Integer
- * 3) P_YEAR expects java.lang.Integer
- */
-public void setPropertyValue(Object name, Object value) {
- if (P_ID_DAY.equals(name)) {
- setDay(new Integer(((Integer)value).intValue() + 1));
- return;
- }
- if (P_ID_MONTH.equals(name)) {
- setMonth(new Integer(((Integer)value).intValue() + 1));
- return;
- }
- if (P_ID_YEAR.equals(name)) {
- try {
- setYear(new Integer((String)value));
- } catch (NumberFormatException e) {
- setYear(YEAR_DEFAULT);
- }
- return;
- }
-}
-/**
- * Sets the year
- */
-private void setYear(Integer newYear) {
- year = newYear;
-}
-/**
- * The value as displayed in the Property Sheet. Will not print default values
- * @return java.lang.String
- */
-public String toString() {
- Date bday =(new GregorianCalendar(getYear().intValue(), getMonth().intValue() - 1, getDay().intValue())).getTime();
- return formatter.format(bday);
-}
-}
diff --git a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/EmailAddress.java b/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/EmailAddress.java deleted file mode 100644 index b35d6520634..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/EmailAddress.java +++ /dev/null @@ -1,189 +0,0 @@ -package org.eclipse.ui.examples.propertysheet;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import java.util.Vector;
-
-import org.eclipse.ui.views.properties.*;
-
-/**
- * Example IPropertySource is editable and whose childern properties are itself not editable.
- * The values of "userid" and "mailserver" are parsed from seting "email"
- */
-public class EmailAddress implements IPropertySource {
-
- //Property-Value
- private String userid;
- private String domain;
-
- //Default Property-Value
- private static final String USERID_DEFAULT = MessageUtil.getString("unknownUser"); //$NON-NLS-1$
- private static final String DOMAIN_DEFAULT = MessageUtil.getString("unknownDomain"); //$NON-NLS-1$
-
- //Property unique keys
- public static final String P_ID_USERID = "EmailAddress.userid"; //$NON-NLS-1$
- public static final String P_ID_DOMAIN = "EmailAddress.domain"; //$NON-NLS-1$
-
- //Property display keys
- public static final String P_USERID = MessageUtil.getString("userid"); //$NON-NLS-1$
- public static final String P_DOMAIN = MessageUtil.getString("domain"); //$NON-NLS-1$
-
- //Property-Descriptors
- private static Vector descriptors;
-
- static{
- descriptors = new Vector(2,2);
- //non-editable child properties --> provide no editors
- descriptors.addElement(new PropertyDescriptor(P_ID_USERID, P_USERID));
- descriptors.addElement(new PropertyDescriptor(P_ID_DOMAIN, P_DOMAIN));
- }
-/**
- * EmailAddress Default Constructor
- */
-public EmailAddress() {
- super();
-}
-/**
- * Convience EmailAddress constructor.
- * Calls setEmailAddress() to parse emailAddress
- * @param emailAddress java.lang.String, in the form userid@domain
- * @throws java.lang.IllegalArgumentException, if does not subscribe to form
- */
-public EmailAddress(String emailAddress) throws IllegalArgumentException{
- super();
- setEmailAddress(emailAddress);
-
-}
-/**
- * Returns the descriptors
- */
-private static Vector getDescriptors() {
- return descriptors;
-}
-/**
- * Returns the domain
- */
-private String getDomain() {
- if(domain == null)
- domain = DOMAIN_DEFAULT;
- return domain;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public Object getEditableValue() {
- return this.toString();
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public IPropertyDescriptor[] getPropertyDescriptors() {
- return (IPropertyDescriptor[])getDescriptors().toArray(new IPropertyDescriptor[getDescriptors().size()]);
-}
-/**
- * The <code>EmailAddress</code> implementation of this
- * <code>IPropertySource</code> method returns the following properties
- *
- * 1) P_USERID returns String, values before "@"
- * 2) P_DOMAIN returns String, values after "@"
- *
- * Observe the available properties must always equal those listed
- * in the property descriptors
- */
-public Object getPropertyValue(Object propKey) {
- if (propKey.equals(P_ID_USERID))
- return getUserid();
- if (propKey.equals(P_ID_DOMAIN))
- return getDomain();
- return null;
-}
-/**
- * Returns the userid
- */
-private String getUserid() {
- if(userid == null)
- userid = USERID_DEFAULT;
- return userid;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public boolean isPropertySet(Object property) {
- return false;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public void resetPropertyValue(Object property) {
- if (property.equals(P_ID_USERID)) {
- setUserid(USERID_DEFAULT);
- return;
- }
- if (property.equals(P_ID_DOMAIN)) {
- setDomain(DOMAIN_DEFAULT);
- return;
- }
- return;
-}
-/**
- * Sets the domain
- */
-private void setDomain(java.lang.String newDomain) {
- domain = newDomain;
-}
-/**
- * Parses emailAddress into domain and userid. Throws SetPropertyVetoException
- * if emailAddress does not contain an userid and domain seperated by '@'.
- *
- * @param emailAddress the email address
- * @throws IllegalArgumentException
- */
-private void setEmailAddress(String emailAddress) throws IllegalArgumentException {
- if(emailAddress == null)
- throw new IllegalArgumentException(MessageUtil.getString("emailaddress_cannot_be_set_to_null")); //$NON-NLS-1$
- int index = emailAddress.indexOf('@');
- int length = emailAddress.length();
- if (index > 0 && index < length) {
- setUserid(emailAddress.substring(0, index));
- setDomain(emailAddress.substring(index + 1));
- return;
- }
- throw new IllegalArgumentException(MessageUtil.getString("invalid_email_address_format_should_have_been_validated")); //$NON-NLS-1$
-}
-/**
- * The <code>Address</code> implementation of this
- * <code>IPropertySource</code> method
- * defines the following Setable properties
- *
- * 1) P_USERID, expects String
- * 2) P_DOMAIN, expects String
- */
-public void setPropertyValue(Object name, Object value) {
- if (name.equals(P_ID_USERID)) {
- setUserid((String) value);
- return;
- }
- if (name.equals(P_ID_DOMAIN)) {
- setDomain((String) value);
- return;
- }
-}
-/**
- * Sets the userid
- */
-private void setUserid(String newUserid) {
- userid = newUserid;
-}
-/**
- * The value as displayed in the Property Sheet. Will not print default values
- * @return java.lang.String
- */
-public String toString() {
- StringBuffer strbuffer = new StringBuffer(getUserid());
- strbuffer.append('@');
- strbuffer.append(getDomain());
- return strbuffer.toString();
-}
-}
diff --git a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/EmailAddressValidator.java b/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/EmailAddressValidator.java deleted file mode 100644 index f91d8c6d2ad..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/EmailAddressValidator.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.eclipse.ui.examples.propertysheet;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jface.viewers.ICellEditorValidator;
-/**
- * Validator for email addresses
- */
-public class EmailAddressValidator implements ICellEditorValidator {
-/**
- * The <code>EmailAddressValidator</code> implementation of this
- * <code>ICellEditorValidator</code> method
- * determines if the value is a valid email address.
- * (check to see if it is non-null and contains an @)
- */
-public String isValid(Object value) {
- if (value == null) {
- return MessageUtil.getString("email_address_is_incomplete"); //$NON-NLS-1$
- }
- String emailAddress = (String)value;
- int index = emailAddress.indexOf('@');
- int length = emailAddress.length();
- if (index > 0 && index < length) {
- return null;
- }
- return MessageUtil.getString("email_address_does_not_have_a_valid_format"); //$NON-NLS-1$
-}
-}
diff --git a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/GroupElement.java b/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/GroupElement.java deleted file mode 100644 index 4ac05440d9a..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/GroupElement.java +++ /dev/null @@ -1,139 +0,0 @@ -package org.eclipse.ui.examples.propertysheet;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import java.util.Vector;
-
-/**
- * A Group Element
- */
-public class GroupElement extends OrganizationElement {
- public static String P_USERS = "users"; //$NON-NLS-1$
- public static String P_SUBGROUPS = "subgroups"; //$NON-NLS-1$
- public static String P_CONTENTS = "contents"; //$NON-NLS-1$
- private Vector subGroups;
- private Vector users;
- // must be synchronized to contain both the references of subGroups and users
- private Vector contents;
-/**
- * Constructor.
- * Creates a new GroupElement within the passed parent GroupElement,
- * gives it the passed name property, sets Icon.
- *
- * @param name the name
- * @param parent the parent
- */
-public GroupElement(String name, GroupElement parent) {
- super(name, parent);
-}
-/**
- * Adds an OrganizationElement to this GroupElement.
- *
- * @param userGroup The Organization Element
- */
-public void add(OrganizationElement userGroup) {
- if (userGroup.isUser() || userGroup.isGroup()) {
- getContents().add(userGroup);
- }
- if (userGroup.isGroup()) {
- getSubGroups().add(userGroup);
- // synchronizes backpointer of userGroup: defensive
- userGroup.setParent(this);
- }
- if (userGroup.isUser()) {
- getUsers().add(userGroup);
- // synchronizes backpointer of userGroup: defensive
- userGroup.setParent(this);
- }
-
-}
-/**
- * Creates a new <code>GroupElement</code>
- * nested in this <code>GroupElement<code>
- *
- * @param name the name of the sub group
- */
-public GroupElement createSubGroup(String name) {
- GroupElement newGroup = new GroupElement(name, this);
- add(newGroup);
- return newGroup;
-}
-/**
- * Creates a new <code>UserElement</code>
- *
- * @param the name of the user element
- */
-public UserElement createUser(String name) {
- UserElement newUser = new UserElement(name, this);
- add(newUser);
- return newUser;
-}
-/**
- * Deletes an OrganizationElement from this GroupElement.
- *
- * @param userGroup the Organization Element
- */
-public void delete(OrganizationElement userGroup) {
- if (userGroup.isUser() || userGroup.isGroup()) {
- getContents().remove(userGroup);
- }
- if (userGroup.isGroup()) {
- getSubGroups().remove(userGroup);
- // synchronizes backpointer of userGroup: defensive
- }
- if (userGroup.isUser()) {
- getUsers().remove(userGroup);
- // synchronizes backpointer of userGroup: defensive
- }
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public Object[] getChildren(Object o) {
- return getContents().toArray();
-}
-/**
- * Returns the content
- */
-private Vector getContents() {
- if (contents == null)
- contents = new Vector();
- return contents;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public Object getEditableValue() {
- return this.toString();
-}
-/**
- * Returns the error message
- */
-public String getErrorMessage() {
- return null;
-}
-/**
- * Returns the subgroups
- */
-private Vector getSubGroups() {
- if (subGroups == null)
- subGroups = new Vector();
- return subGroups;
-}
-/**
- * Returns the users
- */
-private Vector getUsers() {
- if (users == null)
- users = new Vector();
- return users;
-}
-/* (non-Javadoc)
- * Method declared on OrganizationElement
- */
-public boolean isGroup() {
- return true;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/IUserConstants.java b/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/IUserConstants.java deleted file mode 100644 index 6484841458f..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/IUserConstants.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.eclipse.ui.examples.propertysheet;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-/**
- * This interface contains constants for use only within the
- * property sheet example.
- */
-public interface IUserConstants {
- public static final String PLUGIN_ID = "org.eclipse.ui.examples.propertysheet"; //$NON-NLS-1$
- public static final String PREFIX = PLUGIN_ID + "."; //$NON-NLS-1$
- public static final String P_CONTENT_OUTLINE = PREFIX + "content_outline"; //$NON-NLS-1$
- public static final String EXTENSION = "usr"; //$NON-NLS-1$
- public static final String ATT_CLASS = "class"; //$NON-NLS-1$
-}
diff --git a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/MessageUtil.java b/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/MessageUtil.java deleted file mode 100644 index 034b0ceaef7..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/MessageUtil.java +++ /dev/null @@ -1,50 +0,0 @@ -/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.ui.examples.propertysheet;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Utility class which helps with managing messages.
- */
-/* package */ class MessageUtil {
-
- private static final String RESOURCE_BUNDLE= "org.eclipse.ui.examples.propertysheet.messages";//$NON-NLS-1$
-
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private MessageUtil() {
- }
-
- /**
- * Returns the formatted message for the given key in
- * the resource bundle.
- *
- * @param key the resource name
- * @param args the message arguments
- * @return the string
- */
- public static String format(String key, Object[] args) {
- return MessageFormat.format(getString(key),args);
- }
-
- /**
- * Returns the resource object with the given key in
- * the resource bundle. If there isn't any value under
- * the given key, the key is returned, surrounded by '!'s.
- *
- * @param key the resource name
- * @return the string
- */
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-}
diff --git a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/Name.java b/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/Name.java deleted file mode 100644 index 46ce9d4400c..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/Name.java +++ /dev/null @@ -1,203 +0,0 @@ -package org.eclipse.ui.examples.propertysheet;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import java.util.Vector;
-
-import org.eclipse.ui.views.properties.*;
-
-/**
- * Example IPropertySource whose value as well as its children are editable.
- */
-public class Name implements IPropertySource
-{
- private String firstName = ""; //$NON-NLS-1$
- private String lastName = ""; //$NON-NLS-1$
- private String initial = ""; //$NON-NLS-1$
-
- // property unique keys
- public static String P_ID_FIRSTNAME = "Name.FirstName"; //$NON-NLS-1$
- public static String P_ID_LASTNAME = "Name.LastName"; //$NON-NLS-1$
- public static String P_ID_MIDDLENAME = "Name.Middle"; //$NON-NLS-1$
-
- // property display keys
- public static String P_FIRSTNAME = MessageUtil.getString("FirstName"); //$NON-NLS-1$
- public static String P_LASTNAME = MessageUtil.getString("LastName"); //$NON-NLS-1$
- public static String P_MIDDLENAME = MessageUtil.getString("Middle"); //$NON-NLS-1$
-
- public static final String P_DESCRIPTORS = "properties"; //$NON-NLS-1$
- static private Vector descriptors;
- static
- {
- descriptors = new Vector();
- descriptors.addElement(new TextPropertyDescriptor(P_ID_FIRSTNAME, P_FIRSTNAME));
- descriptors.addElement(new TextPropertyDescriptor(P_ID_LASTNAME, P_LASTNAME));
- descriptors.addElement(new TextPropertyDescriptor(P_ID_MIDDLENAME, P_MIDDLENAME));
- }
-/**
- * Creates a new Name.
- * @param name String in the form "firstname initial lastname"
- */
-public Name(String name) {
- int index1, index2, length;
- index1 = name.indexOf(' ');
- if (index1 < 0)
- index1 = name.length();
- index2 = name.lastIndexOf(' ');
- length = name.length();
- if (index2 > 0)
- lastName = name.substring(index2 + 1);
- firstName = name.substring(0, index1);
- if (index1 < index2)
- initial = name.substring(index1 + 1, index2);
-}
-/**
- * Returns the descriptors
- */
-private static Vector getDescriptors() {
- return descriptors;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public Object getEditableValue() {
- return this.toString();
-}
-/**
- * Returns the first name
- */
-private String getFirstName()
-{
- return firstName;
-}
-/**
- * Returns the initial
- */
-private String getInitial()
-{
- return initial;
-}
-/**
- * Returns the last name
- */
-private String getLastName()
-{
- return lastName;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public IPropertyDescriptor[] getPropertyDescriptors() {
- return (IPropertyDescriptor[])getDescriptors().toArray(new IPropertyDescriptor[getDescriptors().size()]);
-}
-/**
- * The <code>Name</code> implementation of this
- * <code>IPropertySource</code> method returns the following properties
- *
- * 1) P_FIRSTNAME returns String, firstname
- * 2) P_LASTNAME returns String, lastname
- * 3) P_MIDDLENAME returns String, middle
- */
-public Object getPropertyValue(Object propKey) {
- if (P_ID_FIRSTNAME.equals(propKey))
- return getFirstName();
- if (P_ID_LASTNAME.equals(propKey))
- return getLastName();
- if (P_ID_MIDDLENAME.equals(propKey))
- return getInitial();
- return null;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public boolean isPropertySet(Object key) {
- return false;
-}
-/**
- * Implemented as part of IPropertySource framework. Sets the specified property
- * to its default value.
- *
- * @see IPropertySource#resetPropertyValue(Object)
- * @param property The property to reset.
- */
-public void resetPropertyValue(Object property) {
- if (P_ID_FIRSTNAME.equals(property)) {
- setFirstName(null);
- return;
- }
- if (P_ID_LASTNAME.equals(property)) {
- setLastName(null);
- return;
- }
- if (P_ID_MIDDLENAME.equals(property)) {
- setInitial(null);
- return;
- }
-}
-/**
- * Sets the first name
- */
-private void setFirstName(String newFirstName)
-{
- firstName = newFirstName;
-}
-/**
- * Sets the initial
- */
-private void setInitial(String newInitial)
-{
- initial = newInitial;
-}
-/**
- * Sets the last name
- */
-private void setLastName(String newLastName)
-{
- lastName = newLastName;
-}
-/**
- * The <code>Name</code> implementation of this
- * <code>IPropertySource</code> method
- * defines the following Setable properties
- *
- * 1) P_FIRST, expects String, sets the firstname of this OrganizationElement
- * 2) P_MIDDLENAME, expects String, sets middlename of this OrganizationElement
- * 3) P_LASTNAME, expects String, sets lastname of this OrganizationElement
- */
-public void setPropertyValue(Object propName, Object val) {
- if (P_ID_FIRSTNAME.equals(propName)) {
- setFirstName((String) val);
- return;
- }
- if (P_ID_LASTNAME.equals(propName)) {
- setLastName((String) val);
- return;
- }
- if (P_ID_MIDDLENAME.equals(propName)){
- setInitial((String) val);
- return;
- }
-}
-/**
- * The value as displayed in the Property Sheet. Will not print default values
- * @return java.lang.String
- */
-public String toString(){
- StringBuffer outStringBuffer = new StringBuffer();
- if(getFirstName()!=null)
- { outStringBuffer.append(getFirstName());
- outStringBuffer.append(" "); //$NON-NLS-1$
- if(getInitial()!=null)
- { outStringBuffer.append(getInitial());
- outStringBuffer.append(" "); //$NON-NLS-1$
- }
- }
- if(getLastName()!=null)
- { outStringBuffer.append(getLastName());
- }
-
- return outStringBuffer.toString();
-}
-}
diff --git a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/OrganizationElement.java b/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/OrganizationElement.java deleted file mode 100644 index b0195d1c8db..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/OrganizationElement.java +++ /dev/null @@ -1,173 +0,0 @@ -package org.eclipse.ui.examples.propertysheet;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.views.properties.*;
-
-/**
- * An Organization Element
- */
-public abstract class OrganizationElement implements IAdaptable, IPropertySource, IWorkbenchAdapter {
- //
- private GroupElement parent;
- private String name;
- private ImageDescriptor imageDescriptor;
-
- //
- private static Vector descriptors;
- static {
- descriptors = new Vector();
- PropertyDescriptor name = new TextPropertyDescriptor(IBasicPropertyConstants.P_TEXT, MessageUtil.getString("name")); //$NON-NLS-1$
- descriptors.addElement(name);
- }
-/**
- * Constructor.
- * Creates a new OrganizationElement within the passed parent GroupElement,
- *
- * @param name the name
- * @param parent the parent
- */
-OrganizationElement(String name, GroupElement parent) {
- this.name = name;
- this.parent = parent;
-}
-/**
- * Deletes this OrganizationElement from its parentGroup
- */
-public void delete()
-{ parent.delete(this);
-}
-/* (non-Javadoc)
- * Method declared on IAdaptable
- */
-public Object getAdapter(Class adapter) {
- if (adapter == IPropertySource.class) {
- return this;
- }
- if (adapter == IWorkbenchAdapter.class) {
- return this;
- }
- return null;
-}
-/**
- * Returns the descriptors
- */
-static Vector getDescriptors()
-{
- return descriptors;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public Object getEditableValue() {
- return this;
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public ImageDescriptor getImageDescriptor(Object object) {
- return imageDescriptor;
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public String getLabel(Object o) {
- return getName();
-}
-/**
- * Returns the name
- */
-String getName()
-{
- return name;
-}
-/**
- * Returns the parent
- */
-public Object getParent(Object o)
-{
- return parent;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public IPropertyDescriptor[] getPropertyDescriptors()
-{ return (IPropertyDescriptor[])getDescriptors().toArray(new IPropertyDescriptor[getDescriptors().size()]);
-}
-/**
- * The <code>OrganizationElement</code> implementation of this
- * <code>IPropertySource</code> method returns the following properties
- *
- * 1) P_NAME returns String, name of this element
- * this property key is defined in <code>IBasicPropertyConstants</code>
- */
-public Object getPropertyValue(Object propKey)
-{
- if (propKey.equals(IBasicPropertyConstants.P_TEXT))
- return getName();
- return null;
-}
-/**
- * Hook. Implemented by <code>GroupElement</code> for use instead of instanceof
- * @return boolean
- */
-public boolean isGroup() {
- return false;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public boolean isPropertySet(Object property) {
- return false;
-}
-/**
- * Hook. Implemented by <code>UserElement</code> for use instead of instanceof
- * @return boolean
- */
-public boolean isUser() {
- return false;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public void resetPropertyValue(Object property){}
-/**
- * Sets the image descriptor
- */
-void setImageDescriptor(ImageDescriptor desc) {
- imageDescriptor = desc;
-}
-/**
- * Sets the name
- */
-void setName(String newName) {
- name = newName;
-}
-/**
- * Sets this instance's parent back pointer.
- */
-void setParent(GroupElement newParent){
- parent = newParent;
-}
-/**
- * The <code>OrganizationElement</code> implementation of this
- * <code>IPropertySource</code> method returns the following properties
- * defines the following Setable properties
- *
- * 1) P_NAME, expects String, sets the name of this OrganizationElement
- */
-public void setPropertyValue(Object name, Object value) {
- if (name.equals(IBasicPropertyConstants.P_TEXT)) {
- setName((String) value);
- return;
- }
-}
-}
diff --git a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/PopupMenuActionDelegate.java b/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/PopupMenuActionDelegate.java deleted file mode 100644 index 3c329fc0936..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/PopupMenuActionDelegate.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.eclipse.ui.examples.propertysheet;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Action delegate for handling popup menu actions.
- */
-public class PopupMenuActionDelegate implements IObjectActionDelegate {
-
- private IWorkbenchPart part;
-/** (non-Javadoc)
- * Method declared on IDropActionDelegate
- */
-public void run(IAction action) {
- MessageDialog.openInformation(
- this.part.getSite().getShell(),
- MessageUtil.getString("Property_Sheet_Example"), //$NON-NLS-1$
- MessageUtil.getString("Popup_Menu_Action_executed")); //$NON-NLS-1$
-}
-/** (non-Javadoc)
- * Method declared on IActionDelegate
- */
-public void selectionChanged(IAction action, ISelection selection) {
- //Ignored for this example
-}
-/** (non-Javadoc)
- * Method declared on IObjectActionDelegate
- */
-public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- this.part = targetPart;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/PropertySheetContentOutlinePage.java b/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/PropertySheetContentOutlinePage.java deleted file mode 100644 index c86a3ddd7a2..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/PropertySheetContentOutlinePage.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.ui.examples.propertysheet;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.part.IPageSite;
-import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
-
-/**
- * Page for the content outliner
- */
-public class PropertySheetContentOutlinePage extends ContentOutlinePage {
-
- private IAdaptable model;
-/**
- * Create a new instance of the reciver using adapatable
- * as the model.
- */
-public PropertySheetContentOutlinePage(IAdaptable adaptable) {
- this.model = adaptable;
-}
-/**
- * Creates the control and registers the popup menu for this page
- * Menu id "org.eclipse.ui.examples.propertysheet.outline"
- */
-public void createControl(Composite parent) {
- super.createControl(parent);
- TreeViewer viewer = getTreeViewer();
- viewer.setContentProvider(new WorkbenchContentProvider());
- viewer.setLabelProvider(new WorkbenchLabelProvider());
- viewer.setInput(this.model);
- viewer.expandAll();
-
- // Configure the context menu.
- MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
- menuMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- menuMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS+"-end")); //$NON-NLS-1$
-
- Menu menu = menuMgr.createContextMenu(viewer.getTree());
- viewer.getTree().setMenu(menu);
- // Be sure to register it so that other plug-ins can add actions.
- getSite().registerContextMenu("org.eclipse.ui.examples.propertysheet.outline", menuMgr, viewer); //$NON-NLS-1$
-}
-}
diff --git a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/PropertySheetPlugin.java b/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/PropertySheetPlugin.java deleted file mode 100644 index 4b2c20f65ac..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/PropertySheetPlugin.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.eclipse.ui.examples.propertysheet;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.*;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- * This is the top-level class of the property sheet example.
- *
- * @see AbstractUIPlugin for additional information on UI plugins
- */
-public class PropertySheetPlugin extends AbstractUIPlugin {
- // Default instance of the receiver
- private static PropertySheetPlugin inst;
-/**
- * Create the PropertySheet plugin and cache its default instance
- *
- * @param descriptor the plugin descriptor which the receiver is made from
- */
-public PropertySheetPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- if (inst==null) inst = this;
-}
-/**
- * Returns the plugin singleton.
- *
- * @return the default PropertySheetPlugin instance
- */
-static public PropertySheetPlugin getDefault() {
- return inst;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/StreetAddress.java b/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/StreetAddress.java deleted file mode 100644 index 115812fd24f..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/StreetAddress.java +++ /dev/null @@ -1,226 +0,0 @@ -package org.eclipse.ui.examples.propertysheet;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import java.util.Vector;
-
-import org.eclipse.ui.views.properties.*;
-
-/**
- * PropertySource containing street information pertenant to Address
- */
-public class StreetAddress implements IPropertySource {
-
- //properties
- private Integer buildNo;
- private String aptBox;
- private String streetName;
-
- //default property values
- private static final Integer BUILD_NO_DEFAULT = new Integer(0);
- private static final String APTBOX_DEFAULT = MessageUtil.getString("unspecified"); //$NON-NLS-1$
- private static final String STREETNAME_DEFAULT = MessageUtil.getString("unspecified"); //$NON-NLS-1$
-
- //property unique keys
- public static final String P_ID_BUILD_NO = "Street.buildingNo"; //$NON-NLS-1$
- public static final String P_ID_APTBOX = "Street.aptNo"; //$NON-NLS-1$
- public static final String P_ID_STREET = "Street.street"; //$NON-NLS-1$
-
- //property display keys
- public static final String P_BUILD_NO = MessageUtil.getString("building_number"); //$NON-NLS-1$
- public static final String P_APTBOX = MessageUtil.getString("apt.no_or_box.no"); //$NON-NLS-1$
- public static final String P_STREET = MessageUtil.getString("street"); //$NON-NLS-1$
-
- //
- private static Vector descriptors;
-
- static {
- descriptors = new Vector();
- descriptors.addElement(new TextPropertyDescriptor(P_ID_BUILD_NO, P_BUILD_NO));
- descriptors.addElement(new TextPropertyDescriptor(P_ID_APTBOX, P_APTBOX));
- descriptors.addElement(new TextPropertyDescriptor(P_ID_STREET, P_STREET));
- }
-/**
- * Street Default Constructor.
- */
-public StreetAddress() {
- super();
-}
-/**
- * Convenience Street constructor. AptBox set to default
- */
-public StreetAddress(int buildNo, String streetName) {
- super();
- setBuildNo(new Integer(buildNo));
- setStreetName(streetName);
-}
-/**
- * Convenience Street constructor.
- */
-public StreetAddress(int buildNo, String aptBox, String streetName) {
- super();
- setBuildNo(new Integer(buildNo));
- setAptBox(aptBox);
- setStreetName(streetName);
-}
-/* (non-Javadoc)
- * Method declared on Object
- */
-public boolean equals(Object ob) {
- return toString().equals(ob.toString());
-}
-/**
- * the appartment number
- */
-private String getAptBox() {
- if(aptBox == null)
- aptBox = APTBOX_DEFAULT;
- return aptBox;
-}
-/**
- * Returns the building number
- */
-private Integer getBuildNo() {
- if(buildNo == null)
- buildNo = BUILD_NO_DEFAULT;
- return buildNo;
-}
-/**
- * Returns the descriptors
- */
-private static Vector getDescriptors() {
- return descriptors;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public Object getEditableValue() {
- return this.toString();
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public IPropertyDescriptor[] getPropertyDescriptors() {
- return (IPropertyDescriptor[])getDescriptors().toArray(new IPropertyDescriptor[getDescriptors().size()]);
-}
-/**
- * The <code>Name</code> implementation of this
- * <code>IPropertySource</code> method returns the following properties
- *
- * 1) P_BUILD_NO returns java.lang.Integer
- * 2) P_APTBOX returns java.lang.String
- * 3) P_STREET returns java.lang.String
- */
-public Object getPropertyValue(Object propKey) {
- if (propKey.equals(P_ID_BUILD_NO))
- return getBuildNo().toString();
- if (propKey.equals(P_ID_APTBOX))
- return getAptBox();
- if (propKey.equals(P_ID_STREET))
- return getStreetName();
- return null;
-}
-/**
- * Returns the street name
- */
-private String getStreetName() {
- if(streetName == null)
- streetName = STREETNAME_DEFAULT;
- return streetName;
-}
-/* (non-Javadoc)
- * Method declared on Object
- */
-public int hashCode()
-{ return toString().hashCode();
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public boolean isPropertySet(Object property) {
- return false;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public void resetPropertyValue(Object property) {
- if (property.equals(P_ID_BUILD_NO)) {
- setBuildNo(BUILD_NO_DEFAULT);
- return;
- }
- if (property.equals(P_ID_APTBOX)) {
- setAptBox(APTBOX_DEFAULT);
- return;
- }
- if (property.equals(P_ID_STREET)) {
- setStreetName(STREETNAME_DEFAULT);
- return;
- }
-}
-/**
- * Sets the appartment number
- */
-private void setAptBox(String newAptBox) {
- aptBox = newAptBox;
-}
-/**
- * Sets the building number
- */
-private void setBuildNo(Integer newBuildNo) {
- buildNo = newBuildNo;
-}
-/**
- * The <code>Name</code> implementation of this
- * <code>IPropertySource</code> method
- * defines the following Setable properties
- *
- * 1) P_BUILD_NO expects java.lang.Integer
- * 2) P_APTBOX expects java.lang.String
- * 3) P_STREET expects java.lang.String
- */
-public void setPropertyValue(Object name, Object value) {
- if (name.equals(P_ID_BUILD_NO)) {
- try {
- setBuildNo(new Integer(Integer.parseInt((String)value)));
- } catch (NumberFormatException e) {
- setBuildNo(BUILD_NO_DEFAULT);
- }
- return;
- }
- if (name.equals(P_ID_APTBOX)) {
- setAptBox((String) value);
- return;
- }
- if (name.equals(P_ID_STREET)){
- setStreetName((String) value);
- return;
- }
-}
-/**
- * Sets the street name
- */
-private void setStreetName(String newStreetName) {
- streetName = newStreetName;
-}
-/**
- * The value as displayed in the Property Sheet. Will not print default values
- * @return java.lang.String
- */
-public String toString() {
- StringBuffer outStringBuffer = new StringBuffer();
- if (!getAptBox().equals(APTBOX_DEFAULT)) {
- outStringBuffer.append(getAptBox());
- outStringBuffer.append(", "); //$NON-NLS-1$
- }
- if (!getBuildNo().equals(BUILD_NO_DEFAULT)) {
- outStringBuffer.append(getBuildNo());
- outStringBuffer.append(" "); //$NON-NLS-1$
- }
- if (!getStreetName().equals(STREETNAME_DEFAULT)) {
- outStringBuffer.append(getStreetName());
- }
- return outStringBuffer.toString();
-}
-}
diff --git a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/UserEditor.java b/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/UserEditor.java deleted file mode 100644 index 16f86b44e55..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/UserEditor.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.eclipse.ui.examples.propertysheet;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jface.text.Document;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.editors.text.TextEditor;
-import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.ui.views.properties.PropertySheetPage;
-
-/**
- * This class implements the User editor.
- */
-public class UserEditor extends TextEditor {
- private ContentOutlinePage userContentOutline;
-/**
- * UserEditor default Constructor
- */
-public UserEditor() {
- super();
-}
-/* (non-Javadoc)
- * Method declared on WorkbenchPart
- */
-public void createPartControl(Composite parent) {
- super.createPartControl(parent);
- getSourceViewer().setDocument(new Document(MessageUtil.getString("Editor_instructions"))); //$NON-NLS-1$
-}
-/* (non-Javadoc)
- * Method declared on IAdaptable
- */
-public Object getAdapter(Class adapter) {
- if (adapter.equals(IContentOutlinePage.class)) {
- return getContentOutline();
- }
- if (adapter.equals(IPropertySheetPage.class)) {
- return getPropertySheet();
- }
- return super.getAdapter(adapter);
-}
-/**
- * Returns the content outline.
- */
-protected ContentOutlinePage getContentOutline() {
- if (userContentOutline == null) {
- //Create a property outline page using the parsed result of passing in the document provider.
- userContentOutline =
- new PropertySheetContentOutlinePage(
- new UserFileParser().parse(getDocumentProvider()));
- }
- return userContentOutline;
-}
-/**
- * Returns the property sheet.
- */
-protected IPropertySheetPage getPropertySheet() {
- return new PropertySheetPage();
-}
-}
diff --git a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/UserElement.java b/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/UserElement.java deleted file mode 100644 index 67e3a0f1013..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/UserElement.java +++ /dev/null @@ -1,505 +0,0 @@ -package org.eclipse.ui.examples.propertysheet;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.ui.views.properties.*;
-
-/**
- * A User Element
- */
-public class UserElement extends OrganizationElement {
-
- // Properties
- private Name fullName;
- private Address address;
- private String phoneNumber;
- private EmailAddress emailAddress;
- private Boolean coop;
- private Birthday birthday;
- private Float salary;
- private RGB hairColor;
- private RGB eyeColor;
-
- // Property default values
- private Name fullName_Default;
- private Address address_Default;
- private String phoneNumber_Default= "555-1111"; //$NON-NLS-1$
- private EmailAddress emailAddress_Default;
- private Boolean coop_Default;
- private Birthday birthday_Default;
- private Float salary_Default;
- private RGB hairColor_Default;
- private RGB eyeColor_Default;
-
- // Property unique keys
- public static final String P_ID_PHONENUMBER = "User.phonenumber"; //$NON-NLS-1$
- public static final String P_ID_ADDRESS = "User.address"; //$NON-NLS-1$
- public static final String P_ID_FULLNAME = "User.fullname"; //$NON-NLS-1$
- public static final String P_ID_EMAIL = "User.email"; //$NON-NLS-1$
- public static final String P_ID_COOP = "User.coop student"; //$NON-NLS-1$
- public static final String P_ID_BDAY = "User.birthday"; //$NON-NLS-1$
- public static final String P_ID_SALARY = "User.salary"; //$NON-NLS-1$
- public static final String P_ID_HAIRCOLOR = "User.haircolor"; //$NON-NLS-1$
- public static final String P_ID_EYECOLOR = "User.eyecolor"; //$NON-NLS-1$
-
- // Property display keys
- public static final String P_PHONENUMBER = MessageUtil.getString("phonenumber"); //$NON-NLS-1$
- public static final String P_ADDRESS = MessageUtil.getString("address"); //$NON-NLS-1$
- public static final String P_FULLNAME = MessageUtil.getString("fullname"); //$NON-NLS-1$
- public static final String P_EMAIL = MessageUtil.getString("email"); //$NON-NLS-1$
- public static final String P_COOP = MessageUtil.getString("coop_student"); //$NON-NLS-1$
- public static final String P_BDAY = MessageUtil.getString("birthday"); //$NON-NLS-1$
- public static final String P_SALARY = MessageUtil.getString("salary"); //$NON-NLS-1$
- public static final String P_HAIRCOLOR = MessageUtil.getString("haircolor"); //$NON-NLS-1$
- public static final String P_EYECOLOR = MessageUtil.getString("eyecolor"); //$NON-NLS-1$
-
- // Help context ids
- private static final String PHONE_NUMBER_CONTEXT ="org.eclipse.ui.examples.propertysheet.phone_number_context"; //$NON-NLS-1$
- private static final String ADDRESS_CONTEXT ="org.eclipse.ui.examples.propertysheet.address_context"; //$NON-NLS-1$
- private static final String FULL_NAME_CONTEXT ="org.eclipse.ui.examples.propertysheet.full_name_context"; //$NON-NLS-1$
- private static final String EMAIL_CONTEXT ="org.eclipse.ui.examples.propertysheet.email_context"; //$NON-NLS-1$
- private static final String COOP_CONTEXT ="org.eclipse.ui.examples.propertysheet.coop_context"; //$NON-NLS-1$
- private static final String BIRTHDAY_CONTEXT ="org.eclipse.ui.examples.propertysheet.birthday_context"; //$NON-NLS-1$
- private static final String SALARY_CONTEXT ="org.eclipse.ui.examples.propertysheet.salary_context"; //$NON-NLS-1$
- private static final String HAIR_COLOR__CONTEXT ="org.eclipse.ui.examples.propertysheet.hair_color_context"; //$NON-NLS-1$
- private static final String EYE_COLOR_CONTEXT ="org.eclipse.ui.examples.propertysheet.eye_color_context"; //$NON-NLS-1$
-
- // Property Category
- public static final String P_CONTACTINFO = MessageUtil.getString("contact"); //$NON-NLS-1$
- public static final String P_PERSONELINFO = MessageUtil.getString("personel"); //$NON-NLS-1$
- public static final String P_PERSONALINFO = MessageUtil.getString("personal"); //$NON-NLS-1$
-
- // Property Values
- public static final Integer P_VALUE_TRUE = new Integer(0);
- public static final Integer P_VALUE_FALSE = new Integer(1);
- public static final String P_VALUE_TRUE_LABEL = MessageUtil.getString("true"); //$NON-NLS-1$
- public static final String P_VALUE_FALSE_LABEL = MessageUtil.getString("false"); //$NON-NLS-1$
-
-
- static private class BooleanLabelProvider extends LabelProvider {
- public String getText(Object element) {
- String[] values = new String[] {P_VALUE_TRUE_LABEL, P_VALUE_FALSE_LABEL};
- return values[((Integer)element).intValue()];
- }
- }
-
-
- //
- static private Vector descriptors;
- static {
- descriptors = new Vector();
- PropertyDescriptor propertyDescriptor;
-
- ///
- propertyDescriptor = new TextPropertyDescriptor(P_ID_PHONENUMBER, P_PHONENUMBER);
- propertyDescriptor.setCategory(P_CONTACTINFO);
- propertyDescriptor.setHelpContextIds(PHONE_NUMBER_CONTEXT);
- descriptors.addElement(propertyDescriptor);
-
- ///
- propertyDescriptor = new PropertyDescriptor(P_ID_ADDRESS, P_ADDRESS);
- propertyDescriptor.setCategory(P_CONTACTINFO);
- propertyDescriptor.setHelpContextIds(ADDRESS_CONTEXT);
- descriptors.addElement(propertyDescriptor);
-
- ///
- propertyDescriptor = new TextPropertyDescriptor(P_ID_EMAIL, P_EMAIL);
- propertyDescriptor.setCategory(P_CONTACTINFO);
- propertyDescriptor.setHelpContextIds(EMAIL_CONTEXT);
- propertyDescriptor.setValidator(new EmailAddressValidator());
- descriptors.addElement(propertyDescriptor);
-
- ///
- propertyDescriptor = new TextPropertyDescriptor(P_ID_FULLNAME, P_FULLNAME);
- propertyDescriptor.setCategory(P_PERSONELINFO);
- propertyDescriptor.setHelpContextIds(FULL_NAME_CONTEXT);
- descriptors.addElement(propertyDescriptor);
-
- ///
- propertyDescriptor = new PropertyDescriptor(P_ID_BDAY, P_BDAY);
- propertyDescriptor.setCategory(P_PERSONELINFO);
- propertyDescriptor.setHelpContextIds(BIRTHDAY_CONTEXT);
- descriptors.addElement(propertyDescriptor);
-
- ///
- propertyDescriptor = new ComboBoxPropertyDescriptor(P_ID_COOP, P_COOP, new String[] {P_VALUE_TRUE_LABEL, P_VALUE_FALSE_LABEL});
- propertyDescriptor.setCategory(P_PERSONELINFO);
- propertyDescriptor.setHelpContextIds(COOP_CONTEXT);
- propertyDescriptor.setLabelProvider(new BooleanLabelProvider());
- descriptors.addElement(propertyDescriptor);
-
- ///
- propertyDescriptor = new TextPropertyDescriptor(P_ID_SALARY, P_SALARY);
- //add custom validator to propertyDescriptor limiting salary values to be
- //greator than zero
- propertyDescriptor.setHelpContextIds(new Object[] {SALARY_CONTEXT});
- propertyDescriptor.setFilterFlags(new String[] {IPropertySheetEntry.FILTER_ID_EXPERT});
- propertyDescriptor.setValidator(
- new ICellEditorValidator(){
- public String isValid(Object value){
- if(value == null)
- return MessageUtil.getString("salary_is_invalid"); //$NON-NLS-1$
- //
- Float trySalary;
- try {
- trySalary = new Float(Float.parseFloat((String)value));
- } catch (NumberFormatException e) {
- return MessageUtil.getString("salary_is_invalid"); //$NON-NLS-1$
- }
- if(trySalary.floatValue() < 0.0)
- return MessageUtil.getString("salary_must_be_greator_than_zero"); //$NON-NLS-1$
- return null;
- }
- });
- propertyDescriptor.setCategory(P_PERSONELINFO);
- descriptors.addElement(propertyDescriptor);
-
- /// HairColor
- propertyDescriptor = new ColorPropertyDescriptor(P_ID_HAIRCOLOR, P_HAIRCOLOR);
- propertyDescriptor.setCategory(P_PERSONALINFO);
- propertyDescriptor.setHelpContextIds(HAIR_COLOR__CONTEXT);
- descriptors.addElement(propertyDescriptor);
-
- /// EyeColor
- propertyDescriptor = new ColorPropertyDescriptor(P_ID_EYECOLOR, P_EYECOLOR);
- propertyDescriptor.setCategory(P_PERSONALINFO);
- propertyDescriptor.setHelpContextIds(EYE_COLOR_CONTEXT);
- descriptors.addElement(propertyDescriptor);
-
- //gets descriptors from parent, warning name-space collision may occur
- Vector parentDescriptors = OrganizationElement.getDescriptors();
- for (int i = 0; i < parentDescriptors.size(); i++) {
- descriptors.addElement(parentDescriptors.elementAt(i));
- }
- }
-/**
- * Constructor. Default visibility only called from GroupElement.createSubGroup()
- * Creates a new UserElement within the passed parent GroupElement,
- * *
- * @param name the name
- * @param parent the parent
- */
-UserElement(String name, GroupElement parent) {
- super(name, parent);
-}
-/**
- * Returns the address
- */
-private Address getAddress() {
- if (address == null)
- address = new Address();
- return address;
-}
-/**
- * Returns the birthday
- */
-private Birthday getBirthday() {
- if(birthday == null)
- birthday = new Birthday();
- return birthday;
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public Object[] getChildren(Object o) {
- return new Object[0];
-}
-/**
- * Returns the coop
- */
-private Boolean getCoop() {
- if(coop == null)
- coop = new Boolean(false);
- return coop;
-}
-/**
- * Returns the descriptors
- */
-static Vector getDescriptors()
-{
- return descriptors;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public Object getEditableValue() {
- return this.toString();
-}
-/**
- * Returns the email address
- */
-EmailAddress getEmailAddress() {
- if(emailAddress == null)
- emailAddress = new EmailAddress();
- return emailAddress;
-}
-/**
- * Returns the eye color
- */
-private RGB getEyeColor() {
- if (eyeColor == null)
- eyeColor = new RGB(60, 60, 60);
- return eyeColor;
-}
-/**
- * Returns the full name
- */
-private Name getFullName() {
- if (fullName == null)
- fullName = new Name(getName());
- return fullName;
-}
-/**
- * Returns the hair color
- */
-private RGB getHairColor() {
- if (hairColor == null)
- hairColor = new RGB(255, 255, 255);
- return hairColor;
-}
-/**
- * Returns the phone number
- */
-private String getPhoneNumber(){
- return phoneNumber;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public IPropertyDescriptor[] getPropertyDescriptors() {
- return (IPropertyDescriptor[])getDescriptors().toArray(new IPropertyDescriptor[getDescriptors().size()]);
-}
-/**
- * The <code>Userment</code> implementation of this
- * <code>IPropertySource</code> method returns the following properties
- *
- * 1) P_ADDRESS returns Address (IPropertySource), the address of this user
- * 2) P_FULLNAME returns Name (IPropertySource), the full name of this user
- * 3) P_PHONENUMBER returns String, the phone number of this user
- * 4) P_EMAIL returns EmailAddress (IPropertySource), the email address of this user
- * 5) P_COOP returns Boolean, whether the individual is a coop student or not
- * 6) P_BDAY returns Birthday
- * 7) P_SALARY return java.lang.Float
- * 8) P_HAIRCOLOR, expects RGB
- * 9) P_EYECOLOR, expects RGB
- */
-public Object getPropertyValue(Object propKey) {
- if (propKey.equals(P_ID_ADDRESS))
- return getAddress();
- if (propKey.equals(P_ID_FULLNAME))
- return getFullName();
- if (propKey.equals(P_ID_PHONENUMBER))
- return getPhoneNumber();
- if (propKey.equals(P_ID_EMAIL))
- return getEmailAddress();
- if (propKey.equals(P_ID_COOP))
- return getCoop().equals(Boolean.TRUE) ? P_VALUE_TRUE : P_VALUE_FALSE;
- if (propKey.equals(P_ID_BDAY))
- return getBirthday();
- if (propKey.equals(P_ID_SALARY))
- return getSalary().toString();
- if (propKey.equals(P_ID_HAIRCOLOR))
- return getHairColor();
- if (propKey.equals(P_ID_EYECOLOR))
- return getEyeColor();
- return super.getPropertyValue(propKey);
-}
-/**
- * Returns the salary
- */
-private Float getSalary() {
- if(salary==null)
- salary = new Float(0);
- return salary;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public boolean isPropertySet(Object property) {
- if (property.equals(P_ID_ADDRESS))
- return getAddress() != address_Default;
- if (property.equals(P_ID_FULLNAME))
- return getFullName() != fullName_Default;
- if (property.equals(P_ID_PHONENUMBER))
- return getPhoneNumber() != phoneNumber_Default;
- if (property.equals(P_ID_EMAIL))
- return getEmailAddress() != emailAddress_Default;
- if (property.equals(P_ID_COOP))
- return getCoop() != coop_Default;
- if (property.equals(P_ID_BDAY))
- return getBirthday() != birthday_Default;
- if (property.equals(P_ID_SALARY))
- return getSalary() != salary_Default;
- if (property.equals(P_ID_HAIRCOLOR))
- return getHairColor() != hairColor_Default;
- if (property.equals(P_ID_EYECOLOR))
- return getEyeColor() != eyeColor_Default;
- return false;
-}
-/* (non-Javadoc)
- * Method declared on OrganizationElement
- */
-public boolean isUser() {
- return true;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public void resetPropertyValue(Object property) {
- if (property.equals(P_ID_ADDRESS)) {
- setAddress(address_Default);
- return;
- }
- if (property.equals(P_ID_FULLNAME)) {
- setFullName(fullName_Default);
- return;
- }
- if (property.equals(P_ID_PHONENUMBER)) {
- setPhoneNumber(phoneNumber_Default);
- return;
- }
- if (property.equals(P_ID_EMAIL)) {
- setEmailAddress(emailAddress_Default);
- return;
- }
- if (property.equals(P_ID_COOP)) {
- setCoop(coop_Default);
- }
- if (property.equals(P_ID_BDAY)) {
- setBirthday(birthday_Default);
- return;
- }
- if (property.equals(P_ID_SALARY)) {
- setSalary(salary_Default);
- return;
- }
- if (property.equals(P_ID_HAIRCOLOR)) {
- setHairColor(hairColor_Default);
- return;
- }
- if (property.equals(P_ID_EYECOLOR)) {
- setEyeColor(eyeColor_Default);
- return;
- }
- super.resetPropertyValue(property);
-}
-/**
- * Sets the address
- */
-public void setAddress(Address newAddress) {
- address = newAddress;
-}
-/**
- * Sets the birthday
- */
-public void setBirthday(Birthday newBirthday) {
- birthday = new Birthday();
-}
-/**
- * Sets the coop
- */
-public void setCoop(Boolean newCoop) {
- coop = newCoop;
-}
-/**
- *Sets the email address
- */
-public void setEmailAddress(EmailAddress newEmailAddress){
- emailAddress = newEmailAddress;
-}
-/**
- * Sets eye color
- */
-public void setEyeColor(RGB newEyeColor) {
- eyeColor = newEyeColor;
-}
-/**
- * Sets full name
- */
-public void setFullName(Name newFullName)
-{ fullName = newFullName;
-}
-/**
- * Sets hair color
- */
-public void setHairColor(RGB newHairColor) {
- hairColor = newHairColor;
-}
-/**
- * Sets phone number
- */
-public void setPhoneNumber(String newPhoneNumber)
-{ phoneNumber = newPhoneNumber;
-}
-/**
- * The <code>OrganizationElement</code> implementation of this
- * <code>IPropertySource</code> method
- * defines the following Setable properties
- *
- * 1) P_ADDRESS, expects Address
- * 2) P_FULLNAME, expects Name
- * 3) P_PHONENUMBER, expects String
- * 4) P_EMAIL, expects EmailAddress.
- * 5) P_BOOLEAN, expects Boolean, whether the individual is a coop student or not
- * 6) P_BDAY, expects Birthday
- * 7) P_SALARY, expects java.lang.Float
- * 8) P_HAIRCOLOR, expects RGB
- * 9) P_EYECOLOR, expects RGB
- */
-public void setPropertyValue(Object propKey, Object val) {
- // need to convert from String to domain objects
- if (propKey.equals(P_ID_ADDRESS)) {
- //setAddress((Address)val);
- return;
- }
- if (propKey.equals(P_ID_FULLNAME)) {
- setFullName(new Name((String)val));
- return;
- }
- if (propKey.equals(P_ID_PHONENUMBER)) {
- setPhoneNumber((String) val);
- return;
- }
- if (propKey.equals(P_ID_EMAIL)) {
- setEmailAddress(new EmailAddress((String)val));
- return;
- }
- if (propKey.equals(P_ID_COOP)) {
- setCoop(((Integer)val).equals(P_VALUE_TRUE) ? Boolean.TRUE : Boolean.FALSE);
- }
- if (propKey.equals(P_ID_BDAY)) {
- //setBirthday((Birthday)val);
- return;
- }
- if (propKey.equals(P_ID_SALARY)) {
- try {
- setSalary(new Float(Float.parseFloat((String)val)));
- } catch (NumberFormatException e) {
- setSalary(salary_Default);
- }
- return;
- }
- if (propKey.equals(P_ID_HAIRCOLOR)) {
- setHairColor((RGB) val);
- return;
- }
- if (propKey.equals(P_ID_EYECOLOR)) {
- setEyeColor((RGB) val);
- return;
- }
- super.setPropertyValue(propKey, val);
-}
-/**
- * Sets the salary
- */
-void setSalary(Float newSalary) {
- salary = newSalary;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/UserFileParser.java b/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/UserFileParser.java deleted file mode 100644 index a381941126d..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/UserFileParser.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.eclipse.ui.examples.propertysheet;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-
-/**
- * This class is an example of the implementation of a simple parser.
- */
-public class UserFileParser {
-/**
- * Return the fabricated result for this example.
- *
- */
-private static IAdaptable getFabricatedResult() {
- // returns fabricated input.
- GroupElement root = new GroupElement(MessageUtil.getString("Everybody"), null); //$NON-NLS-1$
- GroupElement userGroup = root.createSubGroup(MessageUtil.getString("Company_Inc")); //$NON-NLS-1$
- GroupElement ottGroup = userGroup.createSubGroup(MessageUtil.getString("Waterloo_Lab")); //$NON-NLS-1$
- userGroup.createSubGroup(MessageUtil.getString("Toronto_Lab")); //$NON-NLS-1$
- userGroup.createSubGroup(MessageUtil.getString("Hamilton_Lab")); //$NON-NLS-1$
- userGroup.createSubGroup(MessageUtil.getString("London_Lab")); //$NON-NLS-1$
- userGroup.createSubGroup(MessageUtil.getString("Grimsby_Lab")); //$NON-NLS-1$
- GroupElement uiTeam = ottGroup.createSubGroup(MessageUtil.getString("Team1")); //$NON-NLS-1$
- //
- UserElement user1 = uiTeam.createUser("richard"); //$NON-NLS-1$
- user1.setFullName(new Name(MessageUtil.getString("Richard_Zokol"))); //$NON-NLS-1$
- user1.setEmailAddress(new EmailAddress(MessageUtil.getString("rzokol@company.com"))); //$NON-NLS-1$
- user1.setPhoneNumber("x789"); //$NON-NLS-1$
- user1.setAddress(new Address(new StreetAddress(232, MessageUtil.getString("Champlain")), MessageUtil.getString("Hull"), new Integer(5), MessageUtil.getString("A1B2C3"))); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
- user1.setBirthday(new Birthday(18, 1, 1981));
- user1.setCoop(new Boolean(true));
- user1.setHairColor(new RGB(0, 0, 0));
- user1.setEyeColor(new RGB(0, 0, 0));
- //
- UserElement user2 = uiTeam.createUser("george"); //$NON-NLS-1$
- user2.setFullName(new Name(MessageUtil.getString("George_Knudson"))); //$NON-NLS-1$
- user2.setEmailAddress(new EmailAddress(MessageUtil.getString("gknudson@company.com"))); //$NON-NLS-1$
- user2.setPhoneNumber("x678"); //$NON-NLS-1$
- user2.setAddress(new Address(new StreetAddress(), MessageUtil.getString("Toronto"), new Integer(4), MessageUtil.getString("A1B2C3"))); //$NON-NLS-2$ //$NON-NLS-1$
- user2.setBirthday(new Birthday(7, 5, 1978));
- user2.setCoop(new Boolean(true));
- user2.setHairColor(new RGB(0, 0, 0));
- user2.setEyeColor(new RGB(0, 0, 0));
-
- //
- UserElement user3 = uiTeam.createUser("arnold"); //$NON-NLS-1$
- user3.setFullName(new Name(MessageUtil.getString("Arnold_Palmer"))); //$NON-NLS-1$
- user3.setEmailAddress(new EmailAddress(MessageUtil.getString("apalmer@company.com"))); //$NON-NLS-1$
- user3.setPhoneNumber("x567"); //$NON-NLS-1$
- user3.setAddress(new Address(new StreetAddress(), MessageUtil.getString("Ottawa"), new Integer(4), MessageUtil.getString("A1B2C3"))); //$NON-NLS-2$ //$NON-NLS-1$
- user3.setBirthday(new Birthday(11, 23, 1962));
- user3.setHairColor(new RGB(0, 0, 0));
- user3.setEyeColor(new RGB(0, 0, 0));
-
- //
- UserElement user4 = uiTeam.createUser("lee"); //$NON-NLS-1$
- user4.setFullName(new Name(MessageUtil.getString("Lee_Trevino"))); //$NON-NLS-1$
- user4.setEmailAddress(new EmailAddress(MessageUtil.getString("ltrevino@company.com"))); //$NON-NLS-1$
- user4.setPhoneNumber("x456"); //$NON-NLS-1$
- user4.setAddress(new Address(new StreetAddress(), MessageUtil.getString("Ottawa"), new Integer(4), MessageUtil.getString("A1B2C3"))); //$NON-NLS-2$ //$NON-NLS-1$
- //
- UserElement user5 = uiTeam.createUser("tiger"); //$NON-NLS-1$
- user5.setFullName(new Name(MessageUtil.getString("Tiger_Woods"))); //$NON-NLS-1$
- user5.setEmailAddress(new EmailAddress(MessageUtil.getString("twoods@company.com"))); //$NON-NLS-1$
- user5.setPhoneNumber("x345"); //$NON-NLS-1$
- user5.setAddress(new Address(new StreetAddress(), MessageUtil.getString("Ottawa"), new Integer(4), MessageUtil.getString("A1B2C3"))); //$NON-NLS-2$ //$NON-NLS-1$
- //
- UserElement user6 = uiTeam.createUser("jack"); //$NON-NLS-1$
- user6.setFullName(new Name(MessageUtil.getString("Jack_Nicklaus"))); //$NON-NLS-1$
- user6.setEmailAddress(new EmailAddress(MessageUtil.getString("jnicklaus@company.com"))); //$NON-NLS-1$
- user6.setPhoneNumber("x234 "); //$NON-NLS-1$
- user6.setAddress(new Address(new StreetAddress(), MessageUtil.getString("Ottawa"), new Integer(4), MessageUtil.getString("A1B2C3"))); //$NON-NLS-2$ //$NON-NLS-1$
- //
- UserElement greg = uiTeam.createUser("weslock"); //$NON-NLS-1$
- greg.setFullName(new Name(MessageUtil.getString("Weslock"))); //$NON-NLS-1$
- greg.setEmailAddress(new EmailAddress(MessageUtil.getString("weslock@company.com"))); //$NON-NLS-1$
- greg.setPhoneNumber("x123"); //$NON-NLS-1$
- greg.setAddress(new Address(new StreetAddress(), MessageUtil.getString("Ottawa"), new Integer(4), MessageUtil.getString("A1B2C3"))); //$NON-NLS-2$ //$NON-NLS-1$
-
- return root;
-}
-/**
- * Parse the input given by the argument. For this example we do no parsing and return
- * a fabricated result.
- *
- */
-public IAdaptable parse(IDocumentProvider documentProvider) {
-
- return getFabricatedResult();
-}
-}
diff --git a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/messages.properties b/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/messages.properties deleted file mode 100644 index f0076faee99..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/messages.properties +++ /dev/null @@ -1,98 +0,0 @@ -Alberta=Alberta
-British_Columbia=British Columbia
-City=City
-Manitoba=Manitoba
-New_Brunswick=New Brunswick
-Newfoundland=Newfoundland
-North_West_Territories=North West Territories
-Nova_Scotia=Nova Scotia
-Nunavut=Nunavut
-Ontario=Ontario
-PostalCode=PostalCode
-Prince_Edward_Island=Prince Edward Island
-Province=Province
-Quebec=Quebec
-Saskatchewan=Saskatchewan
-Street=Street
-Yukon=Yukon
-_is_an_invalid_format_for_a_postal_code={0} is an invalid format for a postal code
-postal_code_is_incomplete=postal code is incomplete
-unspecified_city=unspecified city
-April=April
-August=August
-December=December
-February=February
-January=January
-July=July
-June=June
-March=March
-May=May
-November=November
-October=October
-September=September
-day=day
-month=month
-year=year
-domain=domain
-emailaddress_cannot_be_set_to_null=emailaddress cannot be set to null
-invalid_email_address_format_should_have_been_validated=invalid email address format, should have been validated
-unknownDomain=unknownDomain
-unknownUser=unknownUser
-userid=userid
-email_address_does_not_have_a_valid_format=email address does not have a valid format
-email_address_is_incomplete=email address is incomplete
-FirstName=FirstName
-LastName=LastName
-Middle=Middle
-name=name
-apt.no_or_box.no=apt.no or box.no
-building_number=building number
-street=street
-unspecified=unspecified
-Editor_instructions=Click on the items in the content outline\nto see their properties
-address=address
-birthday=birthday
-contact=contact
-coop_student=coop student
-email=email
-eyecolor=eyecolor
-false=false
-fullname=fullname
-haircolor=haircolor
-personal=personal
-personel=personel
-phonenumber=phonenumber
-salary=salary
-salary_is_invalid=salary is invalid
-salary_must_be_greator_than_zero=salary must be greator than zero
-true=true
-A1B2C3=A1B2C3
-Arnold_Palmer=Arnold Palmer
-Champlain=Champlain
-Company_Inc=Company Inc.
-Everybody=Everybody
-George_Knudson=George Knudson
-Grimsby_Lab=Grimsby Lab
-Hamilton_Lab=Hamilton Lab
-Hull=Hull
-Jack_Nicklaus=Jack Nicklaus
-Lee_Trevino=Lee Trevino
-London_Lab=London Lab
-Ottawa=Ottawa
-Richard_Zokol=Richard Zokol
-Team1=Team1
-Tiger_Woods=Tiger Woods
-Toronto=Toronto
-Toronto_Lab=Toronto Lab
-Waterloo_Lab=Waterloo Lab
-Weslock=Weslock
-apalmer@company.com=apalmer@company.com
-gknudson@company.com=gknudson@company.com
-jnicklaus@company.com=jnicklaus@company.com
-ltrevino@company.com=ltrevino@company.com
-rzokol@company.com=rzokol@company.com
-twoods@company.com=twoods@company.com
-weslock@company.com=weslock@company.com
-Popup_Menu_Action_executed=Popup Menu Action executed
-Property_Sheet_Example=Property Sheet Example
-
diff --git a/examples/org.eclipse.ui.examples.propertysheet/HelpContexts.xml b/examples/org.eclipse.ui.examples.propertysheet/HelpContexts.xml deleted file mode 100644 index a5a47bc1185..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/HelpContexts.xml +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-
-<contexts>
-
- <context id="phone_number_context" >
- <description>Help for phone number</description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 1"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 2"/>
- </context>
- <context id="address_context" >
- <description>Help for address </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 1"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 2"/>
- </context>
- <context id="full_name_context" >
- <description>Help for full name </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 1"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 2"/>
- </context>
- <context id="email_context" >
- <description>Help for email address </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 1"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 2"/>
- </context>
- <context id="coop_context" >
- <description>Help for coop </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 1"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 2"/>
- </context>
- <context id="birthday_context" >
- <description>Help for birthday </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 1"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 2"/>
- </context>
- <context id="salary_context" >
- <description>Help for salary </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 1"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 2"/>
- </context>
- <context id="hair_color_context" >
- <description>Help for hair color </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 1"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 2"/>
- </context>
- <context id="eye_color_context" >
- <description>Help for eye color </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 1"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 2"/>
- </context>
-
-</contexts>
\ No newline at end of file diff --git a/examples/org.eclipse.ui.examples.propertysheet/about.html b/examples/org.eclipse.ui.examples.propertysheet/about.html deleted file mode 100644 index 9db411aab99..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/about.html +++ /dev/null @@ -1,30 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> -<html> -<head> -<title>About</title> -<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1"> -</head> -<body lang="EN-US"> -<h2>About This Content</h2> - -<p>20th June, 2002</p> -<h3>License</h3> -<p>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 <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>. -For purposes of the CPL, "Program" will mean the Content.</p> - -<h3>Contributions</h3> - -<p>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.</p> - -<p>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.</p> - -</body> -</html>
\ No newline at end of file diff --git a/examples/org.eclipse.ui.examples.propertysheet/build.properties b/examples/org.eclipse.ui.examples.propertysheet/build.properties deleted file mode 100644 index 9427026a9c7..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -source.propertysheet.jar = Eclipse UI Examples PropertySheet/
-
-bin.includes = doc-html/,\
- icons/,\
- .options,\
- about.html,\
- doc.zip,\
- HelpContexts.xml,\
- plugin.properties,\
- plugin.xml,\
- *.jar
-
-src.includes = about.html
diff --git a/examples/org.eclipse.ui.examples.propertysheet/doc-html/hglegal.htm b/examples/org.eclipse.ui.examples.propertysheet/doc-html/hglegal.htm deleted file mode 100644 index b071dbdf45b..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/doc-html/hglegal.htm +++ /dev/null @@ -1,14 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.73 [en] (Win98; U) [Netscape]">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright IBM Corp. 2000, 2001. All Rights Reserved.
-</body>
-</html>
diff --git a/examples/org.eclipse.ui.examples.propertysheet/doc-html/ngibmcpy.gif b/examples/org.eclipse.ui.examples.propertysheet/doc-html/ngibmcpy.gif Binary files differdeleted file mode 100644 index 360f8e99891..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/doc-html/ngibmcpy.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.propertysheet/doc-html/ui_propertysheet_ex.html b/examples/org.eclipse.ui.examples.propertysheet/doc-html/ui_propertysheet_ex.html deleted file mode 100644 index 00ba3ebc28e..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/doc-html/ui_propertysheet_ex.html +++ /dev/null @@ -1,47 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Desktop - Property Sheet Example</title>
-</head>
-<body>
-
-<h2>
-<b>Example - Property Sheet</b></h2>
-
-<h3>
-Introduction</h3>
-The Property Sheet Example adds an editor for files with the .usr extension
-and also demonstrates how to add properties and outline views on a file.
-<br>
-<h3>
-Running the example</h3>
-To start using the Property Sheet Example, create a file with extension
-.usr. Open the file and the Outline and Properties views to
-see the example in action. Click on items in the Outline view and
-look in the Properties view for details of the selected item in the Outline
-view. The people items in the list show the most detail in the Properties
-view.
-<h4>
-<b>Creating a new usr file</b></h4>
-Create a new file with file extension .usr. From the File menu, select
-New and then select Other... from the sub-menu. Click on Simple in
-the wizard, then select
-<br>File in the list on the left. Click on Next to supply the file
-name (make sure the extension is .usr) and the folder in which the file
-should be contained.
-<br>
-<h3>
-Details</h3>
-The Property Sheet Example demonstrates how to provide properties to the
-Property Sheet View.
-<p>The tree viewer of the Content Outline View contains and presents OrganizationElements.
-When an element is selected in the Content Outline View the Workspace will
-invoke <tt>getAdapter</tt>
-on the selected OrganizationElement. If an adapter is requested for IPropertySource,
-the OrganizationElement returns itself as it impements IPropertySource
-The Property Sheet View then use the Organization Element as it source.
-<br>
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corp. 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a>
-</body>
-</html>
diff --git a/examples/org.eclipse.ui.examples.propertysheet/doc.zip b/examples/org.eclipse.ui.examples.propertysheet/doc.zip Binary files differdeleted file mode 100644 index 41e8aa99d43..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/doc.zip +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.propertysheet/icons/obj16/usereditor.gif b/examples/org.eclipse.ui.examples.propertysheet/icons/obj16/usereditor.gif Binary files differdeleted file mode 100644 index 64d79074260..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/icons/obj16/usereditor.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.propertysheet/plugin.properties b/examples/org.eclipse.ui.examples.propertysheet/plugin.properties deleted file mode 100644 index caa55e821a3..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/plugin.properties +++ /dev/null @@ -1,4 +0,0 @@ -Plugin.name = User File Editor
-Plugin.providerName = Eclipse.org
-Editors.UserEditor = User File Editor
-PopupMenus.action = Show Action
diff --git a/examples/org.eclipse.ui.examples.propertysheet/plugin.xml b/examples/org.eclipse.ui.examples.propertysheet/plugin.xml deleted file mode 100644 index 279976ff871..00000000000 --- a/examples/org.eclipse.ui.examples.propertysheet/plugin.xml +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-
-<plugin
- name = "%Plugin.name"
- id = "org.eclipse.ui.examples.propertysheet"
- version = "2.0.0"
- provider-name = "%Plugin.providerName"
- class="org.eclipse.ui.examples.propertysheet.PropertySheetPlugin">
-
-<requires>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.resources"/>
-</requires>
-
-
-<runtime>
- <library name="propertysheet.jar" />
-</runtime>
-
-<extension
- point = "org.eclipse.ui.editors">
- <editor
- id = "org.eclipse.ui.examples.propertysheet.UserEditor"
- name="%Editors.UserEditor"
- icon="icons/obj16/usereditor.gif"
- extensions="usr"
- class="org.eclipse.ui.examples.propertysheet.UserEditor">
- </editor>
-</extension>
-
-<extension point = "org.eclipse.ui.popupMenus">
- <objectContribution
- id="org.eclipse.ui.examples.propertysheet"
- objectClass="org.eclipse.ui.examples.propertysheet.UserElement">
- <action id="org.eclipse.ui.examples.propertysheet.action1"
- label="%PopupMenus.action"
- menubarPath="additions"
- class="org.eclipse.ui.examples.propertysheet.PopupMenuActionDelegate"
- enablesFor="1">
- </action>
- </objectContribution>
-</extension>
-
-<extension point="org.eclipse.help.contexts">
- <contexts name="HelpContexts.xml"/>
-</extension>
-
-</plugin>
diff --git a/examples/org.eclipse.ui.examples.readmetool/.classpath b/examples/org.eclipse.ui.examples.readmetool/.classpath deleted file mode 100644 index 72dfb488661..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/.classpath +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="Eclipse UI Examples Readme Tool"/> - <classpathentry kind="src" path="/org.eclipse.ui"/> - <classpathentry kind="src" path="/org.eclipse.swt"/> - <classpathentry kind="src" path="/org.eclipse.core.resources"/> - <classpathentry kind="src" path="/org.eclipse.core.runtime"/> - <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/examples/org.eclipse.ui.examples.readmetool/.cvsignore b/examples/org.eclipse.ui.examples.readmetool/.cvsignore deleted file mode 100644 index c5e82d74585..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin
\ No newline at end of file diff --git a/examples/org.eclipse.ui.examples.readmetool/.project b/examples/org.eclipse.ui.examples.readmetool/.project deleted file mode 100644 index eff1d5066cf..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/.project +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.ui.examples.readmetool</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.core.resources</project>
- <project>org.eclipse.core.runtime</project>
- <project>org.eclipse.swt</project>
- <project>org.eclipse.ui</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AdaptableList.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AdaptableList.java deleted file mode 100644 index a14bd528c1e..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AdaptableList.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import java.util.*;
-
-/**
- * A list of adaptable objects. This is a generic list that can
- * be used to display an arbitrary set of adaptable objects in the workbench.
- * Also implements the IWorkbenchAdapter interface for simple display
- * and navigation.
- */
-public class AdaptableList implements IWorkbenchAdapter, IAdaptable {
- protected List children = new ArrayList();
-/**
- * Creates a new adaptable list with the given children.
- */
-public AdaptableList() {
-}
-/**
- * Creates a new adaptable list with the given children.
- */
-public AdaptableList(IAdaptable[] newChildren) {
- for (int i = 0; i < newChildren.length; i++) {
- children.add(newChildren[i]);
- }
-}
-/**
- * Adds all the adaptable objects in the given enumeration to this list.
- * Returns this list.
- */
-public AdaptableList add(Iterator iterator) {
- while (iterator.hasNext()) {
- add((IAdaptable)iterator.next());
- }
- return this;
-}
-/**
- * Adds the given adaptable object to this list.
- * Returns this list.
- */
-public AdaptableList add(IAdaptable adaptable) {
- children.add(adaptable);
- return this;
-}
-/* (non-Javadoc)
- * Method declared on IAdaptable
- */
-public Object getAdapter(Class adapter) {
- if (adapter == IWorkbenchAdapter.class) return this;
- return null;
-}
-/**
- * Returns the elements in this list.
- */
-public Object[] getChildren() {
- return children.toArray();
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public Object[] getChildren(Object o) {
- return children.toArray();
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public ImageDescriptor getImageDescriptor(Object object) {
- return null;
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public String getLabel(Object object) {
- return object == null ? "" : object.toString(); //$NON-NLS-1$
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public Object getParent(Object object) {
- return null;
-}
-/**
- * Removes the given adaptable object from this list.
- */
-public void remove(IAdaptable adaptable) {
- children.remove(adaptable);
-}
-/**
- * Returns the number of items in the list
- */
-public int size() {
- return children.size();
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddReadmeMarkerAction.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddReadmeMarkerAction.java deleted file mode 100644 index d5255965f03..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddReadmeMarkerAction.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.MarkerUtilities;
-
-
-
-/**
- * Action for creating a readme marker with a specfic id
- * attribute value.
- */
-public class AddReadmeMarkerAction extends Action {
- private ITextEditor textEditor;
- private Object[][] customAttributes;
- private String message;
- private final static String MARKER_TYPE = "org.eclipse.ui.examples.readmetool.readmemarker"; //$NON-NLS-1$
-
- /**
- * Creates a new action for the given text editor.
- *
- * @param editor the text editor
- * @param label the label for the action
- * @param attributes the custom attributes for this marker
- * @param message the message for the marker
- */
- public AddReadmeMarkerAction(ITextEditor editor, String label, Object[][] attributes, String message) {
- textEditor = editor;
- setText(label);
- this.customAttributes = attributes;
- this.message = message;
- }
-
- /*
- * @see IAction#run()
- */
- public void run() {
- Map attributes= new HashMap(11);
-
- ITextSelection selection= (ITextSelection) textEditor.getSelectionProvider().getSelection();
- if (!selection.isEmpty()) {
-
- int start= selection.getOffset();
- int length= selection.getLength();
-
- if (length < 0) {
- length= -length;
- start -= length;
- }
-
- MarkerUtilities.setCharStart(attributes, start);
- MarkerUtilities.setCharEnd(attributes, start + length);
-
- // marker line numbers are 1-based
- int line= selection.getStartLine();
- MarkerUtilities.setLineNumber(attributes, line == -1 ? -1 : line + 1);
-
- // set custom attribute values
- for (int i = 0; i < customAttributes.length; i++) {
- attributes.put(customAttributes[i][0], customAttributes[i][1]);
- }
-
- MarkerUtilities.setMessage(attributes, message);
- }
-
- try {
- MarkerUtilities.createMarker(getResource(), attributes, MARKER_TYPE);
- } catch (CoreException x) {
- Platform.getPlugin(PlatformUI.PLUGIN_ID).getLog().log(x.getStatus());
-
- Shell shell= textEditor.getSite().getShell();
- String title= MessageUtil.getString("Add_readme_marker_error_title"); //$NON-NLS-1$
- String msg= MessageUtil.getString("Add_readme_marker_error_message"); //$NON-NLS-1$
-
- ErrorDialog.openError(shell, title, msg, x.getStatus());
- }
- }
-
- /**
- * Returns the resource on which to create the marker,
- * or <code>null</code> if there is no applicable resource. This
- * queries the editor's input using <code>getAdapter(IResource.class)</code>.
- *
- * @return the resource to which to attach the newly created marker
- */
- protected IResource getResource() {
- IEditorInput input= textEditor.getEditorInput();
- return (IResource) ((IAdaptable) input).getAdapter(IResource.class);
- }
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddSentenceResolution.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddSentenceResolution.java deleted file mode 100644 index 75b3e9bada0..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddSentenceResolution.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IMarkerResolution;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-
-/**
- * A resolution which inserts a sentence into the readme file
- */
-public class AddSentenceResolution implements IMarkerResolution {
- /* (non-Javadoc)
- * Method declared on IMarkerResolution.
- */
- public String getLabel() {
- return MessageUtil.getString("Add_Sentence"); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * Method declared on IMarkerResolution.
- */
- public void run(IMarker marker) {
- // Se if there is an open editor on the file containing the marker
- IWorkbenchWindow w = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (w == null)
- return;
- IWorkbenchPage page = w.getActivePage();
- if (page == null)
- return;
- IFileEditorInput input = new FileEditorInput((IFile)marker.getResource());
- IEditorPart editorPart = page.findEditor(input);
-
- if (editorPart == null) {
- // open an editor
- try {
- editorPart = page.openEditor((IFile)marker.getResource());
- } catch (PartInitException e) {
- MessageDialog.openError(
- w.getShell(),
- MessageUtil.getString("Resolution_Error"), //$NON-NLS-1$
- MessageUtil.getString("Unable_to_open_file_editor")); //$NON-NLS-1$
- }
- }
- if (editorPart == null || !(editorPart instanceof ReadmeEditor))
- return;
- // insert the sentence
- ReadmeEditor editor = (ReadmeEditor)editorPart;
- IDocument doc = editor.getDocumentProvider().getDocument(editor.getEditorInput());
- String s = MessageUtil.getString("Simple_sentence"); //$NON-NLS-1$
- try {
- doc.replace(marker.getAttribute(IMarker.CHAR_START, -1), 0, s);
- } catch (BadLocationException e) {
- // ignore
- return;
- }
- // delete the marker
- try {
- marker.delete();
- } catch (CoreException e) {
- e.printStackTrace();
- // ignore
- }
-
- }
-
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DefaultSectionsParser.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DefaultSectionsParser.java deleted file mode 100644 index 4f8cbb0118a..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DefaultSectionsParser.java +++ /dev/null @@ -1,154 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.CoreException;
-import java.io.*;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
-/**
- * This class is a simple parser implementing the IReadmeFileParser
- * interface. It parses a Readme file into sections based on the
- * existence of numbered section tags in the input. A line beginning
- * with a number followed by a dot will be taken as a section indicator
- * (for example, 1., 2., or 12.).
- * As well, a line beginning with a subsection-style series of numbers
- * will also be taken as a section indicator, and can be used to
- * indicate subsections (for example, 1.1, or 1.1.12).
- */
-public class DefaultSectionsParser implements IReadmeFileParser {
-/**
- * Returns the mark element that is the logical parent
- * of the given mark number. Each dot in a mark number
- * represents a parent-child separation. For example,
- * the parent of 1.2 is 1, the parent of 1.4.1 is 1.4.
- * Returns null if there is no appropriate parent.
- */
-protected IAdaptable getParent(Hashtable toc, String number) {
- int lastDot = number.lastIndexOf('.');
- if (lastDot < 0)
- return null;
- String parentNumber = number.substring(0, lastDot);
- return (IAdaptable) toc.get(parentNumber);
-}
-/**
- * Returns a string containing the contents of the given
- * file. Returns an empty string if there were any errors
- * reading the file.
- */
-protected String getText(IFile file) {
- try {
- InputStream in = file.getContents();
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- byte[] buf = new byte[1024];
- int read = in.read(buf);
- while (read > 0) {
- out.write(buf, 0, read);
- read = in.read(buf);
- }
- return out.toString();
- } catch (CoreException e) {
- } catch (IOException e) {
- }
- return ""; //$NON-NLS-1$
-}
-/**
- * Parses the input given by the argument.
- *
- * @param file the element containing the input text
- * @return an element collection representing the parsed input
- */
-public MarkElement[] parse(IFile file) {
- Hashtable markTable = new Hashtable(40);
- Vector topLevel = new Vector();
- String s = getText(file);
- int start = 0;
- int end = -1;
- int lineno = 0;
- int lastlineno = 0;
- MarkElement lastme = null;
- int ix;
-
- // parse content for headings
- ix = s.indexOf('\n', start);
- while (ix != -1) {
- start = end + 1;
- end = ix = s.indexOf('\n', start);
- lineno++;
- if (ix != -1) {
- // skip blanks
- while (s.charAt(start) == ' ' || s.charAt(start) == '\t') {
- start++;
- }
- if (Character.isDigit(s.charAt(start))) {
- if (lastme != null) {
- lastme.setNumberOfLines(lineno - lastlineno - 1);
- }
- lastlineno = lineno;
- String markName = parseHeading(s, start, end);
-
- //get the parent mark, if any.
- String markNumber = parseNumber(markName);
- IAdaptable parent = getParent(markTable, markNumber);
- if (parent == null)
- parent = file;
-
- MarkElement me = new MarkElement(parent, markName, start, end - start);
- lastme = me;
-
- markTable.put(markNumber, me);
- if (parent == file) {
- topLevel.add(me);
- }
- }
- }
- }
- if (lastme != null) {
- // set the number of lines for the last section
- lastme.setNumberOfLines(lineno - lastlineno - 1);
- }
- MarkElement[] results = new MarkElement[topLevel.size()];
- topLevel.copyInto(results);
- return results;
-}
-/**
- * Creates a section name from the buffer and trims trailing
- * space characters.
- *
- * @param buffer the string from which to create the section name
- * @param start the start index
- * @param end the end index
- * @return a section name
- */
-private String parseHeading(String buffer, int start, int end) {
- while (Character.isWhitespace(buffer.charAt(end-1)) && end >start) {
- end--;
- }
- return buffer.substring(start, end);
-}
-/**
- * Returns the number for this heading. A heading consists
- * of a number (an arbitrary string of numbers and dots), followed by
- * arbitrary text.
- */
-protected String parseNumber(String heading) {
- int start = 0;
- int end = heading.length();
- char c;
- do {
- c = heading.charAt(start++);
- } while ((c == '.' || Character.isDigit(c)) && start < end);
-
- //disregard trailing dots
- while (heading.charAt(start-1) == '.' && start > 0) {
- start--;
- }
- return heading.substring(0, start);
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DirtyStateContribution.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DirtyStateContribution.java deleted file mode 100644 index 750fb71d95c..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DirtyStateContribution.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.ui.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.*;
-
-/**
- * This class demonstrates the contribution of a custom control to the
- * status line for the readme editor. The control shows the
- * dirty status of the editor.
- */
-public class DirtyStateContribution extends ControlContribution
- implements IPropertyListener
-{
- private Composite composite;
- private Label label;
- private IEditorPart activeEditor;
-/**
- * Creates a new DirtyStateContribution.
- */
-protected DirtyStateContribution() {
- super("DirtyState"); //$NON-NLS-1$
-}
-/* (non-Javadoc)
- * Method declared on ControlContribution
- */
-protected Control createControl(Composite parent) {
- // If the composite is good just return it.
- if (composite != null && !composite.isDisposed())
- return composite;
-
- // Create composite for border.
- composite = new Composite(parent, SWT.BORDER);
- composite.setData(this);
-
- // Create label inside composite.
- label = new Label(composite, SWT.NONE);
- label.setSize(80, 15);
-
- updateState();
- return composite;
-}
-/**
- * Called when an editor is activated.
- *
- * @see ReadmeEditorActionBarContributor#setActiveEditor(IEditorPart)
- */
-public void editorChanged(IEditorPart part) {
- if (activeEditor != null) {
- activeEditor.removePropertyListener(this);
- }
- activeEditor = part;
- if (activeEditor != null) {
- activeEditor.addPropertyListener(this);
- }
- updateState();
-}
-/* (non-Javadoc)
- * Method declared on IPropertyListener
- */
-public void propertyChanged(Object source, int propID) {
- if (source instanceof IEditorPart)
- updateState();
-}
-/**
- * Updates the state of the label.
- */
-private void updateState() {
- if (label == null || label.isDisposed())
- return;
-
- boolean saveNeeded = false;
- if (activeEditor != null)
- saveNeeded = activeEditor.isDirty();
- if (saveNeeded)
- label.setText(MessageUtil.getString("Save_Needed")); //$NON-NLS-1$
- else
- label.setText(MessageUtil.getString("Clean")); //$NON-NLS-1$
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/EditorActionDelegate.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/EditorActionDelegate.java deleted file mode 100644 index c5db72258f5..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/EditorActionDelegate.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.*;
-
-/**
- * This class is used to demonstrate editor action extensions.
- * An extension should be defined in the readme plugin.xml.
- */
-public class EditorActionDelegate implements IEditorActionDelegate {
- private IEditorPart editor;
-/**
- * Creates a new EditorActionDelegate.
- */
-public EditorActionDelegate() {
-}
-/* (non-Javadoc)
- * Method declared on IActionDelegate
- */
-public void run(IAction action) {
- MessageDialog.openInformation(editor.getSite().getShell(),
- MessageUtil.getString("Readme_Editor"), //$NON-NLS-1$
- MessageUtil.getString("Editor_Action_executed")); //$NON-NLS-1$
-}
-/**
- * The <code>EditorActionDelegate</code> implementation of this
- * <code>IActionDelegate</code> method
- *
- * Selection in the desktop has changed. Plugin provider
- * can use it to change the availability of the action
- * or to modify other presentation properties.
- *
- * <p>Action delegate cannot be notified about
- * selection changes before it is loaded. For that reason,
- * control of action's enable state should also be performed
- * through simple XML rules defined for the extension
- * point. These rules allow enable state control before
- * the delegate has been loaded.</p>
- */
-public void selectionChanged(IAction action, ISelection selection) {
-}
-/**
- * The <code>EditorActionDelegate</code> implementation of this
- * <code>IEditorActionDelegate</code> method
- *
- * The matching editor has been activated. Notification
- * guarantees that only editors that match the type for which
- * this action has been registered will be tracked.
- *
- * @param action action proxy that represents this delegate in the desktop
- * @param editor the matching editor that has been activated
- */
-public void setActiveEditor(IAction action, IEditorPart editor) {
- this.editor = editor;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeConstants.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeConstants.java deleted file mode 100644 index 5869b87b531..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeConstants.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-/**
- * This interface contains constants for use only within the
- * Readme example.
- */
-public interface IReadmeConstants {
- public static final String PLUGIN_ID ="org.eclipse.ui.examples.readmetool"; //$NON-NLS-1$
- public static final String PREFIX = PLUGIN_ID+"."; //$NON-NLS-1$
- public static final String P_CONTENT_OUTLINE=PREFIX+"content_outline"; //$NON-NLS-1$
- public static final String P_SECTIONS=PREFIX+"sections"; //$NON-NLS-1$
- public static final String EXTENSION = "readme"; //$NON-NLS-1$
- public static final String TAG_PARSER = "parser"; //$NON-NLS-1$
- public static final String ATT_CLASS = "class"; //$NON-NLS-1$
- public static final String PP_SECTION_PARSER = "sectionParser"; //$NON-NLS-1$
-
- // Global actions
- public static final String RETARGET2 = PREFIX + "retarget2";
- public static final String LABELRETARGET3 = PREFIX + "labelretarget3";
-
- public static final String ACTION_SET_RETARGET4 = "org_eclipse_ui_examples_readmetool_readmeRetargetAction";
- public static final String ACTION_SET_LABELRETARGET5 = "org_eclipse_ui_examples_readmetool_readmeRelabelRetargetAction";
-
- // Preference constants
- public static final String PRE_CHECK1=PREFIX+"check1"; //$NON-NLS-1$
- public static final String PRE_CHECK2=PREFIX+"check2"; //$NON-NLS-1$
- public static final String PRE_CHECK3=PREFIX+"check3"; //$NON-NLS-1$
- public static final String PRE_RADIO_CHOICE = PREFIX+"radio_choice"; //$NON-NLS-1$
- public static final String PRE_TEXT = PREFIX+"text"; //$NON-NLS-1$
-
- // Help context ids
- public static final String EDITOR_ACTION1_CONTEXT = PREFIX+"editor_action1_context"; //$NON-NLS-1$
- public static final String EDITOR_ACTION2_CONTEXT = PREFIX+"editor_action2_context"; //$NON-NLS-1$
- public static final String EDITOR_ACTION3_CONTEXT = PREFIX+"editor_action3_context"; //$NON-NLS-1$
- public static final String SECTIONS_VIEW_CONTEXT = PREFIX+"sections_view_context"; //$NON-NLS-1$
- public static final String PREFERENCE_PAGE_CONTEXT = PREFIX+"preference_page_context"; //$NON-NLS-1$
- public static final String PROPERTY_PAGE_CONTEXT = PREFIX+"property_page_context"; //$NON-NLS-1$
- public static final String PROPERTY_PAGE2_CONTEXT = PREFIX+"property_page2_context"; //$NON-NLS-1$
- public static final String EDITOR_CONTEXT = PREFIX+"editor_context"; //$NON-NLS-1$
- public static final String SECTIONS_DIALOG_CONTEXT = PREFIX+"sections_dialog_context"; //$NON-NLS-1$
- public static final String CONTENT_OUTLINE_PAGE_CONTEXT = PREFIX+"content_outline_page_context"; //$NON-NLS-1$
- public static final String CREATION_WIZARD_PAGE_CONTEXT = PREFIX+"creation_wizard_page_context"; //$NON-NLS-1$
-
- // Marker attributes
- public static final String MARKER_ATT_ID = PREFIX+"id"; //$NON-NLS-1$
- public static final String MARKER_ATT_LEVEL = PREFIX+"level"; //$NON-NLS-1$
- public static final String MARKER_ATT_DEPT = PREFIX+"department"; //$NON-NLS-1$
- public static final String MARKER_ATT_CODE = PREFIX+"code"; //$NON-NLS-1$
- public static final String MARKER_ATT_LANG = PREFIX+"language"; //$NON-NLS-1$
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeFileParser.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeFileParser.java deleted file mode 100644 index 3f51c06acbb..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeFileParser.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.resources.IFile;
-
-/**
- * This interface is used as API for the Readme parser extension
- * point. The default implementation simply looks for lines
- * in the file that start with a number and assumes that they
- * represent sections. Tools are allowed to replace this
- * algorithm by defining an extension and supplying an
- * alternative that implements this interface.
- */
-public interface IReadmeFileParser {
-/**
- * Parses the contents of the provided file
- * and generates a collection of sections.
- */
-public MarkElement[] parse(IFile readmeFile);
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElement.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElement.java deleted file mode 100644 index e611e8ea725..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElement.java +++ /dev/null @@ -1,128 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.model.*;
-import org.eclipse.jface.resource.ImageDescriptor;
-import java.util.Iterator;
-import java.util.Vector;
-
-/**
- * This class represents a marked location in the Readme
- * file text.
- *
- * TIP: By implementing the <code>IWorkbenchAdapter</code> interface,
- * we can easily add objects of this type to viewers and parts in
- * the workbench. When a viewer contains <code>IWorkbenchAdapter</code>,
- * the generic <code>WorkbenchContentProvider</code> and
- * <code>WorkbenchLabelProvider</code> can be used to provide
- * navigation and display for that viewer.
- */
-public class MarkElement implements IWorkbenchAdapter,IAdaptable {
- private String headingName;
- private IAdaptable parent;
- private int offset;
- private int numberOfLines;
- private int length;
- private Vector children;
-/**
- * Creates a new MarkElement and stores parent element and
- * location in the text.
- *
- * @param parent the parent of this element
- * @param heading text corresponding to the heading
- * @param offset the offset into the Readme text
- * @param length the length of the element
- */
-public MarkElement(IAdaptable parent, String heading, int offset, int length) {
- this.parent = parent;
- if (parent instanceof MarkElement) {
- ((MarkElement)parent).addChild(this);
- }
- this.headingName = heading;
- this.offset = offset;
- this.length = length;
-}
-/**
- * Adds a child to this element
- */
-private void addChild(MarkElement child) {
- if (children == null) {
- children = new Vector();
- }
- children.add(child);
-}
-/* (non-Javadoc)
- * Method declared on IAdaptable
- */
-public Object getAdapter(Class adapter) {
- if (adapter == IWorkbenchAdapter.class)
- return this;
- if (adapter == IPropertySource.class)
- return new MarkElementProperties(this);
- return null;
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public Object[] getChildren(Object object) {
- if (children != null) {
- return children.toArray();
- }
- return new Object[0];
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public ImageDescriptor getImageDescriptor(Object object) {
- IWorkbenchAdapter parentElement = (IWorkbenchAdapter)parent.getAdapter(IWorkbenchAdapter.class);
- if (parentElement != null) {
- return parentElement.getImageDescriptor(object);
- }
- return null;
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public String getLabel(Object o) {
- return headingName;
-}
-/**
- * Returns the number of characters in this section.
- */
-public int getLength() {
- return length;
-}
-/**
- * Returns the number of lines in the element.
- *
- * @return the number of lines in the element
- */
-public int getNumberOfLines() {
- return numberOfLines;
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public Object getParent(Object o) {
- return null;
-}
-/**
- * Returns the offset of this section in the file.
- */
-public int getStart() {
- return offset;
-}
-/**
- * Sets the number of lines in the element
- *
- * @param newNumberOfLines the number of lines in the element
- */
-public void setNumberOfLines(int newNumberOfLines) {
- numberOfLines = newNumberOfLines;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElementProperties.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElementProperties.java deleted file mode 100644 index 7120ae890f7..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElementProperties.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.ui.views.properties.*;
-import org.eclipse.ui.views.properties.*;
-import java.util.List;
-import java.util.Vector;
-
-/**
- * This class encapsulates property sheet properties
- * for MarkElement. This will display properties for
- * the MarkElement when selected in the readme editor's
- * content outline.
- */
-public class MarkElementProperties implements IPropertySource {
- protected MarkElement element;
-
- protected static final String PROPERTY_LINECOUNT = "lineno"; //$NON-NLS-1$
- protected static final String PROPERTY_START = "start"; //$NON-NLS-1$
- protected static final String PROPERTY_LENGTH = "length"; //$NON-NLS-1$
-/**
- * Creates a new MarkElementProperties.
- *
- * @param element the element whose properties this instance represents
- */
-public MarkElementProperties(MarkElement element) {
- super();
- this.element = element;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public Object getEditableValue() {
- return this;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public IPropertyDescriptor[] getPropertyDescriptors() {
- // Create the property vector.
- IPropertyDescriptor[] propertyDescriptors = new IPropertyDescriptor[3];
-
- // Add each property supported.
- PropertyDescriptor descriptor;
-
- descriptor = new PropertyDescriptor(PROPERTY_LINECOUNT, MessageUtil.getString("Line_count")); //$NON-NLS-1$
- propertyDescriptors[0] = descriptor;
- descriptor = new PropertyDescriptor(PROPERTY_START, MessageUtil.getString("Title_start")); //$NON-NLS-1$
- propertyDescriptors[1] = descriptor;
- descriptor = new PropertyDescriptor(PROPERTY_LENGTH, MessageUtil.getString("Title_length")); //$NON-NLS-1$
- propertyDescriptors[2] = descriptor;
-
- // Return it.
- return propertyDescriptors;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public Object getPropertyValue(Object name) {
- if (name.equals(PROPERTY_LINECOUNT))
- return new Integer(element.getNumberOfLines());
- if (name.equals(PROPERTY_START))
- return new Integer(element.getStart());
- if (name.equals(PROPERTY_LENGTH))
- return new Integer(element.getLength());
- return null;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public boolean isPropertySet(Object property) {
- return false;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public void resetPropertyValue(Object property) {
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public void setPropertyValue(Object name, Object value) {
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MessageUtil.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MessageUtil.java deleted file mode 100644 index 75d181563c9..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MessageUtil.java +++ /dev/null @@ -1,51 +0,0 @@ -/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.ui.examples.readmetool;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Utility class which helps with managing messages.
- */
-/* package */ class MessageUtil {
-
- private static final String RESOURCE_BUNDLE= "org.eclipse.ui.examples.readmetool.messages";//$NON-NLS-1$
-
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private MessageUtil() {
- // prevent instantiation of class
- }
-
- /**
- * Returns the formatted message for the given key in
- * the resource bundle.
- *
- * @param key the resource name
- * @param args the message arguments
- * @return the string
- */
- public static String format(String key, Object[] args) {
- return MessageFormat.format(getString(key),args);
- }
-
- /**
- * Returns the resource object with the given key in
- * the resource bundle. If there isn't any value under
- * the given key, the key is returned, surrounded by '!'s.
- *
- * @param key the resource name
- * @return the string
- */
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/PopupMenuActionDelegate.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/PopupMenuActionDelegate.java deleted file mode 100644 index d9e53d12bbd..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/PopupMenuActionDelegate.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Action delegate for handling popup menu actions on a readme file.
- */
-public class PopupMenuActionDelegate implements IObjectActionDelegate {
-
- private IWorkbenchPart part;
-/** (non-Javadoc)
- * Method declared on IDropActionDelegate
- */
-public void run(IAction action) {
- MessageDialog.openInformation(
- this.part.getSite().getShell(),
- MessageUtil.getString("Readme_Example"), //$NON-NLS-1$
- MessageUtil.getString("Popup_Menu_Action_executed")); //$NON-NLS-1$
-}
-/** (non-Javadoc)
- * Method declared on IActionDelegate
- */
-public void selectionChanged(IAction action, ISelection selection) {
- //Ignored for this example
-}
-/** (non-Javadoc)
- * Method declared on IObjectActionDelegate
- */
-public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- this.part = targetPart;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlineDragListener.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlineDragListener.java deleted file mode 100644 index fbd6b46e9f9..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlineDragListener.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.ui.part.PluginTransfer;
-import org.eclipse.ui.part.PluginTransferData;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.dnd.*;
-
-/**
- * A drag listener for the readme editor's content outline page.
- * Allows dragging of content segments into views that support
- * the <code>TextTransfer</code> or <code>PluginTransfer</code> transfer types.
- */
-public class ReadmeContentOutlineDragListener extends DragSourceAdapter {
- private ReadmeContentOutlinePage page;
-/**
- * Creates a new drag listener for the given page.
- */
-public ReadmeContentOutlineDragListener(ReadmeContentOutlinePage page) {
- this.page = page;
-}
-/* (non-Javadoc)
- * Method declared on DragSourceListener
- */
-public void dragSetData(DragSourceEvent event) {
- if (PluginTransfer.getInstance().isSupportedType(event.dataType)) {
- byte[] segmentData = getSegmentText().getBytes();
- event.data = new PluginTransferData(ReadmeDropActionDelegate.ID, segmentData);
- return;
- }
- if (TextTransfer.getInstance().isSupportedType(event.dataType)) {
- event.data = getSegmentText();
- return;
- }
-}
-/**
- * Returns the text of the currently selected readme segment.
- */
-private String getSegmentText() {
- StringBuffer result = new StringBuffer();
- ISelection selection = page.getSelection();
- if (selection instanceof org.eclipse.jface.viewers.IStructuredSelection) {
- Object[] selected = ((IStructuredSelection) selection).toArray();
- result.append("\n"); //$NON-NLS-1$
- for (int i = 0; i < selected.length; i++) {
- if (selected[i] instanceof MarkElement) {
- result.append(((MarkElement) selected[i]).getLabel(selected[i]));
- result.append("\n"); //$NON-NLS-1$
- }
- }
- }
- return result.toString();
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlinePage.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlinePage.java deleted file mode 100644 index 7853c22b2a7..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlinePage.java +++ /dev/null @@ -1,132 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.resources.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.ui.model.*;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.part.IPageSite;
-import org.eclipse.ui.part.PluginTransfer;
-import org.eclipse.ui.views.contentoutline.*;
-import org.eclipse.swt.dnd.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-
-/**
- * Content outline page for the readme editor.
- */
-public class ReadmeContentOutlinePage extends ContentOutlinePage {
- protected IFile input;
-
- class OutlineAction extends Action {
- private Shell shell;
- public OutlineAction(String label) {
- super(label);
- getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- setEnabled(!event.getSelection().isEmpty());
- }
- });
- }
- public void setShell(Shell shell) {
- this.shell = shell;
- }
- public void run() {
- MessageDialog.openInformation(shell,
- MessageUtil.getString("Readme_Outline"), //$NON-NLS-1$
- MessageUtil.getString("ReadmeOutlineActionExecuted")); //$NON-NLS-1$
- }
- }
-
-/**
- * Creates a new ReadmeContentOutlinePage.
- */
-public ReadmeContentOutlinePage(IFile input) {
- super();
- this.input = input;
-}
-/**
- * Creates the control and registers the popup menu for this page
- * Menu id "org.eclipse.ui.examples.readmetool.outline"
- */
-public void createControl(Composite parent) {
- super.createControl(parent);
-
- WorkbenchHelp.setHelp(getControl(), IReadmeConstants.CONTENT_OUTLINE_PAGE_CONTEXT);
-
- TreeViewer viewer = getTreeViewer();
- viewer.setContentProvider(new WorkbenchContentProvider());
- viewer.setLabelProvider(new WorkbenchLabelProvider());
- viewer.setInput(getContentOutline(input));
- initDragAndDrop();
-
- // Configure the context menu.
- MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
- menuMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- menuMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS+"-end")); //$NON-NLS-1$
-
- Menu menu = menuMgr.createContextMenu(viewer.getTree());
- viewer.getTree().setMenu(menu);
- // Be sure to register it so that other plug-ins can add actions.
- getSite().registerContextMenu("org.eclipse.ui.examples.readmetool.outline", menuMgr, viewer); //$NON-NLS-1$
-
- getSite().getActionBars().setGlobalActionHandler(
- IReadmeConstants.RETARGET2,
- new OutlineAction(MessageUtil.getString("Outline_Action2"))); //$NON-NLS-1$
-
- OutlineAction action = new OutlineAction(MessageUtil.getString("Outline_Action3")); //$NON-NLS-1$
- action.setToolTipText(MessageUtil.getString("Readme_Outline_Action3")); //$NON-NLS-1$
- getSite().getActionBars().setGlobalActionHandler(
- IReadmeConstants.LABELRETARGET3,
- action);
- action = new OutlineAction(MessageUtil.getString("Outline_Action4")); //$NON-NLS-1$
- getSite().getActionBars().setGlobalActionHandler(
- IReadmeConstants.ACTION_SET_RETARGET4,
- action);
- action = new OutlineAction(MessageUtil.getString("Outline_Action5")); //$NON-NLS-1$
- action.setToolTipText(MessageUtil.getString("Readme_Outline_Action5")); //$NON-NLS-1$
- getSite().getActionBars().setGlobalActionHandler(
- IReadmeConstants.ACTION_SET_LABELRETARGET5,
- action);
-}
-/**
- * Gets the content outline for a given input element.
- * Returns the outline (a list of MarkElements), or null
- * if the outline could not be generated.
- */
-private IAdaptable getContentOutline(IAdaptable input) {
- return ReadmeModelFactory.getInstance().getContentOutline(input);
-}
-/**
- * Initializes drag and drop for this content outline page.
- */
-private void initDragAndDrop() {
- int ops = DND.DROP_COPY | DND.DROP_MOVE;
- Transfer[] transfers = new Transfer[] {TextTransfer.getInstance(), PluginTransfer.getInstance()};
- getTreeViewer().addDragSupport(ops, transfers, new ReadmeContentOutlineDragListener(this));
-}
-/**
- * Forces the page to update its contents.
- *
- * @see ReadmeEditor#doSave(IProgressMonitor)
- */
-public void update() {
- getControl().setRedraw(false);
- getTreeViewer().setInput(getContentOutline(input));
- getTreeViewer().expandAll();
- getControl().setRedraw(true);
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationPage.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationPage.java deleted file mode 100644 index bc346671b5a..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationPage.java +++ /dev/null @@ -1,174 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.resources.IFile;
-import org.eclipse.ui.*;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import java.io.*;
-
-/**
- * This class is the only page of the Readme file resource creation wizard.
- * It subclasses the standard file resource creation page class,
- * and consequently inherits the file resource creation functionality.
- *
- * This page provides users with the choice of creating sample headings for
- * sections and subsections. Additionally, the option is presented to open
- * the file immediately for editing after creation.
- */
-public class ReadmeCreationPage extends WizardNewFileCreationPage {
- private IWorkbench workbench;
-
- // widgets
- private Button sectionCheckbox;
- private Button subsectionCheckbox;
- private Button openFileCheckbox;
-
- // constants
- private static int nameCounter = 1;
-/**
- * Creates the page for the readme creation wizard.
- *
- * @param workbench the workbench on which the page should be created
- * @param selection the current selection
- */
-public ReadmeCreationPage(IWorkbench workbench, IStructuredSelection selection) {
- super("sampleCreateReadmePage1", selection); //$NON-NLS-1$
- this.setTitle(MessageUtil.getString("Create_Readme_File")); //$NON-NLS-1$
- this.setDescription(MessageUtil.getString("Create_a_new_Readme_file_resource")); //$NON-NLS-1$
- this.workbench = workbench;
-}
-/** (non-Javadoc)
- * Method declared on IDialogPage.
- */
-public void createControl(Composite parent) {
- // inherit default container and name specification widgets
- super.createControl(parent);
- Composite composite = (Composite)getControl();
-
- WorkbenchHelp.setHelp(composite, IReadmeConstants.CREATION_WIZARD_PAGE_CONTEXT);
-
- GridData data = (GridData)composite.getLayoutData();
- this.setFileName("sample" + nameCounter + ".readme"); //$NON-NLS-1$ //$NON-NLS-2$
-
- new Label(composite,SWT.NONE); // vertical spacer
-
- // sample section generation group
- Group group = new Group(composite,SWT.NONE);
- group.setLayout(new GridLayout());
- group.setText(MessageUtil.getString("Automatic_sample_section_generation")); //$NON-NLS-1$
- group.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
-
- // sample section generation checkboxes
- sectionCheckbox = new Button(group,SWT.CHECK);
- sectionCheckbox.setText(MessageUtil.getString("Generate_sample_section_titles")); //$NON-NLS-1$
- sectionCheckbox.setSelection(true);
- sectionCheckbox.addListener(SWT.Selection,this);
-
- subsectionCheckbox = new Button(group,SWT.CHECK);
- subsectionCheckbox.setText(MessageUtil.getString("Generate_sample_subsection_titles")); //$NON-NLS-1$
- subsectionCheckbox.setSelection(true);
- subsectionCheckbox.addListener(SWT.Selection,this);
-
- new Label(composite,SWT.NONE); // vertical spacer
-
- // open file for editing checkbox
- openFileCheckbox = new Button(composite,SWT.CHECK);
- openFileCheckbox.setText(MessageUtil.getString("Open_file_for_editing_when_done")); //$NON-NLS-1$
- openFileCheckbox.setSelection(true);
-
- setPageComplete(validatePage());
-
-}
-/**
- * Creates a new file resource as requested by the user. If everything
- * is OK then answer true. If not, false will cause the dialog
- * to stay open.
- *
- * @return whether creation was successful
- * @see ReadmeCreationWizard#performFinish()
- */
-public boolean finish() {
- // create the new file resource
- IFile newFile = createNewFile();
- if (newFile == null)
- return false; // ie.- creation was unsuccessful
-
- // Since the file resource was created fine, open it for editing
- // if requested by the user
- try {
- if (openFileCheckbox.getSelection()) {
- IWorkbenchWindow dwindow = workbench.getActiveWorkbenchWindow();
- IWorkbenchPage page = dwindow.getActivePage();
- if (page != null)
- page.openEditor(newFile);
- }
- } catch (PartInitException e) {
- e.printStackTrace();
- return false;
- }
- nameCounter++;
- return true;
-}
-/**
- * The <code>ReadmeCreationPage</code> implementation of this
- * <code>WizardNewFileCreationPage</code> method
- * generates sample headings for sections and subsections in the
- * newly-created Readme file according to the selections of self's
- * checkbox widgets
- */
-protected InputStream getInitialContents() {
- if (!sectionCheckbox.getSelection())
- return null;
-
- StringBuffer sb = new StringBuffer();
- sb.append(MessageUtil.getString("SAMPLE_README_FILE")); //$NON-NLS-1$
- sb.append(MessageUtil.getString("SECTION_1")); //$NON-NLS-1$
- sb.append(MessageUtil.getString("SECTION_1_BODY_1")); //$NON-NLS-1$
-
- if (subsectionCheckbox.getSelection()) {
- sb.append(MessageUtil.getString("Subsection_1_1")); //$NON-NLS-1$
- sb.append(MessageUtil.getString("Subsection_1_1_Body_1")); //$NON-NLS-1$
- }
-
- sb.append(MessageUtil.getString("SECTION_2")); //$NON-NLS-1$
- sb.append(MessageUtil.getString("SECTION_2_BODY_1")); //$NON-NLS-1$
- sb.append(MessageUtil.getString("SECTION_2_BODY_2")); //$NON-NLS-1$
-
- if (subsectionCheckbox.getSelection()) {
- sb.append(MessageUtil.getString("Subsection_2_1")); //$NON-NLS-1$
- sb.append(MessageUtil.getString("Subsection_2_1_BODY_1")); //$NON-NLS-1$
- sb.append(MessageUtil.getString("Subsection_2_2")); //$NON-NLS-1$
- sb.append(MessageUtil.getString("Subsection_2_2_BODY_1")); //$NON-NLS-1$
- }
-
- return new ByteArrayInputStream(sb.toString().getBytes());
-}
-/** (non-Javadoc)
- * Method declared on WizardNewFileCreationPage.
- */
-protected String getNewFileLabel() {
- return MessageUtil.getString("Readme_file_name"); //$NON-NLS-1$
-}
-/** (non-Javadoc)
- * Method declared on WizardNewFileCreationPage.
- */
-public void handleEvent(Event e) {
- Widget source = e.widget;
-
- if (source == sectionCheckbox) {
- if (!sectionCheckbox.getSelection())
- subsectionCheckbox.setSelection(false);
- subsectionCheckbox.setEnabled(sectionCheckbox.getSelection());
- }
-
- super.handleEvent(e);
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationWizard.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationWizard.java deleted file mode 100644 index d06fa2a5054..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationWizard.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.ui.*;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-
-/**
- * This class implements the interface required by the desktop
- * for all 'New' wizards. This wizard creates readme files.
- */
-public class ReadmeCreationWizard extends Wizard implements INewWizard {
- private IStructuredSelection selection;
- private IWorkbench workbench;
- private ReadmeCreationPage mainPage;
-/** (non-Javadoc)
- * Method declared on Wizard.
- */
-public void addPages() {
- mainPage = new ReadmeCreationPage(workbench, selection);
- addPage(mainPage);
-}
-/** (non-Javadoc)
- * Method declared on INewWizard
- */
-public void init(IWorkbench workbench,IStructuredSelection selection) {
- this.workbench = workbench;
- this.selection = selection;
- setWindowTitle(MessageUtil.getString("New_Readme_File")); //$NON-NLS-1$
- setDefaultPageImageDescriptor(ReadmeImages.README_WIZARD_BANNER);
-}
-/** (non-Javadoc)
- * Method declared on IWizard
- */
-public boolean performFinish() {
- return mainPage.finish();
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeDropActionDelegate.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeDropActionDelegate.java deleted file mode 100644 index 0919590f845..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeDropActionDelegate.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.ui.part.IDropActionDelegate;
-import java.io.ByteArrayInputStream;
-
-/**
- * Adapter for handling the dropping of readme segments into
- * another plugin. In this case, we expect the segments
- * to be dropped onto <code>IFile</code> object, or an adapter
- * that supports <code>IFile</code>.
- */
-public class ReadmeDropActionDelegate implements IDropActionDelegate {
- public static final String ID = "org_eclipse_ui_examples_readmetool_drop_actions"; //$NON-NLS-1$
-/** (non-Javadoc)
- * Method declared on IDropActionDelegate
- */
-public boolean run(Object source, Object target) {
- if (source instanceof byte[] && target instanceof IFile) {
- IFile file = (IFile)target;
- try {
- file.appendContents(new ByteArrayInputStream((byte[])source), false, true, null);
- } catch (CoreException e) {
- System.out.println(MessageUtil.getString("Exception_in_readme_drop_adapter") + e.getStatus().getMessage()); //$NON-NLS-1$
- return false;
- }
- return true;
- }
- return false;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditor.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditor.java deleted file mode 100644 index 9b7e52dbb18..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditor.java +++ /dev/null @@ -1,125 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ui.editors.text.TextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-
-/**
- * This class implements the Readme editor. Since the readme
- * editor is mostly just a text editor, there is very little
- * implemented in this actual class. It can be regarded as
- * simply decorating the text editor with a content outline.
- */
-public class ReadmeEditor extends TextEditor {
- protected ReadmeContentOutlinePage page;
-
- private final static String ATT_1 = IReadmeConstants.PREFIX + "attribute1"; //$NON-NLS-1$
- private final static String ATT_2 = IReadmeConstants.PREFIX + "attribute2"; //$NON-NLS-1$
- private final static String ATT_3 = IReadmeConstants.PREFIX + "attribute3"; //$NON-NLS-1$
- private final static String ATT_4 = IReadmeConstants.PREFIX + "attribute4"; //$NON-NLS-1$
- private final static String ATT_5 = IReadmeConstants.PREFIX + "attribute5"; //$NON-NLS-1$
-
- /**
- * Creates a new ReadmeEditor.
- */
- public ReadmeEditor() {
- super();
- }
- /** (non-Javadoc)
- * Method declared on IEditorPart
- */
- public void doSave(IProgressMonitor monitor) {
- super.doSave(monitor);
- if (page != null)
- page.update();
- }
- /** (non-Javadoc)
- * Method declared on IAdaptable
- */
- public Object getAdapter(Class key) {
- if (key.equals(IContentOutlinePage.class)) {
- IEditorInput input = getEditorInput();
- if (input instanceof IFileEditorInput) {
- page = new ReadmeContentOutlinePage(((IFileEditorInput)input).getFile());
- return page;
- }
- }
- return super.getAdapter(key);
- }
-
- /** (non-Javadoc)
- * Method declared on AbstractTextEditor
- */
- protected void editorContextMenuAboutToShow(IMenuManager parentMenu) {
- super.editorContextMenuAboutToShow(parentMenu);
- parentMenu.add(new Separator());
- IMenuManager subMenu = new MenuManager(MessageUtil.getString("Add"));
- parentMenu.add(subMenu);
- if (subMenu != null) {
- // Add readme actions with various attributes
- Object[][] att = new Object[][] {{IReadmeConstants.MARKER_ATT_ID, new Integer(1234)}};
- subMenu.add(new AddReadmeMarkerAction(this,
- MessageUtil.getString("Add_readme_marker_action_label") + "1", //$NON-NLS-1$ //$NON-NLS-2$
- att,
- MessageUtil.getString("Readme_marker_message_example") + " id=1234")); //$NON-NLS-1$ //$NON-NLS-2$
-
- att = new Object[][] {{IReadmeConstants.MARKER_ATT_LEVEL, new Integer(7)}};
- subMenu.add(new AddReadmeMarkerAction(this,
- MessageUtil.getString("Add_readme_marker_action_label") + "2", //$NON-NLS-1$ //$NON-NLS-2$
- att,
- MessageUtil.getString("Readme_marker_message_example") + " level=7")); //$NON-NLS-1$ //$NON-NLS-2$
-
- att = new Object[][] {{IReadmeConstants.MARKER_ATT_LEVEL, new Integer(7)},
- {IReadmeConstants.MARKER_ATT_DEPT, "infra"}}; //$NON-NLS-1$
- subMenu.add(new AddReadmeMarkerAction(this,
- MessageUtil.getString("Add_readme_marker_action_label") + "3", //$NON-NLS-1$ //$NON-NLS-2$
- att,
- MessageUtil.getString("Readme_marker_message_example") + " level=7, department=infra")); //$NON-NLS-1$ //$NON-NLS-2$
-
- att = new Object[][] {{IReadmeConstants.MARKER_ATT_CODE, "red"}}; //$NON-NLS-1$
- subMenu.add(new AddReadmeMarkerAction(this,
- MessageUtil.getString("Add_readme_marker_action_label") + "4", //$NON-NLS-1$ //$NON-NLS-2$
- att,
- MessageUtil.getString("Readme_marker_message_example") + " code=red")); //$NON-NLS-1$ //$NON-NLS-2$
-
- att = new Object[][] {{IReadmeConstants.MARKER_ATT_LANG, "english"}}; //$NON-NLS-1$
- subMenu.add(new AddReadmeMarkerAction(this,
- MessageUtil.getString("Add_readme_marker_action_label") + "5", //$NON-NLS-1$ //$NON-NLS-2$
- att,
- MessageUtil.getString("Readme_marker_message_example") + " language=english")); //$NON-NLS-1$ //$NON-NLS-2$
-
- att = new Object[][] {{IReadmeConstants.MARKER_ATT_ID, new Integer(1234)},
- {IReadmeConstants.MARKER_ATT_LEVEL, new Integer(7)},
- {IReadmeConstants.MARKER_ATT_DEPT, "infra"}, //$NON-NLS-1$
- {IReadmeConstants.MARKER_ATT_CODE, "red"}, //$NON-NLS-1$
- {IReadmeConstants.MARKER_ATT_LANG, "english"}}; //$NON-NLS-1$
- subMenu.add(new AddReadmeMarkerAction(this,
- MessageUtil.getString("Add_readme_marker_action_label") + "6", //$NON-NLS-1$ //$NON-NLS-2$
- att,
- MessageUtil.getString("Readme_marker_message_example") + //$NON-NLS-1$
- " id=1234, level=7, department=infra, code=red, language=english")); //$NON-NLS-1$
-
- att = new Object[0][0];
- subMenu.add(new AddReadmeMarkerAction(this,
- MessageUtil.getString("Add_readme_marker_action_label") + "7", //$NON-NLS-1$ //$NON-NLS-2$
- att,
- MessageUtil.getString("Readme_marker_message_example") + " No attributes specified")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditorActionBarContributor.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditorActionBarContributor.java deleted file mode 100644 index 7b11af96d18..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditorActionBarContributor.java +++ /dev/null @@ -1,185 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.ui.*;
-import org.eclipse.ui.actions.LabelRetargetAction;
-import org.eclipse.ui.actions.RetargetAction;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.part.EditorActionBarContributor;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.action.ControlContribution;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.ui.texteditor.BasicTextEditorActionContributor;
-
-/**
- * This class demonstrates action contribution for the readme editor.
- * A number of menu, toolbar, and status line contributions are defined
- * in the workbench window. These actions are shared among all
- * readme editors, and are only visible when a readme editor is
- * active. Otherwise, they are invisible.
- */
-public class ReadmeEditorActionBarContributor extends BasicTextEditorActionContributor
-{
- private EditorAction action1;
- private RetargetAction action2;
- private LabelRetargetAction action3;
- private EditorAction handler2;
- private EditorAction handler3;
- private EditorAction handler4;
- private EditorAction handler5;
- private DirtyStateContribution dirtyStateContribution;
-
- class EditorAction extends Action {
- private Shell shell;
- private IEditorPart activeEditor;
- public EditorAction(String label) {
- super(label);
- }
- public void setShell(Shell shell) {
- this.shell = shell;
- }
- public void run() {
- String editorName = MessageUtil.getString("Empty_Editor_Name"); //$NON-NLS-1$
- if (activeEditor != null)
- editorName = activeEditor.getTitle();
- MessageDialog.openInformation(shell,
- MessageUtil.getString("Readme_Editor"), //$NON-NLS-1$
- MessageUtil.format("ReadmeEditorActionExecuted", new Object[] {getText(), editorName})); //$NON-NLS-1$
- }
- public void setActiveEditor(IEditorPart part) {
- activeEditor = part;
- }
- }
-/**
- * Creates a new ReadmeEditorActionBarContributor.
- */
-public ReadmeEditorActionBarContributor() {
- ImageRegistry registry = ReadmePlugin.getDefault().getImageRegistry();
- action1 = new EditorAction(MessageUtil.getString("Editor_Action1")); //$NON-NLS-1$
- action1.setToolTipText(MessageUtil.getString("Readme_Editor_Action1")); //$NON-NLS-1$
- action1.setDisabledImageDescriptor(ReadmeImages.EDITOR_ACTION1_IMAGE_DISABLE);
- action1.setImageDescriptor(ReadmeImages.EDITOR_ACTION1_IMAGE_ENABLE);
- action1.setHoverImageDescriptor(ReadmeImages.EDITOR_ACTION1_IMAGE);
- WorkbenchHelp.setHelp(action1, IReadmeConstants.EDITOR_ACTION1_CONTEXT);
-
- action2 = new RetargetAction(IReadmeConstants.RETARGET2, MessageUtil.getString("Editor_Action2")); //$NON-NLS-1$
- action2.setToolTipText(MessageUtil.getString("Readme_Editor_Action2")); //$NON-NLS-1$
- action2.setDisabledImageDescriptor(ReadmeImages.EDITOR_ACTION2_IMAGE_DISABLE);
- action2.setImageDescriptor(ReadmeImages.EDITOR_ACTION2_IMAGE_ENABLE);
- action2.setHoverImageDescriptor(ReadmeImages.EDITOR_ACTION2_IMAGE);
-
- action3 = new LabelRetargetAction(IReadmeConstants.LABELRETARGET3, MessageUtil.getString("Editor_Action3")); //$NON-NLS-1$
- action3.setDisabledImageDescriptor(ReadmeImages.EDITOR_ACTION3_IMAGE_DISABLE);
- action3.setImageDescriptor(ReadmeImages.EDITOR_ACTION3_IMAGE_ENABLE);
- action3.setHoverImageDescriptor(ReadmeImages.EDITOR_ACTION3_IMAGE);
-
- handler2 = new EditorAction(MessageUtil.getString("Editor_Action2")); //$NON-NLS-1$
- WorkbenchHelp.setHelp(action2, IReadmeConstants.EDITOR_ACTION2_CONTEXT);
-
- handler3 = new EditorAction(MessageUtil.getString("Editor_Action3")); //$NON-NLS-1$
- handler3.setToolTipText(MessageUtil.getString("Readme_Editor_Action3")); //$NON-NLS-1$
- WorkbenchHelp.setHelp(action3, IReadmeConstants.EDITOR_ACTION3_CONTEXT);
-
- handler4 = new EditorAction(MessageUtil.getString("Editor_Action4")); //$NON-NLS-1$
- handler5 = new EditorAction(MessageUtil.getString("Editor_Action5")); //$NON-NLS-1$
- handler5.setToolTipText(MessageUtil.getString("Readme_Editor_Action5")); //$NON-NLS-1$
-
- dirtyStateContribution = new DirtyStateContribution();
-}
-/** (non-Javadoc)
- * Method declared on EditorActionBarContributor
- */
-public void contributeToMenu(IMenuManager menuManager) {
- // Run super.
- super.contributeToMenu(menuManager);
-
- // Editor-specitic menu
- MenuManager readmeMenu = new MenuManager(MessageUtil.getString("Readme_Menu")); //$NON-NLS-1$
- // It is important to append the menu to the
- // group "additions". This group is created
- // between "Project" and "Tools" menus
- // for this purpose.
- menuManager.insertAfter("additions", readmeMenu); //$NON-NLS-1$
- readmeMenu.add(action1);
- readmeMenu.add(action2);
- readmeMenu.add(action3);
-}
-/** (non-Javadoc)
- * Method declared on EditorActionBarContributor
- */
-public void contributeToStatusLine(IStatusLineManager statusLineManager) {
- // Run super.
- super.contributeToStatusLine(statusLineManager);
- // Test status line.
- statusLineManager.setMessage(MessageUtil.getString("Editor_is_active")); //$NON-NLS-1$
- statusLineManager.add(dirtyStateContribution);
-}
-
-/** (non-Javadoc)
- * Method declared on EditorActionBarContributor
- */
-public void contributeToToolBar(IToolBarManager toolBarManager) {
- // Run super.
- super.contributeToToolBar(toolBarManager);
-
- // Add toolbar stuff.
- toolBarManager.add(new Separator("ReadmeEditor")); //$NON-NLS-1$
- toolBarManager.add(action1);
- toolBarManager.add(action2);
- toolBarManager.add(action3);
-}
-/** (non-Javadoc)
- * Method declared on IEditorActionBarContributor
- */
-public void dispose() {
- // Remove retarget actions as page listeners
- getPage().removePartListener(action2);
- getPage().removePartListener(action3);
-}
-
-/** (non-Javadoc)
- * Method declared on IEditorActionBarContributor
- */
-public void init(IActionBars bars, IWorkbenchPage page) {
- super.init(bars, page);
- bars.setGlobalActionHandler(IReadmeConstants.RETARGET2, handler2);
- bars.setGlobalActionHandler(IReadmeConstants.LABELRETARGET3, handler3);
- bars.setGlobalActionHandler(IReadmeConstants.ACTION_SET_RETARGET4, handler4);
- bars.setGlobalActionHandler(IReadmeConstants.ACTION_SET_LABELRETARGET5, handler5);
-
- // Hook retarget actions as page listeners
- page.addPartListener(action2);
- page.addPartListener(action3);
- IWorkbenchPart activePart = page.getActivePart();
- if (activePart != null) {
- action2.partActivated(activePart);
- action3.partActivated(activePart);
- }
-}
-
-/** (non-Javadoc)
- * Method declared on IEditorActionBarContributor
- */
-public void setActiveEditor(IEditorPart editor) {
- // Run super.
- super.setActiveEditor(editor);
-
- // Target shared actions to new editor
- action1.setActiveEditor(editor);
- handler2.setActiveEditor(editor);
- handler3.setActiveEditor(editor);
- handler4.setActiveEditor(editor);
- handler5.setActiveEditor(editor);
- dirtyStateContribution.editorChanged(editor);
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage.java deleted file mode 100644 index fc6c558b9a2..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage.java +++ /dev/null @@ -1,171 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.*;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.ui.help.*;
-import org.eclipse.swt.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import java.io.*;
-
-/**
- * This page will be added to the property page dialog
- * when the "Properties..." popup menu item is selected
- * for Readme files.
- */
-public class ReadmeFilePropertyPage extends PropertyPage {
-
-/**
- * Utility method that creates a new composite and
- * sets up its layout data.
- *
- * @param parent the parent of the composite
- * @param numColumns the number of columns in the new composite
- * @return the newly-created composite
- */
-protected Composite createComposite(Composite parent, int numColumns) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
- return composite;
-}
-/** (non-Javadoc)
- * Method declared on PreferencePage
- */
-public Control createContents(Composite parent) {
-
- // ensure the page has no special buttons
- noDefaultAndApplyButton();
- Composite panel = createComposite(parent, 2);
-
- WorkbenchHelp.setHelp(panel, IReadmeConstants.PROPERTY_PAGE_CONTEXT);
-
- // layout the page
-
- IResource resource = (IResource) getElement();
- IStatus result = null;
- if (resource.getType() == IResource.FILE) {
- Label l = createLabel(panel, MessageUtil.getString("File_name")); //$NON-NLS-1$
- l = createLabel(panel, resource.getName());
- grabExcessSpace(l);
-
- //
- createLabel(panel, MessageUtil.getString("Path")); //$NON-NLS-1$
- l = createLabel(panel, resource.getFullPath().setDevice(null).toString());
- grabExcessSpace(l);
-
- //
- createLabel(panel, MessageUtil.getString("Size")); //$NON-NLS-1$
- InputStream contentStream = null;
- try {
- IFile file = (IFile) resource;
- if (!file.isLocal(IResource.DEPTH_ZERO))
- l = createLabel(panel,MessageUtil.getString("<file_contents_not_local>")); //$NON-NLS-1$
- else {
- contentStream = file.getContents();
- Reader in = new InputStreamReader(contentStream);
- int chunkSize = contentStream.available();
- StringBuffer buffer = new StringBuffer(chunkSize);
- char[] readBuffer = new char[chunkSize];
- int n = in.read(readBuffer);
-
- while (n > 0) {
- buffer.append(readBuffer);
- n = in.read(readBuffer);
- }
-
- contentStream.close();
- l = createLabel(panel, Integer.toString(buffer.length()));
- }
- } catch (CoreException e) {
- result = e.getStatus();
- String message = result.getMessage();
- if (message == null)
- l = createLabel(panel, MessageUtil.getString("<Unknown>")); //$NON-NLS-1$
- else
- l = createLabel(panel, message);
- } catch (IOException e) {
- l = createLabel(panel, MessageUtil.getString("<Unknown>")); //$NON-NLS-1$
- } finally {
- if (contentStream != null) {
- try {
- contentStream.close();
- } catch (IOException e) {
- }
- }
- }
- grabExcessSpace(l);
- createLabel(panel, MessageUtil.getString("Number_of_sections")); //$NON-NLS-1$
- // We will get the sections property and simply
- // report number of elements found.
- IAdaptable sections = getSections(resource);
- if (sections instanceof AdaptableList) {
- AdaptableList list = (AdaptableList)sections;
- l = createLabel(panel, String.valueOf(list.size()));
- grabExcessSpace(l);
- }
- }
-
- //
- Label l = createLabel(panel, MessageUtil.getString("Additional_information")); //$NON-NLS-1$
- grabExcessSpace(l);
- GridData gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- return new Canvas(panel, 0);
-}
-/**
- * Utility method that creates a new label and sets up its layout data.
- *
- * @param parent the parent of the label
- * @param text the text of the label
- * @return the newly-created label
- */
-protected Label createLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
- return label;
-}
-/**
- * Returns the readme sections for this resource, or null
- * if not applicable (resource is not a readme file).
- */
-private AdaptableList getSections(IAdaptable adaptable) {
- if (adaptable instanceof IFile)
- return ReadmeModelFactory.getInstance().getSections((IFile)adaptable);
- else
- return null;
-}
-/**
- * Sets this control to grab any excess horizontal space
- * left in the window.
- *
- * @param control the control for which to grab excess space
- */
-private void grabExcessSpace(Control control) {
- GridData gd = (GridData) control.getLayoutData();
- if (gd != null) {
- gd.grabExcessHorizontalSpace = true;
- }
-}
-/** (non-Javadoc)
- * Method declared on PreferencePage
- */
-public boolean performOk() {
- // nothing to do - read-only page
- return true;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage2.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage2.java deleted file mode 100644 index b2f0aaa4258..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage2.java +++ /dev/null @@ -1,203 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.ui.help.*;
-import org.eclipse.swt.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import java.io.*;
-
-/**
- * This page will be added to the property page dialog
- * when "Properties..." popup menu item is selected
- * for Readme files.
- *
- * This page demonstrates conditional property pages which look
- * different depending on the state of the element. In this example,
- * the arbitrary condition chosen is whether the Readme file is
- * greater than 256 bytes in length. If it is smaller than 256 bytes
- * in length, this will be a placeholder page containing
- * a simple message. If it is 256 bytes or larger, additional
- * information will be provided. This information is determined at
- * runtime.
- *
- * This class may be reused to implement a conditional property page.
- * The getPageIndex() method tests the condition and returns the
- * index of the page to create. The createPage*() methods are called
- * upon to create the actual pages.
- */
-public class ReadmeFilePropertyPage2 extends PropertyPage {
-
-/**
- * Utility method that creates a new composite and
- * sets up its layout data.
- *
- * @param parent the parent of the composite
- * @param numColumns the number of columns in the new composite
- * @return the newly-created composite
- */
-protected Composite createComposite(Composite parent, int numColumns) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
- return composite;
-}
-/** (non-Javadoc)
- * Method declared on PreferencePage
- */
-public Control createContents(Composite parent) {
- // ensure the page has no special buttons
- noDefaultAndApplyButton();
- Composite panel = createComposite(parent, 2);
-
- WorkbenchHelp.setHelp(panel, IReadmeConstants.PROPERTY_PAGE2_CONTEXT);
-
- // layout the page
- int page = getPageIndex();
- switch (page) {
- case 1:
- createPageOne(panel);
- break;
- case 2:
- createPageTwo(panel);
- break;
- default:
- }
- return new Canvas(panel, 0);
-}
-/**
- * Utility method that creates a new label and sets up
- * its layout data.
- *
- * @param parent the parent of the label
- * @param text the text of the label
- * @return the newly-created label
- */
-protected Label createLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
- return label;
-}
-/**
- * Creates the first version of the page. This is a placeholder page which
- * notified the user that the page is not available.
- *
- * @param panel the panel in which to create the page
- */
-protected void createPageOne(Composite panel) {
- Label l = createLabel(panel, MessageUtil.getString("Additional_Readme_properties_not_available.")); //$NON-NLS-1$
- GridData gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- gd.grabExcessHorizontalSpace = true;
- l = createLabel(panel, MessageUtil.getString("This_illustrates_a_property_page_that_is_dynamically_determined")); //$NON-NLS-1$
- gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- gd.grabExcessHorizontalSpace = true;
- l = createLabel(panel, MessageUtil.getString("not_to_be_available_based_on_the_state_of_the_object.")); //$NON-NLS-1$
- gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- gd.grabExcessHorizontalSpace = true;
-}
-/**
- * Creates the second version of the page. This page might contain more information
- * about the file or other information.
- *
- * @param panel the panel in which to create the page
- */
-protected void createPageTwo(Composite panel) {
- Label l = createLabel(panel, MessageUtil.getString("The_size_of_the_Readme_file_is_at_least_256_bytes.")); //$NON-NLS-1$
- GridData gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- gd.grabExcessHorizontalSpace = true;
- l = createLabel(panel, MessageUtil.getString("Had_it_been_less_than_256_bytes_this_page_would_be_a_placeholder_page.")); //$NON-NLS-1$
- gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- gd.grabExcessHorizontalSpace = true;
- l = createLabel(panel, MessageUtil.getString("Additional_information")); //$NON-NLS-1$
- gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- gd.grabExcessHorizontalSpace = true;
- l = createLabel(panel, MessageUtil.getString("This_illustrates_a_property_page_that_is_dynamically_determined")); //$NON-NLS-1$
- gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- gd.grabExcessHorizontalSpace = true;
- l = createLabel(panel, MessageUtil.getString("to_be_available_based_on_the_state_of_the_object.")); //$NON-NLS-1$
- gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- gd.grabExcessHorizontalSpace = true;
-}
-/**
- * Returns which page to display. This implementation
- * answers 1 if the size of the Readme file is less than 256 bytes
- * and 2 otherwise.
- *
- * @return the index of the page to display
- */
-protected int getPageIndex() {
- IResource resource = (IResource) getElement();
-
- if (resource.getType() == IResource.FILE) {
- InputStream contentStream = null;
- int length = 0;
- try {
- IFile file = (IFile) resource;
-
- if (file.isLocal(IResource.DEPTH_ZERO)) {
- contentStream = file.getContents();
- Reader in = new InputStreamReader(contentStream);
- int chunkSize = contentStream.available();
- StringBuffer buffer = new StringBuffer(chunkSize);
- char[] readBuffer = new char[chunkSize];
- int n = in.read(readBuffer);
-
- while (n > 0) {
- buffer.append(readBuffer);
- n = in.read(readBuffer);
- }
-
- contentStream.close();
- length = buffer.length();
- }
- } catch (CoreException e) {
- length = 0;
- } catch (IOException e) {
- } finally {
- if (contentStream != null) {
- try {
- contentStream.close();
- } catch (IOException e) {
- }
- }
- }
-
- if (length < 256)
- return 1;
- else
- return 2;
- }
-
- return 0;
-}
-/** (non-Javadoc)
- * Method declared on PreferencePage
- */
-public boolean performOk() {
- // nothing to do - read-only page
- return true;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeImages.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeImages.java deleted file mode 100644 index 7fd5baa71f4..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeImages.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.widgets.Display;
-import java.net.MalformedURLException;
-import java.net.URL;
-/**
- * Convenience class for storing references to image descriptors
- * used by the readme tool.
- */
-public class ReadmeImages {
- static final URL BASE_URL = ReadmePlugin.getDefault().getDescriptor().getInstallURL();
- static final ImageDescriptor EDITOR_ACTION1_IMAGE;
- static final ImageDescriptor EDITOR_ACTION2_IMAGE;
- static final ImageDescriptor EDITOR_ACTION3_IMAGE;
- static final ImageDescriptor EDITOR_ACTION1_IMAGE_DISABLE;
- static final ImageDescriptor EDITOR_ACTION2_IMAGE_DISABLE;
- static final ImageDescriptor EDITOR_ACTION3_IMAGE_DISABLE;
- static final ImageDescriptor EDITOR_ACTION1_IMAGE_ENABLE;
- static final ImageDescriptor EDITOR_ACTION2_IMAGE_ENABLE;
- static final ImageDescriptor EDITOR_ACTION3_IMAGE_ENABLE;
- static final ImageDescriptor README_WIZARD_BANNER;
-
- static {
- String iconPath = "icons/";
-
- String prefix = iconPath + "ctool16/"; //$NON-NLS-1$
- EDITOR_ACTION1_IMAGE = createImageDescriptor(prefix + "action1.gif"); //$NON-NLS-1$
- EDITOR_ACTION2_IMAGE = createImageDescriptor(prefix + "action2.gif"); //$NON-NLS-1$
- EDITOR_ACTION3_IMAGE = createImageDescriptor(prefix + "action3.gif"); //$NON-NLS-1$
-
- prefix = iconPath + "dtool16/"; //$NON-NLS-1$
- EDITOR_ACTION1_IMAGE_DISABLE = createImageDescriptor(prefix + "action1.gif"); //$NON-NLS-1$
- EDITOR_ACTION2_IMAGE_DISABLE = createImageDescriptor(prefix + "action2.gif"); //$NON-NLS-1$
- EDITOR_ACTION3_IMAGE_DISABLE = createImageDescriptor(prefix + "action3.gif"); //$NON-NLS-1$
-
- prefix = iconPath + "etool16/"; //$NON-NLS-1$
- EDITOR_ACTION1_IMAGE_ENABLE = createImageDescriptor(prefix + "action1.gif"); //$NON-NLS-1$
- EDITOR_ACTION2_IMAGE_ENABLE = createImageDescriptor(prefix + "action2.gif"); //$NON-NLS-1$
- EDITOR_ACTION3_IMAGE_ENABLE = createImageDescriptor(prefix + "action3.gif"); //$NON-NLS-1$
-
- prefix = iconPath + "wizban/"; //$NON-NLS-1$
- README_WIZARD_BANNER = createImageDescriptor(prefix + "newreadme_wiz.gif"); //$NON-NLS-1$
- }
-/**
- * Utility method to create an <code>ImageDescriptor</code>
- * from a path to a file.
- */
-private static ImageDescriptor createImageDescriptor(String path) {
- try {
- URL url = new URL(BASE_URL, path);
- return ImageDescriptor.createFromURL(url);
- } catch (MalformedURLException e) {
- }
- return ImageDescriptor.getMissingImageDescriptor();
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeMarkerResolutionGenerator.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeMarkerResolutionGenerator.java deleted file mode 100644 index 2b7012027e0..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeMarkerResolutionGenerator.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * 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.core.resources.IMarker;
-import org.eclipse.ui.IMarkerResolution;
-import org.eclipse.ui.IMarkerResolutionGenerator;
-
-/**
- * Creates resolutions for readme markers.
- */
-public class ReadmeMarkerResolutionGenerator implements IMarkerResolutionGenerator {
- /*(non-Javadoc)
- * Method declared on IMarkerResolutionGenerator.
- */
- public IMarkerResolution[] getResolutions(IMarker marker) {
- return new IMarkerResolution[] {new AddSentenceResolution()};
- }
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeModelFactory.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeModelFactory.java deleted file mode 100644 index 187aa3f7bb3..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeModelFactory.java +++ /dev/null @@ -1,154 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import java.util.Enumeration;
-import java.util.Iterator;
-
-/**
- * Creates the sections used in the <code>ContentOutline</code>
- *
- * @see ReadmeContentOutlinePage#getContentOutline(IAdaptable)
- */
-public class ReadmeModelFactory {
- private static ReadmeModelFactory instance = new ReadmeModelFactory();
- private boolean registryLoaded = false;
- IReadmeFileParser parser = null;
-/**
- * Creates a new ReadmeModelFactory.
- */
-private ReadmeModelFactory() {
-}
-/**
- * Adds all mark elements to the list for the subtree rooted
- * at the given mark element.
- */
-protected void addSections(AdaptableList list, MarkElement element) {
- list.add(element);
- Object[] children = element.getChildren(element);
- for (int i = 0; i < children.length; ++i) {
- addSections(list, (MarkElement) children[i]);
- }
-}
-/**
- * Returns the content outline for the given Readme file.
- *
- * @param adaptable the element for which to return the content outline
- * @return the content outline for the argument
- */
-public AdaptableList getContentOutline(IAdaptable adaptable) {
- return new AdaptableList(getToc((IFile)adaptable));
-}
-/**
- * Returns the singleton readme adapter.
- */
-public static ReadmeModelFactory getInstance() {
- return instance;
-}
-/**
- * Returns a list of all sections in this readme file.
- *
- * @param file the file for which to return section heading and subheadings
- * @return A list containing headings and subheadings
- */
-public AdaptableList getSections(IFile file) {
- MarkElement[] topLevel = getToc(file);
- AdaptableList list = new AdaptableList();
- for (int i = 0; i < topLevel.length; i++) {
- addSections(list, topLevel[i]);
- }
- return list;
-}
-/**
- * Convenience method. Looks for a readme file in the selection,
- * and if one is found, returns the sections for it. Returns null
- * if there is no readme file in the selection.
- */
-public AdaptableList getSections(ISelection sel) {
- // If sel is not a structured selection just return.
- if (!(sel instanceof IStructuredSelection))
- return null;
- IStructuredSelection structured = (IStructuredSelection)sel;
-
- //if the selection is a readme file, get its sections.
- Object object = structured.getFirstElement();
- if (object instanceof IFile) {
- IFile file = (IFile) object;
- String extension = file.getFileExtension();
- if (extension != null && extension.equals(IReadmeConstants.EXTENSION)) {
- return getSections(file);
- }
- }
-
- //the selected object is not a readme file
- return null;
-}
-/**
- * Parses the contents of the Readme file by looking for lines
- * that start with a number.
- *
- * @param file the file representing the Readme file
- * @return an element collection representing the table of contents
- */
-private MarkElement[] getToc(IFile file) {
- if (registryLoaded == false) loadParser();
- return parser.parse(file);
-}
-/**
- * Loads the parser from the registry by searching for
- * extensions that satisfy our published extension point.
- * For the sake of simplicity, we will pick the last extension,
- * allowing tools to override what is used. In a more
- * elaborate tool, all the extensions would be processed.
- */
-private void loadParser() {
- IPluginRegistry pluginRegistry = Platform.getPluginRegistry();
- IExtensionPoint point = pluginRegistry.getExtensionPoint(IReadmeConstants.PLUGIN_ID, IReadmeConstants.PP_SECTION_PARSER);
- if (point != null) {
- IExtension[] extensions = point.getExtensions();
- for (int i = 0; i < extensions.length; i++) {
- IExtension currentExtension = extensions[i];
- // in a real application, we would collection
- // the entire list and probably expose it
- // as a drop-down list. For the sake
- // of simplicity, we will pick the last extension only.
- if (i == extensions.length - 1) {
- IConfigurationElement[] configElements = currentExtension.getConfigurationElements();
- for (int j = 0; j < configElements.length; j++) {
- IConfigurationElement config = configElements[i];
- if (config.getName().equals(IReadmeConstants.TAG_PARSER)) {
- // process the first 'parser' element and stop
- processParserElement(config);
- break;
- }
- }
- }
- }
- }
- if (parser == null)
- parser = new DefaultSectionsParser();
- registryLoaded = true;
-}
-/**
- * Tries to create the Readme file parser. If an error occurs during
- * the creation of the parser, print an error and set the parser
- * to null.
- *
- * @param element the element to process
- */
-private void processParserElement(IConfigurationElement element) {
- try {
- parser = (IReadmeFileParser)element.createExecutableExtension(IReadmeConstants.ATT_CLASS);
- } catch (CoreException e) {
- // since this is an example just write to the console
- System.out.println(MessageUtil.getString("Unable_to_create_file_parser") + e.getStatus().getMessage()); //$NON-NLS-1$
- parser = null;
- }
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePlugin.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePlugin.java deleted file mode 100644 index 6b1b57be51d..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePlugin.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.runtime.*;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-
-/**
- * This is the top-level class of the Readme plugin tool.
- *
- * @see AbstractUIPlugin for additional information on UI plugins
- */
-public class ReadmePlugin extends AbstractUIPlugin {
- // Default instance of the receiver
-
- private static ReadmePlugin inst;
-/**
- * Creates the Readme plugin and caches its default instance
- *
- * @param descriptor the plugin descriptor which the receiver is made from
- */
-public ReadmePlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- if (inst==null) inst = this;
-}
-/**
- * Gets the plugin singleton.
- *
- * @return the default ReadmePlugin instance
- */
-static public ReadmePlugin getDefault() {
- return inst;
-}
-/**
- * Sets default preference values. These values will be used
- * until some preferences are actually set using Preference dialog.
- */
-protected void initializeDefaultPreferences(IPreferenceStore store) {
- // These settings will show up when Preference dialog
- // opens up for the first time.
- store.setDefault(IReadmeConstants.PRE_CHECK1, true);
- store.setDefault(IReadmeConstants.PRE_CHECK2, true);
- store.setDefault(IReadmeConstants.PRE_CHECK3, false);
- store.setDefault(IReadmeConstants.PRE_RADIO_CHOICE, 2);
- store.setDefault(IReadmeConstants.PRE_TEXT, MessageUtil.getString("Default_text")); //$NON-NLS-1$
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePreferencePage.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePreferencePage.java deleted file mode 100644 index 0ee7d336032..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePreferencePage.java +++ /dev/null @@ -1,310 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.ui.*;
-import org.eclipse.ui.help.*;
-import org.eclipse.jface.preference.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.events.*;
-
-/**
- * This class implements a sample preference page that is
- * added to the preference dialog based on the registration.
- */
-public class ReadmePreferencePage extends PreferencePage implements IWorkbenchPreferencePage, SelectionListener, ModifyListener {
- private Button radioButton1;
- private Button radioButton2;
- private Button radioButton3;
-
- private Button checkBox1;
- private Button checkBox2;
- private Button checkBox3;
-
- private Text textField;
-
- private Button pushButton_textField;
-/**
- * Creates an new checkbox instance and sets the default
- * layout data.
- *
- * @param group the composite in which to create the checkbox
- * @param label the string to set into the checkbox
- * @return the new checkbox
- */
-private Button createCheckBox(Composite group, String label) {
- Button button = new Button(group, SWT.CHECK | SWT.LEFT);
- button.setText(label);
- button.addSelectionListener(this);
- GridData data = new GridData();
- button.setLayoutData(data);
- return button;
-}
-/**
- * Creates composite control and sets the default layout data.
- *
- * @param parent the parent of the new composite
- * @param numColumns the number of columns for the new composite
- * @return the newly-created coposite
- */
-private Composite createComposite(Composite parent, int numColumns) {
- Composite composite = new Composite(parent, SWT.NULL);
-
- //GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
-
- //GridData
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
- return composite;
-}
-/** (non-Javadoc)
- * Method declared on PreferencePage
- */
-protected Control createContents(Composite parent)
-{
- WorkbenchHelp.setHelp(parent, IReadmeConstants.PREFERENCE_PAGE_CONTEXT);
-
- //composite_textField << parent
- Composite composite_textField = createComposite(parent, 2);
- Label label_textField = createLabel(composite_textField, MessageUtil.getString("Text_Field")); //$NON-NLS-1$
- textField = createTextField(composite_textField);
- pushButton_textField = createPushButton(composite_textField, MessageUtil.getString("Change")); //$NON-NLS-1$
-
- //composite_tab << parent
- Composite composite_tab = createComposite(parent, 2);
- Label label1 = createLabel(composite_tab, MessageUtil.getString("Radio_Button_Options")); //$NON-NLS-1$
-
- //
- tabForward(composite_tab);
- //radio button composite << tab composite
- Composite composite_radioButton = createComposite(composite_tab, 1);
- radioButton1 = createRadioButton(composite_radioButton, MessageUtil.getString("Radio_button_1")); //$NON-NLS-1$
- radioButton2 = createRadioButton(composite_radioButton, MessageUtil.getString("Radio_button_2")); //$NON-NLS-1$
- radioButton3 = createRadioButton(composite_radioButton, MessageUtil.getString("Radio_button_3")); //$NON-NLS-1$
-
-
- //composite_tab2 << parent
- Composite composite_tab2 = createComposite(parent, 2);
- Label label2 = createLabel(composite_tab2, MessageUtil.getString("Check_Box_Options")); //$NON-NLS-1$
-
- //
- tabForward(composite_tab2);
- //composite_checkBox << composite_tab2
- Composite composite_checkBox = createComposite(composite_tab2, 1);
- checkBox1 = createCheckBox(composite_checkBox, MessageUtil.getString("Check_box_1")); //$NON-NLS-1$
- checkBox2 = createCheckBox(composite_checkBox, MessageUtil.getString("Check_box_2")); //$NON-NLS-1$
- checkBox3 = createCheckBox(composite_checkBox, MessageUtil.getString("Check_box_3")); //$NON-NLS-1$
-
- initializeValues();
-
- //font = null;
- return new Composite(parent, SWT.NULL);
-}
-/**
- * Utility method that creates a label instance
- * and sets the default layout data.
- *
- * @param parent the parent for the new label
- * @param text the text for the new label
- * @return the new label
- */
-private Label createLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
- GridData data = new GridData();
- data.horizontalSpan = 2;
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
- return label;
-}
-/**
- * Utility method that creates a push button instance
- * and sets the default layout data.
- *
- * @param parent the parent for the new button
- * @param label the label for the new button
- * @return the newly-created button
- */
-private Button createPushButton(Composite parent, String label) {
- Button button = new Button(parent, SWT.PUSH);
- button.setText(label);
- button.addSelectionListener(this);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- button.setLayoutData(data);
- return button;
-}
-/**
- * Utility method that creates a radio button instance
- * and sets the default layout data.
- *
- * @param parent the parent for the new button
- * @param label the label for the new button
- * @return the newly-created button
- */
-private Button createRadioButton(Composite parent, String label) {
- Button button = new Button(parent, SWT.RADIO | SWT.LEFT);
- button.setText(label);
- button.addSelectionListener(this);
- GridData data = new GridData();
- button.setLayoutData(data);
- return button;
-}
-/**
- * Create a text field specific for this application
- *
- * @param parent the parent of the new text field
- * @return the new text field
- */
-private Text createTextField(Composite parent) {
- Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
- text.addModifyListener(this);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.verticalAlignment = GridData.CENTER;
- data.grabExcessVerticalSpace = false;
- text.setLayoutData(data);
- return text;
-}
-/**
- * The <code>ReadmePreferencePage</code> implementation of this
- * <code>PreferencePage</code> method
- * returns preference store that belongs to the our plugin.
- * This is important because we want to store
- * our preferences separately from the desktop.
- */
-protected IPreferenceStore doGetPreferenceStore() {
- return ReadmePlugin.getDefault().getPreferenceStore();
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchPreferencePage
- */
-public void init(IWorkbench workbench){
-}
-/**
- * Initializes states of the controls using default values
- * in the preference store.
- */
-private void initializeDefaults() {
- IPreferenceStore store = getPreferenceStore();
- checkBox1.setSelection(store.getDefaultBoolean(IReadmeConstants.PRE_CHECK1));
- checkBox2.setSelection(store.getDefaultBoolean(IReadmeConstants.PRE_CHECK2));
- checkBox3.setSelection(store.getDefaultBoolean(IReadmeConstants.PRE_CHECK3));
-
- radioButton1.setSelection(false);
- radioButton2.setSelection(false);
- radioButton3.setSelection(false);
- int choice = store.getDefaultInt(IReadmeConstants.PRE_RADIO_CHOICE);
- switch (choice) {
- case 1:
- radioButton1.setSelection(true);
- break;
- case 2:
- radioButton2.setSelection(true);
- break;
- case 3:
- radioButton3.setSelection(true);
- break;
- }
- textField.setText(store.getDefaultString(IReadmeConstants.PRE_TEXT));
-}
-/**
- * Initializes states of the controls from the preference store.
- */
-private void initializeValues() {
- IPreferenceStore store = getPreferenceStore();
- checkBox1.setSelection(store.getBoolean(IReadmeConstants.PRE_CHECK1));
- checkBox2.setSelection(store.getBoolean(IReadmeConstants.PRE_CHECK2));
- checkBox3.setSelection(store.getBoolean(IReadmeConstants.PRE_CHECK3));
-
- int choice = store.getInt(IReadmeConstants.PRE_RADIO_CHOICE);
- switch (choice) {
- case 1:
- radioButton1.setSelection(true);
- break;
- case 2:
- radioButton2.setSelection(true);
- break;
- case 3:
- radioButton3.setSelection(true);
- break;
- }
- textField.setText(store.getString(IReadmeConstants.PRE_TEXT));
-}
-/** (non-Javadoc)
- * Method declared on ModifyListener
- */
-public void modifyText(ModifyEvent event) {
- //Do nothing on a modification in this example
-}
-/* (non-Javadoc)
- * Method declared on PreferencePage
- */
-protected void performDefaults() {
- super.performDefaults();
- initializeDefaults();
-}
-/* (non-Javadoc)
- * Method declared on PreferencePage
- */
-public boolean performOk() {
- storeValues();
- ReadmePlugin.getDefault().savePluginPreferences();
- return true;
-}
-/**
- * Stores the values of the controls back to the preference store.
- */
-private void storeValues() {
- IPreferenceStore store = getPreferenceStore();
- store.setValue(IReadmeConstants.PRE_CHECK1, checkBox1.getSelection());
- store.setValue(IReadmeConstants.PRE_CHECK2, checkBox2.getSelection());
- store.setValue(IReadmeConstants.PRE_CHECK3, checkBox3.getSelection());
-
- int choice = 1;
-
- if (radioButton2.getSelection()) choice = 2;
- else if (radioButton3.getSelection()) choice = 3;
-
- store.setValue(IReadmeConstants.PRE_RADIO_CHOICE, choice);
- store.setValue(IReadmeConstants.PRE_TEXT, textField.getText());
-}
-/**
- * Creates a tab of one horizontal spans.
- *
- * @param parent the parent in which the tab should be created
- */
-private void tabForward(Composite parent) {
- Label vfiller = new Label(parent, SWT.LEFT);
- GridData gridData = new GridData();
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.BEGINNING;
- gridData.grabExcessHorizontalSpace = false;
- gridData.verticalAlignment = GridData.CENTER;
- gridData.grabExcessVerticalSpace = false;
- vfiller.setLayoutData(gridData);
-}
-/** (non-Javadoc)
- * Method declared on SelectionListener
- */
-public void widgetDefaultSelected(SelectionEvent event) {
- //Handle a default selection. Do nothing in this example
-}
-/** (non-Javadoc)
- * Method declared on SelectionListener
- */
-public void widgetSelected(SelectionEvent event) {
- //Do nothing on selection in this example;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeSectionsView.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeSectionsView.java deleted file mode 100644 index 29fcd4ccaaf..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeSectionsView.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ui.*;
-import org.eclipse.ui.help.*;
-import org.eclipse.ui.part.*;
-import org.eclipse.ui.model.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This class demonstrates a simple view containing a single viewer.
- */
-public class ReadmeSectionsView extends ViewPart implements ISelectionListener {
- ListViewer viewer;
-/**
- * Creates a new ReadmeSectionsView .
- */
-public ReadmeSectionsView() {
- super();
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchPart
- */
-public void createPartControl(Composite parent) {
- viewer = new ListViewer(parent);
-
- WorkbenchHelp.setHelp(viewer.getControl(), IReadmeConstants.SECTIONS_VIEW_CONTEXT);
-
- // if the objects in the viewer implement the IDesktopElement adapter,
- // these generic content and label providers can be used.
- viewer.setContentProvider(new WorkbenchContentProvider());
- viewer.setLabelProvider(new WorkbenchLabelProvider());
-
- // add myself as a global selection listener
- getSite().getPage().addSelectionListener(this);
-
- // prime the selection
- selectionChanged(null, getSite().getPage().getSelection());
-}
-/**
- * The <code>ReadmeSectionView</code> implementation of this
- * <code>IWorkbenchPart</code> method runs super
- * and removes itself from the global selection listener.
- */
-public void dispose() {
- super.dispose();
- getSite().getPage().removeSelectionListener(this);
-}
-/* (non-Javadoc)
- * Method declared on ISelectionListener
- */
-public void selectionChanged(IWorkbenchPart part, ISelection sel) {
- //if the selection is a readme file, get its sections.
- AdaptableList input = ReadmeModelFactory.getInstance().getSections(sel);
- viewer.setInput(input);
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchPart
- */
-public void setFocus() {
- viewer.getControl().setFocus();
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/SectionsDialog.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/SectionsDialog.java deleted file mode 100644 index 0c66a7bfaf7..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/SectionsDialog.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ui.model.*;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.*;
-/**
- * This dialog is an example of a detached window launched
- * from an action in the desktop.
- */
-public class SectionsDialog extends Dialog {
- protected IAdaptable input;
-/**
- * Creates a new SectionsDialog.
- */
-public SectionsDialog(Shell parentShell, IAdaptable input) {
- super(parentShell);
- this.input = input;
-}
-/* (non-Javadoc)
- * Method declared on Window.
- */
-protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(MessageUtil.getString("Readme_Sections")); //$NON-NLS-1$
- WorkbenchHelp.setHelp(newShell, IReadmeConstants.SECTIONS_DIALOG_CONTEXT);
-}
-/* (non-Javadoc)
- * Method declared on Dialog
- */
-protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite)super.createDialogArea(parent);
-
- List list = new List(composite, SWT.BORDER);
- GridData data = new GridData(GridData.FILL_BOTH);
- list.setLayoutData(data);
- ListViewer viewer = new ListViewer(list);
- viewer.setContentProvider(new WorkbenchContentProvider());
- viewer.setLabelProvider(new WorkbenchLabelProvider());
- viewer.setInput(input);
-
- return composite;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ViewActionDelegate.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ViewActionDelegate.java deleted file mode 100644 index 12614d02e4c..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ViewActionDelegate.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.ui.*;
-import org.eclipse.jface.dialogs.MessageDialog;
-
-/**
- * This class is used to demonstrate view action extensions.
- * An extension should be defined in the readme plugin.xml.
- */
-public class ViewActionDelegate implements IViewActionDelegate {
- public IViewPart view;
-/**
- * Creates a new ViewActionDelegate.
- */
-public ViewActionDelegate() {
- super();
-}
-/* (non-Javadoc)
- * Method declared on IViewActionDelegate
- */
-public void init(IViewPart view) {
- this.view = view;
-}
-/* (non-Javadoc)
- * Method declared on IActionDelegate
- */
-public void run(org.eclipse.jface.action.IAction action) {
- MessageDialog.openInformation(view.getSite().getShell(),
- MessageUtil.getString("Readme_Editor"), //$NON-NLS-1$
- MessageUtil.getString("View_Action_executed")); //$NON-NLS-1$
-}
-/* (non-Javadoc)
- * Method declared on IActionDelegate
- */
-public void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection) {}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/WindowActionDelegate.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/WindowActionDelegate.java deleted file mode 100644 index ec6df817483..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/WindowActionDelegate.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.ui.*;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This class shows how <code>IActionDelegate</code> implementations
- * should be used for global action registration for menu
- * and tool bars. Action proxy object is created in the
- * desktop based on presentation information in the plugin.xml
- * file. Delegate is not loaded until the first time the user
- * presses the button or selects the menu. Based on the action
- * availability, it is possible that the button will disable
- * instead of executing.
- */
-public class WindowActionDelegate implements IWorkbenchWindowActionDelegate {
- private IWorkbenchWindow window;
- private ISelection selection;
-/* (non-Javadoc)
- * Method declared on IWorkbenchActionDelegate
- */
-public void dispose() {}
-/* (non-Javadoc)
- * Method declared on IWorkbenchActionDelegate
- */
-public void init(IWorkbenchWindow window) {
- this.window = window;
-}
-/**
- * The <code>WindowActionDelegate</code> implementation of this
- * <code>IActionDelegate</code> method
- * launches a stand-alone dialog that contains a list of sections for
- * the selected readme file in the navigator.
- */
-public void run(IAction action) {
- SectionsDialog dialog = new SectionsDialog(window.getShell(),
- ReadmeModelFactory.getInstance().getSections(selection));
- dialog.open();
-}
-/**
- * The <code>WindowActionDelegate</code> implementation of this
- * <code>IActionDelegate</code> method
- * does nothing - we will let simple rules in the XML
- * config file react to selections.
- */
-public void selectionChanged(IAction action, ISelection selection) {
- this.selection = selection;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/messages.properties b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/messages.properties deleted file mode 100644 index 80368b8f7fd..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/messages.properties +++ /dev/null @@ -1,85 +0,0 @@ -Add=&Add
-Clean=Clean
-Save_Needed=Save Needed
-Editor_Action_executed=Editor Action executed
-Readme_Editor=Readme Editor
-Readme_Outline=Readme Outline
-Line_count=Line count
-Title_length=Title length
-Title_start=Title start
-Popup_Menu_Action_executed=Popup Menu Action executed
-Readme_Example=Readme Example
-Automatic_sample_section_generation=Automatic sample section generation
-Create_Readme_File=Create Readme File
-Create_a_new_Readme_file_resource=Create a new Readme file resource.
-Generate_sample_section_titles=&Generate sample section titles
-Generate_sample_subsection_titles=Generate sample subsection &titles
-Open_file_for_editing_when_done=&Open file for editing when done
-Readme_file_name=&Readme file name:
-SAMPLE_README_FILE=\n\n SAMPLE README FILE\n\n
-SECTION_1=1. SECTION 1\n
-SECTION_1_BODY_1=This text is a placeholder for the section body.\n
-SECTION_2=2. SECTION 2\n
-SECTION_2_BODY_1=This text is a placeholder for the section body. It is\n
-SECTION_2_BODY_2=a bit longer in order to span two lines.\n
-Subsection_1_1=\ \ \ 1.1 Subsection\n
-Subsection_1_1_Body_1=\ \ \ This text is a placeholder for the subsection body\n
-Subsection_2_1=\ \ \ 2.1 Subsection\n
-Subsection_2_1_BODY_1=\ \ \ This text is a placeholder for the subsection body\n
-Subsection_2_2=\ \ \ 2.2 Subsection\n
-Subsection_2_2_BODY_1=\ \ \ This text is a placeholder for the subsection body\n
-New_Readme_File=New Readme File
-Exception_in_readme_drop_adapter=Exception in readme drop adapter:
-Editor_Action1=Editor Action &1
-Editor_Action2=Editor Action &2
-Editor_Action3=Editor Action &3
-Editor_Action4=Editor Action &4
-Editor_Action5=Editor Action &5
-Outline_Action2=Outline Action &2
-Outline_Action3=Outline Action &3
-Outline_Action4=Outline Action &4
-Outline_Action5=Outline Action &5
-Editor_is_active=Editor is active
-Empty_Editor_Name=Empty
-Readme_Editor_Action1=Readme Editor Action 1
-Readme_Editor_Action2=Readme Retarget Editor Action 2
-Readme_Editor_Action3=Readme Label Retarget Editor Action 3
-Readme_Editor_Action5=Readme Label Retarget Editor Action 5
-Readme_Outline_Action3=Readme Label Retarget Outline Action 3
-Readme_Outline_Action5=Readme Label Retarget Outline Action 5
-Readme_Menu=&Readme
-ReadmeEditorActionExecuted=Readme Editor Action executed: {0} for: {1}
-ReadmeOutlineActionExecuted=Readme Outline Action executed
-<Unknown>=<Unknown>
-<file_contents_not_local>=<file contents not local>
-Additional_information=Additional information about the Readme file can go here.
-File_name=File name:
-Number_of_sections=Number of sections:
-Path=Path:
-Size=Size:
-Additional_Readme_properties_not_available.=Additional Readme properties not available.
-Had_it_been_less_than_256_bytes_this_page_would_be_a_placeholder_page.=Had it been less than 256 bytes, this page would be a placeholder page.
-The_size_of_the_Readme_file_is_at_least_256_bytes.=The size of the Readme file is at least 256 bytes.
-This_illustrates_a_property_page_that_is_dynamically_determined=This illustrates a property page that is dynamically determined
-not_to_be_available_based_on_the_state_of_the_object.=not to be available based on the state of the object.
-to_be_available_based_on_the_state_of_the_object.=to be available based on the state of the object.
-Unable_to_create_file_parser=Unable to create file parser.
-Default_text=Default text
-Change=Chan&ge
-Check_Box_Options=Check Box Options
-Check_box_1=&Check box 1
-Check_box_2=C&heck box 2
-Check_box_3=Check bo&x 3
-Radio_Button_Options=Radio Button Options
-Radio_button_1=&Radio button 1
-Radio_button_2=Rad&io button 2
-Radio_button_3=Radio b&utton 3
-Text_Field=&Text Field
-Readme_Sections=Readme Sections
-View_Action_executed=View Action executed
-Add_Sentence=Add Sentence
-Resolution_Error=Resolution Error
-Unable_to_open_file_editor=Unable to open file editor
-Simple_sentence=This is a simple sentence.\n
-Readme_marker_message_example=Readme marker example
-Add_readme_marker_action_label=Readme Marker Example &
\ No newline at end of file diff --git a/examples/org.eclipse.ui.examples.readmetool/HelpContexts.xml b/examples/org.eclipse.ui.examples.readmetool/HelpContexts.xml deleted file mode 100644 index 6bf7c3c2fd7..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/HelpContexts.xml +++ /dev/null @@ -1,104 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-
-<contexts>
-
- <context id="open_browser_action_context" >
- <description>Opens the readme browser </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 3 - Temporary"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 4 - Temporary"/>
- </context>
- <context id="view_action_context" >
- <description>Runs a readme view action <b>Help</b> </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 3 - Temporary"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 4 - Temporary"/>
- </context>
- <context id="editor_action_context" >
- <description>Runs a readme editor action <b>Help</b> </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 3 - Temporary"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 4 - Temporary"/>
- </context>
- <context id="editor_action1_context" >
- <description>Runs readme editor action 1 <b>Help</b> </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 3 - Temporary"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 4 - Temporary"/>
- </context>
- <context id="editor_action2_context" >
- <description>Runs readme editor action 2 <b>Help</b> </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 3 - Temporary"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 4 - Temporary"/>
- </context>
- <context id="editor_action3_context" >
- <description>Runs readme editor action 3 <b>Help</b> </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 3 - Temporary"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 4 - Temporary"/>
- </context>
-
- <context id="sections_view_context" >
- <description>Readme sections view <b>Help</b> </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 3 - Temporary"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 4 - Temporary"/>
- </context>
-
- <context id="sections_dialog_context" >
- <description>Readme sections dialog <b>Help</b> </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 3 - Temporary"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 4 - Temporary"/>
- </context>
-
- <context id="preference_page_context" >
- <description>Readme preference page <b>Help</b> </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 3 - Temporary"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 4 - Temporary"/>
- </context>
-
- <context id="property_page_context" >
- <description>Readme property page <b>Help</b> </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 3 - Temporary"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 4 - Temporary"/>
- </context>
- <context id="property_page2_context" >
- <description>Readme property page2 <b>Help</b> </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 3 - Temporary"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 4 - Temporary"/>
- </context>
-
- <context id="editor_context" >
- <description>Readme editor <b>Help</b> </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 3 - Temporary"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 4 - Temporary"/>
- </context>
-
- <context id="content_outline_page_context" >
- <description>Readme editor content outline <b>Help</b> </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 3 - Temporary"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 4 - Temporary"/>
- </context>
-
- <context id="creation_wizard_page_context" >
- <description>Readme file creation wizard <b>Help</b> </description>
- <topic href="contexts/RelatedContext3.html" label="Help Related Topic 3 - Temporary"/>
- <topic href="contexts/RelatedContext4.html" label="Help Related Topic 4 - Temporary"/>
- </context>
-
- <context id="marker_example1_context" >
- <description>Readme marker example 1 <b>Help</b> id = 1234 </description>
- </context>
- <context id="marker_example2_context" >
- <description>Readme marker example 2 <b>Help</b> level = 7 </description>
- </context>
- <context id="marker_example3_context" >
- <description>Readme marker example 3 <b>Help</b> level = 7, department = infra </description>
- </context>
- <context id="marker_example4_context" >
- <description>Readme marker example 4 <b>Help</b> code = red </description>
- </context>
- <context id="marker_example5_context" >
- <description>Readme marker example 5 <b>Help</b> language = english </description>
- </context>
- <context id="marker_example6_context" >
- <description>Readme marker example 6 <b>Help</b> id = 1234, level = 7, department = infra, code = red, language = english </description>
- </context>
- <context id="marker_example7_context" >
- <description>Readme marker example 7 <b>Help</b> No attributes specified </description>
- </context>
-</contexts>
\ No newline at end of file diff --git a/examples/org.eclipse.ui.examples.readmetool/about.html b/examples/org.eclipse.ui.examples.readmetool/about.html deleted file mode 100644 index 9db411aab99..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/about.html +++ /dev/null @@ -1,30 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> -<html> -<head> -<title>About</title> -<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1"> -</head> -<body lang="EN-US"> -<h2>About This Content</h2> - -<p>20th June, 2002</p> -<h3>License</h3> -<p>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 <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>. -For purposes of the CPL, "Program" will mean the Content.</p> - -<h3>Contributions</h3> - -<p>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.</p> - -<p>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.</p> - -</body> -</html>
\ No newline at end of file diff --git a/examples/org.eclipse.ui.examples.readmetool/build.properties b/examples/org.eclipse.ui.examples.readmetool/build.properties deleted file mode 100644 index 80dd4c0accd..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/build.properties +++ /dev/null @@ -1,14 +0,0 @@ -source.readmetool.jar = Eclipse UI Examples Readme Tool/
-
-bin.includes = doc/,\
- doc-html/,\
- icons/,\
- .options,\
- about.html,\
- doc.zip,\
- HelpContexts.xml,\
- plugin.properties,\
- plugin.xml,\
- *.jar
-
-src.includes = about.html
diff --git a/examples/org.eclipse.ui.examples.readmetool/doc-html/hglegal.htm b/examples/org.eclipse.ui.examples.readmetool/doc-html/hglegal.htm deleted file mode 100644 index b071dbdf45b..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/doc-html/hglegal.htm +++ /dev/null @@ -1,14 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.73 [en] (Win98; U) [Netscape]">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright IBM Corp. 2000, 2001. All Rights Reserved.
-</body>
-</html>
diff --git a/examples/org.eclipse.ui.examples.readmetool/doc-html/ngibmcpy.gif b/examples/org.eclipse.ui.examples.readmetool/doc-html/ngibmcpy.gif Binary files differdeleted file mode 100644 index 360f8e99891..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/doc-html/ngibmcpy.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/doc-html/ui_readmetool_ex.html b/examples/org.eclipse.ui.examples.readmetool/doc-html/ui_readmetool_ex.html deleted file mode 100644 index 796eb7656ff..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/doc-html/ui_readmetool_ex.html +++ /dev/null @@ -1,165 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Desktop - Readme Tool Example</title>
-</head>
-<body>
-
-<h2>
-<b>Example - Readme Tool</b></h2>
-
-<h3>
-Introduction</h3>
-The Readme editor shows how to define your own extension points for use
-by other plugins. It also shows how to create extensions for resource popup
-menu entries, new resource wizards, file editors on an extension (.readme),
-a custom view and property pages.
-<h3>
-Running the example</h3>
-To start using this example create a file with the .readme extension using
-the file creation wizard or create one using the example creation wizard.
-The additional view provided by this example can be seen by selecting
-Perspectives > Show View > Other and expanding the Readme section. The
-view action can be seen by clicking on the readme icon on the Navigator
-View.
-<h4>
-Creating a new readme file</h4>
-Create a new file with file extension .readme. From the File menu,
-select New and then select Other... from the sub menu. Click on Simple
-in the wizard, then select File in the list on the left. Click on
-Next to supply the file name (make sure the extension is .readme) and the
-folder in which the file should be contained.
-<h4>
-Example creation wizards</h4>
-From the File menu, select New and from the sub menu select Other...
-Now select Example Creation Wizards. Select Readme File. Click Next. Select
-the folder in which you want the file to be created. Type the name of the
-file with a .readme extension. Click Finish.
-<h4>
-Readme view extension action</h4>
-In the Navigator View, select a file with extension .readme. If there isn't
-one create a file with that extension. On the local toolbar of the Navigator
-View, you will see a button whose hover help says Run Readme View Extension.
-Click on this button. A dialog will popup saying View Action executed.
-<h4>
-Popup menus</h4>
-In the Navigator View, select a file with extension .readme. If there
-isn't one create a file with that extension. Select the file to bring
-up the popup menu. Notice there is a menu item that says Show Readme
-Action in the popup menu. Choose this menu item to open a dialog
-that says Popup Menu Action Executed.
-<h4>
-Preference page</h4>
-From the Window menu, select Preferences. Click on the page called
-Readme Example. This shows an example of a preference page.
-<h4>
-Property page</h4>
-In the Navigator View, select a file with extension .readme. If there
-isn't one create a file with that extension. Select the file to bring
-up the popup menu, then select the Properties menu item. Click on
-the page called Readme Tool to see an example of a property page.
-<h4>
-Readme file editor</h4>
-The Readme File Editor is the default editor for files of type *.readme.
-Create a file with extension .readme and open the file by double clicking
-on it, or by bringing up the popup menu, selecting Open With, then
-selecting Readme File Editor from the sub menu. Notice the editor
-has an icon with a pencil. This is the editor that the readme tool
-uses by default for files of type *.readme.
-<h4>
-Readme Editor Actions</h4>
-This demonstrates an example of actions that are applicable only to a particular
-editor. When a readme file editor has focus, notice 4 additional
-tool bar buttons - Run Readme Editor Extension, Readme Editor Action 1,
-Readme Editor Action 2, Readme Editor Action 3.
-<p>A pull down menu named Readme appears when a readme file editor has
-focus. It contains the actions previously described: Readme Editor
-Action 1, Readme Editor Action 2, Readme Editor Action 3.
-<h4>
-Readme sections view</h4>
-To see this Readme Sections view, from the Window menu select Show
-View, then select Other... from the sub menu. Expand the Readme item
-and then select Readme Sections. This will show a list of the sections
-in the current *.readme file when a .readme file is selected in the Navigator
-View. You can also see the structure of a *.readme file in the Outline
-view.
-<p>A file with extension .readme can be broken down into sections when
-each section begins with a number. For example, if the following
-text were entered into the readme file editor, the readme tool would detect
-2 sections. To see how sections are detected in the readme tool,
-type some text in the readme file editor, save the file by either typing
-CTRL-S or selecting File->Save. Open the Readme Sections view and
-select the .readme file in the Navigator View.
-<p>Example text:
-<p>99.1 This is my first section
-<br>This is some text in my first section.
-<p>99.1.1 This is a sub section
-<br>This is some text in my sub-section.
-<h4>Drag and Drop</h4>
-<p>The Drag and Drop functionality can be seen by selecting a section in the
-Outline View and dragging the selection over top of a text file. The contents of
-the selection will be appended to the file.
-<h4>
-Help contribution</h4>
-The readme tool example also demonstrates how to use and implement context
-help on all of the extensions it supplies - a view, various actions and
-a wizard page. To get context help on an action, hover over the menu
-item, but do no select it, then hit the F1 key. You can also get
-context sensitive (F1) help on the Readme Sections view and the Example
-Creation Wizards page (in the New wizard).
-<br>
-<h3>
-Details</h3>
-The Readme Tool example declares one extension point and supplies a number
-of extensions. The extensions supplied are quite comprehensive in
-understanding how the Workbench functions, as it utilizes a number of the
-more interesting extension points declared by the workbench. Supplied
-extensions included in this example are views and view actions, preference
-pages, property pages, wizards, editors and editor actions, popup menus,
-action sets, help contributions, help contexts, and drop actions.
-<p>This example also supplies an extension point declared in the plug-in..
-The class IReadmeFileParser is required for any plug-in that uses the org.eclipse.ui.examples.readmetool.sectionParser
-extension that this example defines. The class DefaultSectionParser is
-an example implementation of IReadmeFileParser.
-<p>The class ReadmeEditor implements IEditorPart and is defined as an editor
-on files with the extension .readme in the plugin.xml using the org.eclipse.ui.editors
-extension point. The class ReadmeSectionsView implements IViewPart and
-is defined as a view using the org.eclipse.ui.views extension point. This
-extension point also defines a category for the view for use in view selection.
-<p>Two types of preference settings are defined in this example, workbench
-preferences and resource properties. The workbench preference is defined
-in class ReadmePreferencePage which implements IWorkbenchPreferencePage
-so that it will be added to the Workbench->Preferences dialog. The class
-is defined in the extension point org.eclipse.ui.preferencePages in the
-plugin.xml. The two resource properties pages are ReadmeFilePropertyPage
-and ReadmeFilePropertyPage2 both of which implement IWorkbenchPropertyPage.
-They are both defined to be invoked on the IFile type by the objectClass
-tag in the plugin.xml in the org.eclipse.ui.propertyPages extension point.
-<p>The class ReadmeCreationWizard implements INewWizard and is defined
-in the org.eclipse.ui.newWizards extension point in the plugin.xml. This
-extension point also defines the category that the wizard that is shown
-when the user selects File->New->Other....
-<p>Several action stubs are added to this example. The action set declares
-a menu labeled Readme File Editor<b> </b>to be included in the workbench
-window menu bar using the extension point org.eclipse.ui.actionSets. It
-also defines an action for the workbench toolbar and menu bar using the
-tags toolbarPath and menubarPath. It uses the class WindowActionDelegate
-which implements IWorkbenchWindowActionDelegate to implement the action.
-The action for the popup menu is defined as an objectContribution by the
-class PopupMenuActionDelegate in the extension point org.eclipse.ui.popupMenus.
-PopupMenuActionDelegate implements IObjectActionDelegate and uses the IWorkbenchPart
-provided to open a message dialog. The view action ViewActionDelegate is
-defined in the extension point org.eclipse.ui.viewActions and implements
-IViewActionDelegate. The View it appears in is defined by the tag targetID
-which in this example is org.eclipse.ui.views.ResourceNavigator. The editor
-action is defined by the class EditorActionDelegate which implements IEditorActionDelegate
-and is added using the org.eclipse.ui.editorActions extension point. The
-editor that it is applied to is defined by the tag targetID which in this
-example is defined on org.eclipse.ui.examples.readmetool.ReadmeEditor.<p>The
-class ReadmeDropActionDelegate implements IDropDelegate. IDropDelegates are
-informed every time there is a drop action performed in the workbench . The
-extension point for this action is org.eclipse.ui.dropActions.
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corp. 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a>
-</body>
-</html>
diff --git a/examples/org.eclipse.ui.examples.readmetool/doc.zip b/examples/org.eclipse.ui.examples.readmetool/doc.zip Binary files differdeleted file mode 100644 index 41e8aa99d43..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/doc.zip +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/doc/hglegal.htm b/examples/org.eclipse.ui.examples.readmetool/doc/hglegal.htm deleted file mode 100644 index b071dbdf45b..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/doc/hglegal.htm +++ /dev/null @@ -1,14 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.73 [en] (Win98; U) [Netscape]">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright IBM Corp. 2000, 2001. All Rights Reserved.
-</body>
-</html>
diff --git a/examples/org.eclipse.ui.examples.readmetool/doc/ngibmcpy.gif b/examples/org.eclipse.ui.examples.readmetool/doc/ngibmcpy.gif Binary files differdeleted file mode 100644 index 360f8e99891..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/doc/ngibmcpy.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/doc/org_eclipse_ui_examples_readmetool.html b/examples/org.eclipse.ui.examples.readmetool/doc/org_eclipse_ui_examples_readmetool.html deleted file mode 100644 index aed1eca6490..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/doc/org_eclipse_ui_examples_readmetool.html +++ /dev/null @@ -1,28 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Readme Tool Extension Points</title>
-</head>
-<body link="#0000FF" vlink="#800080">
-
-<center>
-<h1>
-Readme Tool</h1></center>
-The Readme Tool is provided as an example for tool developers. It demonstrates
-the extension of various aspects of the workbench, both visually and functionally.
-As well, the Readme Tool provides extension points of its own.
-<p>
-<hr WIDTH="100%">
-<h1>
-Extension Points</h1>
-The following extension points can be used to extend the Readme Tool:
-<ul>
-<li>
-<a href="org_eclipse_ui_examples_readmetool_sectionParser.html">org.eclipse.ui.readmetool.sectionParser</a></li>
-</ul>
-
-<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved." width="195" height="12" border="0"></a></p>
-
-</body>
-</html>
diff --git a/examples/org.eclipse.ui.examples.readmetool/doc/org_eclipse_ui_examples_readmetool_sectionParser.html b/examples/org.eclipse.ui.examples.readmetool/doc/org_eclipse_ui_examples_readmetool_sectionParser.html deleted file mode 100644 index 7c889f663e6..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/doc/org_eclipse_ui_examples_readmetool_sectionParser.html +++ /dev/null @@ -1,65 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>README Tool Extension Points</title>
-</head>
-<body link="#0000FF" vlink="#800080">
-
-<center>
-<h1>
-Section Parser</h1></center>
-<b><i>Identifier: </i></b>org.eclipse.ui.examples.readmetool.sectionParser
-<p><b><i>Description: </i></b>This extension point allows tools to provide
-a parser for Readme files which identifies the sections of the file.
-The sections determined by this parser will show up in the outliner when a
-Readme file is open in the editor. The sections will also appear in the
-"Readme sections" view.
-<p>The default section parser provided with the Readme Tool is a simple parser
-which considers sections to be numbered at the beginning of a line. Top-level
-sections are signified by a number followed by a period, such as in the following
-regular expression: "[0-9]+\.". Examples are "1.", "0.", and "12345.".
-Subsections are signified by the regular expression: "([0-9]+\.)+[0-9]+". Examples
-of subsections are "1.1", "1.1.1.1", and "123.456.7890". Any level of subsection
-nesting may occur. Section and subsection markers must occur before any other
-non-whitespace characters on a line.
-<p><b><i>Configuration Markup:</i></b>
-<p><tt> <!ATTLIST sectionParser</tt>
-<br><tt> name CDATA #REQUIRED</tt>
-<br><tt> id CDATA #REQUIRED</tt>
-<br><tt> class CDATA #REQUIRED</tt>
-<br><tt> ></tt>
-<ul>
-<li>
-<b>name</b> - a string describing this contribution.</li>
-
-<li>
-<b>id</b> - a unique identifier that can be used to reference this extension.</li>
-
-<li>
-<b>class</b> - a fully qualified name of the class which provides this extension.</li>
-</ul>
-
-<b><i>Examples:</i></b>
-<p>The following is an example of a sectionParser extension point:
-<p><tt> <extension point="org.eclipse.ui.examples.readmetool.sectionParser"></tt>
-<br><tt> <parser</tt>
-<br><tt> name="Custom README Section Parser"</tt>
-<br><tt> id="com.xyz.CustomSectionParser"</tt>
-<br><tt> class="com.xyz.CustomSectionParser"></tt>
-<br><tt> </parser></tt>
-<br><tt> </extension></tt>
-<p>In the example above, the class com.xyz.CustomSectionParser will be used as
-the section parser for Readme files.
-<p><b><i>API Information: </i></b>Value of the action attribute <b>class</b>
-must be a fully qualified class name of a Java class that implements the interface
-org.eclipse.ui.examples.readmetool.IReadmeFileParser. This interface is loaded as
-late as possible to avoid loading the entire tool before it is really needed.
-<p><b><i>Supplied Implementation: </i></b>As described above, the default section
-parser uses a simple grammar of sections identified by numbers followed by periods,
-and subsections identified by the pattern of a number followed by a period, repeated
-an arbitrary number of times, and ending with a number.
-<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved." width="195" height="12" border="0"></a></p>
-
-</body>
-</html>
diff --git a/examples/org.eclipse.ui.examples.readmetool/icons/ctool16/action1.gif b/examples/org.eclipse.ui.examples.readmetool/icons/ctool16/action1.gif Binary files differdeleted file mode 100644 index 91077ef103c..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/icons/ctool16/action1.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/icons/ctool16/action2.gif b/examples/org.eclipse.ui.examples.readmetool/icons/ctool16/action2.gif Binary files differdeleted file mode 100644 index c2a3e178ab6..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/icons/ctool16/action2.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/icons/ctool16/action3.gif b/examples/org.eclipse.ui.examples.readmetool/icons/ctool16/action3.gif Binary files differdeleted file mode 100644 index 9c14f74246c..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/icons/ctool16/action3.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/icons/ctool16/openbrwsr.gif b/examples/org.eclipse.ui.examples.readmetool/icons/ctool16/openbrwsr.gif Binary files differdeleted file mode 100644 index 6d40439b49c..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/icons/ctool16/openbrwsr.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/icons/dtool16/action1.gif b/examples/org.eclipse.ui.examples.readmetool/icons/dtool16/action1.gif Binary files differdeleted file mode 100644 index 0c50830b6e4..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/icons/dtool16/action1.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/icons/dtool16/action2.gif b/examples/org.eclipse.ui.examples.readmetool/icons/dtool16/action2.gif Binary files differdeleted file mode 100644 index 3f978df7327..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/icons/dtool16/action2.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/icons/dtool16/action3.gif b/examples/org.eclipse.ui.examples.readmetool/icons/dtool16/action3.gif Binary files differdeleted file mode 100644 index f9f1e958bc6..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/icons/dtool16/action3.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/icons/dtool16/openbrwsr.gif b/examples/org.eclipse.ui.examples.readmetool/icons/dtool16/openbrwsr.gif Binary files differdeleted file mode 100644 index 02a2df85a67..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/icons/dtool16/openbrwsr.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/icons/etool16/action1.gif b/examples/org.eclipse.ui.examples.readmetool/icons/etool16/action1.gif Binary files differdeleted file mode 100644 index 55fb1a678c7..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/icons/etool16/action1.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/icons/etool16/action2.gif b/examples/org.eclipse.ui.examples.readmetool/icons/etool16/action2.gif Binary files differdeleted file mode 100644 index f801d2edbaa..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/icons/etool16/action2.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/icons/etool16/action3.gif b/examples/org.eclipse.ui.examples.readmetool/icons/etool16/action3.gif Binary files differdeleted file mode 100644 index 5e199b1aeb1..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/icons/etool16/action3.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/icons/etool16/openbrwsr.gif b/examples/org.eclipse.ui.examples.readmetool/icons/etool16/openbrwsr.gif Binary files differdeleted file mode 100644 index bdbe8ca878e..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/icons/etool16/openbrwsr.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/icons/obj16/editor.gif b/examples/org.eclipse.ui.examples.readmetool/icons/obj16/editor.gif Binary files differdeleted file mode 100644 index c48d9a95677..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/icons/obj16/editor.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/icons/obj16/newreadme_wiz.gif b/examples/org.eclipse.ui.examples.readmetool/icons/obj16/newreadme_wiz.gif Binary files differdeleted file mode 100644 index 293826dfe06..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/icons/obj16/newreadme_wiz.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/icons/obj16/usereditor.gif b/examples/org.eclipse.ui.examples.readmetool/icons/obj16/usereditor.gif Binary files differdeleted file mode 100644 index 64d79074260..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/icons/obj16/usereditor.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/icons/view16/sections.gif b/examples/org.eclipse.ui.examples.readmetool/icons/view16/sections.gif Binary files differdeleted file mode 100644 index 008fd7ada9a..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/icons/view16/sections.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/icons/wizban/newreadme_wiz.gif b/examples/org.eclipse.ui.examples.readmetool/icons/wizban/newreadme_wiz.gif Binary files differdeleted file mode 100644 index 3265aafae75..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/icons/wizban/newreadme_wiz.gif +++ /dev/null diff --git a/examples/org.eclipse.ui.examples.readmetool/plugin.properties b/examples/org.eclipse.ui.examples.readmetool/plugin.properties deleted file mode 100644 index 1c0dd7abafa..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/plugin.properties +++ /dev/null @@ -1,27 +0,0 @@ -Plugin.name = Readme File Editing Tool
-Plugin.providerName = Eclipse.org
-ExtPoint.sectionParser = Section parser for Readme file editor
-SectionParser.name = Default section parser for Readme tool
-ActionSet.name = ReadMe Actions
-ActionSet.menu = Readme &File Editor
-ReadmeAction.label = &Open Readme Browser
-ReadmeAction.tooltip = Open Readme Browser
-ReadmeRetargetAction.label = &Open Readme Browser (Retarget)
-ReadmeRetargetAction.tooltip = Open Readme Browser (Retarget)
-ReadmeRelabelRetargetAction.label = &Open Readme Browser (Retarget - Label Update)
-ReadmeRelabelRetargetAction.tooltip = Open Readme Browser (Retarget - Label Update)
-NewWizard.category = Example Creation Wizards
-NewWizard.name = Readme File
-NewWizard.desc = An example of a wizard that creates sample Readme file
-Editors.ReadmeEditor = &Readme File Editor
-Views.category = &Readme
-Views.ReadmeSections = Readme Sections
-PreferencePage.name = Readme Example
-PropertiesPage.filePage = Readme Tool
-PropertiesPage.filePage2 = More Readme Info
-PopupMenus.action = &Show Readme Action
-PopupMenu.ResourceNav.label = &Readme View Extension
-PopupMenu.ResourceNav.tooltip = Run Readme View Extension
-Editors.Action.label = &Readme Editor Extension
-Editors.Action.tooltip = Run Readme Editor Extension
-ReadmeMarker.name = Readme Marker
\ No newline at end of file diff --git a/examples/org.eclipse.ui.examples.readmetool/plugin.xml b/examples/org.eclipse.ui.examples.readmetool/plugin.xml deleted file mode 100644 index 5a57d0a2037..00000000000 --- a/examples/org.eclipse.ui.examples.readmetool/plugin.xml +++ /dev/null @@ -1,307 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ======================================================================= -->
-<!-- The Readme tool is a sample plugin which demonstrates many available -->
-<!-- extension points provided by the workbench, as well as providing its -->
-<!-- own extension point for other plugins to use. -->
-<!-- ======================================================================= -->
-<plugin
- name = "%Plugin.name"
- id = "org.eclipse.ui.examples.readmetool"
- version = "2.0.0"
- provider-name = "%Plugin.providerName"
- class="org.eclipse.ui.examples.readmetool.ReadmePlugin">
-
- <requires>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.resources"/>
- </requires>
-
- <runtime>
- <library name="readmetool.jar"/>
- </runtime>
-
- <!-- ================================================================== -->
- <!-- Extension point: org.eclipse.ui.examples.readmetool.sectionParser -->
- <!-- Purpose: Provide a custom parser for Readme files which determines -->
- <!-- the file's section and subsection structure -->
- <!-- Extension Implementation: must implement -->
- <!-- org.eclipse.ui.examples.readmetool.IReadmeFileParser -->
- <!-- ================================================================== -->
- <extension-point name="%ExtPoint.sectionParser" id="sectionParser"/>
-
- <extension
- point="org.eclipse.ui.examples.readmetool.sectionParser">
- <parser
- name="%SectionParser.name"
- id="org.eclipse.ui.examples.readmetool.DefaultSectionsParser"
- class="org.eclipse.ui.examples.readmetool.DefaultSectionsParser">
- </parser>
- </extension>
-
- <extension point = "org.eclipse.ui.actionSets">
- <actionSet id="org_eclipse_ui_examples_readmetool_actionSet"
- label="%ActionSet.name"
- visible="true">
- <menu id="org_eclipse_ui_examples_readmetool"
- label="%ActionSet.menu"
- path="window/additions">
- <separator name="slot1"/>
- <separator name="slot2"/>
- <separator name="slot3"/>
- </menu>
- <action id="org_eclipse_ui_examples_readmetool_readmeAction"
- menubarPath="window/org_eclipse_ui_examples_readmetool/slot1"
- toolbarPath="readme"
- label="%ReadmeAction.label"
- tooltip="%ReadmeAction.tooltip"
- helpContextId="org.eclipse.ui.examples.readmetool.open_browser_action_context"
- icon="icons/ctool16/openbrwsr.gif"
- class="org.eclipse.ui.examples.readmetool.WindowActionDelegate"
- enablesFor="1">
- <selection class="org.eclipse.core.resources.IFile"
- name="*.readme">
- </selection>
- </action>
- <action id="org_eclipse_ui_examples_readmetool_readmeRetargetAction"
- menubarPath="window/org_eclipse_ui_examples_readmetool/slot1"
- toolbarPath="readme"
- label="%ReadmeRetargetAction.label"
- tooltip="%ReadmeRetargetAction.tooltip"
- helpContextId="org.eclipse.ui.examples.readmetool.open_browser_action_context"
- icon="icons/ctool16/openbrwsr.gif"
- retarget="true">
- </action>
- <action id="org_eclipse_ui_examples_readmetool_readmeRelabelRetargetAction"
- menubarPath="window/org_eclipse_ui_examples_readmetool/slot1"
- toolbarPath="readme"
- label="%ReadmeRelabelRetargetAction.label"
- tooltip="%ReadmeRelabelRetargetAction.tooltip"
- helpContextId="org.eclipse.ui.examples.readmetool.open_browser_action_context"
- icon="icons/ctool16/openbrwsr.gif"
- retarget="true"
- allowLabelUpdate="true">
- </action>
- </actionSet>
- </extension>
-
- <extension
- point = "org.eclipse.ui.newWizards">
- <category
- id = "org.eclipse.ui.examples.readmetool.new"
- parentCategory="org.eclipse.ui.Examples"
- name="%NewWizard.category">
- </category>
- <wizard
- id = "org.eclipse.ui.examples.readmetool.wizards.new.file"
- name = "%NewWizard.name"
- class="org.eclipse.ui.examples.readmetool.ReadmeCreationWizard"
- category="org.eclipse.ui.Examples/org.eclipse.ui.examples.readmetool.new"
- icon="icons/obj16/newreadme_wiz.gif">
- <description>%NewWizard.desc</description>
- <selection class="org.eclipse.core.resources.IResource"/>
- </wizard>
- </extension>
-
- <extension
- point = "org.eclipse.ui.editors">
- <editor
- id = "org.eclipse.ui.examples.readmetool.ReadmeEditor"
- name="%Editors.ReadmeEditor"
- icon="icons/obj16/editor.gif"
- class="org.eclipse.ui.examples.readmetool.ReadmeEditor"
- extensions="readme"
- contributorClass="org.eclipse.ui.examples.readmetool.ReadmeEditorActionBarContributor">
- </editor>
- </extension>
-
-
- <extension
- point="org.eclipse.ui.views">
- <category
- id="org.eclipse.ui.examples.readmetool"
- name="%Views.category">
- </category>
- <view
- id="org.eclipse.ui.examples.readmetool.views.SectionsView"
- name="%Views.ReadmeSections"
- icon="icons/view16/sections.gif"
- category="org.eclipse.ui.examples.readmetool"
- class="org.eclipse.ui.examples.readmetool.ReadmeSectionsView">
- </view>
- </extension>
-
- <extension
- point = "org.eclipse.ui.preferencePages">
- <page id="org.eclipse.ui.examples.readmetool.Page1"
- class="org.eclipse.ui.examples.readmetool.ReadmePreferencePage"
- name="%PreferencePage.name">
- </page>
- </extension>
-
- <extension
- point = "org.eclipse.ui.propertyPages">
- <page
- id="org.eclipse.ui.examples.readmetool.FilePage"
- name="%PropertiesPage.filePage"
- objectClass="org.eclipse.core.resources.IFile"
- class="org.eclipse.ui.examples.readmetool.ReadmeFilePropertyPage"
- nameFilter="*.readme">
- </page>
- <page
- id="org.eclipse.ui.examples.readmetool.FilePage2"
- name="%PropertiesPage.filePage2"
- objectClass="org.eclipse.core.resources.IFile"
- class="org.eclipse.ui.examples.readmetool.ReadmeFilePropertyPage2"
- nameFilter="*.readme">
- </page>
- </extension>
-
- <extension point = "org.eclipse.ui.popupMenus">
- <objectContribution
- id="org.eclipse.ui.examples.readmetool"
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.readme">
- <action id="org.eclipse.ui.examples.readmetool.action1"
- label="%PopupMenus.action"
- icon="icons/ctool16/openbrwsr.gif"
- menubarPath="additions"
- helpContextId="org.eclipse.ui.examples.readmetool.open_browser_action_context"
- class="org.eclipse.ui.examples.readmetool.PopupMenuActionDelegate"
- enablesFor="1">
- </action>
- </objectContribution>
- <viewerContribution
- id="org.eclipse.ui.examples.readmetool2"
- targetID="org.eclipse.ui.examples.readmetool.outline">
- <action id="org.eclipse.ui.examples.readmetool.action1"
- label="%PopupMenus.action"
- icon="icons/ctool16/openbrwsr.gif"
- menubarPath="additions"
- helpContextId="org.eclipse.ui.examples.readmetool.open_browser_action_context"
- class="org.eclipse.ui.examples.readmetool.ViewActionDelegate">
- </action>
- </viewerContribution>
- </extension>
-
-<extension
- point = "org.eclipse.ui.viewActions">
- <viewContribution
- id="org.eclipse.ui.examples.readmetool.vc1"
- targetID="org.eclipse.ui.views.ResourceNavigator">
- <action id="org.eclipse.ui.examples.readmetool.va1"
- label="%PopupMenu.ResourceNav.label"
- menubarPath="additions"
- toolbarPath="additions"
- icon="icons/obj16/editor.gif"
- tooltip="%PopupMenu.ResourceNav.tooltip"
- helpContextId="org.eclipse.ui.examples.readmetool.view_action_context"
- class="org.eclipse.ui.examples.readmetool.ViewActionDelegate"
- enablesFor="1">
- <selection class="org.eclipse.core.resources.IFile" name="*.readme"/>
- </action>
- </viewContribution>
- </extension>
-
-<extension
- point = "org.eclipse.ui.editorActions">
- <editorContribution
- id="org.eclipse.ui.examples.readmetool.ec1"
- targetID="org.eclipse.ui.examples.readmetool.ReadmeEditor">
- <action id="org.eclipse.ui.examples.readmetool.ea1"
- label="%Editors.Action.label"
- toolbarPath="ReadmeEditor"
- icon="icons/obj16/editor.gif"
- tooltip="%Editors.Action.tooltip"
- class="org.eclipse.ui.examples.readmetool.EditorActionDelegate"
- />
- </editorContribution>
- </extension>
-
- <extension point="org.eclipse.help.contexts">
- <contexts name="HelpContexts.xml"/>
- </extension>
-
- <extension
- point="org.eclipse.ui.dropActions">
- <action
- id="org_eclipse_ui_examples_readmetool_drop_actions"
- class="org.eclipse.ui.examples.readmetool.ReadmeDropActionDelegate">
- </action>
- </extension>
-
- <extension id="readmemarker" point="org.eclipse.core.resources.markers" name="%ReadmeMarker.name">
- <super type="org.eclipse.core.resources.taskmarker"/>
- <super type="org.eclipse.core.resources.textmarker"/>
- <persistent value="true"/>
- <attribute name="org.eclipse.ui.examples.readmetool.id"/>
- <attribute name="org.eclipse.ui.examples.readmetool.level"/>
- <attribute name="org.eclipse.ui.examples.readmetool.department"/>
- <attribute name="org.eclipse.ui.examples.readmetool.code"/>
- <attribute name="org.eclipse.ui.examples.readmetool.language"/>
- </extension>
-
- <extension point="org.eclipse.ui.markerHelp">
- <markerHelp
- markerType="org.eclipse.ui.examples.readmetool.readmemarker"
- helpContextId="org.eclipse.ui.examples.readmetool.marker_example1_context">
- <attribute name="org.eclipse.ui.examples.readmetool.id" value= "1234"/>
- </markerHelp>
- <markerHelp
- markerType="org.eclipse.ui.examples.readmetool.readmemarker"
- helpContextId="org.eclipse.ui.examples.readmetool.marker_example2_context">
- <attribute name="org.eclipse.ui.examples.readmetool.level" value= "7"/>
- </markerHelp>
- <markerHelp
- markerType="org.eclipse.ui.examples.readmetool.readmemarker"
- helpContextId="org.eclipse.ui.examples.readmetool.marker_example3_context">
- <attribute name="org.eclipse.ui.examples.readmetool.level" value= "7"/>
- <attribute name="org.eclipse.ui.examples.readmetool.department" value= "infra"/>
- </markerHelp>
- <markerHelp
- markerType="org.eclipse.ui.examples.readmetool.readmemarker"
- helpContextId="org.eclipse.ui.examples.readmetool.marker_example4_context">
- <attribute name="org.eclipse.ui.examples.readmetool.code" value= "red"/>
- </markerHelp>
- <markerHelp
- markerType="org.eclipse.ui.examples.readmetool.readmemarker"
- helpContextId="org.eclipse.ui.examples.readmetool.marker_example5_context">
- <attribute name="org.eclipse.ui.examples.readmetool.language" value= "english"/>
- </markerHelp>
- <markerHelp
- markerType="org.eclipse.ui.examples.readmetool.readmemarker"
- helpContextId="org.eclipse.ui.examples.readmetool.marker_example6_context">
- <attribute name="org.eclipse.ui.examples.readmetool.id" value= "1234"/>
- <attribute name="org.eclipse.ui.examples.readmetool.level" value= "7"/>
- <attribute name="org.eclipse.ui.examples.readmetool.department" value= "infra"/>
- <attribute name="org.eclipse.ui.examples.readmetool.code" value= "red"/>
- <attribute name="org.eclipse.ui.examples.readmetool.language" value= "english"/>
- </markerHelp>
- <markerHelp
- markerType="org.eclipse.ui.examples.readmetool.readmemarker"
- helpContextId="org.eclipse.ui.examples.readmetool.marker_example7_context">
- </markerHelp>
- </extension>
-
- <extension point="org.eclipse.ui.markerResolution">
- <markerResolutionGenerator
- class="org.eclipse.ui.examples.readmetool.ReadmeMarkerResolutionGenerator"
- markerType="org.eclipse.ui.examples.readmetool.readmemarker">
- <attribute name="org.eclipse.ui.examples.readmetool.id" value= "1234"/>
- </markerResolutionGenerator>
- <markerResolutionGenerator
- class="org.eclipse.ui.examples.readmetool.ReadmeMarkerResolutionGenerator"
- markerType="org.eclipse.ui.examples.readmetool.readmemarker">
- <attribute name="org.eclipse.ui.examples.readmetool.level" value= "7"/>
- </markerResolutionGenerator>
- <markerResolutionGenerator
- class="org.eclipse.ui.examples.readmetool.ReadmeMarkerResolutionGenerator"
- markerType="org.eclipse.ui.examples.readmetool.readmemarker">
- <attribute name="org.eclipse.ui.examples.readmetool.code" value= "red"/>
- <attribute name="org.eclipse.ui.examples.readmetool.language" value= "english"/>
- </markerResolutionGenerator>
-</extension>
-
-
-
-</plugin>
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/.classpath b/tests/org.eclipse.ui.tests/.classpath deleted file mode 100644 index 6e87e010d0b..00000000000 --- a/tests/org.eclipse.ui.tests/.classpath +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="UI Test Utils"/> - <classpathentry kind="src" path="Eclipse JFace Tests"/> - <classpathentry kind="src" path="Eclipse UI Tests"/> - <classpathentry kind="src" path="/org.junit"/> - <classpathentry kind="src" path="/org.eclipse.ui"/> - <classpathentry kind="src" path="/org.eclipse.swt"/> - <classpathentry kind="src" path="/org.eclipse.core.resources"/> - <classpathentry kind="src" path="/org.eclipse.core.runtime"/> - <classpathentry kind="var" path="ECLIPSE_HOME/startup.jar"/> - <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/> - <classpathentry kind="src" path="Benchmark Tests"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/tests/org.eclipse.ui.tests/.cvsignore b/tests/org.eclipse.ui.tests/.cvsignore deleted file mode 100644 index c5e82d74585..00000000000 --- a/tests/org.eclipse.ui.tests/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/.project b/tests/org.eclipse.ui.tests/.project deleted file mode 100644 index fc0e6088b52..00000000000 --- a/tests/org.eclipse.ui.tests/.project +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.ui.tests</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.core.resources</project>
- <project>org.eclipse.core.runtime</project>
- <project>org.eclipse.swt</project>
- <project>org.eclipse.ui</project>
- <project>org.junit</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.ui.tests/Benchmark Tests/org/eclipse/ui/tests/benchmarks/OpenCloseTest.java b/tests/org.eclipse.ui.tests/Benchmark Tests/org/eclipse/ui/tests/benchmarks/OpenCloseTest.java deleted file mode 100644 index bfb2ee08947..00000000000 --- a/tests/org.eclipse.ui.tests/Benchmark Tests/org/eclipse/ui/tests/benchmarks/OpenCloseTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.eclipse.ui.tests.benchmarks; - -/* - * 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.ui.tests.util.UITestCase; - -/** - * @version 1.0 - * @author - */ -public class OpenCloseTest extends UITestCase { - - /** - * Constructor for OpenCloseTest. - * @param testName - */ - public OpenCloseTest(String testName) { - super(testName); - } - - /** - * Tests that the Navigator is initially populated with - * the correct elements from the workspace. - */ - public void testOpenClose() { - } - -} diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/preferences/FontPreferenceTestCase.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/preferences/FontPreferenceTestCase.java deleted file mode 100644 index 636cbb9cb78..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/preferences/FontPreferenceTestCase.java +++ /dev/null @@ -1,118 +0,0 @@ -package org.eclipse.jface.tests.preferences;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.ui.tests.util.UITestCase;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.resource.FontRegistry;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- * The FontPreferenceTestCase tests adding fonts to
- * the preference store and what occurs if the values
- * are bogus
- */
-
-public class FontPreferenceTestCase extends UITestCase {
-
- public String BAD_FONT_DEFINITION = "BadFont-regular-10";
- public String TEST_FONT_ID = "org.eclipse.jface.tests.preference.testfont";
- public String MISSING_FONT_ID =
- "org.eclipse.jface.tests.preference.missingfont";
-
- private IPreferenceStore preferenceStore;
-
- /**
- * Constructor for FontPreferenceTestCase.
- * @param testName
- */
- public FontPreferenceTestCase(String testName) {
- super(testName);
- }
-
- /*
- * @see TestCase#setUp
- */
- protected void setUp() throws Exception {
- super.setUp();
- AbstractUIPlugin plugin =
- (AbstractUIPlugin) Platform.getPlugin(PlatformUI.PLUGIN_ID);
- preferenceStore = plugin.getPreferenceStore();
-
- FontRegistry registry = JFaceResources.getFontRegistry();
- //Set up the bogus entry for the bad first test
- FontData bogusData = new FontData();
- bogusData.setName("BadData");
- bogusData.setHeight(11);
- FontData[] storedValue = new FontData[2];
-
- //We assume here that the text font is OK
- storedValue[0] = bogusData;
- storedValue[1] =
- (PreferenceConverter
- .getDefaultFontDataArray(preferenceStore, JFaceResources.TEXT_FONT))[0];
- PreferenceConverter.setValue(preferenceStore,TEST_FONT_ID,storedValue);
- PreferenceConverter.setDefault(preferenceStore,TEST_FONT_ID,storedValue);
-
- }
-
-
- /**
- * Test for a valid font like the test font. The first good one
- * we should find should be the first one in the list.
- */
-
- public void testGoodFontDefinition(){
-
- FontRegistry fontRegistry = JFaceResources.getFontRegistry();
- FontData[] currentTextFonts =
- PreferenceConverter.getFontDataArray(preferenceStore, JFaceResources.TEXT_FONT);
- FontData bestFont = fontRegistry.bestData(currentTextFonts,Display.getCurrent());
-
- //Assert that it is the first font that we get as the
- //valid one
- assertEquals(bestFont.getName(),currentTextFonts[0].getName());
- assertEquals(bestFont.getHeight(),currentTextFonts[0].getHeight());
- }
-
- /**
- * Test that if the first font in the list is bad that the
- * second one comes back as valid.
- */
-
- public void testBadFirstFontDefinition(){
-
- FontRegistry fontRegistry = JFaceResources.getFontRegistry();
- FontData[] currentTestFonts =
- PreferenceConverter.getFontDataArray(preferenceStore, TEST_FONT_ID);
- FontData bestFont = fontRegistry.bestData(currentTestFonts,Display.getCurrent());
-
- //Assert that it is the second font that we get as the
- //valid one
- assertEquals(bestFont.getName(),currentTestFonts[1].getName());
- assertEquals(bestFont.getHeight(),currentTestFonts[1].getHeight());
- }
-
- /**
- * Test that the no valid font is returned when the entry
- * is missing.
- */
-
- public void testNoFontDefinition(){
-
- FontRegistry fontRegistry = JFaceResources.getFontRegistry();
- FontData[] currentTestFonts =
- PreferenceConverter.getFontDataArray(preferenceStore, MISSING_FONT_ID);
- FontData bestFont = fontRegistry.bestData(currentTestFonts,Display.getCurrent());
-
- FontData[] systemFontData = Display.getCurrent().getSystemFont().getFontData();
-
- //Assert that the first font is the system font
- assertEquals(bestFont.getName(),systemFontData[0].getName());
- assertEquals(bestFont.getHeight(),systemFontData[0].getHeight());
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AbstractTreeViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AbstractTreeViewerTest.java deleted file mode 100644 index 0a3931801f1..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AbstractTreeViewerTest.java +++ /dev/null @@ -1,173 +0,0 @@ -package org.eclipse.jface.tests.viewers;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-
-import org.eclipse.jface.*;
-import org.eclipse.jface.resource.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import java.util.*;
-import junit.framework.*;
-
-public abstract class AbstractTreeViewerTest extends StructuredItemViewerTest {
-
- AbstractTreeViewer fTreeViewer;
-
- public AbstractTreeViewerTest(String name) {
- super(name);
- }
- protected void assertEqualsArray(String s, Object[] a1, Object[] a2) {
- int s1= a1.length;
- int s2= a2.length;
- assertTrue(s, s1 == s2);
- for (int i= 0; i < s1; i++) {
- assertEquals(s, a1[i], a2[i]);
- }
- }
- protected abstract int getItemCount(TestElement element); //was IElement
-public void testBulkExpand() {
- // navigate
- TestElement first = fRootElement.getFirstChild();
- TestElement first2 = first.getFirstChild();
- TestElement last = fRootElement.getLastChild();
-
- // expand a few nodes
- fTreeViewer.expandToLevel(first, 2);
- fTreeViewer.expandToLevel(first2, 2);
- fTreeViewer.expandToLevel(last, 2);
-
- // get expand state
- Object[] list1 = fTreeViewer.getExpandedElements();
-
- // flush viewer
- fViewer.setInput(fRootElement);
-
- // restore old expand state
- fTreeViewer.collapseAll();
- fTreeViewer.expandToLevel(first, 2);
- fTreeViewer.expandToLevel(first2, 2);
- fTreeViewer.expandToLevel(last, 2);
-
- Object[] list2 = fTreeViewer.getExpandedElements();
-
- assertEqualsArray("old and new expand state are the same", list1, list2);
-}
- public void testDeleteChildExpanded() {
- TestElement first= fRootElement.getFirstChild();
- TestElement first2= first.getFirstChild();
- fTreeViewer.expandToLevel(first2,0);
-
- assertNotNull("first child is visible", fViewer.testFindItem(first2));
- first.deleteChild(first2);
- assertNull("first child is not visible", fViewer.testFindItem(first2));
- }
- public void testDeleteChildren() {
- TestElement first= fRootElement.getFirstChild();
- first.deleteChildren();
- assertTrue("no children", getItemCount(first) == 0);
- }
- public void testDeleteChildrenExpanded() {
- TestElement first= fRootElement.getFirstChild();
- TestElement first2= first.getFirstChild();
- fTreeViewer.expandToLevel(first2,0);
- assertNotNull("first child is visible", fViewer.testFindItem(first2));
-
- first.deleteChildren();
- assertTrue("no children", getItemCount(first) == 0);
- }
- public void testExpand() {
- TestElement first= fRootElement.getFirstChild();
- TestElement first2= first.getFirstChild();
- assertNull("first child is not visible", fViewer.testFindItem(first2));
- fTreeViewer.expandToLevel(first2,0);
- assertNotNull("first child is visible", fViewer.testFindItem(first2));
- }
-public void testExpandElement() {
- TestElement first = fRootElement.getFirstChild();
- TestElement first2 = first.getFirstChild();
- TestElement first3 = first2.getFirstChild();
- fTreeViewer.expandToLevel(first3, 0);
- assertNotNull("first3 is visible", fViewer.testFindItem(first3));
- assertNotNull("first2 is visible", fViewer.testFindItem(first2));
-}
- public void testExpandToLevel() {
- TestElement first= fRootElement.getFirstChild();
- TestElement first2= first.getFirstChild();
- fTreeViewer.expandToLevel(2);
- assertNotNull("first2 is visible", fViewer.testFindItem(first2));
- }
- public void testFilterExpanded() {
- TestElement first= fRootElement.getFirstChild();
- TestElement first2= first.getFirstChild();
- fTreeViewer.expandToLevel(first2,0);
-
- fTreeViewer.addFilter(new TestLabelFilter());
- assertTrue("filtered count", getItemCount() == 5);
- }
- public void testInsertChildReveal() {
- TestElement first= fRootElement.getFirstChild();
- TestElement newElement= first.addChild(TestModelChange.INSERT | TestModelChange.REVEAL);
- assertNotNull("new sibling is visible", fViewer.testFindItem(newElement));
- }
- public void testInsertChildRevealSelect() {
- TestElement last= fRootElement.getLastChild();
- TestElement newElement= last.addChild(TestModelChange.INSERT | TestModelChange.REVEAL | TestModelChange.SELECT);
- assertNotNull("new sibling is visible", fViewer.testFindItem(newElement));
- assertSelectionEquals("new element is selected", newElement);
- }
- public void testInsertChildRevealSelectExpanded() {
- TestElement first= fRootElement.getFirstChild();
- TestElement newElement= first.addChild(TestModelChange.INSERT | TestModelChange.REVEAL | TestModelChange.SELECT);
- assertNotNull("new sibling is visible", fViewer.testFindItem(newElement));
- assertSelectionEquals("new element is selected", newElement);
- }
- /**
- * Regression test for 1GDN0PX: ITPUI:WIN2000 - SEVERE - AssertionFailure when expanding Navigator
- * Problem was:
- * - before addition, parent item had no children, and was expanded
- * - after addition, during refresh(), updatePlus() added dummy node even though parent item was expanded
- * - in updateChildren, it wasn't handling a dummy node
- */
- public void testRefreshWithAddedChildren() {
- TestElement parent = fRootElement.addChild(TestModelChange.INSERT);
- TestElement child = parent.addChild(TestModelChange.INSERT);
- ((AbstractTreeViewer) fViewer).setExpandedState(parent, true);
- parent.deleteChild(child);
- child = parent.addChild(TestModelChange.STRUCTURE_CHANGE);
- assertNotNull("new child is visible", fViewer.testFindItem(child));
- }
- /**
- * Regression test for 1GBDB5A: ITPUI:WINNT - Exception in AbstractTreeViewer update.
- * Problem was:
- * node has child A
- * node gets duplicate child A
- * viewer is refreshed rather than using add for new A
- * AbstractTreeViewer.updateChildren(...) was not properly handling it
- */
- public void testRefreshWithDuplicateChild() {
- TestElement first= fRootElement.getFirstChild();
- TestElement newElement= (TestElement) first.clone();
- fRootElement.addChild(newElement, new TestModelChange(TestModelChange.STRUCTURE_CHANGE, fRootElement));
- assertNotNull("new sibling is visible", fViewer.testFindItem(newElement));
- }
- public void testRenameChildElement() {
- TestElement first= fRootElement.getFirstChild();
- TestElement first2= first.getFirstChild();
- fTreeViewer.expandToLevel(first2,0);
- assertNotNull("first child is visible", fViewer.testFindItem(first2));
-
- String newLabel= first2.getLabel()+" changed";
- first2.setLabel(newLabel);
- Widget widget= fViewer.testFindItem(first2);
- assertTrue(widget instanceof Item);
- assertEquals("changed label", first2.getID()+" "+newLabel, ((Item)widget).getText());
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AllTests.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AllTests.java deleted file mode 100644 index c825d97eeea..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AllTests.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.jface.tests.viewers;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import junit.framework.*;
-
-public class AllTests {
-
- public static void main(String[] args) {
- junit.textui.TestRunner.run(suite());
- }
- public static Test suite() {
- TestSuite suite= new TestSuite();
- suite.addTest(new TestSuite(TreeViewerTest.class));
- suite.addTest(new TestSuite(TableViewerTest.class));
- suite.addTest(new TestSuite(TableTreeViewerTest.class));
- suite.addTest(new TestSuite(ListViewerTest.class));
- suite.addTest(new TestSuite(CheckboxTableViewerTest.class));
- suite.addTest(new TestSuite(CheckboxTreeViewerTest.class));
- return suite;
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/CheckboxTableViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/CheckboxTableViewerTest.java deleted file mode 100644 index eee39ad0ac0..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/CheckboxTableViewerTest.java +++ /dev/null @@ -1,131 +0,0 @@ -package org.eclipse.jface.tests.viewers;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-
-import org.eclipse.jface.*;
-import org.eclipse.jface.resource.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.*;
-import java.util.*;
-import junit.framework.*;
-
-
-public class CheckboxTableViewerTest extends TableViewerTest {
-public static class CheckboxTableTestLabelProvider
- extends TestLabelProvider
- implements ITableLabelProvider {
-
- public boolean fExtended = false;
-
- public String getText(Object element) {
- if (fExtended)
- return providedString((String) element);
- return element.toString();
- }
- public String getColumnText(Object element, int index) {
- if (fExtended)
- return providedString((TestElement) element);
- return element.toString();
- }
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-}
- public CheckboxTableViewerTest(String name) {
- super(name);
- }
-protected StructuredViewer createViewer(Composite parent) {
- Table table = new Table(parent, SWT.CHECK | SWT.BORDER);
- table.setLinesVisible(true);
- TableLayout layout = new TableLayout();
- table.setLayout(layout);
- table.setHeaderVisible(true);
-
- String headers[] = { "column 1 header", "column 2 header" };
-
- ColumnLayoutData layouts[] =
- { new ColumnWeightData(100), new ColumnWeightData(100)};
-
- final TableColumn columns[] = new TableColumn[headers.length];
-
- for (int i = 0; i < headers.length; i++) {
- layout.addColumnData(layouts[i]);
- TableColumn tc = new TableColumn(table, SWT.NONE, i);
- tc.setResizable(layouts[i].resizable);
- tc.setText(headers[i]);
- columns[i] = tc;
- }
-
- TableViewer viewer = new CheckboxTableViewer(table);
- viewer.setContentProvider(new TestModelContentProvider());
- viewer.setLabelProvider(new TableTestLabelProvider());
- return viewer;
-}
- public static void main(String args[]) {
- junit.textui.TestRunner.run(CheckboxTableViewerTest.class);
- }
- public void testCheckAllElements() {
- CheckboxTableViewer ctv= (CheckboxTableViewer)fViewer;
- ctv.setAllChecked(true);
- assertTrue(ctv.getChecked(fRootElement.getFirstChild()));
- assertTrue(ctv.getChecked(fRootElement.getLastChild()));
- ctv.setAllChecked(false);
- assertTrue(!ctv.getChecked(fRootElement.getFirstChild()));
- assertTrue(!ctv.getChecked(fRootElement.getLastChild()));
- }
- public void testGrayAllElements() {
- CheckboxTableViewer ctv= (CheckboxTableViewer)fViewer;
- ctv.setAllGrayed(true);
- assertTrue(ctv.getGrayed(fRootElement.getFirstChild()));
- assertTrue(ctv.getGrayed(fRootElement.getLastChild()));
- ctv.setAllGrayed(false);
- assertTrue(!ctv.getGrayed(fRootElement.getFirstChild()));
- assertTrue(!ctv.getGrayed(fRootElement.getLastChild()));
- }
- public void testGrayed() {
- CheckboxTableViewer ctv= (CheckboxTableViewer)fViewer;
- TestElement element= fRootElement.getFirstChild();
-
- assertTrue(ctv.getGrayedElements().length == 0);
- assertTrue(!ctv.getGrayed(element));
-
- ctv.setGrayed(element, true);
- assertTrue(ctv.getGrayedElements().length == 1);
- assertTrue(ctv.getGrayed(element));
-
- ctv.setGrayed(element, false);
- assertTrue(ctv.getGrayedElements().length == 0);
- assertTrue(!ctv.getGrayed(element));
-
- ctv.setAllGrayed(false);
- }
- public void testGrayedElements() {
- CheckboxTableViewer ctv= (CheckboxTableViewer)fViewer;
- TestElement first= fRootElement.getFirstChild();
- TestElement last= fRootElement.getLastChild();
-
- assertTrue(ctv.getGrayedElements().length == 0);
- assertTrue(!ctv.getGrayed(first));
- assertTrue(!ctv.getGrayed(last));
-
- ctv.setGrayed(first, true);
- ctv.setGrayed(last, true);
- Object[] elements= ctv.getGrayedElements();
- assertTrue(elements.length == 2);
- assertTrue(elements[0] == first);
- assertTrue(elements[1] == last);
-
- ctv.setGrayed(first, false);
- ctv.setGrayed(last, false);
- assertTrue(ctv.getGrayedElements().length == 0);
-
- ctv.setAllGrayed(false);
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/CheckboxTreeViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/CheckboxTreeViewerTest.java deleted file mode 100644 index 61c0a5551aa..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/CheckboxTreeViewerTest.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.eclipse.jface.tests.viewers;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-
-import org.eclipse.jface.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import junit.framework.*;
-import java.util.*;
-
-public class CheckboxTreeViewerTest extends TreeViewerTest {
- public static class CheckboxTableTestLabelProvider
- extends TestLabelProvider
- implements ITableLabelProvider {
-
- public boolean fExtended = false;
-
- public String getText(Object element) {
- if (fExtended)
- return providedString((String) element);
- return element.toString();
- }
- public String getColumnText(Object element, int index) {
- if (fExtended)
- return providedString((TestElement) element);
- return element.toString();
- }
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
- }
- public CheckboxTreeViewerTest(String name) {
- super(name);
- }
- protected StructuredViewer createViewer(Composite parent) {
- fTreeViewer = new CheckboxTreeViewer(parent);
- fTreeViewer.setContentProvider(new TestModelContentProvider());
- return fTreeViewer;
- }
- public static void main(String args[]) {
- junit.textui.TestRunner.run(CheckboxTreeViewerTest.class);
- }
- public void testCheckSubtree() {
- CheckboxTreeViewer ctv = (CheckboxTreeViewer) fViewer;
- TestElement first = fRootElement.getFirstChild();
- TestElement firstfirst = first.getFirstChild();
- TestElement firstfirstfirst = firstfirst.getFirstChild();
- fTreeViewer.expandToLevel(firstfirst, 0);
-
- ctv.setSubtreeChecked(first, true);
- assertTrue(ctv.getChecked(firstfirst));
- ctv.setSubtreeChecked(first, false);
- assertTrue(!ctv.getChecked(firstfirst));
-
- // uncheck invisible subtree
- assertTrue(ctv.setSubtreeChecked(firstfirstfirst, false));
- assertTrue(!ctv.getChecked(firstfirstfirst));
- }
- public void testGrayed() {
- CheckboxTreeViewer ctv = (CheckboxTreeViewer) fViewer;
- TestElement element = fRootElement.getFirstChild();
-
- assertTrue(ctv.getGrayedElements().length == 0);
- assertTrue(!ctv.getGrayed(element));
-
- ctv.setGrayed(element, true);
- assertTrue(ctv.getGrayedElements().length == 1);
- assertTrue(ctv.getGrayed(element));
-
- ctv.setGrayed(element, false);
- assertTrue(ctv.getGrayedElements().length == 0);
- assertTrue(!ctv.getGrayed(element));
- }
- public void testParentGrayed() {
- CheckboxTreeViewer ctv = (CheckboxTreeViewer) fViewer;
- TestElement first = fRootElement.getFirstChild();
- TestElement firstfirst = first.getFirstChild();
- TestElement firstfirstfirst = firstfirst.getFirstChild();
- ctv.expandToLevel(firstfirstfirst, 0);
-
- ctv.setParentsGrayed(firstfirstfirst, true);
- Object[] elements = ctv.getGrayedElements();
- assertTrue(elements.length == 3);
- for (int i = 0; i < elements.length; ++i) {
- assertTrue(ctv.getGrayed(elements[i]));
- };
-
- assertTrue(elements[0] == first);
- assertTrue(elements[1] == firstfirst);
- assertTrue(elements[2] == firstfirstfirst);
- ctv.setParentsGrayed(firstfirstfirst, false);
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ITestModelListener.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ITestModelListener.java deleted file mode 100644 index ca72f685da8..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ITestModelListener.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.eclipse.jface.tests.viewers;
-
-public interface ITestModelListener {
- public void testModelChanged(TestModelChange change);
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ListViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ListViewerTest.java deleted file mode 100644 index 83977062fbe..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ListViewerTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.eclipse.jface.tests.viewers;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.jface.viewers.*;
-import junit.framework.*;
-
-public class ListViewerTest extends StructuredViewerTest {
-
- public ListViewerTest(String name) {
- super(name);
- }
- protected StructuredViewer createViewer(Composite parent) {
- ListViewer viewer= new ListViewer(parent);
- viewer.setContentProvider(new TestModelContentProvider());
- return viewer;
- }
- protected int getItemCount() {
- TestElement first= fRootElement.getFirstChild();
- List list= (List)fViewer.testFindItem(first);
- return list.getItemCount();
- }
- protected String getItemText(int at) {
- List list= (List) fViewer.getControl();
- return list.getItem(at);
- }
- public static void main(String args[]) {
- junit.textui.TestRunner.run(ListViewerTest.class);
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/StructuredItemViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/StructuredItemViewerTest.java deleted file mode 100644 index 5ce6e94de4e..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/StructuredItemViewerTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.eclipse.jface.tests.viewers;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-
-import org.eclipse.jface.*;
-import org.eclipse.jface.resource.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import java.util.*;
-import junit.framework.*;
-
-
-public abstract class StructuredItemViewerTest extends StructuredViewerTest {
-
- public StructuredItemViewerTest(String name) {
- super(name);
- }
-public void testCheckElement() {
-
- if (fViewer instanceof ICheckable) {
- TestElement first = fRootElement.getFirstChild();
- TestElement firstfirst = first.getFirstChild();
-
- ICheckable ctv = (ICheckable) fViewer;
- ctv.setChecked(first, true);
- assertTrue(ctv.getChecked(first));
-
- // checking an invisible element
- if (fViewer instanceof AbstractTreeViewer) {
- // The first child of the first child can only be resolved in a tree
- assertTrue(ctv.setChecked(firstfirst, true));
- assertTrue(ctv.getChecked(firstfirst));
- } else {
- assertTrue(!ctv.setChecked(firstfirst, true));
- assertTrue(!ctv.getChecked(firstfirst));
- }
-
- ctv.setChecked(first, false);
- assertTrue(!ctv.getChecked(first));
- }
-}
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/StructuredSelectionTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/StructuredSelectionTest.java deleted file mode 100644 index 05a7fb203da..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/StructuredSelectionTest.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.eclipse.jface.tests.viewers;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.viewers.*;
-import java.util.*;
-import junit.framework.*;
-
-public class StructuredSelectionTest extends TestCase {
-
- public StructuredSelectionTest(String name) {
- super(name);
- }
- public static void main(String args[]) {
- junit.textui.TestRunner.run(StructuredSelectionTest.class);
- }
- public void testEquals() {
- String element= "A selection";
- StructuredSelection sel1= new StructuredSelection(element);
- StructuredSelection sel2= new StructuredSelection(element);
- assertEquals(sel1, sel2);
- }
- public void testEquals2() {
- String element1= "A selection";
- String element2= "A selection";
- String element3= "Other";
- StructuredSelection sel1= new StructuredSelection(element1);
- StructuredSelection sel2= new StructuredSelection(element2);
- StructuredSelection sel3= new StructuredSelection(element3);
- assertEquals(sel1, sel2);
- assertTrue(!sel1.equals(sel3));
- }
- public void testEquals3() { // two empty selections
- StructuredSelection empty1= new StructuredSelection();
- StructuredSelection empty2= new StructuredSelection();
- assertTrue(empty1.equals(empty2));
- assertTrue(empty2.equals(empty1));
- }
- public void testEquals4() { // empty selection with non-empty selection
- StructuredSelection sel= new StructuredSelection("A selection");
- StructuredSelection empty= new StructuredSelection();
- assertTrue(!sel.equals(empty));
- assertTrue(!empty.equals(sel));
- }
- public void testEquals5() { // equality is order-dependent
- List l1 = new ArrayList();
- l1.add("element 1");
- l1.add("element 2");
-
- List l2 = new ArrayList();
- l2.add("element 2");
- l2.add("element 1");
-
- StructuredSelection sel1 = new StructuredSelection(l1);
- StructuredSelection sel2 = new StructuredSelection(l2);
- assertTrue(!sel1.equals(sel2));
- assertTrue(!sel2.equals(sel1));
- }
- public void testEquals6() { // equality is independent from order
- List l1 = new ArrayList();
- l1.add("element 1");
- l1.add("element 2");
-
- List l2 = new ArrayList();
- l2.add("element 2");
- l2.add("element 3");
- l2.add("element 1");
-
- StructuredSelection sel1= new StructuredSelection(l1);
- StructuredSelection sel2= new StructuredSelection(l2);
- assertTrue(!sel1.equals(sel2));
- assertTrue(!sel2.equals(sel1));
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/StructuredViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/StructuredViewerTest.java deleted file mode 100644 index 420f208db1a..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/StructuredViewerTest.java +++ /dev/null @@ -1,341 +0,0 @@ -package org.eclipse.jface.tests.viewers;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import junit.framework.*;
-import org.eclipse.jface.*;
-import org.eclipse.jface.resource.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import java.util.*;
-
-public abstract class StructuredViewerTest extends TestCase {
- Display fDisplay;
- Shell fShell;
- StructuredViewer fViewer;
- TestElement fRootElement;
-
- public static class TestLabelFilter extends ViewerFilter {
- public boolean select(Viewer viewer, Object parent, Object element) {
- String label = ((TestElement) element).getLabel();
- int count = label.indexOf("-");
- if (count < 0)
- return false;
- String number = label.substring(count + 1);
- return ((Integer.parseInt(number) % 2) == 0);
- }
- public boolean isFilterProperty(Object element, String property) {
- return property.equals(IBasicPropertyConstants.P_TEXT);
- }
- };
-
- public static class TestLabelSorter extends ViewerSorter {
- public int compare(Viewer v, Object e1, Object e2) {
- // put greater labels first
- String name1 = ((TestElement) e1).getLabel();
- String name2 = ((TestElement) e2).getLabel();
- return name2.compareTo(name1);
- }
- public boolean isSorterProperty(Object element, String property) {
- return property.equals(IBasicPropertyConstants.P_TEXT);
- }
- };
-
- public static class TestLabelProvider extends LabelProvider {
- public static String fgSuffix = "";
-
- static Image fgImage = ImageDescriptor.createFromFile(TestLabelProvider.class, "images/java.gif").createImage();
-
- public String getText(Object element) {
- return providedString((TestElement) element);
- }
-
- public Image getImage(Object element) {
- return fgImage;
- }
-
- public void setSuffix(String suffix) {
- fgSuffix = suffix;
- fireLabelProviderChanged(new LabelProviderChangedEvent(this));
- }
- };
-
- public TestModel fModel;
- public StructuredViewerTest(String name) {
- super(name);
- }
-protected void assertSelectionEquals(String message, TestElement expected) {
- ISelection selection = fViewer.getSelection();
- assertTrue(selection instanceof StructuredSelection);
- StructuredSelection expectedSelection = new StructuredSelection(expected);
- assertEquals("selections", selection, expectedSelection);
-}
-protected void bulkChange(TestModelChange eventToFire) {
- TestElement first = fRootElement.getFirstChild();
- TestElement newElement = first.getContainer().basicAddChild();
- fRootElement.basicDeleteChild(first);
- fModel.fireModelChanged(eventToFire);
- assertNotNull("new sibling is visible", fViewer.testFindItem(newElement));
- assertNull("first child is not visible", fViewer.testFindItem(first));
-}
-/**
- * Creates the viewer used by this test, under the given parent widget.
- */
-protected abstract StructuredViewer createViewer(Composite parent);
- protected abstract int getItemCount();
- protected abstract String getItemText(int at);
- /**
- * Interacts with a test set up. Call this method from your
- * test when you want to interactively experiment with a set up.
- * The interaction terminates when the browser is closed.
- */
- public void interact() {
- Shell shell= fShell;
- if (shell != null && !shell.isDisposed()) {
- Display display= shell.getDisplay();
- if (display != null) {
- while (shell.isVisible())
- display.readAndDispatch();
- }
- }
- }
- protected void openBrowser() {
- fDisplay = Display.getCurrent();
- if (fDisplay == null) {
- fDisplay = new Display();
- }
- fShell = new Shell(fDisplay);
- fShell.setSize(500, 500);
- fShell.setLayout(new FillLayout());
- fViewer = createViewer(fShell);
- fViewer.setUseHashlookup(true);
- fViewer.setInput(fRootElement);
- fShell.open();
- //processEvents();
- }
-public void processEvents() {
- Shell shell = fShell;
- if (shell != null && !shell.isDisposed()) {
- Display display = shell.getDisplay();
- if (display != null) {
- while (display.readAndDispatch())
- ;
- }
- }
-}
- public static String providedString(String s) {
- return s+"<rendered>"+TestLabelProvider.fgSuffix;
- }
- public static String providedString(TestElement element) {
- return element.getID()+" "+element.getLabel()+"<rendered>"+TestLabelProvider.fgSuffix;
- }
- public void setUp() {
- fRootElement= TestElement.createModel(3, 10);
- fModel= fRootElement.getModel();
- openBrowser();
- }
- /**
- * Sleeps for the given duration and processes pending
- * events. Call this method to temporarily suspend a test
- * see the current state in the browser.
- */
- void sleep(int d) {
- processEvents();
- try {
- Thread.currentThread().sleep(d*1000);
- } catch(Exception e) {}
- }
-public void tearDown() {
- processEvents();
- fViewer = null;
- if (fShell != null) {
- fShell.dispose();
- fShell = null;
- }
- // leave the display
- fRootElement = null;
-}
- public void testClearSelection() {
- TestElement first= fRootElement.getFirstChild();
- StructuredSelection selection= new StructuredSelection(first);
- fViewer.setSelection(selection);
- fViewer.setSelection(new StructuredSelection());
- ISelection result= fViewer.getSelection();
- assertTrue(result.isEmpty());
- }
- public void testDeleteChild() {
- TestElement first= fRootElement.getFirstChild();
- TestElement first2= first.getFirstChild();
- first.deleteChild(first2);
- assertNull("first child is not visible", fViewer.testFindItem(first2));
- }
- public void testDeleteInput() {
- TestElement first= fRootElement.getFirstChild();
- TestElement firstfirst= first.getFirstChild();
- fViewer.setInput(first);
- fRootElement.deleteChild(first);
- assertNull("first child is not visible", fViewer.testFindItem(firstfirst));
- }
- public void testDeleteSibling() {
- TestElement first= fRootElement.getFirstChild();
- assertNotNull("first child is visible", fViewer.testFindItem(first));
- fRootElement.deleteChild(first);
- assertNull("first child is not visible", fViewer.testFindItem(first));
- }
- public void testFilter() {
- ViewerFilter filter= new TestLabelFilter();
- fViewer.addFilter(filter);
- assertTrue("filtered count", getItemCount() == 5);
- fViewer.removeFilter(filter);
- assertTrue("unfiltered count", getItemCount() == 10);
-
- }
- public void testInsertChild() {
- TestElement first= fRootElement.getFirstChild();
- TestElement newElement= first.addChild(TestModelChange.INSERT);
- assertNull("new sibling is not visible", fViewer.testFindItem(newElement));
- }
- public void testInsertSibling() {
- TestElement newElement= fRootElement.addChild(TestModelChange.INSERT);
- assertNotNull("new sibling is visible", fViewer.testFindItem(newElement));
- }
- public void testInsertSiblingReveal() {
- TestElement newElement= fRootElement.addChild(TestModelChange.INSERT | TestModelChange.REVEAL);
- assertNotNull("new sibling is visible", fViewer.testFindItem(newElement));
- }
- public void testInsertSiblings() {
- TestElement[] newElements = fRootElement.addChildren(TestModelChange.INSERT);
- for (int i = 0; i < newElements.length; ++i)
- assertNotNull("new siblings are visible", fViewer.testFindItem(newElements[i]));
- }
- public void testInsertSiblingSelectExpanded() {
- TestElement newElement= fRootElement.addChild(TestModelChange.INSERT | TestModelChange.REVEAL | TestModelChange.SELECT);
- assertNotNull("new sibling is visible", fViewer.testFindItem(newElement));
- assertSelectionEquals("new element is selected", newElement);
- }
- public void testInsertSiblingWithFilterFiltered() {
- fViewer.addFilter(new TestLabelFilter());
- TestElement newElement= new TestElement(fModel, fRootElement);
- newElement.setLabel("name-111");
- fRootElement.addChild(newElement,
- new TestModelChange(TestModelChange.INSERT | TestModelChange.REVEAL | TestModelChange.SELECT, fRootElement, newElement)
- );
- assertNull("new sibling is not visible", fViewer.testFindItem(newElement));
- assertTrue(getItemCount() == 5);
- }
- public void testInsertSiblingWithFilterNotFiltered() {
- fViewer.addFilter(new TestLabelFilter());
- TestElement newElement= new TestElement(fModel, fRootElement);
- newElement.setLabel("name-222");
- fRootElement.addChild(newElement,
- new TestModelChange(TestModelChange.INSERT | TestModelChange.REVEAL | TestModelChange.SELECT, fRootElement, newElement)
- );
- assertNotNull("new sibling is visible", fViewer.testFindItem(newElement));
- assertTrue(getItemCount() == 6);
- }
- public void testInsertSiblingWithSorter() {
- fViewer.setSorter(new TestLabelSorter());
- TestElement newElement= new TestElement(fModel, fRootElement);
- newElement.setLabel("name-9999");
- fRootElement.addChild(newElement,
- new TestModelChange(TestModelChange.INSERT |TestModelChange.REVEAL | TestModelChange.SELECT, fRootElement, newElement)
- );
- String newLabel= newElement.toString();
- assertEquals("sorted first", newLabel, getItemText(0));
- assertSelectionEquals("new element is selected", newElement);
- }
- public void testLabelProvider() {
- // BUG: non-polymorphic behaviour
- // if (fViewer instanceof TableViewer || fViewer instanceof TableTreeViewer)
- // return;
- fViewer.setLabelProvider(new TestLabelProvider());
- TestElement first= fRootElement.getFirstChild();
- String newLabel= providedString(first);
- assertEquals("rendered label", newLabel, getItemText(0));
- }
- public void testLabelProviderStateChange() {
- // BUG: non-polymorphic behaviour
- // if (fViewer instanceof TableViewer || fViewer instanceof TableTreeViewer)
- // return;
- TestLabelProvider provider= new TestLabelProvider();
- fViewer.setLabelProvider(provider);
- provider.setSuffix("added suffix");
- TestElement first= fRootElement.getFirstChild();
- String newLabel= providedString(first);
- assertEquals("rendered label", newLabel, getItemText(0));
- }
- public void testRename() {
- TestElement first= fRootElement.getFirstChild();
- String newLabel= first.getLabel()+" changed";
- first.setLabel(newLabel);
- assertEquals("changed label", first.getID()+" "+newLabel, getItemText(0));
- }
- public void testRenameWithFilter() {
- fViewer.addFilter(new TestLabelFilter());
- TestElement first= fRootElement.getFirstChild();
- first.setLabel("name-1111"); // should disappear
- assertNull("changed sibling is not visible", fViewer.testFindItem(first));
- first.setLabel("name-2222"); // should reappear
- fViewer.refresh();
- assertNotNull("changed sibling is not visible", fViewer.testFindItem(first));
- }
- public void testRenameWithLabelProvider() {
- if (fViewer instanceof TableViewer || fViewer instanceof TableTreeViewer)
- return;
- fViewer.setLabelProvider(new TestLabelProvider());
- TestElement first= fRootElement.getFirstChild();
- first.setLabel("changed name");
- String newLabel= providedString(first);
- assertEquals("rendered label", newLabel, getItemText(0));
- }
- public void testRenameWithSorter() {
- fViewer.setSorter(new TestLabelSorter());
- TestElement first= fRootElement.getFirstChild();
- first.setLabel("name-9999");
- String newElementLabel= first.toString();
- assertEquals("sorted first", newElementLabel, getItemText(0));
- }
- public void testSetInput() {
- TestElement first= fRootElement.getFirstChild();
- TestElement firstfirst= first.getFirstChild();
-
- fViewer.setInput(first);
- assertNotNull("first child is visible", fViewer.testFindItem(firstfirst));
- }
- public void testSetSelection() {
- TestElement first= fRootElement.getFirstChild();
- StructuredSelection selection= new StructuredSelection(first);
- fViewer.setSelection(selection);
- IStructuredSelection result= (IStructuredSelection)fViewer.getSelection();
- assertTrue(result.size() == 1);
- assertTrue(result.getFirstElement() == first);
- }
- public void testSomeChildrenChanged() {
- bulkChange(new TestModelChange(TestModelChange.STRUCTURE_CHANGE, fRootElement));
- }
- public void testSorter() {
- TestElement first= fRootElement.getFirstChild();
- TestElement last= fRootElement.getLastChild();
- int size= fRootElement.getChildCount();
-
- String firstLabel= first.toString();
- String lastLabel= last.toString();
- assertEquals("unsorted", firstLabel, getItemText(0));
- assertEquals("unsorted", lastLabel, getItemText(size-1));
- fViewer.setSorter(new TestLabelSorter());
- assertEquals("reverse sorted", firstLabel, getItemText(size-1));
- assertEquals("reverse sorted", lastLabel, getItemText(0));
-
- fViewer.setSorter(null);
- assertEquals("unsorted", firstLabel, getItemText(0));
- assertEquals("unsorted", lastLabel, getItemText(size-1));
- }
- public void testWorldChanged() {
- bulkChange(new TestModelChange(TestModelChange.STRUCTURE_CHANGE, null));
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TableTreeViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TableTreeViewerTest.java deleted file mode 100644 index aa297ac9e30..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TableTreeViewerTest.java +++ /dev/null @@ -1,118 +0,0 @@ -package org.eclipse.jface.tests.viewers;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.*;
-import org.eclipse.jface.resource.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import java.util.*;
-import junit.framework.*;
-
-public class TableTreeViewerTest extends AbstractTreeViewerTest {
-
-public static class TableTreeTestLabelProvider
- extends TestLabelProvider
- implements ITableLabelProvider {
- public boolean fExtended = false;
-
- public String getText(Object element) {
- if (fExtended)
- return providedString((String) element);
-
- return element.toString();
- }
- public String getColumnText(Object element, int index) {
- if (fExtended)
- return providedString((TestElement)element);
- return element.toString();
- }
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-}
-
- public TableTreeViewerTest(String name) {
- super(name);
- }
-protected StructuredViewer createViewer(Composite parent) {
- TableTreeViewer viewer = new TableTreeViewer(parent);
- viewer.setContentProvider(new TestModelContentProvider());
- viewer.setLabelProvider(new TableTreeTestLabelProvider());
- viewer.getTableTree().getTable().setLinesVisible(true);
-
- TableLayout layout = new TableLayout();
- viewer.getTableTree().getTable().setLayout(layout);
- viewer.getTableTree().getTable().setHeaderVisible(true);
- String headers[] = { "column 1 header", "column 2 header" };
-
- ColumnLayoutData layouts[] =
- { new ColumnWeightData(100), new ColumnWeightData(100)};
-
- final TableColumn columns[] = new TableColumn[headers.length];
-
- for (int i = 0; i < headers.length; i++) {
- layout.addColumnData(layouts[i]);
- TableColumn tc = new TableColumn(viewer.getTableTree().getTable(), SWT.NONE, i);
- tc.setResizable(layouts[i].resizable);
- tc.setText(headers[i]);
- columns[i] = tc;
- }
- fTreeViewer = viewer;
- return viewer;
-}
- protected int getItemCount() {
- TestElement first = fRootElement.getFirstChild();
- TableTreeItem ti = (TableTreeItem) fViewer.testFindItem(first);
- TableTree table = ti.getParent();
- return table.getItemCount();
- }
- protected int getItemCount(TestElement element) {
- TableTreeItem ti = (TableTreeItem) fViewer.testFindItem(element);
- return ti.getItemCount();
- }
- protected String getItemText(int at) {
- TableTree table = (TableTree) fViewer.getControl();
- return table.getItems()[at].getText();
- }
- public static void main(String args[]) {
- junit.textui.TestRunner.run(TableTreeViewerTest.class);
- }
- public void testLabelProvider() {
- TableTreeViewer viewer = (TableTreeViewer) fViewer;
- TableTreeTestLabelProvider provider = (TableTreeTestLabelProvider) viewer.getLabelProvider();
- provider.fExtended = true;
- // BUG 1FZ5SDC: JFUIF:WINNT - TableViewerColumn should listen for LabelProvider changes
- fViewer.refresh();
- TestElement first = fRootElement.getFirstChild();
- String newLabel = providedString(first);
- assertEquals("rendered label", newLabel, getItemText(0));
- provider.fExtended = false;
- // BUG 1FZ5SDC: JFUIF:WINNT - TableViewerColumn should listen for LabelProvider changes
- fViewer.refresh();
- }
- public void testLabelProviderStateChange() {
- TableTreeViewer viewer = (TableTreeViewer) fViewer;
- TableColumn column = viewer.getTableTree().getTable().getColumn(0);
- TableTreeTestLabelProvider provider =
- (TableTreeTestLabelProvider) viewer.getLabelProvider();
- provider.fExtended = true;
- provider.setSuffix("added suffix");
- // BUG 1FZ5SDC: JFUIF:WINNT - TableViewerColumn should listen for LabelProvider changes
- fViewer.refresh();
- TestElement first = fRootElement.getFirstChild();
- String newLabel = providedString(first);
- assertEquals("rendered label", newLabel, getItemText(0));
- provider.fExtended = false;
- // BUG 1FZ5SDC: JFUIF:WINNT - TableViewerColumn should listen for LabelProvider changes
- fViewer.refresh();
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TableViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TableViewerTest.java deleted file mode 100644 index 5bcf8154299..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TableViewerTest.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.eclipse.jface.tests.viewers;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-
-import org.eclipse.jface.*;
-import org.eclipse.jface.resource.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import java.util.*;
-import junit.framework.*;
-
-public class TableViewerTest extends StructuredItemViewerTest {
-public static class TableTestLabelProvider
- extends TestLabelProvider
- implements ITableLabelProvider {
- public boolean fExtended = false;
-
- public String getText(Object element) {
- if (fExtended)
- return providedString((String) element);
- return element.toString();
- }
- public String getColumnText(Object element, int index) {
- if (fExtended)
- return providedString((TestElement) element);
- return element.toString();
- }
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-}
-public TableViewerTest(String name) {
- super(name);
-}
-/**
- * Creates the viewer used by this test, under the given parent widget.
- */
-protected StructuredViewer createViewer(Composite parent) {
- TableViewer viewer = new TableViewer(parent);
- viewer.setContentProvider(new TestModelContentProvider());
- viewer.setLabelProvider(new TableTestLabelProvider());
- viewer.getTable().setLinesVisible(true);
-
- TableLayout layout = new TableLayout();
- viewer.getTable().setLayout(layout);
- viewer.getTable().setHeaderVisible(true);
- String headers[] = { "column 1 header", "column 2 header" };
-
- ColumnLayoutData layouts[] =
- { new ColumnWeightData(100), new ColumnWeightData(100)};
-
- final TableColumn columns[] = new TableColumn[headers.length];
-
- for (int i = 0; i < headers.length; i++) {
- layout.addColumnData(layouts[i]);
- TableColumn tc = new TableColumn(viewer.getTable(), SWT.NONE, i);
- tc.setResizable(layouts[i].resizable);
- tc.setText(headers[i]);
- columns[i] = tc;
- }
-
- return viewer;
-}
-protected int getItemCount() {
- TestElement first = fRootElement.getFirstChild();
- TableItem ti = (TableItem) fViewer.testFindItem(first);
- Table table = ti.getParent();
- return table.getItemCount();
-}
-protected String getItemText(int at) {
- Table table = (Table) fViewer.getControl();
- return table.getItem(at).getText();
-}
-public static void main(String args[]) {
- junit.textui.TestRunner.run(TableViewerTest.class);
-}
-public void testLabelProvider() {
-
- TableViewer viewer = (TableViewer) fViewer;
- TableTestLabelProvider provider = (TableTestLabelProvider) viewer.getLabelProvider();
-
- provider.fExtended = true;
- // BUG 1FZ5SDC: JFUIF:WINNT - TableViewerColumn should listen for LabelProvider changes
- fViewer.refresh();
- TestElement first = fRootElement.getFirstChild();
- String newLabel = providedString(first);
- assertEquals("rendered label", newLabel, getItemText(0));
- provider.fExtended = false;
- // BUG 1FZ5SDC: JFUIF:WINNT - TableViewerColumn should listen for LabelProvider changes
-}
-public void testLabelProviderStateChange() {
- TableViewer tableviewer = (TableViewer) fViewer;
- TableColumn column = tableviewer.getTable().getColumn(0);
- TableTestLabelProvider provider = (TableTestLabelProvider) tableviewer.getLabelProvider();
-
- provider.fExtended = true;
- provider.setSuffix("added suffix");
- // BUG 1FZ5SDC: JFUIF:WINNT - TableViewerColumn should listen for LabelProvider changes
- tableviewer.refresh();
- TestElement first = fRootElement.getFirstChild();
- String newLabel = providedString(first);
- assertEquals("rendered label", newLabel, getItemText(0));
- provider.fExtended = false;
- // BUG 1FZ5SDC: JFUIF:WINNT - TableViewerColumn should listen for LabelProvider changes
- fViewer.refresh();
-}
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestElement.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestElement.java deleted file mode 100644 index 3eb6e37be47..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestElement.java +++ /dev/null @@ -1,177 +0,0 @@ -package org.eclipse.jface.tests.viewers;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import java.util.*;
-
-public class TestElement implements Cloneable {
- TestModel fModel;
- TestElement fContainer;
- String fSomeName;
- String fId;
- Vector fChildren= new Vector();
- boolean fIsDeleted= false;
-
- public static final String P_SOMENAME= "org.eclipse.jface.viewertest.name";
- public static final String P_COLUMN_1= "org.eclipse.jface.viewertest.column1";
-
-
-public TestElement(TestModel model, TestElement container) {
- fModel = model;
- fContainer = container;
- int p = 0;
- TestElement lastSibling = container.getLastChild();
- if (lastSibling != null) {
- p = lastSibling.childId() + 1;
- }
- fId = container.getID() + "-" + p;
-}
-public TestElement(TestModel model, TestElement container, int level, int position) {
- fModel = model;
- fContainer = container;
- if (container != null)
- fId = container.getID() + "-" + position;
- else
- fId = Integer.toString(position);
- fSomeName = "name-" + position;
-
- if (level < model.getNumLevels()) {
- for (int i = 0; i < model.getNumChildren(); i++) {
- fChildren.add(new TestElement(model, this, level + 1, i));
- }
- }
-}
- public TestElement addChild(int event) {
- TestElement element= new TestElement(fModel, this);
- element.fSomeName= "added";
- addChild(element, new TestModelChange(event, this, element));
- return element;
- }
- public TestElement addChild(TestElement element, TestModelChange change) {
- fChildren.add(element);
- fModel.fireModelChanged(change);
- return element;
- }
- public void addChildren(TestElement[] elements, TestModelChange change) {
- for (int i= 0; i < elements.length; i++)
- fChildren.add(elements[i]);
- fModel.fireModelChanged(change);
- }
- public TestElement[] addChildren(int event) {
- TestElement elements[]= new TestElement[] {
- new TestElement(fModel, this),
- new TestElement(fModel, this)
- };
-
- elements[0].fSomeName= "added1";
- elements[1].fSomeName= "added2";
- addChildren(elements, new TestModelChange(event, this, elements));
- return elements;
- }
- public TestElement basicAddChild() {
- TestElement element= new TestElement(fModel, this);
- element.fSomeName= "added";
- fChildren.add(element);
- return element;
- }
- public void basicDeleteChild(TestElement element) {
- fChildren.remove(element);
- element.fIsDeleted= true;
- }
- private int childId() {
- String id= fId.substring(fId.lastIndexOf("-")+1);
- return Integer.parseInt(id);
- }
- public Object clone() {
- try {
- return super.clone();
- }
- catch (CloneNotSupportedException e) {
- throw new Error(); // should not happen
- }
- }
- static public TestElement createModel(int numLevels, int numChildren) {
- return new TestElement(new TestModel(numLevels, numChildren), null, 0, 0);
- }
- public void deleteChild(TestElement element) {
- deleteChild(element, new TestModelChange(TestModelChange.REMOVE, this, element));
- }
- public void deleteChild(TestElement element, TestModelChange change) {
- basicDeleteChild(element);
- fModel.fireModelChanged(change);
- }
-public void deleteChildren() {
- for (int i = fChildren.size() - 1; i >= 0; i--) {
- TestElement te = (TestElement) fChildren.elementAt(i);
- fChildren.remove(te);
- te.fIsDeleted = true;
- }
- fModel.fireModelChanged(new TestModelChange(TestModelChange.STRUCTURE_CHANGE, this));
-}
-public void deleteSomeChildren() {
- for (int i = fChildren.size() - 1; i >= 0; i -= 2) {
- TestElement te = (TestElement) fChildren.elementAt(i);
- fChildren.remove(te);
- te.fIsDeleted = true;
- }
- fModel.fireModelChanged(new TestModelChange(TestModelChange.STRUCTURE_CHANGE, this));
-}
- public boolean equals(Object arg) {
- if (!(arg instanceof TestElement))
- return false;
- TestElement element= (TestElement)arg;
- return element.fId.equals(fId);
- }
- public TestElement getChildAt(int i) {
- return (TestElement) fChildren.elementAt(i);
- }
- public int getChildCount() {
- return fChildren.size();
- }
- public TestElement getContainer() {
- return fContainer;
- }
- public TestElement getFirstChild() {
- if (fChildren.size() > 0)
- return (TestElement)fChildren.elementAt(0);
- return null;
- }
- public String getID() {
- return fId;
- }
- public String getLabel() {
- return fSomeName;
- }
-public TestElement getLastChild() {
- int size = fChildren.size();
- if (size > 0)
- return (TestElement) fChildren.elementAt(size - 1);
- return null;
-}
-public TestModel getModel() {
- return fModel;
-}
- public int hashCode() {
- return fId.hashCode();
- }
-public boolean isDeleted() {
- return fIsDeleted;
-}
- public void setLabel(String label) {
- fSomeName= label;
- fModel.fireModelChanged(new TestModelChange(TestModelChange.NON_STRUCTURE_CHANGE, this));
- }
- public boolean testDeleted() {
- if (fIsDeleted)
- return true;
- if (fContainer != null)
- return fContainer.testDeleted();
- return false;
- }
-public String toString() {
- return getID() + " " + getLabel();
-}
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestLabelProvider.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestLabelProvider.java deleted file mode 100644 index 8c08a083fd4..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestLabelProvider.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.eclipse.jface.tests.viewers;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.jface.resource.*;
-import org.eclipse.jface.viewers.*;
-
-public class TestLabelProvider extends LabelProvider {
-
- static Image fgImage= null;
-
-/**
- *
- */
-public static Image getImage() {
- if (fgImage == null)
- fgImage = ImageDescriptor.createFromFile(TestLabelProvider.class, "images/java.gif").createImage();
- return fgImage;
-}
- public Image getImage(Object element) {
- return getImage();
- }
- public String getText(Object element) {
- String label= element.toString();
- return label+ " <rendered>";
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModel.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModel.java deleted file mode 100644 index 7d0ba3f5eeb..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModel.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.eclipse.jface.tests.viewers;
-
-import java.util.*;
-
-public class TestModel {
- Vector fListeners = new Vector();
- int fNumLevels;
- int fNumChildren;
-public TestModel(int numLevels, int numChildren) {
- fNumLevels = numLevels;
- fNumChildren = numChildren;
-}
-public void addListener(ITestModelListener listener) {
- fListeners.addElement(listener);
-}
-/**
- * Fires a model changed event to all listeners.
- */
-public void fireModelChanged(TestModelChange change) {
- for (int i = 0; i < fListeners.size(); ++i) {
- ITestModelListener listener = (ITestModelListener) fListeners.get(i);
- listener.testModelChanged(change);
- }
-}
-public int getNumChildren() {
- return fNumChildren;
-}
-public int getNumLevels() {
- return fNumLevels;
-}
-public void removeListener(ITestModelListener listener) {
- fListeners.removeElement(listener);
-}
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelChange.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelChange.java deleted file mode 100644 index e6f4ea180bb..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelChange.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.eclipse.jface.tests.viewers;
-
-public class TestModelChange {
- private int fKind;
- private TestElement fParent;
- private TestElement[] fChildren;
-
- public static final int KIND_MASK = 0x0F;
-
- public static final int INSERT = 1;
- public static final int REMOVE = 2;
- public static final int STRUCTURE_CHANGE = 3;
- public static final int NON_STRUCTURE_CHANGE = 4;
-
- public static final int REVEAL = 16;
- public static final int SELECT = 32;
-
-public TestModelChange(int kind, TestElement parent) {
- this(kind, parent, new TestElement[0]);
-}
-public TestModelChange(int kind, TestElement parent, TestElement[] children) {
- fKind = kind;
- fParent = parent;
- fChildren = children;
-}
-public TestModelChange(int kind, TestElement parent, TestElement child) {
- this(kind, parent, new TestElement[] { child });
-}
-public TestElement[] getChildren() {
- return fChildren;
-}
-public int getKind() {
- return fKind & KIND_MASK;
-}
-public int getModifiers() {
- return fKind & ~KIND_MASK;
-}
-public TestElement getParent() {
- return fParent;
-}
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelContentProvider.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelContentProvider.java deleted file mode 100644 index 5bcfd3ba719..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelContentProvider.java +++ /dev/null @@ -1,120 +0,0 @@ -package org.eclipse.jface.tests.viewers;
-
-import org.eclipse.jface.*;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.*;
-import java.util.*;
-
-public class TestModelContentProvider implements ITestModelListener, IStructuredContentProvider, ITreeContentProvider {
- Viewer fViewer;
-public void dispose() {
-}
-protected void doInsert(TestModelChange change) {
- if (fViewer instanceof ListViewer) {
- if (change.getParent() != null && change.getParent().equals(fViewer.getInput())) {
- ((ListViewer) fViewer).add(change.getChildren());
- }
- }
- else if (fViewer instanceof TableViewer) {
- if (change.getParent() != null && change.getParent().equals(fViewer.getInput())) {
- ((TableViewer) fViewer).add(change.getChildren());
- }
- }
- else if (fViewer instanceof AbstractTreeViewer) {
- ((AbstractTreeViewer) fViewer).add(change.getParent(), change.getChildren());
- }
- else {
- Assert.isTrue(false, "Unknown kind of viewer");
- }
-}
-protected void doNonStructureChange(TestModelChange change) {
- if (fViewer instanceof StructuredViewer) {
- ((StructuredViewer) fViewer).update(change.getParent(), new String[] { IBasicPropertyConstants.P_TEXT });
- }
- else {
- Assert.isTrue(false, "Unknown kind of viewer");
- }
-}
-protected void doRemove(TestModelChange change) {
- if (fViewer instanceof ListViewer) {
- ((ListViewer) fViewer).remove(change.getChildren());
- }
- else if (fViewer instanceof TableViewer) {
- ((TableViewer) fViewer).remove(change.getChildren());
- }
- else if (fViewer instanceof AbstractTreeViewer) {
- ((AbstractTreeViewer) fViewer).remove(change.getChildren());
- }
- else {
- Assert.isTrue(false, "Unknown kind of viewer");
- }
-}
-protected void doStructureChange(TestModelChange change) {
- if (fViewer instanceof StructuredViewer) {
- ((StructuredViewer) fViewer).refresh(change.getParent());
- }
- else {
- Assert.isTrue(false, "Unknown kind of viewer");
- }
-}
-public Object[] getChildren(Object element) {
- TestElement testElement = (TestElement) element;
- int count = testElement.getChildCount();
- TestElement[] children = new TestElement[count];
- for (int i = 0; i < count; ++i)
- children[i] = testElement.getChildAt(i);
- return children;
-}
-public Object[] getElements(Object element) {
- return getChildren(element);
-}
-public Object getParent(Object element) {
- return ((TestElement) element).getContainer();
-}
-public boolean hasChildren(Object element) {
- return ((TestElement) element).getChildCount() > 0;
-}
-public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- fViewer = viewer;
- TestElement oldElement = (TestElement) oldInput;
- if (oldElement != null) {
- oldElement.getModel().removeListener(this);
- }
- TestElement newElement = (TestElement) newInput;
- if (newElement != null) {
- newElement.getModel().addListener(this);
- }
-}
-public boolean isDeleted(Object element) {
- return ((TestElement) element).isDeleted();
-}
-public void testModelChanged(TestModelChange change) {
- switch (change.getKind()) {
- case TestModelChange.INSERT:
- doInsert(change);
- break;
- case TestModelChange.REMOVE:
- doRemove(change);
- break;
- case TestModelChange.STRUCTURE_CHANGE:
- doStructureChange(change);
- break;
- case TestModelChange.NON_STRUCTURE_CHANGE:
- doNonStructureChange(change);
- break;
- default:
- throw new IllegalArgumentException("Unknown kind of change");
- }
-
- StructuredSelection selection = new StructuredSelection(change.getChildren());
- if ((change.getModifiers() & TestModelChange.SELECT) != 0) {
- ((StructuredViewer) fViewer).setSelection(selection);
- }
- if ((change.getModifiers() & TestModelChange.REVEAL) != 0) {
- Object element = selection.getFirstElement();
- if (element != null) {
- ((StructuredViewer) fViewer).reveal(element);
- }
- }
-}
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TreeViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TreeViewerTest.java deleted file mode 100644 index d1786013654..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TreeViewerTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.eclipse.jface.tests.viewers;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-
-import org.eclipse.jface.*;
-import org.eclipse.jface.resource.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.widgets.*;
-import junit.framework.*;
-
-public class TreeViewerTest extends AbstractTreeViewerTest {
-
- public TreeViewerTest(String name) {
- super(name);
- }
- protected StructuredViewer createViewer(Composite parent) {
- fTreeViewer= new TreeViewer(parent);
- fTreeViewer.setContentProvider(new TestModelContentProvider());
- return fTreeViewer;
- }
- protected int getItemCount() {
- TestElement first= fRootElement.getFirstChild();
- TreeItem ti= (TreeItem)fViewer.testFindItem(first);
- Tree tree= ti.getParent();
- return tree.getItemCount();
- }
-/**
- * getItemCount method comment.
- */
-protected int getItemCount(TestElement element) {
- return 0;
-}
- protected String getItemText(int at) {
- Tree tree= (Tree) fTreeViewer.getControl();
- return tree.getItems()[at].getText();
- }
- public static void main(String args[]) {
- junit.textui.TestRunner.run(TreeViewerTest.class);
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddChildAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddChildAction.java deleted file mode 100644 index ecfa1f44218..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddChildAction.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.tests.viewers.*;
-import org.eclipse.jface.viewers.*;
-
-public class AddChildAction extends TestSelectionAction {
-
- int fEventKind;
-
- public AddChildAction(String label, TestBrowser browser) {
- this(label, browser, TestModelChange.INSERT);
- }
- public AddChildAction(String label, TestBrowser browser, int eventKind) {
- super(label, browser);
- fEventKind= eventKind;
- }
- public void run(TestElement element) {
- element.addChild(fEventKind);
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddElementAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddElementAction.java deleted file mode 100644 index 4ea9c838ad9..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddElementAction.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.tests.viewers.*;
-import org.eclipse.jface.viewers.*;
-
-public class AddElementAction extends TestBrowserAction {
-
- public AddElementAction(String label, TestBrowser browser) {
- super(label, browser);
-// window.addFocusChangedListener(this);
- }
- public void run() {
- TestElement element = (TestElement) getBrowser().getViewer().getInput();
- element.addChild(TestModelChange.INSERT);
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddFilterAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddFilterAction.java deleted file mode 100644 index 621d839dbf4..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddFilterAction.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.viewers.*;
-
-public class AddFilterAction extends TestBrowserAction {
-
- public AddFilterAction(String label, TestBrowser browser) {
- super(label, browser);
- }
- public void run() {
- Viewer viewer = getBrowser().getViewer();
- if (viewer instanceof StructuredViewer)
- ((StructuredViewer) viewer).addFilter(new Filter());
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddSiblingAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddSiblingAction.java deleted file mode 100644 index f45fb561b19..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddSiblingAction.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.tests.viewers.*;
-import org.eclipse.jface.viewers.*;
-
-public class AddSiblingAction extends TestSelectionAction {
-
- int fEventKind;
-
- public AddSiblingAction(String label, TestBrowser browser) {
- this(label, browser, TestModelChange.INSERT);
- }
- public AddSiblingAction(String label, TestBrowser browser, int eventKind) {
- super(label, browser);
- fEventKind= eventKind;
- }
- public void run(TestElement element) {
- element.getContainer().addChild(fEventKind);
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ChangeChildLabelAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ChangeChildLabelAction.java deleted file mode 100644 index ed1e2dcdd73..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ChangeChildLabelAction.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.tests.viewers.*;
-
-public class ChangeChildLabelAction extends TestSelectionAction {
- public ChangeChildLabelAction(String label, TestBrowser browser) {
- super(label, browser);
- }
- public void run(TestElement element) {
- TestElement child= element.getFirstChild();
- if (child != null)
- child.setLabel(child.getLabel() + " renamed child");
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ChangeInputLabelAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ChangeInputLabelAction.java deleted file mode 100644 index 435c0cfa9d1..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ChangeInputLabelAction.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.tests.viewers.*;
-
-public class ChangeInputLabelAction extends TestBrowserAction {
-
- public ChangeInputLabelAction(String label, TestBrowser browser) {
- super(label, browser);
- }
-public void run() {
- TestElement element = (TestElement) getBrowser().getInput();
- element.setLabel(element.getLabel() + " changed");
-}
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ChangeLabelAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ChangeLabelAction.java deleted file mode 100644 index 5b989ed35a7..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ChangeLabelAction.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.tests.viewers.*;
-
-public class ChangeLabelAction extends TestSelectionAction {
-
- public ChangeLabelAction(String label, TestBrowser browser) {
- super(label, browser);
- }
- public void run(TestElement element) {
- element.setLabel(element.getLabel() + " changed");
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ClearSelectionAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ClearSelectionAction.java deleted file mode 100644 index 7b5d9db4f3f..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ClearSelectionAction.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-import org.eclipse.jface.viewers.*;
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-
-public class ClearSelectionAction extends TestBrowserAction {
-
- public ClearSelectionAction(String label, TestBrowser browser) {
- super(label, browser);
- }
- public void run() {
- getBrowser().getViewer().setSelection(new StructuredSelection());
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/CreateModelAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/CreateModelAction.java deleted file mode 100644 index abfe539716e..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/CreateModelAction.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.tests.viewers.*;
-
-public class CreateModelAction extends TestBrowserAction {
- int fLevel;
- int fChildCount;
- public CreateModelAction(String label, TestBrowser browser, int level, int childCount) {
- super(label, browser);
- fLevel= level;
- fChildCount= childCount;
- }
- public void run() {
- // Clear input since TestElement.equals does only
- // check the id, not the size of the TestElement.
- getBrowser().setInput(null);
- getBrowser().setInput(TestElement.createModel(fLevel, fChildCount));
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/DeleteAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/DeleteAction.java deleted file mode 100644 index 471d9d7b22a..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/DeleteAction.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.tests.viewers.*;
-
-public class DeleteAction extends TestSelectionAction {
-
- public DeleteAction(String label, TestBrowser browser) {
- super(label, browser);
- }
- public void run(TestElement element) {
- element.getContainer().deleteChild(element);
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/DeleteChildrenAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/DeleteChildrenAction.java deleted file mode 100644 index 371fe059dc1..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/DeleteChildrenAction.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.tests.viewers.*;
-
-public class DeleteChildrenAction extends TestSelectionAction {
-
- boolean fAll= false;
-
- public DeleteChildrenAction(String label, TestBrowser browser, boolean all) {
- super(label, browser);
- fAll= all;
- }
- public void run(TestElement element) {
- if (fAll)
- element.deleteChildren();
- else
- element.deleteSomeChildren();
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/DeleteSiblingsAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/DeleteSiblingsAction.java deleted file mode 100644 index d5be41c930d..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/DeleteSiblingsAction.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.tests.viewers.*;
-
-public class DeleteSiblingsAction extends TestSelectionAction {
-
- boolean fAll= false;
-
- public DeleteSiblingsAction(String label, TestBrowser browser, boolean all) {
- super(label, browser);
- fAll= all;
- }
- public void run(TestElement element) {
- if (fAll)
- element.getContainer().deleteChildren();
- else
- element.getContainer().deleteSomeChildren();
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ExpandAllAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ExpandAllAction.java deleted file mode 100644 index 116ee33a325..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ExpandAllAction.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.viewers.*;
-
-public class ExpandAllAction extends TestBrowserAction {
-
- public ExpandAllAction(String label, TestBrowser browser) {
- super(label, browser);
- }
- public void run() {
- Viewer viewer = getBrowser().getViewer();
- if (viewer instanceof AbstractTreeViewer)
- ((AbstractTreeViewer) viewer).expandAll();
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/Filter.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/Filter.java deleted file mode 100644 index f705ed9a329..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/Filter.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.viewers.*;
-import java.util.*;
-
-public class Filter extends ViewerFilter {
-
- public Object[] filter(Viewer viewer, Object parent, Object[] elements) {
- ArrayList result = new ArrayList();
- for (int i = 0; i < elements.length; ++i) {
- // toss every second item
- if (i % 2 == 1) {
- result.add(elements[i]);
- }
- }
- return result.toArray();
- }
- public boolean isFilterProperty(Object element, Object aspect) {
- return false;
- }
-/* (non-Javadoc)
- * Method declared on ViewerFilter
- */
-public boolean select(Viewer viewer, Object parentElement, Object element) {
- // not used
- return false;
-}
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/FlushInputAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/FlushInputAction.java deleted file mode 100644 index f9ce336a941..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/FlushInputAction.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-
-public class FlushInputAction extends TestBrowserAction {
-
- public FlushInputAction(String label, TestBrowser browser) {
- super(label, browser);
- }
- public void run() {
- getBrowser().setInput(null);
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ResetFilterAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ResetFilterAction.java deleted file mode 100644 index 7a318dffbcf..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ResetFilterAction.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-import org.eclipse.jface.viewers.*;
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-
-public class ResetFilterAction extends TestBrowserAction {
-
- public ResetFilterAction(String label, TestBrowser browser) {
- super(label, browser);
- }
- public void run() {
- Viewer viewer = getBrowser().getViewer();
- if (viewer instanceof StructuredViewer) {
- StructuredViewer v = (StructuredViewer) viewer;
- v.resetFilters();
- }
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ResetSorterAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ResetSorterAction.java deleted file mode 100644 index f19a86de18b..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ResetSorterAction.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-import org.eclipse.jface.viewers.*;
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-
-public class ResetSorterAction extends TestBrowserAction {
-
- public ResetSorterAction(String label, TestBrowser browser) {
- super(label, browser);
- }
- public void run() {
- Viewer viewer = getBrowser().getViewer();
- if (viewer instanceof StructuredViewer) {
- StructuredViewer v = (StructuredViewer) viewer;
- v.setSorter(null);
- }
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/SetLabelProviderAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/SetLabelProviderAction.java deleted file mode 100644 index 1333cfb7086..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/SetLabelProviderAction.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.tests.viewers.*;
-import org.eclipse.jface.viewers.ContentViewer;
-
-public class SetLabelProviderAction extends TestBrowserAction {
-
- public SetLabelProviderAction(String label, TestBrowser browser) {
- super(label, browser);
- }
- public void run() {
- ((ContentViewer) getBrowser().getViewer()).setLabelProvider(new TestLabelProvider());
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/SetSorterAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/SetSorterAction.java deleted file mode 100644 index 594ee5b8fcb..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/SetSorterAction.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-import org.eclipse.jface.viewers.*;
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-
-public class SetSorterAction extends TestBrowserAction {
-
- public SetSorterAction(String label, TestBrowser browser) {
- super(label, browser);
- }
- public void run() {
- Viewer viewer = getBrowser().getViewer();
- if (viewer instanceof StructuredViewer) {
- StructuredViewer v = (StructuredViewer) viewer;
- v.setSorter(new Sorter());
- }
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/Sorter.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/Sorter.java deleted file mode 100644 index effca750aed..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/Sorter.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.*;
-import org.eclipse.jface.viewers.*;
-
-public class Sorter extends ViewerSorter {
-
- public boolean isSorterProperty(Object element, String property) {
- return IBasicPropertyConstants.P_TEXT.equals(property);
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestBrowser.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestBrowser.java deleted file mode 100644 index 40896c7da28..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestBrowser.java +++ /dev/null @@ -1,255 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-import org.eclipse.swt.custom.*;
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.jface.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.tests.viewers.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jface.window.*;
-import java.util.*;
-
-public abstract class TestBrowser extends ApplicationWindow {
- TestElement fInput;
- Viewer fViewer;
-
- Action fChangeLabelAction;
- Action fChangeInputLabelAction;
- Action fChangeChildLabelAction;
- Action fReloadAction;
- Action fReloadActionLarge;
- Action fReloadActionFlat;
-
- Action fDeleteAction;
- Action fDeleteChildrenAction;
- Action fDeleteSomeChildrenAction;
- Action fDeleteSiblingsAction;
- Action fFlushInputAction;
-
- Action fAddElementAction;
-
- Action fAddSiblingAction;
- Action fAddSiblingRevealAction;
- Action fAddSiblingSelectAction;
-
- Action fAddChildAction;
- Action fAddChildRevealAction;
- Action fAddChildSelectAction;
-
- Action fWorldChangedAction;
-
- Action fSetLabelProvider;
-
- Action fAddFilterAction;
- Action fResetFilters;
-
- Action fSetSorter;
- Action fResetSorter;
-
- Action fClearSelection;
-
- int fPanes= 1;
-
- public TestBrowser() {
- super(null);
- addMenuBar();
- }
-/* (non-Javadoc)
- * Method declared on Window.
- */
-protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText("Test Browser");
-}
-protected void createActions() {
- fChangeLabelAction = new ChangeLabelAction("Change Label", this);
- fChangeChildLabelAction =
- new ChangeChildLabelAction("Change Child Label", this);
-// fChangeInputLabelAction =
-// new ChangeInputLabelAction("Change Input Label", this);
-
- fReloadAction = new CreateModelAction("Reload Test Data (small)", this, 3, 10);
- fReloadActionLarge =
- new CreateModelAction("Reload Test Data (large)", this, 3, 33);
- fReloadActionFlat =
- new CreateModelAction("Reload Test Data (flat)", this, 1, 2000);
-
- fDeleteAction = new DeleteAction("Delete", this);
- fDeleteChildrenAction = new DeleteChildrenAction("Delete Children", this, true);
- fDeleteSomeChildrenAction =
- new DeleteChildrenAction("Delete Odd Children", this, false);
- fDeleteSiblingsAction = new DeleteSiblingsAction("Delete Siblings", this, true);
-
- fFlushInputAction = new FlushInputAction("Flush Input", this);
-
- fAddElementAction = new AddElementAction("Add Element to Input", this);
- fAddSiblingAction = new AddSiblingAction("Add Sibling", this);
- fAddSiblingRevealAction =
- new AddSiblingAction(
- "Add Sibling and Reveal",
- this,
- TestModelChange.INSERT | TestModelChange.REVEAL);
- fAddSiblingSelectAction =
- new AddSiblingAction(
- "Add Sibling and Select",
- this,
- TestModelChange.INSERT | TestModelChange.REVEAL | TestModelChange.SELECT);
- fAddChildAction = new AddChildAction("Add Child", this);
- fAddChildRevealAction =
- new AddChildAction(
- "Add Child and Reveal",
- this,
- TestModelChange.INSERT | TestModelChange.REVEAL);
- fAddChildSelectAction =
- new AddChildAction(
- "Add Child and Select",
- this,
- TestModelChange.INSERT | TestModelChange.REVEAL | TestModelChange.SELECT);
-
- fWorldChangedAction = new WorldChangedAction("World Changed", this);
-
- fSetLabelProvider =
- new SetLabelProviderAction("Set Custom Label Provider", this);
-
- fAddFilterAction = new AddFilterAction("Add Filter", this);
- fResetFilters = new ResetFilterAction("Reset All Filters", this);
-
- fSetSorter = new SetSorterAction("Set Sorter", this);
- fResetSorter = new ResetSorterAction("Reset Sorter", this);
-
- fClearSelection = new ClearSelectionAction("Clear Selection", this);
-}
-protected Control createContents() {
- Shell shell = getShell();
- ViewForm form = new ViewForm(shell, SWT.NONE);
- CLabel label = new CLabel(form, SWT.NONE);
- form.setTopLeft(label);
- Object input = getInput();
- label.setText(input.toString());
- if (fPanes == 1) {
- Viewer viewer = createViewer(form);
- form.setContent(viewer.getControl());
- fViewer = viewer;
- viewer.setInput(input);
- } else if (fPanes == 2) {
- SashForm sashForm = new SashForm(form, SWT.VERTICAL);
- form.setContent(sashForm);
- Viewer viewer = createViewer(sashForm);
- fViewer = viewer;
- viewer.setInput(input);
- viewer = createViewer(sashForm);
- viewer.setInput(input);
- }
- createActions();
- fillMenuBar(getMenuBarManager());
- viewerFillMenuBar(getMenuBarManager());
- getMenuBarManager().updateAll(false);
- return form;
-}
-protected Control createContents(Composite parent) {
- ViewForm form = new ViewForm(parent, SWT.NONE);
- CLabel label = new CLabel(form, SWT.NONE);
- form.setTopLeft(label);
- Object input = getInput();
- label.setText(input.toString());
- if (fPanes == 1) {
- Viewer viewer = createViewer(form);
- form.setContent(viewer.getControl());
- fViewer = viewer;
- viewer.setInput(input);
- } else if (fPanes == 2) {
- SashForm sashForm = new SashForm(form, SWT.VERTICAL);
- form.setContent(sashForm);
- Viewer viewer = createViewer(sashForm);
- fViewer = viewer;
- viewer.setInput(input);
- viewer = createViewer(sashForm);
- viewer.setInput(input);
- }
- createActions();
- fillMenuBar(getMenuBarManager());
- viewerFillMenuBar(getMenuBarManager());
- getMenuBarManager().updateAll(false);
- return form;
-}
- public abstract Viewer createViewer(Composite parent);
-protected void fillMenuBar(MenuManager mgr) {
-
- MenuManager setupMenu = new MenuManager("Setup","Setup");
- mgr.add(setupMenu);
- setupMenu.add(fReloadAction);
- setupMenu.add(fReloadActionLarge);
- setupMenu.add(fReloadActionFlat);
- setupMenu.add(new Separator());
- setupMenu.add(fFlushInputAction);
- setupMenu.add(new Separator());
- setupMenu.add(fSetLabelProvider);
- setupMenu.add(new Separator());
- setupMenu.add(fAddFilterAction);
- setupMenu.add(fResetFilters);
- setupMenu.add(new Separator());
- setupMenu.add(fSetSorter);
- setupMenu.add(fResetSorter);
-
- MenuManager testMenu = new MenuManager("Tests","Tests");
- mgr.add(testMenu);
- testMenu.add(fChangeLabelAction);
- testMenu.add(fChangeChildLabelAction);
-// testMenu.add(fChangeInputLabelAction);
- testMenu.add(new Separator());
-
- testMenu.add(fDeleteAction);
- testMenu.add(fDeleteChildrenAction);
- testMenu.add(fDeleteSomeChildrenAction);
- testMenu.add(fDeleteSiblingsAction);
- testMenu.add(new Separator());
-
- testMenu.add(fAddElementAction);
- testMenu.add(new Separator());
-
- testMenu.add(fAddSiblingAction);
- testMenu.add(fAddSiblingRevealAction);
- testMenu.add(fAddSiblingSelectAction);
- testMenu.add(new Separator());
-
- testMenu.add(fAddChildAction);
- testMenu.add(fAddChildRevealAction);
- testMenu.add(fAddChildSelectAction);
- testMenu.add(new Separator());
-
- testMenu.add(fClearSelection);
- testMenu.add(new Separator());
-
- testMenu.add(fWorldChangedAction);
-// ((TestTree)this).testTreeFillMenuBar(testMenu);
-}
-public TestElement getInput() {
- return fInput;
-}
- public Viewer getViewer() {
- return fViewer;
- }
- public Composite getViewerContainer() {
- return null;
- }
-public void open(TestElement input) {
- setInput(input);
- super.open();
-}
-public void setInput(TestElement input) {
- fInput = input;
- if (getViewer() != null)
- getViewer().setInput(input);
-}
- public void show2Panes() {
- fPanes= 2;
- }
-protected abstract void viewerFillMenuBar(MenuManager mgr);
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestBrowserAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestBrowserAction.java deleted file mode 100644 index ad0d6270d93..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestBrowserAction.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.viewers.*;
-
-public abstract class TestBrowserAction extends Action {
- private TestBrowser browser;
- public TestBrowserAction(String label, TestBrowser browser) {
- super(label);
- this.browser = browser;
- }
- /**
- * Returns the test browser.
- */
- public TestBrowser getBrowser() {
- return browser;
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestCheckboxTree.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestCheckboxTree.java deleted file mode 100644 index 9e81499b839..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestCheckboxTree.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.tests.viewers.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import java.util.*;
-
-public class TestCheckboxTree extends TestTree {
- CheckboxTreeViewer fCheckboxViewer;
-
- public TestCheckboxTree() {
- super();
- }
-public void checkChildren(TestElement element, boolean state) {
- int numChildren = element.getChildCount();
- for (int i = 0; i < numChildren; i++) {
- TestElement child = element.getChildAt(i);
- if (fCheckboxViewer.setChecked(child, state))
- checkChildren(child, state);
- }
-}
-public Viewer createViewer(Composite parent) {
- CheckboxTreeViewer viewer = new CheckboxTreeViewer(parent);
- viewer.setContentProvider(new TestModelContentProvider());
- viewer.setLabelProvider(new TestLabelProvider());
-
- viewer.addTreeListener(new ITreeViewerListener() {
- public void treeExpanded(TreeExpansionEvent e) {
- handleTreeExpanded((TestElement) e.getElement());
- }
- public void treeCollapsed(TreeExpansionEvent e) {
- }
- });
-
- viewer.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent e) {
- checkChildren((TestElement) e.getElement(), e.getChecked());
- }
- });
-
- fCheckboxViewer = viewer;
- fViewer = viewer;
- return viewer;
-}
- public void handleTreeExpanded(TestElement element) {
- // apply the same check recursively to all children
- boolean checked = fCheckboxViewer.getChecked(element);
- int numChildren = element.getChildCount();
- for (int i= 0; i < numChildren; i++) {
- TestElement child= element.getChildAt(i);
- fCheckboxViewer.setChecked(child, checked);
- }
- }
-public static void main(String[] args) {
- TestBrowser browser = new TestCheckboxTree();
- if (args.length > 0 && args[0].equals("-twopanes"))
- browser.show2Panes();
- browser.setBlockOnOpen(true);
- browser.open(TestElement.createModel(3, 10));
-}
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestList.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestList.java deleted file mode 100644 index 524f7b6d70d..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestList.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.tests.viewers.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.widgets.*;
-import java.util.*;
-
-public class TestList extends TestBrowser {
- public Viewer createViewer(Composite parent) {
- ListViewer viewer= new ListViewer(parent);
- viewer.setUseHashlookup(true);
- viewer.setContentProvider(new TestModelContentProvider());
- return viewer;
- }
- public static void main(String[] args) {
- TestList browser = new TestList();
- browser.setBlockOnOpen(true);
- browser.open(TestElement.createModel(3, 10));
- }
-/**
- *
- */
-protected void viewerFillMenuBar(MenuManager mgr) {
-}
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestSelectionAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestSelectionAction.java deleted file mode 100644 index df885beb461..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestSelectionAction.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.tests.viewers.*;
-import org.eclipse.jface.viewers.*;
-import java.util.*;
-
-public abstract class TestSelectionAction extends TestBrowserAction implements ISelectionChangedListener {
- public TestSelectionAction(String label, TestBrowser browser) {
- super(label, browser);
- browser.getViewer().addSelectionChangedListener(this);
- setEnabled(false);
- }
- public TestElement getTestElement(ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- return (TestElement) ((IStructuredSelection) selection).getFirstElement();
- }
- return null;
- }
-/**
- * Overridden from Action.
- */
-public void run() {
- TestElement testElement = getTestElement(getBrowser().getViewer().getSelection());
- if (testElement != null) {
- run(testElement);
- }
-}
- /**
- * The default implementation calls run(TestElement)
- * on every element contained in the vector.
- */
- public void run(TestElement o) {
- }
- public void selectionChanged(SelectionChangedEvent event) {
- setEnabled(!event.getSelection().isEmpty());
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTable.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTable.java deleted file mode 100644 index b8354926efb..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTable.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.tests.viewers.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import java.util.*;
-
-public class TestTable extends TestBrowser {
-
-public Viewer createViewer(Composite parent) {
- TableViewer viewer = new TableViewer(parent);
- viewer.setContentProvider(new TestModelContentProvider());
- viewer.setLabelProvider(new TestLabelProvider());
- viewer.getTable().setLinesVisible(true);
-
- TableLayout layout = new TableLayout();
- viewer.getTable().setLayout(layout);
- viewer.getTable().setHeaderVisible(true);
- String headers[] = { "Label Column", "Second Column" };
-
- ColumnLayoutData layouts[] =
- { new ColumnWeightData(100, false), new ColumnWeightData(100, false)};
-
- final TableColumn columns[] = new TableColumn[headers.length];
-
- for (int i = 0; i < headers.length; i++) {
- layout.addColumnData(layouts[i]);
- TableColumn tc = new TableColumn(viewer.getTable(), SWT.NONE, i);
- tc.setResizable(layouts[i].resizable);
- tc.setText(headers[i]);
- columns[i] = tc;
- }
-
- viewer.setUseHashlookup(true);
-
- return viewer;
-}
- public static void main(String[] args) {
- TestTable browser = new TestTable();
- browser.setBlockOnOpen(true);
- browser.open(TestElement.createModel(3, 10));
- }
-/**
- *
- */
-protected void viewerFillMenuBar(MenuManager mgr) {
-}
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTableTree.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTableTree.java deleted file mode 100644 index d43ad28f621..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTableTree.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.tests.viewers.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import java.util.*;
-
-public class TestTableTree extends TestBrowser {
-
- TableTreeViewer fViewer;
- Action fExpandAllAction;
-
- public TestTableTree() {
- super();
- fExpandAllAction= new ExpandAllAction("Expand All", this);
- }
-public Viewer createViewer(Composite parent) {
- TableTreeViewer viewer = new TableTreeViewer(parent);
- viewer.setContentProvider(new TestModelContentProvider());
- viewer.setLabelProvider(new TestTableTreeLabelProvider());
- viewer.getTableTree().getTable().setLinesVisible(true);
-
- TableLayout layout = new TableLayout();
- viewer.getTableTree().getTable().setLayout(layout);
- viewer.getTableTree().getTable().setHeaderVisible(true);
- String headers[] = { "First Column", "Second Column" };
-
- ColumnLayoutData layouts[] =
- { new ColumnWeightData(100), new ColumnWeightData(100)};
-
- final TableColumn columns[] = new TableColumn[headers.length];
-
- for (int i = 0; i < headers.length; i++) {
- layout.addColumnData(layouts[i]);
- TableColumn tc = new TableColumn(viewer.getTableTree().getTable(), SWT.NONE, i);
- tc.setResizable(layouts[i].resizable);
- tc.setText(headers[i]);
- columns[i] = tc;
- }
- if (fViewer == null)
- fViewer = viewer;
-
- return viewer;
-}
-public static void main(String[] args) {
- TestBrowser browser = new TestTableTree();
- if (args.length > 0 && args[0].equals("-twopanes"))
- browser.show2Panes();
- browser.setBlockOnOpen(true);
- browser.open(TestElement.createModel(3, 10));
-}
-/**
- * Adds the expand all action to the tests menu.
- */
-protected void viewerFillMenuBar(MenuManager mgr) {
- MenuManager testMenu = (MenuManager) (mgr.findMenuUsingPath("tests"));
- testMenu.add(new Separator());
- testMenu.add(fExpandAllAction);
-}
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTableTreeLabelProvider.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTableTreeLabelProvider.java deleted file mode 100644 index e6b7a013f9b..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTableTreeLabelProvider.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.jface.resource.*;
-import org.eclipse.jface.tests.viewers.*;
-import org.eclipse.jface.viewers.*;
-
-public class TestTableTreeLabelProvider extends TestLabelProvider implements ITableLabelProvider{
-/**
- * Returns the label image for a given column.
- *
- * @param element the object representing the entire row. Can be
- * <code>null</code> indicating that no input object is set in the viewer.
- * @param columnIndex the index of the column in which the label appears. Numbering is zero based.
- */
-public Image getColumnImage(Object element, int columnIndex) {
- return getImage();
-}
-/**
- * Returns the label text for a given column.
- *
- * @param element the object representing the entire row. Can be
- * <code>null</code> indicating that no input object is set in the viewer.
- * @param columnIndex the index of the column in which the label appears. Numbering is zero based.
- */
-public String getColumnText(Object element, int columnIndex) {
- if (element != null)
- return element.toString() + " column " + columnIndex;
- return null;
-}
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTree.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTree.java deleted file mode 100644 index c0b6f111118..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTree.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-import org.eclipse.jface.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.tests.viewers.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jface.window.*;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import java.util.*;
-
-public class TestTree extends TestBrowser {
- TreeViewer fViewer;
- Action fExpandAllAction;
- public TestTree() {
- super();
- fExpandAllAction= new ExpandAllAction("Expand All", this);
- }
-/**
- *
- */
-public Viewer createViewer(Composite parent) {
- TreeViewer viewer = new TreeViewer(parent);
- viewer.setContentProvider(new TestModelContentProvider());
- viewer.setUseHashlookup(true);
-
- if (fViewer == null)
- fViewer = viewer;
- return viewer;
-}
- public static void main(String[] args) {
- TestBrowser browser= new TestTree();
- if (args.length > 0 && args[0].equals("-twopanes"))
- browser.show2Panes();
- browser.setBlockOnOpen(true);
- browser.open(TestElement.createModel(3, 10));
- }
- public void testTreeFillMenuBar(MenuManager testMenu) {
-
-
-
- }
-/**
- * Adds the expand all action to the tests menu.
- */
-protected void viewerFillMenuBar(MenuManager mgr) {
- MenuManager testMenu = (MenuManager) (mgr.findMenuUsingPath("tests"));
- testMenu.add(new Separator());
- testMenu.add(fExpandAllAction);
-}
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/WorldChangedAction.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/WorldChangedAction.java deleted file mode 100644 index 90cdad7402f..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/WorldChangedAction.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.eclipse.jface.tests.viewers.interactive;
-
-import org.eclipse.jface.viewers.*;
-/*
- * Licensed Materials - Property of IBM,
- * WebSphere Studio Workbench
- * (c) Copyright IBM Corp 1999, 2000
- */
-
-public class WorldChangedAction extends TestBrowserAction {
-
- public WorldChangedAction(String label, TestBrowser browser) {
- super(label, browser);
- }
- public void run() {
- ((StructuredViewer)getBrowser().getViewer()).refresh();
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Component Tests.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Component Tests.html deleted file mode 100644 index d32fcffa423..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Component Tests.html +++ /dev/null @@ -1,30 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>Workbench Manual Component Tests</title> -</head> -<body> - -<h2> -<b>Manual Component Tests for the Workbench (org.eclipse.ui)</b></h2> -Last updated June 2, 2002 - -<p> -<br><a href="WorkbenchLayout.txt">Workbench Layout</a> -<br><a href="WorkbenchAction.txt">Workbench Actions</a> -<br><a href="WelcomeEditor.txt">Welcome Editor</a> -<br><a href="Import.txt">Import</a> -<br><a href="Export.txt">Export</a> -<br><a href="Navigator.txt">Navigator View</a> -<br><a href="Outline.txt">Outline View</a> -<br><a href="PropertiesView.txt">Properties View</a> -<br><a href="Tasks.txt">Tasks View</a> -<br><a href="Preferences.txt">Preferences</a> -<br><a href="PropertiesDialog.txt">Properties Dialog</a> -<br><a href="TextEditor.txt">Text Editor</a> - -<br> - -</body> -</html> diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Export.txt b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Export.txt deleted file mode 100644 index 297d3df1d30..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Export.txt +++ /dev/null @@ -1,105 +0,0 @@ -This is a test script for the export wizard.
-
-Common Properties for All Pages
- Verify that all listboxes show appropriate scrollbars when
- their contents extends beyond their client area.
- The Cancel button is enabled all the time.
- Verify that Cancel discards all changes made to the wizard by
- doing the following:
- - on the Select page, choose any one of items in the list and click Next.
- - make change to the destination or the option settings or both.
- - cancel the wizard.
- - open the wizard again and ensure that the preselection of the Select page( if there was any ), and the values of
- the destination and the options remain the same as before the change.
-
-Select Page( first page )
- The Next button is enabled only if there is selection in the list.
- Verify that the destination from the most recent export, regardless
- of session, is preselected in the listbox.
- Verify icons for items in the list.
-
-Common Properties for the File System Page and the Zip File Page( second page )
-* Please run this test separately for each of the pages.
- [Presentation]
- The folder tree shows open projects only.
- Verify icons for files in the file listbox.
- [Enablement]
- The Back and Browse button are enabled and the Next button
- is disabled all the time.
- Finish is disabled if the destination folder is empty.
- If nothing is selected when Finish is pressed a warning dialog
- appears.
- The 'Select Types', 'Select All', and 'Deselect All' buttons
- are always enabled.
- [Selection Action]
- Verify that 'Select All' and 'Deselect All' work.
- Selecting a folder resource shows all files it has in the
- file listbox.
- Checking a folder resource checks all of its subfolders and
- its files, and always grey-checks its ancestor folders.
- Unchecking a folder unchecks files and subfolders underneath it.
- It unchecks its ancestor folder recursively.
- If it is last resource checked. Otherwise, it grey-checks
- its ancestor recursively.
- Checking a file always grey-checks the folder it is in.
- Unchecking a file unchecks its ancestor folder recursively
- if it is last resource selected.
- Otherwise, it grey-checks its ancestor recursively.
- [Select Types Dialog]
- Verify that the 'Other Extensions' text box shows only those
- user-defined file types that are not in the list.
- e.g.
- - type in *.java and click OK
- - open the dialog again and ensure that the .java check box is checked and the textbox does NOT have .java in it.
- - in the dialog, type in *.eclipse and click OK
- - open the dialog again and ensure that the textbox has .eclipse in it.
- The filter selects files by both checked file types and
- specified types from entire resources.
- Invoking the filter updates appropriate checkboxes of files and
- folders.
- [Destination]
- The destination combo listbox is preselected with the most
- recent destination to which the user exported.
- The destination combo listbox in the wizard stores the five
- most recent destinations to which resources were exported.
- [Options]
- The setting for common options are shared by pages.
- If the Overwrite checkbox is unchecked, exporting a resource
- to the same destination twice pops up the Confirm Overwrite
- dialog.
- If the Overwrite checkbox is checked, exporting a resource
- to the same destination twice does not invoke confirmation.
- [Persistence]
- Verify that the five most recent destinations stored in
- the destination listbox are persistent between sessions.
- Verify that the settings of the options are persistent
- between sessions.
- [Navigator View]
- If the wizard is invoked while there is a resource(s) selected
- in the navigator view, those resource(s) are checked in the folder tree.
-
-File System Page
- [Export]
- Verify that all files are exported successfully to the
- specified destination.
- If the 'Create directory structure' checkbox is unchecked,
- exporting creates a directory structure that roots from
- the root of the folder tree within the destination directory.
- If the 'Create directory structure' checkbox is checked,
- exporting creates the same directory structure as the
- workspace within the destination directory.
- [Browse for Folder Dialog]
- The destination textbox of the dialog is preselected with
- the current destination folder from the dialog.
- Specifying the destination in the dialog and then clicking OK
- updates the destination textbox of the wizard. Otherwise,
- the wizard is not updated.
-
-Zip File Page
- Verify that a .zip file is exported successfully to the
- specified destination.
- Use an external ZIP program to verify the following:
- - the ZIP file is extracted successfully by the ZIP program.
- - the ZIP file made with the 'Create directory structure'
- checkbox turned on has the same directory structure
- as the workspace.
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Import.txt b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Import.txt deleted file mode 100644 index 8e45aa2fcd5..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Import.txt +++ /dev/null @@ -1,79 +0,0 @@ -This is a test list for the import wizard.
-
-Common Properties for All Pages
- Verify that all listboxes show appropriate scrollbars when
- their contents extends beyond their client area.
- The Cancel button is enabled all the time.
- Verify that Cancel discards all changes made to the wizard by doing
- the following:
- - on the Select page, choose any one of items in the list and
- click Next.
- - make change to the destination or the option settings or both.
- - cancel the wizard.
- - open the wizard again and ensure that the preselection of
- the Select page( if there was any ), and the values of
- the destination and the options remain the same as before
- the change.
-
-Select Page( first page )
- The Next button is enabled only if there is selection in the list.
- Verify that the source from the most recent import, regardless
- of session, is preselected in the listbox.
- Verify icons for items in the list.
-
-Common Properties for Import Pages( second page )
-* Please run this test separately for each of the pages
- [Presentation]
- The source combo listbox stores the five most recent
- sources from which resources were imported.
- Verify icons for files in the file listbox.
- [Enablement]
- The Back button is enabled and the Next button is greyed out all the time.
- Both of the Browse buttons are enabled.
- The 'Select Types', 'Select All', and 'Deselect All' buttons are enabled only if there is at least one item in the folder tree.
- Finish is enabled only if there is one or more resources selected and the destination folder is not empty.
- [Selection Action]
- Verify that 'Select All' and 'Deselect All' work.
- Selecting a folder resource shows all files it has in the file listbox.
- Checking a folder resource checks all of its subfolders and its files, and always grey-checks its ancestor folders.
- Unchecking a folder unchecks files and subfolders underneath it. It unchecks its ancestor folder recursively if
- it is last resource checked. Otherwise, it grey-checks its ancestor recursively.
- Checking a file always grey-checks the folder it is in.
- Unchecking a file unchecks its ancestor folder recursively if it is last file selected. Otherwise, it grey-checks its ancestor recursively.
- [Select Types Dialog]
- Verify that the 'Other Extensions' text box shows only those user-defined file types that are not in the list.
- e.g.
- - type in *.java and click OK
- - open the dialog again and ensure that the .java check box is checked and the textbox does NOT have .java in it.
- - in the dialog, type in *.eclipse and click OK
- - open the dialog again and ensure that the textbox has .eclipse in it.
- Verify that the filter selects files by both checked file types and specified types among the selected resources only.
- Verify that invoking the filter updates appropriate checkboxes of files and folders.
- Verify that invoking the filter by one type and then immediately by a different type leaves all resources unchecked.
- [Destination Folder Selection Dialog]
- Go-into is enabled only if the selected folder has a subfolder.
- If the root of the tree widget is the same as the root of the workspace, Home is enabled and Back is not.
- If the root of the tree widget is NOT the same as the root of the workspace, Home is disabled and Back is enabled.
- Verify that Home, Back, and Go-Into work.
- Selecting a folder shows its complete path in the text box.
- Clicking on OK in the dialog updates the contents of the Folder textbox in the wizard.
- [Options]
- The setting for common options are shared by pages.
- If the Overwrite checkbox is unchecked, importing a resource to the same destination twice pops up the Confirm Overwrite dialog.
- If the Overwrite checkbox is checked, you can import a resource to the same destination twice without confirming it.
- [Navigator View]
- Verify that the navigator view is updated after importing.
- [Persistence]
- Verify that the five most recent sources stored in the source combo listbox are persistent between sessions.
- Verify that the settings of the options are persistent between sessions.
-
-File System Page
- Selecting a source directory shows its folder structure using itself as the root in the left tree.
- Verify that all of the selected resources are imported successfully.
- If the 'Complete folder structure' checkbox is unchecked, importing a resource creates a folder structure relative
- to the root of the tree widget in the destination folder.
- If the 'Complete folder structure' checkbox is checked, importing a resource creates a folder structure using the
- source's absolute path in the destination folder.
-
-Zip File Page
- Selecting a source archive shows its folder structure in the left tree AND checks all of resources in it.
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Navigator.txt b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Navigator.txt deleted file mode 100644 index 20fb31555e8..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Navigator.txt +++ /dev/null @@ -1,62 +0,0 @@ -This is a test list for the navigator view.
-
-Edit Actions
- Verify that enablement of Copy, Delete, Add Bookmark is consistent with that of the Navigator view's context menu, and that
- the same behaviour occurs.
-
-Presentation
- Verify that appropriate strings appear in all menu items and text fields.
- Verify icons for file, folder and project.
- Verify that the view shows appropriate scrollbars when its contents extends beyond its client area.
-
-Standard Object Actions
- Verify menu items: Copy, Move, Rename, Delete for all resouces.
- Verify that the DELETE key maps to the Delete action.
- Verify Delete on a read-only resource.
- Verify Properties for projects, folders, files, and combinations of the same.
- Verify that when the view is active, the status bar shows the full path of the selected resource.
-
-Actions on Multiselected Items
- If two or more resources are multiselected, Rename is disabled.
- If a project and its resource(s) are multiselected, Copy and Move do not show in the context menu.
- If a folder and its child resource(s) are multiselected, Copy and Move are disabled.
- Verify Delete on multiselected resources.
- Verify Copy and Move on multiselected files in the same project.
-
-File Specific Actions
- Verify menu content when file selected.
- Verify Add Bookmark only appears on files and the bookmark is created when invoked.
-
-Folder Specific Actions
- Verify the copy to the same folder and the different folder.
-
-Project Specific Actions
- Menu also includes Open Project, Close Project, Rebuild All
- Verify the disabled Go Into, Rename, Close Project, Rebuild All, Refresh From Local on a closed project
- Verify the disabled Open Project on an open project
-
-New Object Actions
- Invoke File New .. projects, items, other.
- Verify that the view's New menu is the same as File | New in the Window.
-
-View Actions
- Invoke Sort | by Name, | by Type in the pulldown menu. Avoid using only a.java and b.txt for a testing case since the result is the same
- regardless of the sort key.
- Invoke Filters... with Select All, Deselect All options.
- Invoke Show Version Info on a project that is managed.
-
-Navigation Actions
- The view keeps track of navigation history. Go Into and Go Up add an item. Back and Forward change the cursor in the history list.
- Select a project or folder, invoke Go Into, Go to | Back, Go to | Forward, and Go to | Up.
- Verify enablement of Go xx actions reflect selection and navigation history.
- - Go Into is enabled when an open, non-empty project or a non-empty folder is selected
- - Go Up is enabled when the input has a parent .
- - Go Forward is enabled when there are following items in the list, Go Back enabled when there are previous items.
- Verify that the view's titlebar displays the simple name of its input, and that its tooltip displays the full path of its input.
- Verify that the enablement and the actions of the navigation buttons in the local toolbar are consistent with the context menu.
- Verify that when a navigation button in the local toolbar is enabled, the fullpath of where the button leads to is appended to the button's tooltip.
- e.g If the path of the view's input is Project/Folder/MyFolder, the 'Up' button has the tooltip that says 'Up to Project/Folder'
-
-Persistence
- Verify that the sort type remains the same after closing and reopening the Navigator view
- Verify that the input is persistent between sessions.
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Outline.txt b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Outline.txt deleted file mode 100644 index 4ecc9af80c6..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Outline.txt +++ /dev/null @@ -1,14 +0,0 @@ -This is a test list for the outline view. The outine view is a container for pages contributed by open editors.
-We test the contribution and activation of those pages.
-
-Presentation
- Verify that the view shows appropriate scrollbars when its contents extends beyond its client area.
-
-Activation
- If you open a java editor or activate one, its outline contents appears in outline view.
- Switch between two or more java editors to verify the view is updated.
- Switching between java editors updates the outline view's local toolbar and context menu.
- Close one java editor, activating another, and see page in outline change.
- Switching from a java editor to a text editor shows blank in the outline view.
- Close last java editor to see the default blank page in outline.
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Preferences.txt b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Preferences.txt deleted file mode 100644 index 55cb74a6182..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Preferences.txt +++ /dev/null @@ -1,44 +0,0 @@ -This is a test list for the preferences dialog.
-
-Presentation
- Verify that the listbox on the left shows appropriate scrollbars
- when its contents extends beyond its client area.
- Verify that the window grows to fit the content page of the
- selected item.
- Verify that you can traverse all widget groups by pressing TAB.
-
-Actions
- Clicking on a item in the tree shows the corresponding page on
- the right, including the page title.
- Verify that Defaults sets all fields to the default values for
- the current content page ONLY.
- Verify that OK stores all changes made to fields by doing the following:
- - make some changes to checkboxes, option buttons, and textboxes.
- - click OK.
- - open the dialog again and ensure that all the changes were saved.
- Verify that Cancel discards all changes made to fields by doing
- the following:
- - make some changes to checkboxes, option buttons, and textboxes.
- - click Cancel.
- - open the dialog again and ensure that all the field values
- are the same as before the change.
- Verify that ESC maps to Cancel.
- Verify that Apply stores all changes made to values by doing the
- following:
- - make some changes to checkboxes, option buttons, and textboxes.
- - click Apply and then Cancel.
- - open the dialog again and ensure that all the changes were saved.
- Verify that Apply immediately updates the workbench settings by
- doing the following:
- - open a text file with the default text editor.
- - type something in the editor
- - open the preferences dialog, and click on Workbench | Default
- Text Editor
- - click Change... At the Font dialog, select a different font
- and a different font size. Click OK.
- - at the preferences dialog, Click Apply
- - without closing the preferences dialog, ensure that the
- settings for the text editor are updated.
-
-Persistence
- Verify that all field values are persistent all the time.
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/PropertiesDialog.txt b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/PropertiesDialog.txt deleted file mode 100644 index 268090a9113..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/PropertiesDialog.txt +++ /dev/null @@ -1,34 +0,0 @@ -This is a test script for the properties dialog.
-
-Presentation
- Verify that the listbox on the left shows appropriate scrollbars
- when its contents extends beyond its client area.
- Verify that the window grows to fit the content page of the
- selected item.
- Verify that you can traverse all widget groups by pressing TAB.
- Verify that the title bar shows the name of the resource about
- which the dialog shows information.
-
-Actions
- Clicking on a item that contributes in the tree shows the
- corresponding page on the right, including the page title.
- Clicking on a item that does not contribute in the tree shows
- the default page on the right.
- e.g. In the packages view, open the dialog on a package. The
- Team page should show the default page.
- Verify that OK stores all changes made to fields by doing the following:
- - make some changes to checkboxes, option buttons, and textboxes.
- - click OK.
- - open the dialog again and ensure that all the changes were saved.
- Verify that Cancel discards all changes made to fields by doing
- the following:
- - make some changes to checkboxes, option buttons, and textboxes.
- - click Cancel.
- - open the dialog again and ensure that all the field values
- are the same as before the change.
- Verify that ESC maps to Cancel.
- Verify that Apply stores all changes made to values by doing
- the following:
- - make some changes to checkboxes, option buttons, and textboxes.
- - click Apply and then Cancel.
- - open the dialog again and ensure that all the changes were saved.
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/PropertiesView.txt b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/PropertiesView.txt deleted file mode 100644 index f44c05d8f26..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/PropertiesView.txt +++ /dev/null @@ -1,41 +0,0 @@ -This is a test list for the properties view. The properties view is a container for pages contributed by open views and editors.
-We test the contribution and activation of pages in the view.
-
-Presentation
- Verify that the view shows appropriate scrollbars when its contents extends beyond its client area.
-
-Activation
- If you open a view with properties, verify that the page, the local toolbar and local menu bar in properties view are updated.
- e.g. Open the navigator view and see the change in the properties view.
- If you open another view, its own properties page should appear.
- Switch between two or more components to see page in view change.
- Close one part, activating another, to see page in view change.
- Close last editor to see default blank page in the view.
- Verify that the view shows the default page when the active view doesn't have source.
- Make sure Edit menu in the workbench targets the active page in the view.
- Verify that the enablement and action of the Categories, Filter, and Defaults buttons are consistent with the view's
-
- pulldown menu.
-
-Navigator View
- Verify that toggling the Show/Hide-Categories button shows/hides items in the corresponding category tree.
- Verify that the properties view shows correct values in the following fields for a selected resource in the navigator view
- editable, last modified, name, and path
- Verify that only files have values in the size field.
-
-Perisistence
- Verify that on start-up of the view, the view displays properties for the active part and selection of the contributing view.
-
-Property Sheet Example
- Before verifying any of the following tests, do:
- 1. Make sure the workbench example is already installed
- 2. Create a .usr file and open it
- 3. Show both the outline view and the properties view
-
- Verify that the 'Show/Hide Category' toggle button and the 'Restore Default' button work.
- Verify that selecting an item in the outline view shows all properties in the properties view.
- Verify that multiselecting items shows only their common properties.
- Verify that change made to a value for an item is persistent in same session.
- Verify that modifying a value for multiselected items changes the values for all of the selected items.
- Verify that changing the Name value for an item updates the page in the outline view.
- Verify that changing the Name values for multiselected items in the outline view updates the page in the outline view.
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Tasks.txt b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Tasks.txt deleted file mode 100644 index 4b470311f20..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/Tasks.txt +++ /dev/null @@ -1,48 +0,0 @@ -This is a test list for the tasks view.
-
-Presentation
- Verify that appropriate strings appear in all menu items and text fields.
- Verify icons for task items and problem items.
- Verify that the title bar shows the correct number of filtered items and total items.
- Verify that the view shows appropriate scrollbars when its contents extends beyond its client area.
-
-Common Actions
- Verify that header buttons in the table sort records by their respective column values in ascending/descending order alternatively.
- Verify that items that belong to files such as compile time errors are displayed only if their projects are open.
- Verify that Go To File is enabled only on file-bound items.
- Verify that double-click or Go To File on a file-bound item opens the file, if not alreadly open, and locates the code in the editor.
-
-Task Actions in Tasks View
- Verify that New Task, Delete, Delete Completed Tasks work.
- Verify that Delete is enabled only on task items.
- Verify that invoking Delete on a task item in an open file deletes the task marker from the editor.
- Verify that the enablement and action of the New Task and Delete buttons are consistent with those in the context menu.
- Verify that the DELETE button on the keyboard maps to Delete.
- Verify that the task status( completion ) and priority can be set for task items only.
-
-Problem Actions in Tasks View
- Verify that selecting a problem item displays its description message in the status bar of the workbench window.
-
-Filter Tasks Dialog
- Change the values then verify that the Reset button sets those values to default.
- Verify that tasks are filtered by the corresponding criterion of the On-any-resouce, On-selected-resouce-only, and
- On-selected-resouce-and-its-children radio buttons.
- Verify that tasks are filtered based on query word iff the description text box is not empty.
- Verify that only those tasks that contain( do not contain ) the query string show in the task view if the description combo-box
- has the value "Contains"( Does not contain ).
- Verify that the Where-problem-severity-is checkbox is enabled iff at least one of Build-path-Problem and Java-Problem in the tree is checked.
- Verify that the Where-task-priority-is and Where-task-status-is check boxes are enabled iff Task in the tree is checked.
- Verify that the enablement of the Where~ checkboxes determines the enablement of their option check boxes.
- Verify that a newly created task by New Task is affected by the current setting of the filter.
-
-Actions in Text Editor
- Verify that for a line that doesn't have a task, you can add one. It should appear in the vertical ruler and in the view
- with adequate values set in the Resouce, In Folder, and Location fields.
- Verify that for a line that has a task. you can remove the task. It disappears from the vertical ruler and from the view.
- Verify that selecting a task item from the view opens the file, if not already open, and locates the code.
-
-Persistence
- Verify that the view retains its items after being closed and reopened.
- Verify that the view maintains the sort order and filtering between sessions.
- Verify that the top index and the selection of the view are consistent between sessions, and after inserting or detaching the view.
-
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/TextEditor.txt b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/TextEditor.txt deleted file mode 100644 index a08d32e5033..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/TextEditor.txt +++ /dev/null @@ -1,18 +0,0 @@ -This is a test list for the text editor.
-
-Presentation
- Verify that appropriate strings appear in all menu items and text fields.
- Verify that the view shows appropriate scrollbars when its contents extends beyond its client area.
-
-Editor Actions
- Verify that Cut and Copy are enabled iff there is selected text.
- Verify that Paste is enabled iff there is text in the clipboard buffer.
- Verify that Cut, Copy, Paste, Select-All work correctly.
- Verify that Revert is enabled only if is the file dirty and works correctly.
-
-Edit Menu Actions
- Verify that the enablement and action of Cut, Copy, Paste, and Select-All in the Edit menu are consistent with those in the editor's context menu.
-
-Persistence
- The editor is marked dirty if the text is modified by either the keyboard OR the editor actions.
- The editor is marked clean after either saving the file or reverting it.
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/WelcomeEditor.txt b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/WelcomeEditor.txt deleted file mode 100644 index c57b3fcc74e..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/WelcomeEditor.txt +++ /dev/null @@ -1,20 +0,0 @@ -This is a test list for the welcome editor.
-
-Presentation
- Verify that the editor appears when the workbench runs for the first time.
- Verify that the editor shows appropriate scrollbars when its contents extends beyond its client area.
- Verify that if the editor is closed when the workbench closes, the editor remains closed in next session.
- Verify that modifying the editor's entry in the product.ini file updates the workbench by following the steps below.
- 1. Make sure the editor is closed when exiting Eclipse.
- 2. Open product.ini with a text editor and remove the wecome editor's entry from the file, which is:
- welcomePage = welcome.xml
- 3. Restart Eclipse.
- 4. Verify that Welcome doesn't show under Help in the workbench pulldown menu.
- 5. Exit Eclipse
- 6. Add the entry as in step 2 back to product.ini
- 7. Resart Eclipse
- 8. Verify that Welcome shows again under Help.
-
-Actions
- Verify that Help->Welcome invokes the editor.
- Verify that all links invoke their corresponding actions.
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/WorkbenchAction.txt b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/WorkbenchAction.txt deleted file mode 100644 index 292fb1a883d..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/WorkbenchAction.txt +++ /dev/null @@ -1,49 +0,0 @@ -This is a test script for actions in the workbench.
-
-File Actions ..
- Invoke File New .. projects, items, other.
- Invoke Toolbar button for File New .. projects, items, other.
- Verify close and save action enablement with
- - no editors open
- - one editor
- - one dirty editor
- - after revert
- - two editors
- - two dirty editors
- - after close all
- Verify actions when switching between pages ( one with dirty editor,
- other without ).
- Verify after all pages closed.
- Open many editors, close all, test MRU list.
- Open an editor and try to print the contents.
-
-Edit Actions ..
- Verify global actions track global part.
- Verify editor contributions appear in action bars when is opened.
- Verify editors of same type reuse contributions.
- Verify editors of different type cause contribution change.
- Verify editor contributions are removed when editor is closed.
- Verify edit actions are consistent when switching between pages.
-
-Perspective Actions ..
- Open = always enabled
- Verify other actions only enabled when a page is open.
- Verify "open new window", "open new page", and "replace with"
- using shift and control key options.
- Verify "Save As" by modifying current persp, save as, close, reopen.
- Verify "Reset" by modifying current persp, then reset.
- Verify Preference page.
- Hide Editors, Show Editors
- Hide Editors, Open new editor, verify implicit show editors.
-
-Action Sets ..
- Confirm order is consistent. Add all actions, record order,
- then remove and re-add. Select action sets to verify order.
- Test Customization of File New, Perspective Open, and Show View.
- Confirm editor actions have consistent place ..
- - start with no editors
- - show x action sets
- - open editor, verify editor actions after sets
- - hide x action sets
- - show x action sets
- Verify action set order persisted between sessions.
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/WorkbenchLayout.txt b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/WorkbenchLayout.txt deleted file mode 100644 index 910249ef691..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Component Tests/WorkbenchLayout.txt +++ /dev/null @@ -1,94 +0,0 @@ -This is a test script for layout in the workbench.
-
-Folder Creation ..
- - DnD view over view
- - DnD view over folder
- - DnD view over view in floating window
- - NEG TEST - DnD view over editor area.
- - DnD editor over editor
- - DnD editor over editor folder
- - NEG TEST - DnD editor over view area.
-
-Folder Breakdown ..
- - DnD view out of folder with 2
- - DnD view out of folder with 3. Folder should remain.
- - DnD view out of folder in floating window
- - DnD editor out of editor folder with 2
- - DnD editor out of editor folder with 3. Folder should remain
-
-Relative Drag and Drop ..
- - DnD view to top, right, bottom, left of another view
- - DnD view to top, right, bottom, left of folder
- - DnD view to top, right, bottom, left of editor area.
- - DnD editor within editor area
-
-Detached Windows ..
- - DnD view out of window, open detached window
- - DnD view back into window, close detached window
- - DnD second view over floating window
- - DnD second view out of floating window to create second
- detached window
- - DnD second view out of floating window onto main.
-
-Tab Items
- - reorder items in view folder by dragging tabs
- - reorder itmes in editor folder by dragging tabs
-
-Fast Views
- - DnD view over shortcut bar. It should become fast view
- - Open fast view. Unpin. It should return to last position in
- root layout.
-
-Page Switch
- - Verify layout persistance of main window when switching pages
- - Verify layout persistance of detached windows when switching pages
-
-Zoom
- - zoom / unzoom view in root layout
- - zoom / unzoom view in folder. Verify folder not visible
- - zoom / unzoom editor in single folder. Verify no other
- editors visible
- - zoom / unzoom editor in mult-folder editor area. Verify no
- other editors visible
- - NEG TEST - zoom / unzoom view in detached window. Should have
- no effect
-
-The following actions should maintain zoom
- - Show View ( if it is zoomed View )
- - Show View ( if view is visible in Detached Window )
- - switch to another page and back
- - click on any visible view or editor
- - Show / hide fast view
-
-The following actions should cause unzoom
- - Open editor
- - Close editor
- - Close all editors
- - Show / Hide editor area
- - Show view / editor which is not visible
- - Activate view / editor which is not visible
- - Reset perspective
- - Save perspective
- - Change perspective
- - DnD zoom view out of main window to detached window
- - DnD view in detached window onto zoom view
-
-The following actions cause unzoom now, but it would be convenient
-if they didn't in future
- - Close detached view.
- - All DnD
-
-Persistance Between Sessions
- - ensure layout is persisted between sessions
- - fast views
- - view layout
- - detached windows
- - open editors
-
-Placeholders
- - Drag view to new position, close, reopen.
- - Drag view to folder, close, reopen.
- - Drag view to detached, close, reopen.
- - Close all views in folder, reopen one by one.
- - Make view fast, restore.
- - Make folder fast, restore views one by one.
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Bookmarks View.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Bookmarks View.html deleted file mode 100644 index 239850f6d91..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Bookmarks View.html +++ /dev/null @@ -1,82 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>Test Scenario: Bookmarks View</title> -</head> -<body> - -<h3> -Bookmarks View</h3> -Purpose: To test the Bookmark view in Eclipse. We will open the view, -add a number of bookmarks to some files, open the source file for each -bookmark and then delete those bookmarks. -<p>Setup: -<ol> -<li> -Install Eclipse Platform.</li> - -<li> -Create a java project containing three java files and a text file.</li> -</ol> -Method: -<ol> -<li> -Start the workbench.</li> - -<li> -Invoke Perspective > Show View > Bookmarks and verify that the Bookmarks -view appears.</li> - -<li> -Select a java file in the navigator and invoke Edit > Add Bookmark. -Verify that a new bookmark appears in the Bookmarks view for the selected -java file.</li> - -<li> -Double click the bookmark in the bookmarks view and verify that an editor -opens on the source file.</li> - -<li> -Select the 10th line of text in the editor and invoke Add Bookmark in the -context menu. A dialog should appear where you can type the bookmark -label. Enter "Line 10" and press OK. Verify that another bookmark -appears in the Bookmarks view with the label "Line 10". A bookmark -icon should also appear in the editor to the left of line 10.</li> - -<li> -Close the editor.</li> - -<li> -Select "Line 10" in the bookmarks view and press the "Go to File" button -in the toolbar. Verify that an editor opens on the source file and -that line 10 is selected.</li> - -<li> -Right click on the bookmark icon in the editor and invoke "Remove Bookmark". -Verify that the bookmark disappears in the editor and the bookmarks view.</li> - -<li> -In the navigator select all three java files, verify that "Add Bookmark" -is enabled, and then invoke it. Verify that 3 bookmarks are appear -in the bookmarks view.</li> - -<li> -Select a project, folder, or any combination of project | folder with file. -Verify that "Add Bookmark is disabled.</li> - -<li> -Go to the bookmarks view and invoke "Select All" from the context menu. -Verify that everything is selected.</li> - -<li> -Then press "Return" in the bookmarks view and verify that all of the bookmarks -are opened in editors.</li> - -<li> -Invoke "Delete" in the bookmarks view and verify that all bookmarks are -deleted.</li> -</ol> - -</body> -</html> diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/File System Export.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/File System Export.html deleted file mode 100644 index 15d8a579dca..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/File System Export.html +++ /dev/null @@ -1,97 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="OTI Employee">
- <meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
- <title>File System Export</title>
-</head>
-<body>
-
-<center>
-<h1>
-File System Export</h1></center>
-
-<h2>
-Purpose</h2>
-The plan is to export a project with a large number files/folders at a
-time, using the file system wizard. The results should be indentical in
-layout and content as the original project used.
-<h2>
-Setup</h2>
-
-<ul>
-<li>
-Download the JUnit zip file source code from www.junit.org.</li>
-
-<li>
-Start the Eclipse workbench</li>
-
-<li>
-Create a new temporary "simple" project called "JUnit Test"</li>
-
-<li>
-Import the JUnit zip file into the project</li>
-
-<li>
-Select File -> Export, select File System and press Next.</li>
-</ul>
-
-<h2>
-Export from a project to a new directory</h2>
-
-<ol>
-<li>
-Select the "JUnit Test" project and mark it as checked.</li>
-
-<li>
-In the Directory field, type in the directory to export to.</li>
-
-<li>
-Press Finish</li>
-
-<li>
-Verify that the contents on the file system match the same file and folder
-structure as the source project</li>
-
-<li>
-Verify the content of the files.</li>
-</ol>
-
-<h2>
-Export from a project to an existing directory</h2>
-
-<ol>
-<li>
-Select the "JUnit Test" project and mark it as checked.</li>
-
-<li>
-In the Directory field, type in the directory to export to.</li>
-
-<li>
-Check the option "Overwrite existing resources without warning"</li>
-
-<li>
-Press Finish</li>
-
-<li>
-Verify you were not prompted to overwrite files</li>
-
-<li>
-Verify that the contents on the file system match the same file and folder
-structure as the source project.</li>
-
-<li>
-Verify the content of the files.</li>
-</ol>
-
-<h2>
-Cleanup</h2>
-
-<ul>
-<li>
-Delete the temporary project "JUnit Test"</li>
-</ul>
-
-</body>
-</html>
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/File System Import.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/File System Import.html deleted file mode 100644 index ee56ff96558..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/File System Import.html +++ /dev/null @@ -1,105 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="OTI Employee">
- <meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
- <title>File System Import</title>
-</head>
-<body>
-
-<center>
-<h1>
-File System Import</h1></center>
-
-<h2>
-Purpose</h2>
-The plan is to import a large number files/folders at a time, using the
-file system wizard. The results should be indentical in layout and content
-as the original source used.
-<h2>
-Setup</h2>
-
-<ul>
-<li>
-Download the JUnit source code from www.junit.org and extract the contents
-into a folder in the file system.</li>
-
-<li>
-Start the Eclipse workbench</li>
-
-<li>
-Create a new temporary "simple" project called "JUnit Test"</li>
-
-<li>
-Select File -> Import, select File System and press Next.</li>
-</ul>
-
-<h2>
-Import into a new project</h2>
-
-<ol>
-<li>
-Click the Browse button and select the directory where the source files
-are located.</li>
-
-<li>
-Expand the folders in the tree view and until "junit" folder is visible
-and check mark the box next to it</li>
-
-<li>
-Type in "JUnit Test" in the Folder field</li>
-
-<li>
-Press Finish</li>
-
-<li>
-Verify that the contents of the project match the same file and folder
-structure as the source in the file system.</li>
-
-<li>
-Verify that the content of the files.</li>
-</ol>
-
-<h2>
-Import into an existing project</h2>
-
-<ol>
-<li>
-Click on the Directory drop down box and select the directory where the
-source files are located</li>
-
-<li>
-Expand the folders in the tree view and until "junit" folder is visible
-and check mark the box next to it</li>
-
-<li>
-Type in "JUnit Test" in the Folder field</li>
-
-<li>
-Check the option "Overwrite existing resources without warning"</li>
-
-<li>
-Press Finish</li>
-
-<li>
-Verify you were not prompted to overwrite files</li>
-
-<li>
-Verify that the contents of the project match the same file and folder
-structure as the source in the file system.</li>
-
-<li>
-Verify that the content of the files.</li>
-</ol>
-
-<h2>
-Cleanup</h2>
-
-<ul>
-<li>
-Delete the temporary project "JUnit Test"</li>
-</ul>
-
-</body>
-</html>
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Navigator View.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Navigator View.html deleted file mode 100644 index 180eb68fae3..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Navigator View.html +++ /dev/null @@ -1,137 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>Test Scenario: Navigator View</title> -</head> -<body> -<h3> -Navigator View</h3> -Purpose: To test the Navigator view in Eclipse. We will start out -with an empty workspace, create some projects and files, open files, open -some new perspectives, delete some files, test the filtering and sorting -options, and test the persistance of view state between sessions. -<p>Setup: -<ol> -<li> -Install Eclipse Platform.</li> - -<li> -Delete the metadata for org.eclipse.ui.</li> -</ol> -Method: -<ol> -<li> -Start the workbench. Confirm that the default perspective (Resource) -and welcome editor both appear.</li> - -<li> -Create a project using the File > New wizard and verify that it appears -in the navigator.</li> - -<li> -Create another project by invoking New > Project from the navigator popup -menu. Verify that it appears in the navigator.</li> - -<li> -Create a .txt file, a .html file, and a .java file by invoking New > File -from the navigator popup menu. Verify that these files appear in -the navigator and that an editor is opened on each. Close all of -these editors.</li> - -<li> -In the Navigator you can change the input. To test this create a -couple of nested folders in a project using the New > Folder action in -the navigator context menu. Then select the top level folder and -and invoke Go Into. Verify that the input for the view changes (it -is shown in the view title) and that only the resources in the input folder -are visible. If you perform the same operation many times you create -a history list in the navigator. Try navigating up and down the history -by using the Back and Forward buttons on the view toolbar.</li> - -<li> -If you select a file you can open it from the context menu. Open -a .txt file and verify that the default text editor opens. Open a -.java file and verify that the java editor opens.</li> - -<li> -You can also open a file in a specific editor. Select a .java file -and invoke Open With > Default Text Editor. The default text editor -should open rather than the java editor. If you select Open With -> System Editor something like notepad should open. The preferred -editor for a file is always indicated with a check mark in the Open With -menu.</li> - -<li> -In the navigator you can open new perspectives. Select a project -or folder in the navigator and invoke Open Perspective > Java from the -context menu. Verify that a new perspective appears with the Java Perspective -and that the input for the navigator is the project. -Close it and go back to the first perspective.</li> - -<li> -The contents of the Open Perspective menu are determined by the perspective -properties. Note the contents of this menu. Then invoke Perspective -> Customize and change the checked perspectives. Press OK and verify -that the contents of Open Perspective reflect the new options.</li> - -<li> -The Navigator has support for drag and drop. Try dragging a file -from one project to another. A cursor should appear to indicate the -drop target. If you release the file it will be moved to the target.</li> - -<li> -In the navigator select a project, folder or file and try out Copy, Move -and Rename in the context menu.</li> - -<li> -Select a project, folder or file and invoke Delete in the context menu -to delete it. Verify that the item disappears from the navigator. -The delete action is also available in the window Edit menu. Select -an item, invoke Edit > Delete, and verify that it has the same behavior.</li> - -<li> -Select a file in the navigator and invoke Add Bookmark from the context -menu. Open up the Bookmark view and verify that a bookmark now exists. -If you double click on the bookmark an editor should open on the bookmark -source file. Verify that Add Bookmark is not available if a project -or folder is selected in the navigator.</li> - -<li> -Select a project and invoke Close Project from the context menu. -At this point the icon should change to a closed folder and all of the -contents will be hidden. Invoke Open Project to reopen it and navigate -the contents.</li> - -<li> -If you select a resource and invoke Properties.. a properties dialog should -appear. It will contain at least an Info, Project Referenes and Team -page for projects, and an Info and Team page for folders or files.</li> - -<li> -In the navigator you can sort items by name or type. Try out these -options in the pulldown menu and verify that they have the correct affect. -All sorting is done in ascending order. You can also filter items -out. Create a couple of .class and .* files and experiment with the -filter options. You should be able to hide or show these files as -desired.</li> - -<li> -The selection in the navigator is linked to the active editor. Open -a couple of files. Then switch between the editors and verify that -the editor input is selected in the navigator. Now select one of -the open files in the navigator and verify that the corresponding editor -is activated. You can disable this option by turning off "Link navigator -selection to active editor" in the workbench preferences. Then verify -that no selection occurs in the navigator as you switch between editors. -Turn it back on and verify that selection works again.</li> - -<li> -The state of the navigator (input, expansion) should be stored between -sessions. To test this open a perspective with the navigator, change -the input and expansions state, and then close the workbench. Restart -the workbench and verify that the input and expansion state is restored.</li> -</ol> - -</body> -</html> diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/New File Wizard.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/New File Wizard.html deleted file mode 100644 index ee9272bbba9..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/New File Wizard.html +++ /dev/null @@ -1,94 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="OTI Employee">
- <meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
- <title>New File Wizard</title>
-</head>
-<body>
-
-<center>
-<h1>
-New File Wizard</h1></center>
-
-<h2>
-Purpose</h2>
-The plan is to create a single empty file. The end result of this wizard
-should be an empty file opened in the proper editor for its type.
-<h2>
-Setup</h2>
-
-<ul>
-<li>
-Start the Eclipse workbench</li>
-
-<li>
-Create a temporary project called "File Test"</li>
-
-<li>
-Select File->New->File from the resource perspective</li>
-</ul>
-
-<h2>
-Create file at project root</h2>
-
-<ol>
-<li>
-Select the project File Test</li>
-
-<li>
-In the File Name field, type in f1.txt</li>
-
-<li>
-Press the Finish button</li>
-
-<li>
-Verify a new f1.txt file is created under the File Test project (in navigator
-view and in the file system)</li>
-
-<li>
-Verify the default text editor opened on f1.txt</li>
-
-<li>
-Verify the content of f1.txt is empty</li>
-</ol>
-
-<h2>
-Create file in new folder</h2>
-
-<ol>
-<li>
-In the "Enter or select the folder" field, type in File Test/folder</li>
-
-<li>
-In the File Name field, type in f1.txt</li>
-
-<li>
-Press the Finish button</li>
-
-<li>
-Verify that "folder" was created under the File Test project (in navigator
-view and in the file system)</li>
-
-<li>
-Verify a new f1.txt file is created under "folder" (in navigator view and
-in the file system)</li>
-
-<li>
-Verify the default text editor opened on f1.txt</li>
-
-<li>
-Verify the content of f1.txt is empty</li>
-</ol>
-
-<h2>
-Cleanup</h2>
-
-<ul>
-<li>
-Delete the temporary project "File Test"</li>
-</ul>
-
-</body>
-</html>
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/New Folder Wizard.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/New Folder Wizard.html deleted file mode 100644 index 186cd1d9d05..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/New Folder Wizard.html +++ /dev/null @@ -1,60 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="OTI Employee">
- <meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
- <title>New Folder Wizard</title>
-</head>
-<body>
-
-<center>
-<h1>
-New Folder Wizard</h1></center>
-
-<h2>
-Purpose</h2>
-The plan is to create a single empty folder. The end result of this wizard
-should be an empty folder.
-<h2>
-Setup</h2>
-
-<ul>
-<li>
-Start the Eclipse workbench</li>
-
-<li>
-Create a temporary project called "Folder Test"</li>
-
-<li>
-Select File->New->Folder from the resource perspective</li>
-</ul>
-
-<h2>
-Create folder at project root</h2>
-
-<ol>
-<li>
-Select the project Folder Test</li>
-
-<li>
-In the Folder Name field, type in f1</li>
-
-<li>
-Press the Finish button</li>
-
-<li>
-Verify a new f1 folder is created under the Folder Test project (in navigator
-view and in the file system)</li>
-</ol>
-
-<h2>
-Cleanup</h2>
-
-<ul>
-<li>
-Delete the temporary project "Folder Test"</li>
-</ul>
-
-</body>
-</html>
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/New Project Wizard.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/New Project Wizard.html deleted file mode 100644 index 9929f46aa41..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/New Project Wizard.html +++ /dev/null @@ -1,92 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="OTI Employee">
- <meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
- <title>New Project Wizard</title>
-</head>
-<body>
-
-<center>
-<h1>
-New Project Wizard</h1></center>
-
-<h2>
-Purpose</h2>
-The plan is to create a single empty project. The end result of this wizard
-should be an empty project.
-<h2>
-Setup</h2>
-
-<ul>
-<li>
-Start the Eclipse workbench</li>
-
-<li>
-Extract the junit.jar file into a directory on the file system</li>
-
-<li>
-Select File->New->Project from the resource perspective</li>
-
-<li>
-Select Simple and then Project and Press Next</li>
-</ul>
-
-<h2>
-Create project at default location</h2>
-
-<ol>
-<li>
-In Project Name field, type in Project Test</li>
-
-<li>
-Press Next and select another project as a reference project</li>
-
-<li>
-Press the Finish button</li>
-
-<li>
-Verify a new Project Test project is created (in navigator view and in
-the file system)</li>
-
-<li>
-Verify, in the project's properties dialog, that the Project References
-page includes the project referenced.</li>
-</ol>
-
-<h2>
-Create project at specific location</h2>
-
-<ol>
-<li>
-In Project Name field, type in Project Test2</li>
-
-<li>
-Uncheck the Use Default Location option</li>
-
-<li>
-In the Location field, type in the directory containing the junit source
-code.</li>
-
-<li>
-Press the Finish button</li>
-
-<li>
-Verify a new Project Test2 project is created (in navigator view)</li>
-
-<li>
-Verify the contents of the project match the files/folders for junit on
-the file system</li>
-</ol>
-
-<h2>
-Cleanup</h2>
-
-<ul>
-<li>
-Delete projects Project Test and Project Test2</li>
-</ul>
-
-</body>
-</html>
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Outline View.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Outline View.html deleted file mode 100644 index a7aa0b46ec6..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Outline View.html +++ /dev/null @@ -1,67 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>Test Scenario: Outline View</title> -</head> -<body> - -<h3> -Outline View</h3> -Purpose: To test the Outline view in Eclipse. The Outline view is -just a container for the pages contributed by open editors. Therefore, -this test will focus on the creation, show, and closure of those pages. -<p>Setup: -<ol> -<li> -Install Eclipse Platform.</li> - -<li> -Create a java project containing three java files and a text file.</li> -</ol> -Method: -<ol> -<li> -Start the workbench.</li> - -<li> -If any editor is open close it.</li> - -<li> -Verify that the Outline view is empty and contains the text "An Outline -is not available".</li> - -<li> -Open an editor on a java file. Verify that a java page appears in the outline -view. If you select items in this page the scroll and selected text -within the editor should change.</li> - -<li> -Open a second file in a java editor. Verify that a second java page -appears in the outline view.</li> - -<li> -If you switch between the two editors the visible page should change.</li> - -<li> -Open a .txt file in a text editor. When this editor is active the -outline view will be empty and contain the standard empty text as described -in step 2.</li> - -<li> -If you switch between a text and java editor the visible page should change. -Verify that the toolbar and menu items in the outline also chnage. -The java editor has Field and Member toolbar items.</li> - -<li> -Close one editor. If another editor is activated verify that its -outline page is now visible. If no editor is activated verify that -the outline is empty.</li> - -<li> -Close the last editor and verify that the default blank page is visible -in the outline.</li> -</ol> - -</body> -</html> diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Persistence.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Persistence.html deleted file mode 100644 index 2d5c2b20ca9..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Persistence.html +++ /dev/null @@ -1,55 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>Test Scenario: Persistence</title> -</head> -<body> -<h3> -Persistence</h3> -Purpose: To test persistence in the workbench. -<p>Setup: -<ol> -<li> -Install Eclipse Platform.</li> - -<li> -Delete the metadata for org.eclipse.ui.</li> -</ol> -Method: -<ol> -<li> -Start the workbench. Confirm that the default perspective (Resource) -and welcome editor both appear.</li> - -<li> -Create a project with 3 files, one.txt, two.txt, and three.txt. Open -one.txt in the default perspective.</li> - -<li> -In the navigator select the project and invoke Open Perspective > Java -from the context menu. Verify that a new Java perspective appears -in the current window. The input for the Packages view and navigator -should be the project.</li> - -<li> -Open two.txt in the Java perspective.</li> - -<li> -Change the Workbench Preferences for "Open Perspective" to "Open in New -Window". Then open a Java perspective and verify that a new window -is created.</li> - -<li> -Now we have two windows. The first window has two perspectives (resource -and java). In the resource perspective one.txt is open in an editor. -In the java perspective two.txt is open in an editor. In the second -window here is one Java perspective with no open editors.</li> - -<li> -Invoke File > Exit. Then restart the workbench and verify that the -window, perspective and editor state of the workbench is restored.</li> -</ol> - -</body> -</html> diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Preferences.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Preferences.html deleted file mode 100644 index ebcf11a23e8..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Preferences.html +++ /dev/null @@ -1,92 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>Test Scenario: Preferences</title> -</head> -<body> - -<h3> -Preferences</h3> -Purpose: To test the Preferences in Eclipse. We will open the Preferences -dialog, select some pages, change and apply preferences, verify their affect, -and test persistence between sessions. -<p>Setup: -<ol> -<li> -Install Eclipse Platform.</li> -</ol> -Method: -<ol> -<li> -Start the workbench.</li> - -<li> -Invoke Window > Preferences and verify that the Preferences dialog appears. -Click on all of the items in the left hand viewer to demonstrate that each -item has a valid page and no exceptions occur in their creation. -Now close the dialog.</li> - -<li> -The behavior of the workbench can be customized using the preferences. -To see this in action we will examine various preferences which ship with -Eclipse.</li> - -<li> -The selection in the navigator is linked to the active editor. Open -a couple of files. Then switch between the editors and watch how -the input for the active editor is selected in the navigator. You -can disable this option in the Preferences. To do this ..</li> - -<ol> -<li> -Open the preferences dialog.</li> - -<li> -Turning off "Link navigator selection to active editor" in the workbench -preferences.</li> - -<li> -Press OK. The dialog should close.</li> - -<li> -Now switch between the editors. Notice that the selection in the -navigator does not change.</li> -</ol> - -<li> -The Perspective > Open menu action can also be customized. By default -this action will open a new perspective in the current window. You -can change this to "open in new window" or "replace other". To see -this behavior ..</li> - -<ol> -<li> -Open the preferences dialog. Change the workbench preferences for -"Open Perspective" to "Open in New Window". Then press OK</li> - -<li> -Invoke Perspective > Open > Java. Notice how a new window is created -for the perspective. The list of open windows is shown in the Window -menu. Select these items to switch between the windows.</li> -</ol> - -<li> -If you don't like the current preferences you can reset them. Open -the preferences dialog again. To reset the state of "Link navigator -.." and "Open Perspective .." press the Restore Defaults button. -If you press OK the options will be saved. However, let's assume -that you decide not to change them. Press Cancel. Then verify -that the deviant options have not been restored to default by switching -between editors and opening a new perspective.</li> - -<li> -Invoke File > Exit. Then restart the workbench.</li> - -<li> -Open the preferences dialog and confirm tha "Link navigator .. " and "Open -Perspective .." still reflect the customized values. The workbench -will automatically save your preferences between sessions.</li> -</ol> -</body> -</html> diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Properties Dialog.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Properties Dialog.html deleted file mode 100644 index 53288406b44..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Properties Dialog.html +++ /dev/null @@ -1,106 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="OTI Employee">
- <meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
- <title>Properties Dialog</title>
-</head>
-<body>
-
-<center>
-<h1>
-Properties Dialog</h1></center>
-
-<h2>
-Purpose</h2>
-The plan is to confirm the default property pages for simple file, folder,
-and project resources.
-<h2>
-Setup</h2>
-
-<ul>
-<li>
-Start the Eclipse workbench</li>
-
-<li>
-Create a simple Project, Folder, and File</li>
-</ul>
-
-<h2>
-Project property pages</h2>
-
-<ol>
-<li>
-Select the simple Project, from the context menu select Properties</li>
-
-<li>
-Click on the Project References page</li>
-
-<li>
-Verify that the Project References page includes no project references</li>
-
-<li>
-Click on the Info page</li>
-
-<li>
-Verify the content is correct</li>
-
-<li>
-Check the Read Only option and press OK</li>
-
-<li>
-Verify that creating another simple file in the simple Project is disallowed</li>
-</ol>
-
-<h2>
-Folder property pages</h2>
-
-<ol>
-<li>
-Select the simple Folder, from the context menu select Properties</li>
-
-<li>
-Click on the Info page</li>
-
-<li>
-Verify the content is correct</li>
-
-<li>
-Check the Read Only option and press OK</li>
-
-<li>
-Verify that creating another simple file in the simple Folder is disallowed</li>
-</ol>
-
-<h2>
-File property pages</h2>
-
-<ol>
-<li>
-Select the simple File, from the context menu select Properties</li>
-
-<li>
-Click on the Info page</li>
-
-<li>
-Verify the content is correct</li>
-
-<li>
-Check the Read Only option and press OK</li>
-
-<li>
-Verify that editing the simple File is disallowed (editor is opened but
-cannot type in it)</li>
-</ol>
-
-<h2>
-Cleanup</h2>
-
-<ul>
-<li>
-Delete the simple File, Folder, and Project</li>
-</ul>
-
-</body>
-</html>
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Properties View.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Properties View.html deleted file mode 100644 index b4c2ade384a..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Properties View.html +++ /dev/null @@ -1,53 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>Test Scenario: Properties View</title> -</head> -<body> - -<h3> -Properties View</h3> -Purpose: To test the Properties view in Eclipse. The Outline view -is just a container for the pages contributed by other editors and views -within the workbench. Therefore, this test will focus on the creation, -show, and closure of those pages. -<p>Setup: -<ol> -<li> -Install Eclipse Platform.</li> - -<li> -Create a project containing some files.</li> -</ol> -Method: -<ol> -<li> -Start the workbench.</li> - -<li> -Open the Navigator, Packages and Properties views.</li> - -<li> -Select a file in the Navigator. Verify that the properties for this -file are visible in the Properties view.</li> - -<li> -Select a project in the Packages view. Verify that the properties -for ths file are onw visible in the properties view.</li> - -<li> -Activate the Navigator, Packages, Navigator, and Packages view by clicking -in the title area of the view. Verify that the visible propreties -in the properties view change to reflect the active part.</li> - -<li> -Close the properties view.</li> - -<li> -Open the view and verify that it shows the properties for the last selection -in the workbench.</li> -</ol> - -</body> -</html> diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Tasks View.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Tasks View.html deleted file mode 100644 index ceb5561ab7f..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Tasks View.html +++ /dev/null @@ -1,105 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>Test Scenario: Tasks View</title> -</head> -<body> - -<h3> -Tasks View</h3> -Purpose: To test the Tasks view in Eclipse. We will create a java -project with java classes, introduce errors in those classes, add tasks -to the files, and then verify them in the tasks list. We also test -the persistance of task filtering between sessions. -<p>Setup: -<ol> -<li> -Install Eclipse Platform.</li> -</ol> -Method: -<ol> -<li> -Start the workbench.</li> - -<li> -Create a Java Project named TaskProject. Then create a class named -TaskClass with the following content.</li> - -<p><br><tt>public class TaskClass {</tt> -<br><tt> private int y;</tt> -<br><tt> public TaskClass() {</tt> -<br><tt> }</tt> -<br><tt> public void doThis() {</tt> -<br><tt> }</tt> -<br><tt> abstract public void doThat();</tt> -<br><tt> public int getX() {</tt> -<br><tt> return x;</tt> -<br><tt> }</tt> -<br><tt>}</tt> -<br> -<li> -If you save this file 2 errors will appear in the source. On line -7 there is an error because abstract methods can only be defined in an -abstract class. On line 9 there is an error because x is unknown.</li> - -<li> -Open the Tasks view by invoking Perspective > Show View > Tasks. -Verify that the tasks views appears and that it shows the 2 errors in the -TaskClass.</li> - -<li> -Select the first line of TaskClass and invoke "Add Task" from the context -menu. Override the label with "Test Label" and press OK. Verify -that a new task icon appears on the left edge of the editor and in the -tasks view.</li> - -<li> -If a problem is resolved or a task removed it should disappear from the -task view. Open the Task view filter dialog and reset all options -with the Reset button. Press OK and go back to the editor for TaskClass.java. -Delete the "doThat" method and save the file. Verify that one of -the errors on TaskClass.java is deleted.</li> - -<li> -Now select the Tasks view and select the task item labelled "Test Label". -Invoke Edit > Delete to delete this task and then verify that it disappears -from the tasks view and from the open editor.</li> - -<li> -Within the Tasks view you can also create new tasks. To test this -press the "New Task" button on the toolbar. A new task should appear. -Type in the label for this task and press Return. Verify that a new -task is created. Do this a couple of times to create more than one -task.</li> - -<li> -A task is very similar to a bookmark. If you select a task you can -open an editor on the task source. To test this close all editors. -Then select one of the java problems for TaskClass.java and invoke Go To -File in the context menu. Verify that an editor opens on the problem -and that the problem is indicated by selection in the editor.</li> - -<li> -Now invoke the Filters toolbar action and change the "show entries of type" -option to "Java Problem" and nothing else. Press OK and verify that -only Java problems appear in the task list now.</li> - -<li> -Reopen the Filters dialog and select "On Selected Resource Only". -Press OK. Now select TaskClass.java in the navigator and verify that -the java problems for this file are visible in the navigator. Select -the TaskProject and verify that the java problems for TaskClass.java are -not visible.</li> - -<li> -Now the task list contains a number of errors and tasks. It also -has a couple of filtering options (java problems only and selected resource -only). This state is persisted between sessions. To test this -note the state of the task view. Then close the workbench and restart -it. Verify that the visible set of tasks and the filtering options -are restored.</li> -</ol> - -</body> -</html> diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Test Scenarios.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Test Scenarios.html deleted file mode 100644 index 7e5dc9d5c36..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Test Scenarios.html +++ /dev/null @@ -1,35 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Workbench Manual Test Scenarios</title>
-</head>
-<body>
-
-<h2>
-<b>Manual Test Scenarios for the Workbench (org.eclipse.ui)</b></h2>
-Last updated June 2, 2002
-
-<p>
-<br><a href="Welcome Editor.html">Welcome Editor</a>
-<br><a href="Window Actions.html">Window Actions</a>
-<br><a href="Window Layout.html">Window Layout</a>
-<br><a href="Persistence.html">Persistence</a>
-<br><a href="Navigator View.html">Navigator View</a>
-<br><a href="Outline View.html">Outline View</a>
-<br><a href="Properties View.html">Properties View</a>
-<br><a href="Bookmarks View.html">Bookmarks View</a>
-<br><a href="Tasks View.html">Tasks View</a>
-
-<br><a href="New File Wizard.html">New File Wizard</a>
-<br><a href="New Folder Wizard.html">New Folder Wizard</a>
-<br><a href="New Project Wizard.html">New Project Wizard</a>
-<br><a href="File System Export.html">File System Export</a>
-<br><a href="File System Import.html">File System Import</a>
-<br><a href="ZIP Export.html">Zip Export</a>
-<br><a href="ZIP Import.html">Zip Import</a>
-<br><a href="Properties Dialog.html">Properties Dialog</a>
-<br>
-
-</body>
-</html>
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Text Editor b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Text Editor deleted file mode 100644 index 2f67424c111..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Text Editor +++ /dev/null @@ -1,98 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Test Scenario: Text Editor</title>
-</head>
-<body>
-
-<h3>
-Text Editor</h3>
-Purpose: To test the Text Editor in Eclipse. We will open a text
-file, adding some text, play with the edit actions, verify the save and
-save as, and then test persistance between sessions.
-<p>Setup:
-<ol>
-<li>
-Install Eclipse Platform.</li>
-
-<li>
-Create a project.</li>
-</ol>
-Method:
-<ol>
-<li>
-Start the workbench.</li>
-
-<li>
-Invoke File > New > File. Create a new text file with some name like
-test1.txt. Verify that a new editor opens on the file.</li>
-
-<li>
-Copy and paste the following text into the editor ..</li>
-</ol>
-
-<blockquote>Beware the beast man, for he is the devil's pawn. Alone among
-God's primates,
-<br>he kills for sport, or lust or greed. Yes, he will murder his brother
-to possess his
-<br>brother's land. Let him not breed in great numbers, for he will make
-a desert of
-<br>his home and yours. Shun him. Drive him back into his jungle lair:
-For he is the
-<br>harbinger of death.
-<p>(Planet of the Apes)</blockquote>
-
-<ol>
-<li>
-After paste has been performed the editor state should be dirty.
-Verify that File > Save is enabled and that Save is enabled in the context
-menu. Invoke Save and verify that save is disabled.</li>
-
-<li>
-The Save As menu action is always enabled. Invoke this action to
-create a new file, say test2.txt, and verify that the name of the new file
-name is reflected in the editor tab.</li>
-
-<li>
-Modify the contents of test2.txt and save. Then open test1.txt and
-verify that it still contains the original text.</li>
-
-<li>
-In text1.txt select the first 3 lines and invoke Edit Copy. Activate
-text2.txt, put the cursor at the end of the file, and invoke Edit Paste.
-Verify that the first 3 lines of text1.txt are copied to text2.txt.</li>
-
-<li>
-Invoke Undo and Redo a few times in text2.txt to undo and redo the paste.</li>
-
-<li>
-Select a few lines of text and invoke Shift Right and Shift Left a few
-times.</li>
-
-<li>
-Now close text2.txt. The file has been modified, so a Save dialog
-should appear. Press No to avoid saving.</li>
-
-<li>
-Now we need to test Find / Replace. Select the text1.txt editor.
-This file contains many instances of he and his. Invoke Find / Replace
-and replace all instances of he by "she". You may find that various
-words like "the" are modified to "tshe". Close the find dialog and
-invoke Revert in the context menu. Verify that the file contents
-are now equal to the original text. Then try Find / Replace again
-with "whole word" selected and verify the results.</li>
-
-<li>
-Open up text2.txt. Now there should be one open editor with changs
-and one without.</li>
-
-<li>
-Invoke File > Close All. At this point a "Save Resources" dialog
-should appear where you can save the modified files. Check all modifications
-and then press "Yes". Verify that all editors are closed. Then
-open up any editor which was saved and verify changes.</li>
-</ol>
-
-</body>
-</html>
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Welcome Editor.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Welcome Editor.html deleted file mode 100644 index 75c375409e2..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Welcome Editor.html +++ /dev/null @@ -1,44 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>Test Scenario: Welcome Editor</title> -</head> -<body> -<h3> -Welcome Editor</h3> -Purpose: To test the Welcome editor in Eclipse. We will start the -workbench after a fresh install, verify the visibility of the Welcome editor, -and then test the format and links. -<p>Setup: -<ol> -<li> -Install Eclipse Platform.</li> - -<li> -Delete the metadata for org.eclipse.ui. This will simulate a fresh -install.</li> -</ol> -Method: -<ol> -<li> -Start the workbench. Confirm that the default perspective (Resource) -and Welcome editor both appear.</li> - -<li> -Close the editor and exit the workbench.</li> - -<li> -Restart the workbench and verify that the Welcome editor does not appear. -The editor only appears automatically after a fresh install.</li> - -<li> -Invoke Help > Welcome and verify that the Welcome editor opens.</li> - -<li> -The Welcome editor contains a number of links. Test each of these links -to ensure that the link invokes an appropriate action.</li> -</ol> - -</body> -</html> diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Window Actions.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Window Actions.html deleted file mode 100644 index 2459250419b..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Window Actions.html +++ /dev/null @@ -1,117 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>Test Scenario: Window Actions</title> -</head> -<body> -<h3> -Window Actions</h3> -Purpose: To test the standard menu and toolbar actions in Eclipse. -We will create a project, open some editors, test the global actions, test -the persistance of workbench state between sessions. -<p>Setup: -<ol> -<li> -Install Eclipse Platform.</li> - -<li> -Delete the metadata for org.eclipse.ui.</li> -</ol> -Testing the File Menu: -<ol> -<li> -Start the workbench.</li> - -<li> -Invoke File > New > Project. A wizard will appear where you can select -a project type. Select each item in the left hand viewer to verify -the basic page operation. Then select Simple > Project and press -Next. Type "SimpleProject" as the name for the project and press -Finish. Verify that a new Resource perspective is created and that -SimpleProject appears in the Navigator view.</li> - -<li> -Create a few folders and files (one.txt, two.txt, three.txt) within SimpleProject. -For more information on this process refer to Simon's work on the New Wizard.</li> - -<li> -Open one.txt within a text editor. Verify that File > Close and Save -As are enabled. Verify that Save is disabled.</li> - -<li> -Add the following text to the file..</li> - -<p><br>File One -<br> -<li> -Once you modify a file the File > Save action should become enabled and -a small asterix should appear in the editor tab. Invoke Save and -verify that the asterix disappears and that the File > Save action is disabled.</li> - -<li> -Open two.txt. Add the following text to the file..</li> - -<p><br>File Two -<br> -<li> -Open three.txt and add the following text to the file..</li> - -<p><br>File Three -<br> -<li> -If you close an editor which is dirty the workbench should ask if you want -to save it. With three.txt active invoke File > Close. Verify -that the Save dialog appears. Press Yes. Then reopen the file -to verify that the text was saved.</li> - -<li> -Invoke File > Close All. At this point there is 1 dirty editor. -Verify that the Save Resources dialog appears. Press Yes. The -dirty editors should be saved and all editors will close.</li> - -<li> -Verify that File > Close, Close All, Save, Save As, and Save All are disabled.</li> -</ol> -Testing the Edit Menu: -<ol> -<li> -The edit actions should target the active view or editor. To test -this ..</li> - -<ol> -<li> -Select a file in the navigator view. Invoke Edit > Delete and verify -that the Delete File dialog appears for the current selection in the navigator. -Close the dialog without completing the delete.</li> - -<li> -Select the file again and invoke Edit > Add Bookmark. Open the Bookmarks -view and verify that a bookmark exists for the file. Select the bookmark. -Invoke Edit > Delete and verify that the bookmark is deleted in the bookmarks -view.</li> - -<li> -Open one.txt in a text editor. Select a piece of text and invoke -Edit > Cut. Verify that the selection in the text editor is cut.</li> -</ol> - -<li> -Create a file named X.java. Open it in an editor and then verify -that the Java editor actions are contributed to the workbench menu and -toolbar.</li> - -<li> -Open one.txt in an editor. Verify that the java editor actions are -no longer visible in the workbench.</li> - -<li> -Activate the java editor and verify that its contributions appear once -again.</li> - -<li> -Close the java editor and verify that the contributions disappear.</li> -</ol> - -</body> -</html> diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Window Layout.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Window Layout.html deleted file mode 100644 index f188196d929..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/Window Layout.html +++ /dev/null @@ -1,196 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>Test Scenario: Window Layout</title> -</head> -<body> -<h3> -Window Layout</h3> -Purpose: To test window layout in Eclipse. We will open a perspective, -test the layout features, open a second perspective, switch between perspectives, -and then create some windows. -<p>Setup: -<ol> -<li> -Install Eclipse Platform.</li> - -<li> -Create a project with 3 .txt files.</li> - -<li> -Delete the metadata for org.eclipse.ui.</li> -</ol> -Testing a Single Perspective: -<ol> -<li> -Start the workbench.</li> - -<li> -Drag the navigator over the shortcut bar (the vertical toolbar at left). -Verify that a stack icon appears. Drop the view on the shortcut bar. -It should become a fast view.</li> - -<li> -Click on the navigator fast view button to show the view. Click on -another view to hide it. You can also hide the view by clicking on -the "hide" button or the fast view button.</li> - -<li> -Close the Outline view. Then invoke Perspective > Show View > Outline -to show it again. Verify that it has the same position as before.</li> - -<li> -Select a text file in the navigator and open it. Verify that the -navigator fast view is hidden and an editor appears in the editor area.</li> - -<li> -Modify the contents of the editor and verify that File > Save becomes enabled. -Save the file and verify that File > Save is disabled.</li> - -<li> -Modify the contents of the editor again and close the editor. Verify -that the Save dialog appears and you can answer, yes, no, and cancel.</li> - -<li> -Open 3 text files within 3 editors. The editors appear in a single -folder.</li> - -<li> -Drag one editor out of the folder. Verify that the relative placement -icons are shown when you are to the top, right, bottom, or left of the -existing editor folder. The "no drop" icon should appear if you are -over a view. Drop the editor below the existing folder.</li> - -<li> -Drag another editor our of the folder onto the single view. Verify -that the first folder is deconstructed and that a new folder is constructed.</li> - -<li> -Maximize the active editor by clicking on the title area. Minimize -it by clicking in the area again. Maximize it again and then close -it. Verify that the perspective layout is restored.</li> - -<li> -Drag a bunch of views out of the window to create detached windows. -Try dragging these views on top of one another to create detached folders.</li> - -<li> -Invoke Perspective > Reset. Answer yes to the dialog and verify that -the layout of the perspective is restored to the original.</li> - -<li> -Invoke Perspective > Close to close the page.</li> -</ol> -Perspective Save As: -<ol> -<li> -Open the resource perspective.</li> - -<li> -Drag a view onto the left tool bar. Drag another out into a detached -window.</li> - -<li> -In Eclipse you can customize the actions visible in a perspective. -Invoke Perspective > Customize and select some new views and actions. -Press OK and verify that the new actions appear in the menu and toolbar.</li> - -<li> -Invoke Perspective > Save As and select the Resource perspective. -Press OK and answer yes to the verify dialog.</li> - -<li> -Close the perspective.</li> - -<li> -Open the Resource perspective. Verify that the new page has the same -layout and visible action sets as you created and saved.</li> - -<li> -Close the perspective.</li> - -<li> -Open up the Preferences dialog and view the Perspectives page. Select -the Resource one and press Reset.</li> - -<li> -Open the Resource perspective. Verify that the new page has the default -layout.</li> - -<li> -Drag a view onto the left tool bar. Drag another out into a detached -window.</li> - -<li> -Invoke Perspective > Save As and type the name of a new perspective (ie -Bob). Press OK and then verify that the window title changes to reflect -the new perspective.</li> - -<li> -Close all perspectives</li> - -<li> -Open a new Resource perspective and a Bob perspective. Verify that -the first has the default layout and that the second has your custom layout.</li> -</ol> -Testing Two or More Perspectives: -<ol> -<li> -Close all Perspectives</li> - -<li> -Open a Resource perspective. Verify that a new page appears in the -window with the Resource perspective.</li> - -<li> -In the Navigator select your project and invoke Open Perspective > Java. -Verify that a new perspective appears with the Java Perspective and that -the input for the navigator is the project. Cool: Perspectives support -scoping !!</li> - -<li> -In the Java perspective open one of the text files in an editor.</li> - -<li> -Drag a couple of views out of the window to create detached windows.</li> - -<li> -Modify the action sets.</li> - -<li> -Switch back and forth between the two pages in the window by clicking in -the left hand tool bar. The active perspective controls the visible -action sets, views and editors in the window. If you switch between -two pages these attributes should change.</li> - -<li> -Try Perspective > Next and Previous.</li> - -<li> -Close the second perspective by invoking Perspective > Close. Verify -that the first perspective is activated.</li> -</ol> -Multiple Windows -<ol> -<li> -Start with one open window which has one perspective.</li> - -<li> -Change the Workbench Preferences for "Open Perspective" to "Open in New -Window". Then open a Java perspective and verify that a new window -is created.</li> - -<li> -A list of the open windows should appear in the Window menu. Select -these items to switch between the windows.</li> - -<li> -Close one window and verify that the other is activated.</li> - -<li> -Close the last window and verify that the workbench shuts down.</li> -</ol> - -</body> -</html> diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/ZIP Export.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/ZIP Export.html deleted file mode 100644 index f0ccc111e29..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/ZIP Export.html +++ /dev/null @@ -1,100 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="OTI Employee">
- <meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
- <title>ZIP Export</title>
-</head>
-<body>
-
-<center>
-<h1>
-ZIP Export</h1></center>
-
-<h2>
-Purpose</h2>
-The plan is to export a project with a large number files/folders at a
-time, using the zip file wizard. The results should be indentical in layout
-and content as the original project used.
-<h2>
-Setup</h2>
-
-<ul>
-<li>
-Download the JUnit zip file source code from www.junit.org.</li>
-
-<li>
-Start the Eclipse workbench</li>
-
-<li>
-Create a new temporary "simple" project called "JUnit Test"</li>
-
-<li>
-Import the JUnit zip file into the project</li>
-
-<li>
-Select File -> Export, select Zip File and press Next.</li>
-</ul>
-
-<h2>
-Export from a project to a new zip file</h2>
-
-<ol>
-<li>
-Select the "JUnit Test" project and mark it as checked.</li>
-
-<li>
-In the Zip File field, type in the filename for the new zip file.</li>
-
-<li>
-Press Finish</li>
-
-<li>
-Verify that the contents in the zip file match the same file and folder
-structure as the source project</li>
-
-<li>
-Verify the content of the files.</li>
-</ol>
-
-<h2>
-Export from a project to an existing zip file</h2>
-
-<ol>
-<li>
-Select the "JUnit Test" project and mark it as checked.</li>
-
-<li>
-In the Zip File field, type in the filename for the existing zip file.</li>
-
-<li>
-Check the option "Overwrite existing resources without warning"</li>
-
-<li>
-Press Finish</li>
-
-<li>
-Verify you were not prompted to overwrite files</li>
-
-<li>
-Verify that the contents in the zip file match the same file and folder
-structure as the source project.</li>
-
-<li>
-Verify the content of the files.</li>
-</ol>
-
-<h2>
-Cleanup</h2>
-
-<ul>
-<li>
-Delete the temporary project "JUnit Test"</li>
-
-<li>
-Delete the temporary jar file</li>
-</ul>
-
-</body>
-</html>
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/ZIP Import.html b/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/ZIP Import.html deleted file mode 100644 index 78e03d9a94c..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/Manual Scenario Tests/ZIP Import.html +++ /dev/null @@ -1,103 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="OTI Employee">
- <meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
- <title>ZIP Import</title>
-</head>
-<body>
-
-<center>
-<h1>
-ZIP Import</h1></center>
-
-<h2>
-Purpose</h2>
-The plan is to import a large number files/folders at a time, using the
-ZIP file wizard. The results should be indentical in layout and content
-as the original source used.
-<h2>
-Setup</h2>
-
-<ul>
-<li>
-Download the JUnit zip file source code from www.junit.org.</li>
-
-<li>
-Start the Eclipse workbench</li>
-
-<li>
-Create a new temporary "simple" project called "JUnit Test"</li>
-
-<li>
-Select File -> Import, select Zip File and press Next.</li>
-</ul>
-
-<h2>
-Import into a new project</h2>
-
-<ol>
-<li>
-Click the Browse button and select the ZIP file.</li>
-
-<li>
-Expand the folders in the tree view and until "junit" folder is visible
-and check mark the box next to it. Deselect the "doc" and "javadoc" folders.</li>
-
-<li>
-Type in "JUnit Test" in the Folder field</li>
-
-<li>
-Press Finish</li>
-
-<li>
-Verify that the contents of the project match the same file and folder
-structure as the source in the file system.</li>
-
-<li>
-Verify that the content of the files.</li>
-</ol>
-
-<h2>
-Import into an existing project</h2>
-
-<ol>
-<li>
-Click on the Zip File drop down box and select the zip file</li>
-
-<li>
-Expand the folders in the tree view and until "junit" folder is visible
-and check mark the box next to it. Deselect the "doc" and "javadoc"
-folders.</li>
-
-<li>
-Type in "JUnit Test" in the Folder field</li>
-
-<li>
-Check the option "Overwrite existing resources without warning"</li>
-
-<li>
-Press Finish</li>
-
-<li>
-Verify you were not prompted to overwrite files</li>
-
-<li>
-Verify that the contents of the project match the same file and folder
-structure as the source in the file system.</li>
-
-<li>
-Verify that the content of the files.</li>
-</ol>
-
-<h2>
-Cleanup</h2>
-
-<ul>
-<li>
-Delete the temporary project "JUnit Test"</li>
-</ul>
-
-</body>
-</html>
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/SelectionProviderView.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/SelectionProviderView.java deleted file mode 100644 index e15addf09a7..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/SelectionProviderView.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.eclipse.ui.tests;
-
-import org.eclipse.jface.util.ListenerList;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.ViewPart;
-/**
- * The view provides api to fire a selection event for its workbench page.
- */
-
-public class SelectionProviderView
- extends ViewPart
- implements ISelectionProvider
-{
- public final static String ID = "org.eclipse.ui.tests.SelectionProviderView";
- public final static String ID_2 = "org.eclipse.ui.tests.SelectionProviderView2";
-
- private ListenerList selectionChangedListeners = new ListenerList();
- private ISelection lastSelection = StructuredSelection.EMPTY;
-
- private Text text;
- public SelectionProviderView() {
- super();
- }
- /**
- * @see WorkbenchPart#setFocus()
- */
- public void setFocus() {
- text.setFocus();
- }
-
- /**
- * @see WorkbenchPart#createPartControl(Composite)
- */
- public void createPartControl(Composite parent) {
- text = new Text(parent, SWT.MULTI | SWT.WRAP);
- text.setLayoutData(new GridData(GridData.FILL_BOTH));
- }
-
- /* (non-Javadoc)
- * Method declared on IViewPart.
- */
- public void init(IViewSite site) throws PartInitException {
- site.setSelectionProvider(this);
- super.init(site);
- }
-
-
- /**
- * @see ISelectionProvider#addSelectionChangedListener(ISelectionChangedListener)
- */
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- selectionChangedListeners.add(listener);
- }
-
- /**
- * @see ISelectionProvider#getSelection()
- */
- public ISelection getSelection() {
- return lastSelection;
- }
-
/**
- * @see ISelectionProvider#removeSelectionChangedListener(ISelectionChangedListener)
- */
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- selectionChangedListeners.remove(listener);
- }
-
/**
- * Sets the selection to a particular object.
- */
- public void setSelection(Object obj) {
- setSelection(new StructuredSelection(obj));
- }
-
- /**
- * @see ISelectionProvider#setSelection(ISelection)
- */
- public void setSelection(ISelection selection) {
- lastSelection = selection;
-
- // create an event
- SelectionChangedEvent event = new SelectionChangedEvent(this, selection);
-
- // write text
- text.setText(selection.toString());
-
- // fire the event
- Object[] listeners = selectionChangedListeners.getListeners();
- for (int i = 0; i < listeners.length; ++i) {
- ((ISelectionChangedListener) listeners[i]).selectionChanged(event);
- }
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/TestPlugin.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/TestPlugin.java deleted file mode 100644 index c8cf5942cec..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/TestPlugin.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.eclipse.ui.tests;
-
-import java.net.*;
-import java.util.*;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class TestPlugin extends AbstractUIPlugin {
- //The shared instance.
- private static TestPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
-
- /**
- * The constructor.
- */
- public TestPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- plugin = this;
- try {
- resourceBundle= ResourceBundle.getBundle("org.eclipse.ui.tests.TestPluginResources");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- }
-
- /**
- * Returns the shared instance.
- */
- public static TestPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the workspace instance.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle= TestPlugin.getDefault().getResourceBundle();
- try {
- return bundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-
- /**
- * Returns the image descriptor with the given relative path.
- */
- public ImageDescriptor getImageDescriptor(String relativePath) {
- String iconPath = "icons/";
- try {
- URL installURL = getDescriptor().getInstallURL();
- URL url = new URL(installURL, iconPath + relativePath);
- return ImageDescriptor.createFromURL(url);
- }
- catch (MalformedURLException e) {
- // should not happen
- return ImageDescriptor.getMissingImageDescriptor();
- }
- }
-
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/UiTestSuite.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/UiTestSuite.java deleted file mode 100644 index 5f64d5d0cda..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/UiTestSuite.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.eclipse.ui.tests;
-
-import junit.framework.*;
-import junit.textui.TestRunner;
-import org.eclipse.swt.SWT;
-
-/**
- * Test all areas of the UI.
- */
-public class UiTestSuite extends TestSuite {
-
- /**
- * Returns the suite. This is required to
- * use the JUnit Launcher.
- */
- public static Test suite() {
- return new UiTestSuite();
- }
-
- /**
- * Construct the test suite.
- */
- public UiTestSuite() {
- addTest(new org.eclipse.ui.tests.api.ApiTestSuite());
- // PR 1GkD5O0 - Fails on linux.
- String platform = SWT.getPlatform();
- if (!platform.equals("motif")) {
- addTest(new org.eclipse.ui.tests.dialogs.UIAutomatedSuite());
- }
- addTest(new org.eclipse.ui.tests.propertysheet.PropertySheetTestSuite());
- addTest(new org.eclipse.ui.tests.internal.InternalTestSuite());
- addTest(new org.eclipse.ui.tests.navigator.NavigatorTestSuite());
- addTest(new org.eclipse.ui.tests.adaptable.AdaptableTestSuite());
- addTest(new org.eclipse.ui.tests.zoom.ZoomTestSuite());
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptableDecoratorTestCase.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptableDecoratorTestCase.java deleted file mode 100644 index d26a8a81f0c..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptableDecoratorTestCase.java +++ /dev/null @@ -1,172 +0,0 @@ -package org.eclipse.ui.tests.adaptable; - -import java.io.ByteArrayInputStream; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.viewers.ILabelProviderListener; -import org.eclipse.jface.viewers.LabelProviderChangedEvent; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.internal.DecoratorDefinition; -import org.eclipse.ui.internal.DecoratorManager; -import org.eclipse.ui.internal.WorkbenchPlugin; -import org.eclipse.ui.tests.navigator.TestDecoratorContributor; -import org.eclipse.ui.tests.util.UITestCase; - -/** - * @version 1.0 - */ -public class AdaptableDecoratorTestCase - extends UITestCase - implements ILabelProviderListener { - - private DecoratorDefinition definition; - private AdaptedResourceNavigator adaptedNavigator; - private boolean updated = false; - public String ADAPTED_NAVIGATOR_ID = - "org.eclipse.ui.tests.adaptable.adaptedHierarchy"; - protected IProject testProject; - protected IFolder testFolder; - protected IFile testFile; - - /** - * Constructor for DecoratorTestCase. - * @param testName - */ - public AdaptableDecoratorTestCase(String testName) { - super(testName); - } - - /** - * Sets up the hierarchy. - */ - protected void setUp() throws Exception { - createTestFile(); - showAdaptedNav(); - - WorkbenchPlugin.getDefault().getDecoratorManager().addListener(this); - - DecoratorDefinition[] definitions = - WorkbenchPlugin.getDefault().getDecoratorManager().getDecoratorDefinitions(); - for (int i = 0; i < definitions.length; i++) { - if (definitions[i].getId().equals("org.eclipse.ui.tests.adaptable.decorator")) - definition = definitions[i]; - } - } - - private DecoratorManager getDecoratorManager() { - return WorkbenchPlugin.getDefault().getDecoratorManager(); - } - - /** - * Remove the listener. - */ - - public void tearDown() throws Exception { - - if (testProject != null) { - try { - testProject.delete(true, null); - } catch (CoreException e) { - fail(e.toString()); - } - testProject = null; - testFolder = null; - testFile = null; - } - super.tearDown(); - adaptedNavigator = null; - - getDecoratorManager().removeListener(this); - } - - /** - * Make a label changed event for resource. - */ - private LabelProviderChangedEvent getLabelChangedEvent(IResource resource) { - return new LabelProviderChangedEvent(getDecoratorManager(), resource); - } - - /** - * Test enabling the contributor - */ - public void testEnableDecorator() throws CoreException{ - definition.setEnabled(true); - getDecoratorManager().reset(); - - } - - /** - * Test disabling the contributor - */ - public void testDisableDecorator() throws CoreException{ - definition.setEnabled(false); - getDecoratorManager().reset(); - } - - /** - * Refresh the test decorator. - */ - public void testRefreshContributor() throws CoreException{ - - updated = false; - definition.setEnabled(true); - getDecoratorManager().reset(); - TestDecoratorContributor.contributor.refreshListeners(testFile); - assertTrue("Got an update", updated); - updated = false; - - } - - /* - * @see ILabelProviderListener#labelProviderChanged(LabelProviderChangedEvent) - */ - public void labelProviderChanged(LabelProviderChangedEvent event) { - updated = true; - } - - /** - * Shows the Adapted Resource Navigator in a new test window. - */ - protected void showAdaptedNav() throws PartInitException { - IWorkbenchWindow window = openTestWindow(); - adaptedNavigator = - (AdaptedResourceNavigator) window.getActivePage().showView( - ADAPTED_NAVIGATOR_ID); - } - - protected void createTestProject() throws CoreException { - if (testProject == null) { - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - testProject = workspace.getRoot().getProject("AdaptedTestProject"); - testProject.create(null); - testProject.open(null); - } - } - - protected void createTestFolder() throws CoreException { - if (testFolder == null) { - createTestProject(); - testFolder = testProject.getFolder("AdaptedTestFolder"); - testFolder.create(false, false, null); - } - } - - protected void createTestFile() throws CoreException { - if (testFile == null) { - createTestFolder(); - testFile = testFolder.getFile("AdaptedFoo.txt"); - testFile.create( - new ByteArrayInputStream("Some content.".getBytes()), - false, - null); - } - } - -}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptableResourceWrapper.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptableResourceWrapper.java deleted file mode 100644 index 52c00e4737b..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptableResourceWrapper.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.eclipse.ui.tests.adaptable; - -/* - * Copyright (c) 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.core.resources.IContainer; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.ui.model.IWorkbenchAdapter; - -public class AdaptableResourceWrapper implements IAdaptable { - - IResource resource; - - /* - * @see IAdaptable#getAdapter(Class) - */ - public Object getAdapter(Class adapter) { - if (adapter == IResource.class) - return resource; - if (adapter == IWorkbenchAdapter.class) - return TestAdaptableWorkbenchAdapter.getInstance(); - return null; - } - - public AdaptableResourceWrapper(IResource wrapped) { - resource = wrapped; - } - - public String getLabel() { - return resource.getName() + " Adapted"; - } - - public AdaptableResourceWrapper getParent() { - if (resource.getParent() != null) - return new AdaptableResourceWrapper(resource.getParent()); - return null; - } - - public AdaptableResourceWrapper[] getChildren() { - AdaptableResourceWrapper[] wrappers = new AdaptableResourceWrapper[0]; - - if (resource instanceof IContainer) { - IResource[] children; - try { - children = ((IContainer) resource).members(); - } catch (CoreException exception) { - return wrappers; - } - wrappers = new AdaptableResourceWrapper[children.length]; - for (int i = 0; i < children.length; i++) { - wrappers[i] = new AdaptableResourceWrapper(children[i]); - } - } - return wrappers; - } -}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptableTestSuite.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptableTestSuite.java deleted file mode 100644 index c989ddedd8e..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptableTestSuite.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.eclipse.ui.tests.adaptable; - -/* - * Copyright (c) 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 junit.framework.Test; -import junit.framework.TestSuite; - -/** - * The AdaptableTestSuite is the TestSuite for the - * adaptable support in the UI. - */ -public class AdaptableTestSuite extends TestSuite { - - /** - * Returns the suite. This is required to - * use the JUnit Launcher. - */ - public static Test suite() { - return new AdaptableTestSuite(); - } - - /** - * Constructor for AdaptableTestSuite. - */ - public AdaptableTestSuite() { - addTest(new TestSuite(AdaptableDecoratorTestCase.class)); - } - - - -} diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptedResourceNavigator.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptedResourceNavigator.java deleted file mode 100644 index c59828b77c2..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptedResourceNavigator.java +++ /dev/null @@ -1,504 +0,0 @@ -package org.eclipse.ui.tests.adaptable; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -import java.util.ArrayList; -import java.util.Iterator; - -import org.eclipse.core.resources.*; -import org.eclipse.core.runtime.*; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.dnd.*; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.KeyListener; -import org.eclipse.swt.widgets.*; - -import org.eclipse.jface.action.*; -import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.viewers.*; - -import org.eclipse.ui.*; -import org.eclipse.ui.actions.ActionContext; -import org.eclipse.ui.part.*; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.eclipse.ui.views.navigator.*; - -/** - * Implements the Resource Navigator view. - */ -public class AdaptedResourceNavigator - extends ViewPart { - private TreeViewer viewer; - private IDialogSettings settings; - private IMemento memento; - private NavigatorFrameSource frameSource; - - protected TestNavigatorActionGroup actionGroup; - - /** - * Preference name constant for linking editor switching to navigator selection. - * - * [Issue: We're cheating here, by referencing a preference which is actually defined - * on the Workbench's preference page. The Navigator should eventually have its own - * preference page with this preference on it, instead of on the Workbench's. - * The value must be the same as IWorkbenchPreferenceConstants.LINK_NAVIGATOR_TO_EDITOR.] - */ - private static final String LINK_NAVIGATOR_TO_EDITOR = - "LINK_NAVIGATOR_TO_EDITOR"; //$NON-NLS-1$ - - // Persistance tags. - private static final String TAG_SORTER = "sorter"; //$NON-NLS-1$ - private static final String TAG_FILTERS = "filters"; //$NON-NLS-1$ - private static final String TAG_FILTER = "filter"; //$NON-NLS-1$ - private static final String TAG_SELECTION = "selection"; //$NON-NLS-1$ - private static final String TAG_EXPANDED = "expanded"; //$NON-NLS-1$ - private static final String TAG_ELEMENT = "element"; //$NON-NLS-1$ - private static final String TAG_PATH = "path"; //$NON-NLS-1$ - private static final String TAG_VERTICAL_POSITION = "verticalPosition"; //$NON-NLS-1$ - private static final String TAG_HORIZONTAL_POSITION = "horizontalPosition"; //$NON-NLS-1$ - - private IPartListener partListener = new IPartListener() { - public void partActivated(IWorkbenchPart part) { - if (part instanceof IEditorPart) - editorActivated((IEditorPart) part); - } - public void partBroughtToTop(IWorkbenchPart part) { - } - public void partClosed(IWorkbenchPart part) { - } - public void partDeactivated(IWorkbenchPart part) { - } - public void partOpened(IWorkbenchPart part) { - } - }; - /** - * Creates a new AdaptedResourceNavigator. - */ - public AdaptedResourceNavigator() { - IDialogSettings workbenchSettings = getPlugin().getDialogSettings(); - settings = workbenchSettings.getSection("ResourceNavigator"); //$NON-NLS-1$ - if (settings == null) - settings = workbenchSettings.addNewSection("ResourceNavigator"); //$NON-NLS-1$ - } - /** - * Converts the given selection into a form usable by the viewer, - * where the elements are resources. - */ - StructuredSelection convertSelection(ISelection selection) { - ArrayList list = new ArrayList(); - if (selection instanceof IStructuredSelection) { - IStructuredSelection ssel = (IStructuredSelection) selection; - for (Iterator i = ssel.iterator(); i.hasNext();) { - Object o = i.next(); - IResource resource = null; - if (o instanceof IResource) { - resource = (IResource) o; - } else { - if (o instanceof IAdaptable) { - resource = (IResource) ((IAdaptable) o).getAdapter(IResource.class); - } - } - if (resource != null) { - list.add(resource); - } - } - } - return new StructuredSelection(list); - } - /* (non-Javadoc) - * Method declared on IWorkbenchPart. - */ - public void createPartControl(Composite parent) { - viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); - // initDrillDownAdapter(viewer); - viewer.setUseHashlookup(true); - viewer.setContentProvider(new TestAdaptableContentProvider()); - IDecoratorManager manager = getSite().getWorkbenchWindow().getWorkbench().getDecoratorManager(); - viewer.setLabelProvider( - new DecoratingLabelProvider( - new TestAdaptableWorkbenchAdapter(), - manager.getLabelDecorator())); - - viewer.setInput(getInitialInput()); - updateTitle(); - - MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$ - menuMgr.setRemoveAllWhenShown(true); - menuMgr.addMenuListener(new IMenuListener() { - public void menuAboutToShow(IMenuManager manager) { - AdaptedResourceNavigator.this.fillContextMenu(manager); - } - }); - Menu menu = menuMgr.createContextMenu(viewer.getTree()); - viewer.getTree().setMenu(menu); - getSite().registerContextMenu(menuMgr, viewer); - - makeActions(); - - // Update the global action enable state to match - // the current selection. - IStructuredSelection selection = (IStructuredSelection) viewer.getSelection(); - actionGroup.updateGlobalActions(selection); - - viewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - handleSelectionChanged(event); - } - }); - viewer.addDoubleClickListener(new IDoubleClickListener() { - public void doubleClick(DoubleClickEvent event) { - handleDoubleClick(event); - } - }); - viewer.getControl().addKeyListener(new KeyListener() { - public void keyPressed(KeyEvent event) { - handleKeyPressed(event); - } - public void keyReleased(KeyEvent event) { - handleKeyReleased(event); - } - }); - - actionGroup.fillActionBars(selection); - - getSite().setSelectionProvider(viewer); - - getSite().getPage().addPartListener(partListener); - - if (memento != null) - restoreState(memento); - memento = null; - } - /* (non-Javadoc) - * Method declared on IWorkbenchPart. - */ - public void dispose() { - getSite().getPage().removePartListener(partListener); - super.dispose(); - } - /** - * An editor has been activated. Set the selection in this navigator - * to be the editor's input, if linking is enabled. - */ - void editorActivated(IEditorPart editor) { - if (!isLinkingEnabled()) - return; - - IEditorInput input = editor.getEditorInput(); - if (input instanceof IFileEditorInput) { - IFileEditorInput fileInput = (IFileEditorInput) input; - IFile file = fileInput.getFile(); - ISelection newSelection = new StructuredSelection(file); - if (!viewer.getSelection().equals(newSelection)) { - viewer.setSelection(newSelection); - } - } - - } - - /** - * Called when the context menu is about to open. - */ - void fillContextMenu(IMenuManager menu) { - actionGroup.setContext(new ActionContext(getViewer().getSelection())); - actionGroup.fillContextMenu(menu); - } - - /** - * Returns the initial input for the viewer. - * Tries to convert the input to a resource, either directly or via IAdaptable. - * If the resource is a container, it uses that. - * If the resource is a file, it uses its parent folder. - * If a resource could not be obtained, it uses the workspace root. - */ - IContainer getInitialInput() { - IAdaptable input = getSite().getPage().getInput(); - IResource resource = null; - if (input instanceof IResource) { - resource = (IResource) input; - } else { - resource = (IResource) input.getAdapter(IResource.class); - } - if (resource != null) { - switch (resource.getType()) { - case IResource.FILE : - return resource.getParent(); - case IResource.FOLDER : - case IResource.PROJECT : - case IResource.ROOT : - return (IContainer) resource; - default : - // Unknown resource type. Fall through. - break; - } - } - return ResourcesPlugin.getWorkspace().getRoot(); - } - - /** - * Returns the navigator's plugin. - */ - public AbstractUIPlugin getPlugin() { - return (AbstractUIPlugin) Platform.getPlugin(PlatformUI.PLUGIN_ID); - } - /** - * Returns the current sorter. - * @since 2.0 - */ - public ResourceSorter getSorter() { - return (ResourceSorter) getViewer().getSorter(); - } - - /** - * Returns the tree viewer which shows the resource hierarchy. - * @since 2.0 - */ - public TreeViewer getViewer() { - return viewer; - } - /** - * Returns the shell to use for opening dialogs. - * Used in this class, and in the actions. - */ - public Shell getShell() { - return getViewSite().getShell(); - } - /** - * Returns the message to show in the status line. - * - * @param selection the current selection - * @return the status line message - */ - String getStatusLineMessage(IStructuredSelection selection) { - if (selection.size() == 1) { - Object o = selection.getFirstElement(); - if (o instanceof IResource) { - return ((IResource) o).getFullPath().makeRelative().toString(); - } else { - return ResourceNavigatorMessages.getString("ResourceNavigator.oneItemSelected"); - //$NON-NLS-1$ - } - } - if (selection.size() > 1) { - return ResourceNavigatorMessages.format( - "ResourceNavigator.statusLine", - new Object[] { new Integer(selection.size())}); - //$NON-NLS-1$ - } - return ""; //$NON-NLS-1$ - } - /** - * Returns the tool tip text for the given element. - */ - String getToolTipText(Object element) { - if (element instanceof IResource) { - IPath path = ((IResource) element).getFullPath(); - if (path.isRoot()) { - return ResourceNavigatorMessages.getString("ResourceManager.toolTip"); - //$NON-NLS-1$ - } else { - return path.makeRelative().toString(); - } - } else { - return ((ILabelProvider) getViewer().getLabelProvider()).getText( - element); - } - } - /** - * Handles double clicks in viewer. - * Opens editor if file double-clicked. - * @since 2.0 - */ - protected void handleDoubleClick(DoubleClickEvent event) { - IStructuredSelection selection = (IStructuredSelection) event.getSelection(); - Object element = selection.getFirstElement(); - - - // 1GBZIA0: ITPUI:WIN2000 - Double-clicking in navigator should expand/collapse containers - if (viewer.isExpandable(element)) { - viewer.setExpandedState(element, !viewer.getExpandedState(element)); - } - - } - /** - * Handles selection changed in viewer. - * Updates global actions. - * Links to editor (if option enabled) - * @since 2.0 - */ - protected void handleSelectionChanged(SelectionChangedEvent event) { - IStructuredSelection sel = (IStructuredSelection) event.getSelection(); - updateStatusLine(sel); - actionGroup.updateGlobalActions(sel); - actionGroup.selectionChanged(sel); - linkToEditor(sel); - } - - /** - * Handles a key press in viewer. By default do nothing. - */ - protected void handleKeyPressed(KeyEvent event) { - - } - - /** - * Handles a key release in viewer. - */ - protected void handleKeyReleased(KeyEvent event) { - - } - - /* (non-Javadoc) - * Method declared on IViewPart. - */ - public void init(IViewSite site, IMemento memento) throws PartInitException { - super.init(site, memento); - this.memento = memento; - } - /** - * Adds drag and drop support to the navigator. - */ - protected void initDragAndDrop() { - int ops = DND.DROP_COPY | DND.DROP_MOVE; - Transfer[] transfers = - new Transfer[] { - ResourceTransfer.getInstance(), - FileTransfer.getInstance(), - PluginTransfer.getInstance()}; - } - /** - * Initializes a drill down adapter on the viewer. - */ - void initDrillDownAdapter(TreeViewer viewer) { - DrillDownAdapter drillDownAdapter = new DrillDownAdapter(viewer) { - // need to update title whenever input changes; - // updateNavigationButtons is called whenever any of the drill down buttons are used - protected void updateNavigationButtons() { - super.updateNavigationButtons(); - updateTitle(); - } - }; - drillDownAdapter.addNavigationActions( - getViewSite().getActionBars().getToolBarManager()); - } - /** - * Returns whether the preference to link navigator selection to active editor is enabled. - * @since 2.0 - */ - protected boolean isLinkingEnabled() { - IPreferenceStore store = getPlugin().getPreferenceStore(); - return store.getBoolean(LINK_NAVIGATOR_TO_EDITOR); - } - /** - * Links to editor (if option enabled) - * @since 2.0 - */ - protected void linkToEditor(IStructuredSelection selection) { - if (!isLinkingEnabled()) - return; - - Object obj = selection.getFirstElement(); - if (obj instanceof IFile && selection.size() == 1) { - IFile file = (IFile) obj; - IWorkbenchPage page = getSite().getPage(); - IEditorPart editorArray[] = page.getEditors(); - for (int i = 0; i < editorArray.length; ++i) { - IEditorPart editor = editorArray[i]; - IEditorInput input = editor.getEditorInput(); - if (input instanceof IFileEditorInput - && file.equals(((IFileEditorInput) input).getFile())) { - page.bringToTop(editor); - return; - } - } - } - } - /** - * Create self's action objects - */ - protected void makeActions() { - actionGroup = new TestNavigatorActionGroup(this); - } - - /** - * Restore the state of the receiver to the state described in - * momento. - * @since 2.0 - */ - - protected void restoreState(IMemento memento) {} - public void saveState(IMemento memento) {} - /** - * Reveal and select the passed element selection in self's visual component - */ - public void selectReveal(ISelection selection) { - StructuredSelection ssel = convertSelection(selection); - if (!ssel.isEmpty()) { - getViewer().setSelection(ssel, true); - } - } - /** - * @see IWorkbenchPart#setFocus() - */ - public void setFocus() { - getViewer().getTree().setFocus(); - } - /** - * Note: For experimental use only. - * Sets the decorator for the navigator. - * - * @param decorator a label decorator or <code>null</code> for no decorations. - */ - public void setLabelDecorator(ILabelDecorator decorator) { - DecoratingLabelProvider provider = - (DecoratingLabelProvider) getViewer().getLabelProvider(); - if(decorator == null) { - IDecoratorManager manager = getSite().getWorkbenchWindow().getWorkbench().getDecoratorManager(); - provider.setLabelDecorator(manager.getLabelDecorator()); - } - else { - provider.setLabelDecorator(decorator); - } - } - - - /** - * Updates the message shown in the status line. - * - * @param selection the current selection - */ - void updateStatusLine(IStructuredSelection selection) { - String msg = getStatusLineMessage(selection); - getViewSite().getActionBars().getStatusLineManager().setMessage(msg); - } - /** - * Updates the title text and title tool tip. - * Called whenever the input of the viewer changes. - */ - void updateTitle() { - Object input = getViewer().getInput(); - String viewName = getConfigurationElement().getAttribute("name"); - //$NON-NLS-1$ - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - if (input == null - || input.equals(workspace) - || input.equals(workspace.getRoot())) { - setTitle(viewName); - setTitleToolTip(""); //$NON-NLS-1$ - } else { - ILabelProvider labelProvider = - (ILabelProvider) getViewer().getLabelProvider(); - setTitle( - ResourceNavigatorMessages.format( - "ResourceNavigator.title", - new Object[] { viewName, labelProvider.getText(input)})); - //$NON-NLS-1$ - setTitleToolTip(getToolTipText(input)); - } - } - -}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/NullLabelDecorator.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/NullLabelDecorator.java deleted file mode 100644 index 676824b2cbf..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/NullLabelDecorator.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.eclipse.ui.tests.adaptable; - -/* - * This decorator tests the null cases - */ - -import org.eclipse.jface.viewers.ILabelDecorator; -import org.eclipse.jface.viewers.ILabelProviderListener; -import org.eclipse.swt.graphics.Image; - -/** - * @version 1.0 - * @author - */ -public class NullLabelDecorator implements ILabelDecorator { - - /* - * @see ILabelDecorator#decorateImage(Image, Object) - */ - public Image decorateImage(Image image, Object element) { - return null; - } - - /* - * @see ILabelDecorator#decorateText(String, Object) - */ - public String decorateText(String text, Object element) { - return null; - } - - /* - * @see IBaseLabelProvider#addListener(ILabelProviderListener) - */ - public void addListener(ILabelProviderListener listener) { - } - - /* - * @see IBaseLabelProvider#dispose() - */ - public void dispose() { - } - - /* - * @see IBaseLabelProvider#isLabelProperty(Object, String) - */ - public boolean isLabelProperty(Object element, String property) { - return false; - } - - /* - * @see IBaseLabelProvider#removeListener(ILabelProviderListener) - */ - public void removeListener(ILabelProviderListener listener) { - } - -} diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/ResourceAction.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/ResourceAction.java deleted file mode 100644 index 13718ae85da..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/ResourceAction.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.eclipse.ui.tests.adaptable; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.tests.navigator.TestDecoratorContributor; - -public class ResourceAction implements IObjectActionDelegate { - - Object selectedItem; - - /* - * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) - */ - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - } - - /* - * @see IActionDelegate#run(IAction) - */ - public void run(IAction action) { - - if (selectedItem != null) - TestDecoratorContributor.contributor.refreshListeners(selectedItem); - - } - - /* - * @see IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged(IAction action, ISelection selection) { - if (selection instanceof IStructuredSelection) { - IStructuredSelection structured = (IStructuredSelection) selection; - if (structured.isEmpty()) - selectedItem = null; - else - selectedItem = structured.getFirstElement(); - } - } - -}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/TestAdaptableContentProvider.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/TestAdaptableContentProvider.java deleted file mode 100644 index 29cbf2e1fec..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/TestAdaptableContentProvider.java +++ /dev/null @@ -1,192 +0,0 @@ -package org.eclipse.ui.tests.adaptable; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -import org.eclipse.core.resources.*; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.viewers.*; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.model.IWorkbenchAdapter; - -/** - * Provides tree contents for objects that have the IWorkbenchAdapter - * adapter registered. - */ -public class TestAdaptableContentProvider implements ITreeContentProvider, IResourceChangeListener { - protected Viewer viewer; -/* (non-Javadoc) - * Method declared on IContentProvider. - */ -public void dispose() { - if (viewer != null) { - Object obj = viewer.getInput(); - if (obj instanceof IWorkspace) { - IWorkspace workspace = (IWorkspace) obj; - workspace.removeResourceChangeListener(this); - } else - if (obj instanceof IContainer) { - IWorkspace workspace = ((IContainer) obj).getWorkspace(); - workspace.removeResourceChangeListener(this); - } - } -} -/** - * Returns the implementation of IWorkbenchAdapter for the given - * object. Returns null if the adapter is not defined or the - * object is not adaptable. - */ -protected IWorkbenchAdapter getAdapter(Object o) { - return TestAdaptableWorkbenchAdapter.getInstance(); -} -/* (non-Javadoc) - * Method declared on ITreeContentProvider. - */ -public Object[] getChildren(Object element) { - IWorkbenchAdapter adapter = getAdapter(element); - if (adapter != null) { - return adapter.getChildren(element); - } - return new Object[0]; -} -/* (non-Javadoc) - * Method declared on IStructuredContentProvider. - */ -public Object[] getElements(Object element) { - return getChildren(element); -} -/* (non-Javadoc) - * Method declared on ITreeContentProvider. - */ -public Object getParent(Object element) { - IWorkbenchAdapter adapter = getAdapter(element); - if (adapter != null) { - return adapter.getParent(element); - } - return null; -} -/* (non-Javadoc) - * Method declared on ITreeContentProvider. - */ -public boolean hasChildren(Object element) { - return getChildren(element).length > 0; -} -/* (non-Javadoc) - * Method declared on IContentProvider. - */ -public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - this.viewer = viewer; - IWorkspace oldWorkspace = null; - IWorkspace newWorkspace = null; - if (oldInput instanceof IWorkspace) { - oldWorkspace = (IWorkspace) oldInput; - } - else if (oldInput instanceof IContainer) { - oldWorkspace = ((IContainer) oldInput).getWorkspace(); - } - if (newInput instanceof IWorkspace) { - newWorkspace = (IWorkspace) newInput; - } else if (newInput instanceof IContainer) { - newWorkspace = ((IContainer) newInput).getWorkspace(); - } - if (oldWorkspace != newWorkspace) { - if (oldWorkspace != null) { - oldWorkspace.removeResourceChangeListener(this); - } - if (newWorkspace != null) { - newWorkspace.addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE); - } - } -} -/** - * Process a resource delta. - */ -protected void processDelta(IResourceDelta delta) { - // This method runs inside a syncExec. The widget may have been destroyed - // by the time this is run. Check for this and do nothing if so. - Control ctrl = viewer.getControl(); - if (ctrl == null || ctrl.isDisposed()) - return; - - // Get the affected resource - IResource resource = delta.getResource(); - - // If any children have changed type, just do a full refresh of this parent, - // since a simple update on such children won't work, - // and trying to map the change to a remove and add is too dicey. - // The case is: folder A renamed to existing file B, answering yes to overwrite B. - IResourceDelta[] affectedChildren = - delta.getAffectedChildren(IResourceDelta.CHANGED); - for (int i = 0; i < affectedChildren.length; i++) { - if ((affectedChildren[i].getFlags() & IResourceDelta.TYPE) != 0) { - ((StructuredViewer) viewer).refresh(resource); - return; - } - } - - // Check the flags for changes the Navigator cares about. - // See ResourceLabelProvider for the aspects it cares about. - // Notice we don't care about F_CONTENT or F_MARKERS currently. - int changeFlags = delta.getFlags(); - if ((changeFlags - & (IResourceDelta.OPEN | IResourceDelta.SYNC)) - != 0) { - ((StructuredViewer) viewer).update(resource, null); - } - - // Handle changed children . - for (int i = 0; i < affectedChildren.length; i++) { - processDelta(affectedChildren[i]); - } - - // Process removals before additions, to avoid multiple equal elements in the viewer. - - // Handle removed children. Issue one update for all removals. - affectedChildren = delta.getAffectedChildren(IResourceDelta.REMOVED); - if (affectedChildren.length > 0) { - Object[] affected = new Object[affectedChildren.length]; - for (int i = 0; i < affectedChildren.length; i++) - affected[i] = affectedChildren[i].getResource(); - if (viewer instanceof AbstractTreeViewer) { - ((AbstractTreeViewer) viewer).remove(affected); - } else { - ((StructuredViewer) viewer).refresh(resource); - } - } - - // Handle added children. Issue one update for all insertions. - affectedChildren = delta.getAffectedChildren(IResourceDelta.ADDED); - if (affectedChildren.length > 0) { - Object[] affected = new Object[affectedChildren.length]; - for (int i = 0; i < affectedChildren.length; i++) - affected[i] = affectedChildren[i].getResource(); - if (viewer instanceof AbstractTreeViewer) { - ((AbstractTreeViewer) viewer).add(resource, affected); - } - else { - ((StructuredViewer) viewer).refresh(resource); - } - } -} -/** - * The workbench has changed. Process the delta and issue updates to the viewer, - * inside the UI thread. - * - * @see IResourceChangeListener#resourceChanged - */ -public void resourceChanged(final IResourceChangeEvent event) { - final IResourceDelta delta = event.getDelta(); - Control ctrl = viewer.getControl(); - if (ctrl != null && !ctrl.isDisposed()) { - // Do a sync exec, not an async exec, since the resource delta - // must be traversed in this method. It is destroyed - // when this method returns. - ctrl.getDisplay().syncExec(new Runnable() { - public void run() { - processDelta(delta); - } - }); - } -} -} diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/TestAdaptableWorkbenchAdapter.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/TestAdaptableWorkbenchAdapter.java deleted file mode 100644 index 851ebc2b63b..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/TestAdaptableWorkbenchAdapter.java +++ /dev/null @@ -1,153 +0,0 @@ -package org.eclipse.ui.tests.adaptable; - -/* - * Copyright (c) 2000, 2002 IBM Corp. All rights reserved. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import java.util.Hashtable; -import java.util.Iterator; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.model.IWorkbenchAdapter; - -/** - * @version 1.0 - * @author - */ -public class TestAdaptableWorkbenchAdapter - extends LabelProvider - implements IWorkbenchAdapter { - - private static TestAdaptableWorkbenchAdapter singleton = - new TestAdaptableWorkbenchAdapter(); - - public static TestAdaptableWorkbenchAdapter getInstance() { - return singleton; - } - - public TestAdaptableWorkbenchAdapter() { - } - - /* - * @see IWorkbenchAdapter#getChildren(Object) - */ - public Object[] getChildren(Object o) { - if (o instanceof AdaptableResourceWrapper) - return ((AdaptableResourceWrapper) o).getChildren(); - if(o instanceof IResource){ - AdaptableResourceWrapper wrapper = new AdaptableResourceWrapper((IResource) o); - return wrapper.getChildren(); - } - return new Object[0]; - } - - /* - * @see IWorkbenchAdapter#getImageDescriptor(Object) - */ - public ImageDescriptor getImageDescriptor(Object object) { - return null; - } - - /* - * @see IWorkbenchAdapter#getLabel(Object) - */ - public String getLabel(Object o) { - if (o instanceof AdaptableResourceWrapper) - return ((AdaptableResourceWrapper) o).getLabel(); - else - return null; - } - - /* - * @see IWorkbenchAdapter#getParent(Object) - */ - public Object getParent(Object o) { - if (o instanceof AdaptableResourceWrapper) - return ((AdaptableResourceWrapper) o).getParent(); - else - return null; - } - - /** - * Returns an image descriptor that is based on the given descriptor, - * but decorated with additional information relating to the state - * of the provided object. - * - * Subclasses may reimplement this method to decorate an object's - * image. - * @see org.eclipse.jface.resource.CompositeImage - */ - protected ImageDescriptor decorateImage( - ImageDescriptor input, - Object element) { - return input; - } - /** - * Returns a label that is based on the given label, - * but decorated with additional information relating to the state - * of the provided object. - * - * Subclasses may implement this method to decorate an object's - * label. - */ - protected String decorateText(String input, Object element) { - return input; - } - /* (non-Javadoc) - * Method declared on IBaseLabelProvider - */ - /** - * Disposes of all allocated images. - */ - public final void dispose() { - } - /** - * Returns the implementation of IWorkbenchAdapter for the given - * object. Returns <code>null</code> if the adapter is not defined or the - * object is not adaptable. - */ - protected final IWorkbenchAdapter getAdapter(Object o) { - if (!(o instanceof IAdaptable)) { - return null; - } - return (IWorkbenchAdapter) ((IAdaptable) o).getAdapter(IWorkbenchAdapter.class); - } - /* (non-Javadoc) - * Method declared on ILabelProvider - */ - public final Image getImage(Object element) { - //obtain the base image by querying the element - IWorkbenchAdapter adapter = getAdapter(element); - if (adapter == null) - return null; - ImageDescriptor descriptor = adapter.getImageDescriptor(element); - if (descriptor == null) - return null; - - //add any annotations to the image descriptor - descriptor = decorateImage(descriptor, element); - - return descriptor.createImage(); - } - /* (non-Javadoc) - * Method declared on ILabelProvider - */ - public final String getText(Object element) { - //query the element for its label - IWorkbenchAdapter adapter = getAdapter(element); - if (adapter == null) - return ""; //$NON-NLS-1$ - String label = adapter.getLabel(element); - - //return the decorated label - return decorateText(label, element); - } -}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/TestNavigatorActionGroup.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/TestNavigatorActionGroup.java deleted file mode 100644 index 95478110298..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/TestNavigatorActionGroup.java +++ /dev/null @@ -1,94 +0,0 @@ -package org.eclipse.ui.tests.adaptable; - -/* - * 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.jface.action.IMenuManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.actions.*; -import org.eclipse.ui.actions.AddBookmarkAction; -import org.eclipse.ui.actions.NewWizardAction; -import org.eclipse.ui.actions.NewWizardMenu; -import org.eclipse.ui.dialogs.PropertyDialogAction; -import org.eclipse.ui.views.navigator.ResourceNavigatorMessages; - -public class TestNavigatorActionGroup extends ActionGroup { - - private AdaptedResourceNavigator navigator; - private AddBookmarkAction addBookmarkAction; - private PropertyDialogAction propertyDialogAction; - private NewWizardAction newWizardAction; - - public TestNavigatorActionGroup(AdaptedResourceNavigator navigator) { - this.navigator = navigator; - } - - protected void makeActions() { - Shell shell = navigator.getSite().getShell(); - addBookmarkAction = new AddBookmarkAction(shell); - newWizardAction = new NewWizardAction(); - propertyDialogAction = - new PropertyDialogAction(shell, navigator.getViewer()); - } - - /** - * @see ActionGroup#fillContextMenu(IMenuManager) - */ - public void fillContextMenu(IMenuManager menu) { - IStructuredSelection selection = (IStructuredSelection) getContext().getSelection(); - - MenuManager newMenu = - new MenuManager(ResourceNavigatorMessages.getString("ResourceNavigator.new")); //$NON-NLS-1$ - menu.add(newMenu); - new NewWizardMenu(newMenu, navigator.getSite().getWorkbenchWindow(), false); - - //Update the selections of those who need a refresh before filling - addBookmarkAction.selectionChanged(selection); - menu.add(addBookmarkAction); - - menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); - menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS + "-end")); //$NON-NLS-1$ - menu.add(new Separator()); - - propertyDialogAction.selectionChanged(selection); - if (propertyDialogAction.isApplicableForSelection()) - menu.add(propertyDialogAction); - } - - /* - * @see ActionFactory#fillActionBarMenu(IMenuManager, IStructuredSelection) - */ - public void fillActionBarMenu( - IMenuManager menu, - IStructuredSelection selection) { - } - - /** - * Updates the global actions with the given selection. - * Be sure to invoke after actions objects have updated, since can* methods delegate to action objects. - */ - public void updateGlobalActions(IStructuredSelection selection) { - - } - - /** - * Contributes actions to the local tool bar and local pulldown menu. - * @since 2.0 - */ - public void fillActionBars(IStructuredSelection selection) { - } - - /** - * Update the selection for new selection. - */ - public void selectionChanged(IStructuredSelection selection) {} - -}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ApiTestSuite.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ApiTestSuite.java deleted file mode 100644 index 8047a45ba4f..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ApiTestSuite.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.eclipse.ui.tests.api;
-import junit.framework.*;
-import junit.textui.TestRunner;
-import org.eclipse.swt.SWT;
-
-/**
- * Test all areas of the UI API.
- */
-public class ApiTestSuite extends TestSuite {
-
- /**
- * Returns the suite. This is required to
- * use the JUnit Launcher.
- */
- public static Test suite() {
- return new ApiTestSuite();
- }
-
- /**
- * Construct the test suite.
- */
- public ApiTestSuite() {
- addTest(new TestSuite(PlatformUITest.class));
- addTest(new TestSuite(IWorkbenchTest.class));
- addTest(new TestSuite(IWorkbenchWindowTest.class));
- addTest(new TestSuite(IWorkbenchPageTest.class));
- addTest(new TestSuite(IActionFilterTest.class));
- addTest(new TestSuite(IPageListenerTest.class));
- addTest(new TestSuite(IPageServiceTest.class));
- addTest(new TestSuite(IPerspectiveRegistryTest.class));
- addTest(new TestSuite(IPerspectiveDescriptorTest.class));
- addTest(new TestSuite(IFileEditorMappingTest.class));
- addTest(new TestSuite(IEditorDescriptorTest.class));
- addTest(new TestSuite(IEditorRegistryTest.class));
- addTest(new TestSuite(IPerspectiveListenerTest.class));
- addTest(new TestSuite(IWorkbenchWindowActionDelegateTest.class));
- addTest(new TestSuite(IViewActionDelegateTest.class));
- addTest(new TestSuite(IViewSiteTest.class));
- addTest(new TestSuite(IEditorSiteTest.class));
- addTest(new TestSuite(IActionBarsTest.class));
- addTest(new TestSuite(IViewPartTest.class));
- addTest(new TestSuite(IEditorPartTest.class));
- addTest(new TestSuite(IEditorActionBarContributorTest.class));
- addTest(new TestSuite(ISelectionServiceTest.class));
- addTest(new TestSuite(IWorkingSetTest.class));
- addTest(new TestSuite(IWorkingSetManagerTest.class));
- addTest(new TestSuite(MockWorkingSetTest.class));
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IActionBarsTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IActionBarsTest.java deleted file mode 100644 index ce839333db6..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IActionBarsTest.java +++ /dev/null @@ -1,153 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.jface.action.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.util.*;
-
-
-/**
- * Test the lifecycle of an action delegate.
- */
-public class IActionBarsTest extends UITestCase {
-
- protected IWorkbenchWindow fWindow;
- protected IWorkbenchPage fPage;
-
- private class MockAction extends Action {
- public boolean hasRun = false;
- public MockAction() {
- super();
- }
- public void run() {
- hasRun = true;
- }
- }
-
- /**
- * Constructor for IActionDelegateTest
- */
- public IActionBarsTest(String testName) {
- super(testName);
- }
-
- public void setUp() {
- fWindow = openTestWindow();
- fPage = fWindow.getActivePage();
- }
-
- public void testGetMenuManager() throws Throwable {
- // From Javadoc: "Returns the menu manager."
-
- IViewPart part = fPage.showView(MockViewPart.ID);
- IActionBars bars = part.getViewSite().getActionBars();
- assertNotNull(bars);
- IMenuManager mgr = bars.getMenuManager();
- assertNotNull(mgr);
- }
-
- public void testGetStatusLineManager() throws Throwable {
- // From Javadoc: "Returns the status line manager."
-
- IViewPart part = fPage.showView(MockViewPart.ID);
- IActionBars bars = part.getViewSite().getActionBars();
- assertNotNull(bars);
- IStatusLineManager mgr = bars.getStatusLineManager();
- assertNotNull(mgr);
- }
-
- public void testGetToolBarManager() throws Throwable {
- // From Javadoc: "Returns the tool bar manager."
-
- IViewPart part = fPage.showView(MockViewPart.ID);
- IActionBars bars = part.getViewSite().getActionBars();
- assertNotNull(bars);
- IToolBarManager mgr = bars.getToolBarManager();
- assertNotNull(mgr);
- }
-
- public void testGetGlobalActionHandler() throws Throwable {
- // From Javadoc: "Returns the global action handler for
- // the action with the given id.
-
- IViewPart part = fPage.showView(MockViewPart.ID);
- IActionBars bars = part.getViewSite().getActionBars();
- assertNotNull(bars);
-
- // Get actions. They should all be null.
- assertNull(bars.getGlobalActionHandler(IWorkbenchActionConstants.CUT));
- assertNull(bars.getGlobalActionHandler(IWorkbenchActionConstants.COPY));
- assertNull(bars.getGlobalActionHandler(IWorkbenchActionConstants.UNDO));
-
- // Create actions.
- MockAction cut = new MockAction();
- MockAction copy = new MockAction();
- MockAction undo = new MockAction();
-
- // Set actions.
- bars.setGlobalActionHandler(IWorkbenchActionConstants.CUT, cut);
- bars.setGlobalActionHandler(IWorkbenchActionConstants.COPY, copy);
- bars.setGlobalActionHandler(IWorkbenchActionConstants.UNDO, undo);
- bars.updateActionBars();
-
- // Get actions. They should not be null.
- assertEquals(cut, bars.getGlobalActionHandler(IWorkbenchActionConstants.CUT));
- assertEquals(copy, bars.getGlobalActionHandler(IWorkbenchActionConstants.COPY));
- assertEquals(undo, bars.getGlobalActionHandler(IWorkbenchActionConstants.UNDO));
- }
-
- public void testSetGlobalActionHandler() throws Throwable {
- // From Javadoc: "Returns the global action handler for
- // the action with the given id.
-
- IViewPart part = fPage.showView(MockViewPart.ID);
- IActionBars bars = part.getViewSite().getActionBars();
- assertNotNull(bars);
-
- // Create actions.
- MockAction cut = new MockAction();
- MockAction copy = new MockAction();
- MockAction undo = new MockAction();
-
- // Set actions.
- bars.setGlobalActionHandler(IWorkbenchActionConstants.CUT, cut);
- bars.setGlobalActionHandler(IWorkbenchActionConstants.COPY, copy);
- bars.setGlobalActionHandler(IWorkbenchActionConstants.UNDO, undo);
- bars.updateActionBars();
-
- // Run the real workbench actions.
- // Verify the actions are invoked.
- cut.hasRun = copy.hasRun = undo.hasRun = false;
- ActionUtil.runActionUsingPath(this, fWindow,
- IWorkbenchActionConstants.M_EDIT + '/' + IWorkbenchActionConstants.CUT);
- ActionUtil.runActionUsingPath(this, fWindow,
- IWorkbenchActionConstants.M_EDIT + '/' + IWorkbenchActionConstants.UNDO);
- assertTrue(cut.hasRun);
- assertTrue(!copy.hasRun);
- assertTrue(undo.hasRun);
-
- // Now create a second view and run the actions again.
- // Our global actions should not be invoked.
- IViewPart part2 = fPage.showView(MockViewPart.ID2);
- cut.hasRun = copy.hasRun = undo.hasRun = false;
- ActionUtil.runActionUsingPath(this, fWindow,
- IWorkbenchActionConstants.M_EDIT + '/' + IWorkbenchActionConstants.CUT);
- ActionUtil.runActionUsingPath(this, fWindow,
- IWorkbenchActionConstants.M_EDIT + '/' + IWorkbenchActionConstants.UNDO);
- assertTrue(!cut.hasRun);
- assertTrue(!copy.hasRun);
- assertTrue(!undo.hasRun);
-
- // Reactivate test view and run actions again.
- // This time our global actions should be invoked.
- fPage.activate(part);
- cut.hasRun = copy.hasRun = undo.hasRun = false;
- ActionUtil.runActionUsingPath(this, fWindow,
- IWorkbenchActionConstants.M_EDIT + '/' + IWorkbenchActionConstants.CUT);
- ActionUtil.runActionUsingPath(this, fWindow,
- IWorkbenchActionConstants.M_EDIT + '/' + IWorkbenchActionConstants.UNDO);
- assertTrue(cut.hasRun);
- assertTrue(!copy.hasRun);
- assertTrue(undo.hasRun);
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IActionDelegateTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IActionDelegateTest.java deleted file mode 100644 index 6bed2464890..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IActionDelegateTest.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.jface.action.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.util.*;
-
-
-/**
- * Test the lifecycle of an action delegate.
- */
-public abstract class IActionDelegateTest extends UITestCase {
-
- protected IWorkbenchWindow fWindow;
- protected IWorkbenchPage fPage;
-
- /**
- * Constructor for IActionDelegateTest
- */
- public IActionDelegateTest(String testName) {
- super(testName);
- }
-
- public void setUp() {
- fWindow = openTestWindow();
- fPage = fWindow.getActivePage();
- }
-
- public void testRun() throws Throwable {
- // Create the action.
- Object obj = createActionWidget();
-
- // Run the action delegate.
- // The selectionChanged and run methods should be called, in that order.
- runAction(obj);
- MockActionDelegate delegate = getDelegate();
- assertNotNull(delegate);
- assertTrue(delegate.callHistory.verifyOrder(
- new String[] {"selectionChanged", "run" } ));
- }
-
- public void testSelectionChanged() throws Throwable {
- // Create the delegate by running it.
- Object obj = createActionWidget();
- runAction(obj);
- MockActionDelegate delegate = getDelegate();
- assertNotNull(delegate);
-
- // Fire a selection.
- // The selectionChanged method should be invoked.
- delegate.callHistory.clear();
- fireSelection(obj);
- assertTrue(delegate.callHistory.contains("selectionChanged"));
- }
-
- /**
- * Returns the last mock action delegate which was created.
- */
- protected MockActionDelegate getDelegate() throws Throwable {
- MockActionDelegate delegate = MockActionDelegate.lastDelegate;
- assertNotNull(delegate);
- return delegate;
- }
-
- /**
- * Creates the widget for an action, and adds the action.
- *
- * @returns an object which will be passed to runAction and
- * fireSelection.
- */
- protected abstract Object createActionWidget() throws Throwable;
-
- /**
- * Adds and runs the action delegate. Subclasses should override.
- *
- * @param obj the object returned from createActionWidget.
- */
- protected abstract void runAction(Object widget) throws Throwable;
-
- /**
- * Fires a selection from the source. Subclasses should override.
- *
- * @param obj the object returned from createActionWidget.
- */
- protected abstract void fireSelection(Object widget) throws Throwable;
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IActionFilterTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IActionFilterTest.java deleted file mode 100644 index 7380b38b7ac..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IActionFilterTest.java +++ /dev/null @@ -1,163 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.jface.action.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.util.*;
-
-/**
- * Test the lifecycle of an action filter.
- *
- * From Javadoc: "An IActionFilter returns whether the specific attribute
- * matches the state of the target object."
- *
- * Setup: The plugin.xml contains a number of popup menu action
- * targetted to ListElements
- *
- * redAction -> (name = red)
- * blueAction -> (name = blue)
- * trueAction -> (flag = true)
- * falseAction -> (flag = false)
- * redTrueAction -> (name = red) (flag = true)
- */
-public class IActionFilterTest extends UITestCase {
-
- protected IWorkbenchWindow fWindow;
- protected IWorkbenchPage fPage;
- protected String STATIC_MENU_VIEW_ID = "org.eclipse.ui.tests.api.IActionFilterTest1";
- protected String DYNAMIC_MENU_VIEW_ID = "org.eclipse.ui.tests.api.IActionFilterTest2";
-
- public IActionFilterTest(String testName) {
- super(testName);
- }
-
- public void setUp() {
- fWindow = openTestWindow();
- fPage = fWindow.getActivePage();
- }
-
- public void testStaticLifecycle() throws Throwable {
- testLifecycle(STATIC_MENU_VIEW_ID);
- }
-
- public void testDynamicLifecycle() throws Throwable {
- testLifecycle(DYNAMIC_MENU_VIEW_ID);
- }
-
- /**
- * Select a list element, popup the menu, and verify that the
- * action filter is called.
- *
- * See Setup above.
- */
- private void testLifecycle(String viewId) throws Throwable {
- // Create a list view.
- ListView view = (ListView)fPage.showView(viewId);
-
- // Create the test objects.
- ListElement red = new ListElement("red");
- view.addElement(red);
- view.selectElement(red);
-
- // Get action filter.
- ListElementActionFilter filter = ListElementActionFilter.getSingleton();
-
- // Open menu. Verify that action filter is called.
- MenuManager menuMgr = view.getMenuManager();
- ActionUtil.fireAboutToShow(menuMgr);
- assertTrue(filter.getCalled());
- }
-
- public void testDynamicMenuContribution() throws Throwable {
- testMenu(DYNAMIC_MENU_VIEW_ID);
- }
-
- public void testStaticMenuContribution() throws Throwable {
- testMenu(STATIC_MENU_VIEW_ID);
- }
-
- /**
- * Select a ListElement, popup a menu and verify that the
- * ListElementActionFilter.testAttribute method is invoked.
- * Then verify that the correct actions are added to the
- * popup menu.
- *
- * See Setup above.
- */
- private void testMenu(String viewId) throws Throwable {
- // Create the test objects.
- ListElement red = new ListElement("red");
- ListElement blue = new ListElement("blue");
- ListElement green = new ListElement("green");
- ListElement redTrue = new ListElement("red", true);
-
- // Create a list view.
- ListView view = (ListView)fPage.showView(viewId);
- MenuManager menuMgr = view.getMenuManager();
- view.addElement(red);
- view.addElement(blue);
- view.addElement(green);
- view.addElement(redTrue);
-
- // Get action filter.
- ListElementActionFilter filter = ListElementActionFilter.getSingleton();
-
- // Select red, verify popup.
- view.selectElement(red);
- ActionUtil.fireAboutToShow(menuMgr);
- assertTrue(filter.getCalled());
- assertNotNull(ActionUtil.getActionWithLabel(menuMgr, "redAction_v1"));
- assertNull(ActionUtil.getActionWithLabel(menuMgr, "blueAction_v1"));
- assertNull(ActionUtil.getActionWithLabel(menuMgr, "trueAction_v1"));
- assertNotNull(ActionUtil.getActionWithLabel(menuMgr, "falseAction_v1"));
- assertNull(ActionUtil.getActionWithLabel(menuMgr, "redTrueAction_v1"));
- view.verifyActions(this, menuMgr);
-
- // Select blue, verify popup.
- filter.clearCalled();
- view.selectElement(blue);
- ActionUtil.fireAboutToShow(menuMgr);
- assertTrue(filter.getCalled());
- assertNull(ActionUtil.getActionWithLabel(menuMgr, "redAction_v1"));
- assertNotNull(ActionUtil.getActionWithLabel(menuMgr, "blueAction_v1"));
- assertNull(ActionUtil.getActionWithLabel(menuMgr, "trueAction_v1"));
- assertNotNull(ActionUtil.getActionWithLabel(menuMgr, "falseAction_v1"));
- assertNull(ActionUtil.getActionWithLabel(menuMgr, "redTrueAction_v1"));
- view.verifyActions(this, menuMgr);
-
- // Select green, verify popup.
- filter.clearCalled();
- view.selectElement(green);
- ActionUtil.fireAboutToShow(menuMgr);
- assertTrue(filter.getCalled());
- assertNull(ActionUtil.getActionWithLabel(menuMgr, "redAction_v1"));
- assertNull(ActionUtil.getActionWithLabel(menuMgr, "blueAction_v1"));
- assertNull(ActionUtil.getActionWithLabel(menuMgr, "trueAction_v1"));
- assertNotNull(ActionUtil.getActionWithLabel(menuMgr, "falseAction_v1"));
- assertNull(ActionUtil.getActionWithLabel(menuMgr, "redTrueAction_v1"));
- view.verifyActions(this, menuMgr);
-
- // Select redTrue, verify popup.
- filter.clearCalled();
- view.selectElement(redTrue);
- ActionUtil.fireAboutToShow(menuMgr);
- assertTrue(filter.getCalled());
- assertNotNull(ActionUtil.getActionWithLabel(menuMgr, "redAction_v1"));
- assertNull(ActionUtil.getActionWithLabel(menuMgr, "blueAction_v1"));
- assertNotNull(ActionUtil.getActionWithLabel(menuMgr, "trueAction_v1"));
- assertNull(ActionUtil.getActionWithLabel(menuMgr, "falseAction_v1"));
- assertNotNull(ActionUtil.getActionWithLabel(menuMgr, "redTrueAction_v1"));
- view.verifyActions(this, menuMgr);
-
- // Select nothing, verify popup.
- filter.clearCalled();
- view.selectElement(null);
- ActionUtil.fireAboutToShow(menuMgr);
- assertTrue(!filter.getCalled());
- assertNull(ActionUtil.getActionWithLabel(menuMgr, "redAction_v1"));
- assertNull(ActionUtil.getActionWithLabel(menuMgr, "blueAction_v1"));
- assertNull(ActionUtil.getActionWithLabel(menuMgr, "trueAction_v1"));
- assertNull(ActionUtil.getActionWithLabel(menuMgr, "falseAction_v1"));
- assertNull(ActionUtil.getActionWithLabel(menuMgr, "redTrueAction_v1"));
- view.verifyActions(this, menuMgr);
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IConstants.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IConstants.java deleted file mode 100644 index 850f7ef7208..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IConstants.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.eclipse.ui.tests.api;
-public interface IConstants {
- public static String FakeID =
- "Is this fake ID for buying beer or getting into a club?",
- FakeLabel =
- "Hmmm. Who's to say this is a fake label? I mean, someday, this can be a real label.",
- UnknownFileName[] =
- {
- "This is not a known file name to the world.with a cool extension",
- "this is not the same as the other.anyways this is a file extension" },
- KnownFileName[] = { "plugin.xml" },
- ProjectName = "JUnitTestingProjectName";
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorActionBarContributorTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorActionBarContributorTest.java deleted file mode 100644 index ad7c8a92440..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorActionBarContributorTest.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.util.*;
-
-/**
- * This is a test for IEditorPart. Since IEditorPart is an
- * interface this test verifies the IEditorPart lifecycle rather
- * than the implementation.
- */
-public class IEditorActionBarContributorTest extends UITestCase {
-
- protected IWorkbenchWindow fWindow;
- protected IWorkbenchPage fPage;
- private String EDITOR_ID = "org.eclipse.ui.tests.api.IEditorActionBarContributorTest";
-
- /**
- * Constructor for IEditorPartTest
- */
- public IEditorActionBarContributorTest(String testName) {
- super(testName);
- }
-
- public void setUp() {
- fWindow = openTestWindow();
- fPage = fWindow.getActivePage();
- }
-
- public void testInit() throws Throwable {
- // From javadoc: "Initializes this contributor, which is expected to
- // add contributions as required to the given action bars and global
- // action handlers."
-
- // Open a part.
- MockEditorPart part = openEditor(fPage, "1");
-
- // Get contributor and verify call history.
- MockEditorActionBarContributor contributor =
- (MockEditorActionBarContributor)part.getEditorSite().getActionBarContributor();
- CallHistory history = contributor.getCallHistory();
- assertTrue(history.verifyOrder(new String[] {
- "init", "setActiveEditor"}));
- assertEquals(part, contributor.getActiveEditor());
-
- // Close the part.
- fPage.closeAllEditors(false);
- }
-
- public void testSetActiveEditor() throws Throwable {
- // From javadoc: "Sets the active editor for the contributor."
-
- // Open an editor.
- MockEditorPart part = openEditor(fPage, "X");
-
- // Get contributor and verify call history.
- MockEditorActionBarContributor contributor =
- (MockEditorActionBarContributor)
- part.getEditorSite().getActionBarContributor();
- CallHistory history = contributor.getCallHistory();
- assertTrue(history.verifyOrder(new String[] {
- "init", "setActiveEditor" }));
- assertEquals(part, contributor.getActiveEditor());
-
- // Open a few more and verify setActiveEditor.
- int editorCount = 5;
- MockEditorPart [] parts = new MockEditorPart[editorCount];
- for (int nX = 0; nX < editorCount; nX ++) {
- history.clear();
- parts[nX] = openEditor(fPage, Integer.toString(nX));
- assertTrue(history.verifyOrder(new String[] {
- "setActiveEditor" }));
- assertEquals(parts[nX], contributor.getActiveEditor());
- }
-
- // Activate the parts and verify setActiveEditor.
- for (int nX = 0; nX < editorCount; nX ++) {
- history.clear();
- fPage.activate(parts[nX]);
- assertTrue(history.verifyOrder(new String[] {
- "setActiveEditor" }));
- assertEquals(parts[nX], contributor.getActiveEditor());
- }
-
- // Close the parts.
- fPage.closeAllEditors(false);
- }
-
- /**
- * @see IWorkbenchPartTest#openPart(IWorkbenchPage)
- */
- protected MockEditorPart openEditor(IWorkbenchPage page, String suffix)
- throws Throwable
- {
- IProject proj = FileUtil.createProject("IEditorActionBarContributorTest");
- IFile file = FileUtil.createFile("test" + suffix + ".txt", proj);
- return (MockEditorPart)page.openEditor(file, EDITOR_ID);
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorActionDelegateTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorActionDelegateTest.java deleted file mode 100644 index 83c1ea6fd92..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorActionDelegateTest.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.tests.util.*;
-
-
-/**
- * Tests the lifecycle for an editor action delegate.
- */
-public class IEditorActionDelegateTest extends IActionDelegateTest {
-
- public static String EDITOR_ID = "org.eclipse.ui.tests.api.IEditorActionDelegateTest";
- private MockEditorPart editor;
-
- /**
- * Constructor for IWorkbenchWindowActionDelegateTest
- */
- public IEditorActionDelegateTest(String testName) {
- super(testName);
- }
-
- public void testSetActiveEditor() throws Throwable {
- // When an action delegate is run the
- // setActiveEditor, selectionChanged, and run methods should
- // be called, in that order.
-
- // Run the action.
- testRun();
-
- // Verify lifecycle.
- MockActionDelegate delegate = getDelegate();
- assertNotNull(delegate);
- assertTrue(delegate.callHistory.verifyOrder(
- new String [] {"setActiveEditor", "selectionChanged", "run"}));
- }
-
- /**
- * @see IActionDelegateTest#createActionWidget()
- */
- protected Object createActionWidget() throws Throwable {
- editor = openEditor(fPage, "X");
- return editor;
- }
-
- /**
- * @see IActionDelegateTest#runAction()
- */
- protected void runAction(Object widget) throws Throwable {
- MockEditorPart editor = (MockEditorPart)widget;
- MockEditorActionBarContributor contributor =
- (MockEditorActionBarContributor)
- editor.getEditorSite().getActionBarContributor();
- IMenuManager mgr = contributor.getActionBars().getMenuManager();
- ActionUtil.runActionWithLabel(this, mgr, "Mock Action");
- }
-
- /**
- * @see IActionDelegateTest#fireSelection()
- */
- protected void fireSelection(Object widget) throws Throwable {
- MockEditorPart editor = (MockEditorPart)widget;
- editor.fireSelection();
- }
-
- protected MockEditorPart openEditor(IWorkbenchPage page, String suffix)
- throws Throwable
- {
- IProject proj = FileUtil.createProject("IEditorActionDelegateTest");
- IFile file = FileUtil.createFile("test" + suffix + ".txt", proj);
- return (MockEditorPart)page.openEditor(file, EDITOR_ID);
- }
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorDescriptorTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorDescriptorTest.java deleted file mode 100644 index 3f74018712a..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorDescriptorTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import junit.framework.TestCase;
-import org.eclipse.ui.tests.util.*;
-import org.eclipse.ui.*;
-
-public class IEditorDescriptorTest extends TestCase {
- IEditorDescriptor[] fEditors;
-
- public IEditorDescriptorTest( String testName )
- {
- super( testName );
- }
-
- public void setUp()
- {
- IFileEditorMapping mapping = ( IFileEditorMapping )ArrayUtil.pickRandom(
- PlatformUI.getWorkbench().getEditorRegistry().getFileEditorMappings()
- );
- fEditors = mapping.getEditors();
- }
-
- public void testGetId() throws Throwable
- {
- for( int i = 0; i < fEditors.length; i ++ )
- assertNotNull( fEditors[ i ].getId() );
- }
-
- public void testGetImageDescriptor() throws Throwable
- {
- for( int i = 0; i < fEditors.length; i ++ )
- assertNotNull( fEditors[ i ].getImageDescriptor() );
- }
-
- public void testGetLabel() throws Throwable
- {
- for( int i = 0; i < fEditors.length; i ++ )
- assertNotNull( fEditors[ i ].getLabel() );
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorLauncherTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorLauncherTest.java deleted file mode 100644 index 0e8576e6a52..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorLauncherTest.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.eclipse.ui.tests.api;
-public class IEditorLauncherTest {
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorPartTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorPartTest.java deleted file mode 100644 index ee48123094d..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorPartTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.ui.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.ui.tests.util.FileUtil;
-
-/**
- * This is a test for IEditorPart. Since IEditorPart is an
- * interface this test verifies the IEditorPart lifecycle rather
- * than the implementation.
- */
-public class IEditorPartTest extends IWorkbenchPartTest {
-
- /**
- * Constructor for IEditorPartTest
- */
- public IEditorPartTest(String testName) {
- super(testName);
- }
-
- /**
- * @see IWorkbenchPartTest#openPart(IWorkbenchPage)
- */
- protected MockWorkbenchPart openPart(IWorkbenchPage page) throws Throwable {
- IProject proj = FileUtil.createProject("IEditorPartTest");
- IFile file = FileUtil.createFile("IEditorPartTest.txt", proj);
- return (MockWorkbenchPart)page.openEditor(file, MockEditorPart.ID1);
- }
-
- /**
- * @see IWorkbenchPartTest#closePart(IWorkbenchPage, MockWorkbenchPart)
- */
- protected void closePart(IWorkbenchPage page, MockWorkbenchPart part)
- throws Throwable
- {
- page.closeEditor((IEditorPart)part, false);
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorRegistryTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorRegistryTest.java deleted file mode 100644 index 3f9c23979f4..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorRegistryTest.java +++ /dev/null @@ -1,265 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import junit.framework.TestCase;
-import org.eclipse.jface.resource.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.ui.tests.util.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.internal.registry.*;
-
-public class IEditorRegistryTest extends TestCase {
- private IEditorRegistry fReg;
- private IProject proj;
-
- public IEditorRegistryTest( String testName )
- {
- super( testName );
- }
-
- public void setUp()
- {
- fReg = PlatformUI.getWorkbench().getEditorRegistry();
- }
-
- public void tearDown()
- {
- if( proj != null ){
- try{
- FileUtil.deleteProject( proj );
- }catch( CoreException e )
- {
- fail();
- }
- }
- }
-
- public void testGetFileEditorMappings()
- {
- assertTrue( ArrayUtil.checkNotNull( fReg.getFileEditorMappings() ) );
- }
-
- /**
- * tests both of the following:
- * IEditorDescriptor[] getEditors(IFile file)
- * IEditorDescriptor[] getEditors(String filename)
- */
- public void testGetEditors() throws Throwable
- {
- IEditorDescriptor[] editors, editors2;
- String[][] maps = {
- {"a.mock1", MockEditorPart.ID1 },
- {"b.mock2", MockEditorPart.ID2 }
- };
-
- proj = FileUtil.createProject("testProject");
-
- for( int i = 0; i < maps.length; i ++ ){
- editors = fReg.getEditors( maps[i][0] );
- assertEquals( editors.length, 1 );
- assertEquals( editors[ 0 ].getId(), maps[i][1] );
- editors2 = fReg.getEditors( FileUtil.createFile( maps[i][0], proj ) );
- assertEquals( ArrayUtil.equals( editors, editors2 ), true );
- }
-
- //there is no matching editor
- String fileName = IConstants.UnknownFileName[0];
- editors = fReg.getEditors( fileName );
- assertEquals( editors.length, 0 );
- editors = fReg.getEditors( FileUtil.createFile( fileName, proj ));
- assertEquals( editors.length, 0 );
- }
-
- public void testFindEditor()
- {
- String id = MockEditorPart.ID1;
- IEditorDescriptor editor = fReg.findEditor( id );
- assertEquals( editor.getId(), id );
-
- //editor is not found
- id = IConstants.FakeID;
- editor = fReg.findEditor( id );
- assertNull( editor );
- }
-
- /**
- * getDefaultEditor()
- */
- public void testGetDefaultEditor()
- {
- assertNotNull( fReg.getDefaultEditor() );
- }
-
- /**
- * getDefaultEditor(String fileName)
- */
- public void testGetDefaultEditor2()
- {
- IEditorDescriptor editor = fReg.getDefaultEditor( "a.mock1" );
- assertEquals( editor.getId(), MockEditorPart.ID1 );
-
- // same extension with different name
- IEditorDescriptor editor2 = fReg.getDefaultEditor( "b.mock1" );
- assertEquals( editor, editor2 );
-
- //editor not found
- assertNull( fReg.getDefaultEditor( IConstants.UnknownFileName[0] ) );
- }
-
- /**
- * getDefaultEditor(IFile file)
- */
- public void testGetDefaultEditor3() throws Throwable
- {
- proj = FileUtil.createProject("testProject");
-
- IFile file = FileUtil.createFile("Whats up.bro", proj);
- String id = MockEditorPart.ID1;
- fReg.setDefaultEditor( file, id );
- IEditorDescriptor editor = fReg.getDefaultEditor( file );
- assertEquals( editor.getId(), id );
-
- //attach an IFile object with a registered extension to a different editor
- file = FileUtil.createFile("ambush.mock1", proj);
- id = MockEditorPart.ID2;
- fReg.setDefaultEditor( file, id );
- editor = fReg.getDefaultEditor( file );
- assertEquals( editor.getId(), id );
-
- //a non-registered IFile object with a registered extension
- String name = "what.mock2";
- file = FileUtil.createFile( name, proj);
- editor = fReg.getDefaultEditor( file );
- assertEquals( editor, fReg.getDefaultEditor( name ) );
-
- //a non-registered IFile object with an unregistered extension
- name = IConstants.UnknownFileName[0];
- file = FileUtil.createFile( name, proj);
- assertNull( fReg.getDefaultEditor( file ) );
- }
-
- public void testSetDefaultEditor() throws Throwable
- {
- proj = FileUtil.createProject("testProject");
- IFile file = FileUtil.createFile("good.file", proj);
-
- String id = MockEditorPart.ID1;
- fReg.setDefaultEditor( file, id );
- IEditorDescriptor editor = fReg.getDefaultEditor( file );
- assertEquals( editor.getId(), id );
-
- //change the default editor
- id = MockEditorPart.ID2;
- fReg.setDefaultEditor( file, id );
- editor = fReg.getDefaultEditor( file );
- assertEquals( editor.getId(), id );
-
- //register the default editor with an invalid editor id
- fReg.setDefaultEditor( file, IConstants.FakeID );
- assertNull( fReg.getDefaultEditor( file ) );
- }
-
- /**
- * tests both of the following:
- * getImageDescriptor(IFile file)
- * getImageDescriptor(String filename)
- */
- public void testGetImageDescriptor() throws Throwable
- {
- proj = FileUtil.createProject("testProject");
-
-
- IFileEditorMapping[] mappings = fReg.getFileEditorMappings();
- ImageDescriptor image1, image2;
- String fileName;
-
- fileName = "a.mock1";
- IFile file = FileUtil.createFile(fileName, proj);
- image1 = fReg.getImageDescriptor( fileName );
- image2 = fReg.getDefaultEditor( fileName).getImageDescriptor();
- assertEquals( image1, image2 );
- //for getImageDescriptor(IFile file)
- assertEquals( image1, fReg.getImageDescriptor( file ) );
-
- //same extension, different file name
- fileName = "b.mock1";
- file = FileUtil.createFile(fileName, proj);
- assertEquals( image1, fReg.getImageDescriptor( fileName ) );
- assertEquals( image1, fReg.getImageDescriptor( file ) );
-
- //default image
- fileName = "a.nullAndVoid";
- file = FileUtil.createFile(fileName, proj);
- image1 = fReg.getImageDescriptor( fileName );
- image2 = fReg.getImageDescriptor( "b.this_is_not_good" );
- assertNotNull( image1 );
- assertEquals( image1, image2 );
- assertEquals( image2, fReg.getImageDescriptor( file ) );
- }
-
- public void testAddPropertyListener() throws Throwable
- {
- final String METHOD = "propertyChanged";
-
- //take out mappings from the registry and put them back right away
- //so that the event gets triggered without making change to the registry
- IFileEditorMapping[] src = fReg.getFileEditorMappings();
- FileEditorMapping[] maps = new FileEditorMapping[src.length];
- System.arraycopy( src, 0, maps, 0, src.length);
-
- MockPropertyListener listener = new MockPropertyListener( fReg, fReg.PROP_CONTENTS );
- fReg.addPropertyListener( listener );
- CallHistory callTrace = listener.getCallHistory();
-
- //multiple listener
- MockPropertyListener listener2 = new MockPropertyListener( fReg, fReg.PROP_CONTENTS );
- fReg.addPropertyListener( listener2 );
- CallHistory callTrace2 = listener2.getCallHistory();
-
- //fire!!
- callTrace.clear();
- callTrace2.clear();
- ((EditorRegistry)fReg).setFileEditorMappings( maps );
- assertEquals( callTrace.contains( METHOD ), true);
- assertEquals( callTrace2.contains( METHOD ), true);
-
- //add the same listener second time
- fReg.addPropertyListener( listener );
-
- //fire!!
- callTrace.clear();
- ((EditorRegistry)fReg).setFileEditorMappings( maps );
- //make sure the method was called only once
- assertEquals( callTrace.verifyOrder(
- new String[] { METHOD } ), true);
-
- fReg.removePropertyListener( listener );
- fReg.removePropertyListener( listener2 );
- }
-
- public void testRemovePropertyListener()
- {
- IFileEditorMapping[] src = fReg.getFileEditorMappings();
- FileEditorMapping[] maps = new FileEditorMapping[src.length];
- System.arraycopy( src, 0, maps, 0, src.length);
-
- MockPropertyListener listener = new MockPropertyListener( fReg, fReg.PROP_CONTENTS );
- fReg.addPropertyListener( listener );
- //remove the listener immediately after adding it
- fReg.removePropertyListener( listener );
- CallHistory callTrace = listener.getCallHistory();
-
- //fire!!
- callTrace.clear();
- ((EditorRegistry)fReg).setFileEditorMappings( maps );
- assertEquals( callTrace.contains( "propertyChanged" ), false );
-
- //removing the listener that is not registered yet should have no effect
- try{
- fReg.removePropertyListener( listener );
- }catch( Throwable e )
- {
- fail();
- }
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorSiteTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorSiteTest.java deleted file mode 100644 index 25376919fa9..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorSiteTest.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.util.*;
-
-public class IEditorSiteTest extends IWorkbenchPartSiteTest {
-
- /**
- * Constructor for IEditorSiteTest
- */
- public IEditorSiteTest(String testName) {
- super(testName);
- }
-
- /**
- * @see IWorkbenchPartSiteTest#getTestPartName()
- */
- protected String getTestPartName() throws Throwable {
- return MockEditorPart.NAME;
- }
-
- /**
- * @see IWorkbenchPartSiteTest#getTestPartId()
- */
- protected String getTestPartId() throws Throwable {
- return MockEditorPart.ID1;
- }
-
- /**
- * @see IWorkbenchPartSiteTest#createTestPart(IWorkbenchPage)
- */
- protected IWorkbenchPart createTestPart(IWorkbenchPage page) throws Throwable {
- IProject proj = FileUtil.createProject("createTestPart");
- IFile file = FileUtil.createFile("test1.mock1", proj);
- return page.openEditor(file);
- }
-
- public void testGetActionBarContributor() throws Throwable {
- // From Javadoc: "Returns the editor action bar contributor for
- // this editor.
-
- IEditorPart editor = (IEditorPart) createTestPart(fPage);
- IEditorSite site = editor.getEditorSite();
- assertNull(site.getActionBarContributor());
-
- // TBD: Flesh this out with a real contributor.
- }
-
-
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IFileEditorMappingTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IFileEditorMappingTest.java deleted file mode 100644 index df0ebd6ae23..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IFileEditorMappingTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.util.*;
-import junit.framework.TestCase;
-
-public class IFileEditorMappingTest extends TestCase {
- private IFileEditorMapping[] fMappings;
-
- public IFileEditorMappingTest( String testName )
- {
- super( testName );
- }
-
- public void setUp()
- {
- fMappings = PlatformUI.getWorkbench().getEditorRegistry().getFileEditorMappings();
- }
-
- public void testGetName() throws Throwable
- {
- for( int i = 0; i < fMappings.length; i ++ )
- assertNotNull( fMappings[ i ].getName() );
- }
-
- public void testGetLabel() throws Throwable
- {
- String label;
- for( int i = 0; i < fMappings.length; i ++ ){
- label = fMappings[ i ].getLabel();
- assertNotNull( label );
- assertTrue( label.equals( fMappings[ i ].getName() + "." + fMappings[ i ].getExtension() ) );
- }
- }
-
- public void testGetExtension() throws Throwable
- {
- for( int i = 0; i < fMappings.length; i ++ )
- assertNotNull( fMappings[ i ].getExtension() );
- }
-
- public void testGetEditors() throws Throwable
- {
- IEditorDescriptor[] editors;
-
- for( int i = 0; i < fMappings.length; i ++ ){
- editors = fMappings[ i ].getEditors();
- assertTrue( ArrayUtil.checkNotNull( editors ) == true );
- }
- }
-
- public void testGetImageDescriptor() throws Throwable
- {
- for( int i = 0; i < fMappings.length; i ++ )
- assertNotNull( fMappings[ i ].getImageDescriptor() );
- }
-
-//how do i set the default editor?
- public void testGetDefaultEditor() throws Throwable
- {
-/* for( int i = 0; i < fMappings.length; i ++ )
- assertNotNull( fMappings[ i ].getDefaultEditor() );*/
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPageListenerTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPageListenerTest.java deleted file mode 100644 index 4beb9724892..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPageListenerTest.java +++ /dev/null @@ -1,139 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import junit.framework.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.util.*;
-
-/**
- * Tests the IPageListener class.
- */
-public class IPageListenerTest extends UITestCase
- implements IPageListener
-{
- private IWorkbenchWindow fWindow;
- private IWorkspace fWorkspace;
-
- private int eventsReceived = 0;
- final private int OPEN = 0x01;
- final private int CLOSE = 0x02;
- final private int ACTIVATE = 0x04;
- private IWorkbenchPage pageMask;
-
- public IPageListenerTest(String testName) {
- super(testName);
- }
-
- public void setUp() {
- fWindow = openTestWindow();
- fWorkspace = ResourcesPlugin.getWorkspace();
- fWindow.addPageListener(this);
- }
-
- public void tearDown() throws Exception {
- fWindow.removePageListener(this);
- super.tearDown();
- }
-
- /**
- * Tests the pageOpened method.
- */
- public void testPageOpened() throws Throwable {
-/*
- * Commented out because until test case can be updated to work
- * with new window/page/perspective implementation
- *
- // From Javadoc: "Notifies this listener that the given page has been opened."
-
- // Test open page.
- eventsReceived = 0;
- IWorkbenchPage page = fWindow.openPage(EmptyPerspective.PERSP_ID,
- fWorkspace);
- assertEquals(eventsReceived, OPEN|ACTIVATE);
-
- // Close page.
- page.close();
-*/
- }
-
- /**
- * Tests the pageClosed method.
- */
- public void testPageClosed() throws Throwable {
-/*
- * Commented out because until test case can be updated to work
- * with new window/page/perspective implementation
- *
- // From Javadoc: "Notifies this listener that the given page has been closed."
-
- // Open page.
- IWorkbenchPage page = fWindow.openPage(EmptyPerspective.PERSP_ID,
- fWorkspace);
-
- // Test close page.
- eventsReceived = 0;
- pageMask = page;
- page.close();
- assertEquals(eventsReceived, CLOSE);
-*/
- }
-
- /**
- * Tests the pageActivated method.
- */
- public void testPageActivate() throws Throwable {
-/*
- * Commented out because until test case can be updated to work
- * with new window/page/perspective implementation
- *
- // From Javadoc: "Notifies this listener that the given page has been activated."
-
- // Add pages.
- IWorkbenchPage page1 = fWindow.openPage(EmptyPerspective.PERSP_ID,
- fWorkspace);
- IWorkbenchPage page2 = fWindow.openPage(EmptyPerspective.PERSP_ID,
- fWorkspace);
-
- // Test activation of page 1.
- eventsReceived = 0;
- pageMask = page1;
- fWindow.setActivePage(page1);
- assertEquals(eventsReceived, ACTIVATE);
-
- // Test activation of page 2.
- eventsReceived = 0;
- pageMask = page2;
- fWindow.setActivePage(page2);
- assertEquals(eventsReceived, ACTIVATE);
-
- // Cleanup.
- page1.close();
- page2.close();
-*/
- }
-
- /**
- * @see IPageListener#pageActivated(IWorkbenchPage)
- */
- public void pageActivated(IWorkbenchPage page) {
- if (pageMask == null || page == pageMask)
- eventsReceived |= ACTIVATE;
- }
-
- /**
- * @see IPageListener#pageClosed(IWorkbenchPage)
- */
- public void pageClosed(IWorkbenchPage page) {
- if (pageMask == null || page == pageMask)
- eventsReceived |= CLOSE;
- }
-
- /**
- * @see IPageListener#pageOpened(IWorkbenchPage)
- */
- public void pageOpened(IWorkbenchPage page) {
- if (pageMask == null || page == pageMask)
- eventsReceived |= OPEN;
- }
-
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPageServiceTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPageServiceTest.java deleted file mode 100644 index 7f24c3555d4..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPageServiceTest.java +++ /dev/null @@ -1,202 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import junit.framework.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.internal.*;
-import org.eclipse.ui.tests.util.*;
-
-/**
- * Tests the IPageService class.
- */
-public class IPageServiceTest extends UITestCase
- implements IPageListener, org.eclipse.ui.IPerspectiveListener
-{
- private IWorkbenchWindow fWindow;
- private IWorkspace fWorkspace;
-
- private boolean pageEventReceived;
- private boolean perspEventReceived;
-
- public IPageServiceTest(String testName) {
- super(testName);
- }
-
- protected void setUp() {
- fWindow = openTestWindow();
- fWorkspace = ResourcesPlugin.getWorkspace();
- }
-
- /**
- * Tests the addPageListener method.
- */
- public void testAddPageListener() throws Throwable {
-/*
- * Commented out because until test case can be updated to work
- * with new window/page/perspective implementation
- *
- // From Javadoc: "Adds the given listener for page lifecycle events.
- // Has no effect if an identical listener is already registered."
-
- // Add listener.
- fWindow.addPageListener(this);
-
- // Open and close page.
- // Verify events are received.
- pageEventReceived = false;
- IWorkbenchPage page = fWindow.openPage(EmptyPerspective.PERSP_ID,
- fWorkspace);
- page.close();
- assertTrue(pageEventReceived);
-
- // Remove listener.
- fWindow.removePageListener(this);
-*/
- }
-
- /**
- * Tests the removePageListener method.
- */
- public void testRemovePageListener() throws Throwable {
- // From Javadoc: "Removes the given page listener.
- // Has no affect if an identical listener is not registered."
-
- // Add and remove listener.
- fWindow.addPageListener(this);
- fWindow.removePageListener(this);
-
- // Open and close page.
- // Verify no events are received.
- pageEventReceived = false;
- IWorkbenchPage page = fWindow.openPage(EmptyPerspective.PERSP_ID,
- fWorkspace);
- page.close();
- assertTrue(!pageEventReceived);
- }
-
- /**
- * Tests getActivePage.
- */
- public void testGetActivePage() throws Throwable {
-/*
- * Commented out because until test case can be updated to work
- * with new window/page/perspective implementation
- *
- // From Javadoc: "return the active page, or null if no page
- // is currently active"
-
- // Add page.
- IWorkbenchPage page1 = fWindow.openPage(EmptyPerspective.PERSP_ID,
- fWorkspace);
- assertEquals(fWindow.getActivePage(), page1);
-
- // Add second page.
- IWorkbenchPage page2 = fWindow.openPage(EmptyPerspective.PERSP_ID,
- fWorkspace);
- assertEquals(fWindow.getActivePage(), page2);
-
- // Set active page.
- fWindow.setActivePage(page1);
- assertEquals(fWindow.getActivePage(), page1);
- fWindow.setActivePage(page2);
- assertEquals(fWindow.getActivePage(), page2);
-
- // Cleanup.
- page1.close();
- page2.close();
-*/
- }
-
- /**
- * Tests the addPerspectiveListener method.
- */
- public void testAddPerspectiveListener() throws Throwable {
-/*
- * Commented out because until test case can be updated to work
- * with new window/page/perspective implementation
- *
- // From Javadoc: "Adds the given listener for a page's perspective lifecycle events.
- // Has no effect if an identical listener is already registered."
-
- // Add listener.
- fWindow.addPerspectiveListener(this);
-
- // Open page and change persp feature.
- // Verify events are received.
- perspEventReceived = false;
- IWorkbenchPage page = fWindow.openPage(IWorkbenchConstants.DEFAULT_LAYOUT_ID,
- fWorkspace);
- page.setEditorAreaVisible(false);
- page.setEditorAreaVisible(true);
- page.close();
- assertTrue(perspEventReceived);
-
- // Remove listener.
- fWindow.removePerspectiveListener(this);
-*/
- }
-
- /**
- * Tests the removePerspectiveListener method.
- */
- public void testRemovePerspectiveListener() throws Throwable {
- // From Javadoc: "Removes the given page's perspective listener.
- // Has no affect if an identical listener is not registered."
-
- // Add and remove listener.
- fWindow.addPerspectiveListener(this);
- fWindow.removePerspectiveListener(this);
-
- // Open page and change persp feature.
- // Verify no events are received.
- perspEventReceived = false;
- IWorkbenchPage page = fWindow.openPage(IWorkbenchConstants.DEFAULT_LAYOUT_ID,
- fWorkspace);
- page.setEditorAreaVisible(false);
- page.setEditorAreaVisible(true);
- page.close();
- assertTrue(!perspEventReceived);
- }
-
- /**
- * @see IPageListener#pageActivated(IWorkbenchPage)
- */
- public void pageActivated(IWorkbenchPage page) {
- pageEventReceived = true;
- }
-
- /**
- * @see IPageListener#pageClosed(IWorkbenchPage)
- */
- public void pageClosed(IWorkbenchPage page) {
- pageEventReceived = true;
- }
-
- /**
- * @see IPageListener#pageOpened(IWorkbenchPage)
- */
- public void pageOpened(IWorkbenchPage page) {
- pageEventReceived = true;
- }
-
- /**
- * @see IPerspectiveListener#perspectiveActivated(IWorkbenchPage, IPerspectiveDescriptor)
- */
- public void perspectiveActivated(IWorkbenchPage page,
- IPerspectiveDescriptor perspective)
- {
- perspEventReceived = true;
- }
-
- /**
- * @see IPerspectiveListener#perspectiveChanged(IWorkbenchPage, IPerspectiveDescriptor, String)
- */
- public void perspectiveChanged(IWorkbenchPage page,
- IPerspectiveDescriptor perspective, String changeId)
- {
- perspEventReceived = true;
- }
-
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPerspectiveDescriptorTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPerspectiveDescriptorTest.java deleted file mode 100644 index adcd733829e..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPerspectiveDescriptorTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import junit.framework.TestCase;
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.util.*;
-
-public class IPerspectiveDescriptorTest extends TestCase {
-
- private IPerspectiveDescriptor fPer;
- private IPerspectiveRegistry fReg;
-
- public IPerspectiveDescriptorTest( String testName )
- {
- super( testName );
- }
-
- public void setUp()
- {
- fPer = ( IPerspectiveDescriptor )ArrayUtil.pickRandom( PlatformUI.getWorkbench().getPerspectiveRegistry().getPerspectives() );
- //fPer.
- }
-
- public void testGetId()
- {
- assertNotNull( fPer.getId() );
- }
-
- public void testGetLabel()
- {
- assertNotNull( fPer.getLabel() );
- }
-
-// This always fails
- public void testGetImageDescriptor()
- {
-/* IWorkbench wb = PlatformUI.getWorkbench();
-
- IPerspectiveDescriptor[] pers = wb.getPerspectiveRegistry().getPerspectives();
- IWorkbenchPage page = wb.getActiveWorkbenchWindow().getActivePage();
-
- for( int i = 0; i < pers.length; i ++ )
- if( pers[ i ] != page.getPerspective() ){
- page.setPerspective( pers[ i ] );
- break;
- }
-
- System.out.println( "active page pers: " + page.getPerspective().getLabel() );
- System.out.println( "active pers image: " + page.getPerspective().getImageDescriptor() );
-
- for( int i = 0; i < pers.length; i ++ )
- if( pers[ i ].getLabel().equals( "Resource" ) ){
- System.out.println( "resource image: " + pers[ i ].getImageDescriptor() );
- break;
- }
- for( int i = 0; i < pers.length; i ++ ){
- assertNotNull( pers[ i ].getImageDescriptor() );
- }*/
- }
-
- public void testThis()
- {
-// opne
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPerspectiveListenerTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPerspectiveListenerTest.java deleted file mode 100644 index ec3f7cca529..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPerspectiveListenerTest.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.ui.*;
-import junit.framework.*;
-import org.eclipse.ui.tests.util.*;
-
-public class IPerspectiveListenerTest extends UITestCase implements IPerspectiveListener {
- private int fEvent;
- private IWorkbenchWindow fWindow;
- private IWorkbenchPage fPageMask;
- private IPerspectiveDescriptor fPerMask;
-
- /**
- * bit masks for events
- */
- public static final int
- NONE = 0x00,
- OPEN = 0x01,
- CLOSED = 0x02,
- ACTIVATED = 0x04,
- CHANGED = 0x08;
-
- public IPerspectiveListenerTest( String testName )
- {
- super( testName );
- }
-
- public void setUp()
- {
- fEvent = NONE;
- fWindow = openTestWindow();
- fWindow.addPerspectiveListener( this );
- }
-
- public void tearDown()
- {
- fWindow.removePerspectiveListener( this );
- }
-
- public void testPerspectiveActivated()
- {
-/*
- * Commented out because until test case can be updated to work
- * with new window/page/perspective implementation
- *
- fPageMask = fWindow.getActivePage();
- fPerMask = fWorkbench.getPerspectiveRegistry().findPerspectiveWithId(EmptyPerspective.PERSP_ID );
- fPageMask.setPerspective( fPerMask );
-
- assertEquals( isActivated( fEvent ), true );
-*/
- }
-
- public void testPerspectiveChanged()
- {
-/*
- * Commented out because until test case can be updated to work
- * with new window/page/perspective implementation
- *
- fPageMask = fWindow.getActivePage();
- fPerMask = fWorkbench.getPerspectiveRegistry().findPerspectiveWithId(EmptyPerspective.PERSP_ID );
- fPageMask.setPerspective( fPerMask );
-
- assertEquals( isActivated( fEvent ), true );
-*/
- }
-
- /**
- * @see IPerspectiveListener#perspectiveActivated(IWorkbenchPage, IPerspectiveDescriptor)
- */
- public void perspectiveActivated( IWorkbenchPage page, IPerspectiveDescriptor perspective )
- {
- if( page == fPageMask && perspective == fPerMask )
- fEvent |= ACTIVATED;
- }
-
- /**
- * @see IPerspectiveListener#perspectiveChanged(IWorkbenchPage, IPerspectiveDescriptor, String)
- */
- public void perspectiveChanged( IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId)
- {
- if( page == fPageMask && perspective == fPerMask )
- fEvent |= CHANGED;
- }
-
- public static boolean isOpen( int bits )
- {
- return ( ( bits & OPEN ) != 0 );
- }
-
- public static boolean isClosed( int bits )
- {
- return ( ( bits & CLOSED ) != 0 );
- }
-
- public static boolean isActivated( int bits )
- {
- return ( ( bits & ACTIVATED ) != 0 );
- }
-
- public static boolean isChanged( int bits )
- {
- return( ( bits & CLOSED ) != 0 );
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPerspectiveRegistryTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPerspectiveRegistryTest.java deleted file mode 100644 index d96d92e3c63..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPerspectiveRegistryTest.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.eclipse.ui.tests.api;
-
import junit.framework.TestCase;
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.util.*;
-
-public class IPerspectiveRegistryTest extends TestCase {
-
- private IPerspectiveRegistry fReg;
-
- public IPerspectiveRegistryTest( String testName )
- {
- super( testName );
- }
-
- public void setUp()
- {
- fReg = PlatformUI.getWorkbench().getPerspectiveRegistry();
- }
-
- public void testFindPerspectiveWithId()
- {
- IPerspectiveDescriptor pers = ( IPerspectiveDescriptor )ArrayUtil.pickRandom( fReg.getPerspectives() );
-
- IPerspectiveDescriptor suspect = fReg.findPerspectiveWithId( pers.getId() );
- assertNotNull( suspect );
- assertEquals( pers, suspect );
-
- suspect = fReg.findPerspectiveWithId( IConstants.FakeID );
- assertNull( suspect );
- }
-/*
- public void testFindPerspectiveWithLabel()
- {
- IPerspectiveDescriptor pers = ( IPerspectiveDescriptor )ArrayUtil.pickRandom( fReg.getPerspectives() );
-
- IPerspectiveDescriptor suspect = fReg.findPerspectiveWithLabel( pers.getLabel() );
- assertNotNull( suspect );
- assertEquals( pers, suspect );
-
- suspect = fReg.findPerspectiveWithLabel( IConstants.FakeLabel );
- assertNull( suspect );
- }
-*/
- public void testGetDefaultPerspective()
- {
- String id = fReg.getDefaultPerspective();
- assertNotNull( id );
-
- IPerspectiveDescriptor suspect = fReg.findPerspectiveWithId( id );
- assertNotNull( suspect );
- }
-
- public void testSetDefaultPerspective()
- {
- IPerspectiveDescriptor pers = ( IPerspectiveDescriptor )ArrayUtil.pickRandom( fReg.getPerspectives() );
- fReg.setDefaultPerspective( pers.getId() );
-
- assertEquals( pers.getId(), fReg.getDefaultPerspective() );
- }
-
- public void testGetPerspectives() throws Throwable
- {
- IPerspectiveDescriptor[] pers = fReg.getPerspectives();
- assertNotNull( pers );
-
- for( int i = 0; i < pers.length; i ++ )
- assertNotNull( pers[ i ] );
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ISelectionServiceTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ISelectionServiceTest.java deleted file mode 100644 index 2e709e0d0c6..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ISelectionServiceTest.java +++ /dev/null @@ -1,198 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.ui.tests.util.UITestCase;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.SelectionProviderView;
-
-/**
- * Tests the ISelectionService class.
- */
-public class ISelectionServiceTest extends UITestCase
- implements ISelectionListener
-{
- private IWorkbenchWindow fWindow;
- private IWorkbenchPage fPage;
-
- // Event state.
- private boolean eventReceived;
- private ISelection eventSelection;
- private IWorkbenchPart eventPart;
-
- public ISelectionServiceTest(String testName) {
- super(testName);
- }
-
- protected void setUp() {
- fWindow = openTestWindow();
- fPage = fWindow.getActivePage();
- }
-
- /**
- * Tests the addSelectionListener method.
- */
- public void testAddSelectionListener() throws Throwable {
- // From Javadoc: "Adds the given selection listener.
- // Has no effect if an identical listener is already registered."
-
- // Add listener.
- fPage.addSelectionListener(this);
-
- // Open a view and select something.
- // Verify events are received.
- clearEventState();
- SelectionProviderView view = (SelectionProviderView)
- fPage.showView(SelectionProviderView.ID);
- view.setSelection("Selection");
- assertTrue("EventReceived", eventReceived);
- }
-
- /**
- * Tests the removePageListener method.
- */
- public void testRemoveSelectionListener() throws Throwable {
- // From Javadoc: "Removes the given selection listener.
- // Has no affect if an identical listener is not registered."
-
- // Add and remove listener.
- fPage.addSelectionListener(this);
- fPage.removeSelectionListener(this);
-
- // Open a view and select something.
- // Verify no events are received.
- clearEventState();
- SelectionProviderView view = (SelectionProviderView)
- fPage.showView(SelectionProviderView.ID);
- view.setSelection("Selection");
- assertTrue("EventReceived", !eventReceived);
- }
-
- /**
- * Tests getActivePage.
- */
- public void testGetSelection() throws Throwable {
- // From Javadoc: "Returns the current selection in the active part.
- // If the selection in the active part is <em>undefined</em> (the
- // active part has no selection provider) the result will be
- // <code>null</code>"
- Object actualSel, sel1 = "Selection 1", sel2 = "Selection 2";
-
- // Open view.
- SelectionProviderView view = (SelectionProviderView)
- fPage.showView(SelectionProviderView.ID);
-
- // Fire selection and verify.
- view.setSelection(sel1);
- actualSel = unwrapSelection(fPage.getSelection());
- assertEquals("Selection", sel1, actualSel);
-
- // Fire selection and verify.
- view.setSelection(sel2);
- actualSel = unwrapSelection(fPage.getSelection());
- assertEquals("Selection", sel2, actualSel);
-
- // Close view and verify.
- fPage.hideView(view);
- assertNull("getSelection", fPage.getSelection());
- }
-
- /**
- * Test event firing for inactive parts. In this scenario
- * the event should not be fired.
- */
- public void testSelectionEventWhenInactive() throws Throwable {
- Object sel1 = "Selection 1", sel2 = "Selection 2";
-
- // Add listener.
- fPage.addSelectionListener(this);
-
- // Open two views.
- SelectionProviderView view1 = (SelectionProviderView)
- fPage.showView(SelectionProviderView.ID);
- SelectionProviderView view2 = (SelectionProviderView)
- fPage.showView(SelectionProviderView.ID_2);
-
- // Fire selection from the second.
- // Verify it is received.
- clearEventState();
- view2.setSelection(sel2);
- assertTrue("EventReceived", eventReceived);
- assertEquals("EventPart", view2, eventPart);
- assertEquals("Event Selection", sel2, unwrapSelection(eventSelection));
-
- // Fire selection from the first.
- // Verify it is NOT received.
- clearEventState();
- view1.setSelection(sel1);
- assertTrue("Unexpected selection events received", !eventReceived);
- }
-
- /**
- * Test event firing when activated.
- */
- public void testSelectionEventWhenActivated() throws Throwable {
- // From Javadoc: "Adds the given selection listener.
- // Has no effect if an identical listener is already registered."
- Object sel1 = "Selection 1", sel2 = "Selection 2";
-
- // Add listener.
- fPage.addSelectionListener(this);
-
- // Open a view and select something.
- SelectionProviderView view1 = (SelectionProviderView)
- fPage.showView(SelectionProviderView.ID);
- view1.setSelection(sel1);
-
- // Open another view and select something.
- SelectionProviderView view2 = (SelectionProviderView)
- fPage.showView(SelectionProviderView.ID_2);
- view2.setSelection(sel2);
-
- // Activate the first view.
- // Verify that selection events are fired.
- clearEventState();
- fPage.activate(view1);
- assertTrue("EventReceived", eventReceived);
- assertEquals("EventPart", view1, eventPart);
- assertEquals("Event Selection", sel1, unwrapSelection(eventSelection));
-
- // Activate the second view.
- // Verify that selection events are fired.
- clearEventState();
- fPage.activate(view2);
- assertTrue("EventReceived", eventReceived);
- assertEquals("EventPart", view2, eventPart);
- assertEquals("Event Selection", sel2, unwrapSelection(eventSelection));
- }
-
- /**
- * Unwrap a selection.
- */
- private Object unwrapSelection(ISelection sel) {
- if (sel instanceof StructuredSelection) {
- StructuredSelection struct = (StructuredSelection)sel;
- if (struct.size() == 1)
- return struct.getFirstElement();
- }
- return null;
- }
-
- /**
- * Clear the event state.
- */
- private void clearEventState() {
- eventReceived = false;
- eventPart = null;
- eventSelection = null;
- }
-
- /*
- * @see ISelectionListener#selectionChanged(IWorkbenchPart, ISelection)
- */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- eventReceived = true;
- eventPart = part;
- eventSelection = selection;
- }
-
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IViewActionDelegateTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IViewActionDelegateTest.java deleted file mode 100644 index 48cf73c3d2e..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IViewActionDelegateTest.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.ui.tests.util.*;
-
-
-/**
- * Tests the lifecycle for a view action delegate.
- */
-public class IViewActionDelegateTest extends IActionDelegateTest {
-
- public static String TEST_VIEW_ID = "org.eclipse.ui.tests.api.IViewActionDelegateTest";
-
- /**
- * Constructor for IWorkbenchWindowActionDelegateTest
- */
- public IViewActionDelegateTest(String testName) {
- super(testName);
- }
-
- public void testInit() throws Throwable {
- // When an action delegate is run the
- // init, selectionChanged, and run methods should
- // be called, in that order.
-
- // Run the action.
- testRun();
-
- // Verify lifecycle.
- MockActionDelegate delegate = getDelegate();
- assertNotNull(delegate);
- assertTrue(delegate.callHistory.verifyOrder(
- new String [] {"init", "selectionChanged", "run"}));
- }
-
- /**
- * @see IActionDelegateTest#createActionWidget()
- */
- protected Object createActionWidget() throws Throwable {
- MockViewPart view = (MockViewPart)fPage.showView(TEST_VIEW_ID);
- return view;
- }
-
- /**
- * @see IActionDelegateTest#runAction()
- */
- protected void runAction(Object widget) throws Throwable {
- MockViewPart view = (MockViewPart)widget;
- IMenuManager mgr = view.getViewSite().getActionBars().getMenuManager();
- ActionUtil.runActionWithLabel(this, mgr, "Mock Action");
- }
-
- /**
- * @see IActionDelegateTest#fireSelection()
- */
- protected void fireSelection(Object widget) throws Throwable {
- MockViewPart view = (MockViewPart)widget;
- view.fireSelection();
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IViewPartTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IViewPartTest.java deleted file mode 100644 index 1838a12b0b2..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IViewPartTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.ui.*;
-import org.eclipse.core.resources.*;
-
-/**
- * This is a test for IViewPart. Since IViewPart is an
- * interface this test verifies the IViewPart lifecycle rather
- * than the implementation.
- */
-public class IViewPartTest extends IWorkbenchPartTest {
-
- /**
- * Constructor for IEditorPartTest
- */
- public IViewPartTest(String testName) {
- super(testName);
- }
-
- /**
- * @see IWorkbenchPartTest#openPart(IWorkbenchPage)
- */
- protected MockWorkbenchPart openPart(IWorkbenchPage page) throws Throwable {
- return (MockWorkbenchPart)page.showView(MockViewPart.ID);
- }
-
- /**
- * @see IWorkbenchPartTest#closePart(IWorkbenchPage, MockWorkbenchPart)
- */
- protected void closePart(IWorkbenchPage page, MockWorkbenchPart part)
- throws Throwable
- {
- page.hideView((IViewPart)part);
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IViewSiteTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IViewSiteTest.java deleted file mode 100644 index 9ec2a593ad9..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IViewSiteTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.ui.*;
-
-public class IViewSiteTest extends IWorkbenchPartSiteTest {
-
- /**
- * Constructor for IViewPartSiteTest
- */
- public IViewSiteTest(String testName) {
- super(testName);
- }
-
- /**
- * @see IWorkbenchPartSiteTest#getTestPartName()
- */
- protected String getTestPartName() throws Throwable {
- return MockViewPart.NAME;
- }
-
- /**
- * @see IWorkbenchPartSiteTest#getTestPartId()
- */
- protected String getTestPartId() throws Throwable {
- return MockViewPart.ID;
- }
-
- /**
- * @see IWorkbenchPartSiteTest#createTestPart(IWorkbenchPage)
- */
- protected IWorkbenchPart createTestPart(IWorkbenchPage page) throws Throwable {
- return page.showView(MockViewPart.ID);
- }
-
- public void testGetActionBars() throws Throwable {
- // From Javadoc: "Returns the action bars for this part site."
-
- IViewPart view = (IViewPart) createTestPart(fPage);
- IViewSite site = view.getViewSite();
- assertNotNull(site.getActionBars());
- }
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchPageTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchPageTest.java deleted file mode 100644 index ea3c53f058d..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchPageTest.java +++ /dev/null @@ -1,772 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.swt.SWT;
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.util.*;
-import org.eclipse.ui.part.*;
-import org.eclipse.ui.internal.*;
-import org.eclipse.ui.internal.registry.*;
-
-public class IWorkbenchPageTest extends UITestCase {
-
- private IWorkbenchPage fActivePage;
- private IWorkbenchWindow fWin;
- private IWorkbenchPart partMask;
- private IProject proj;
-
- public IWorkbenchPageTest(String testName) {
- super(testName);
- }
-
- public void setUp() {
- fWin = openTestWindow();
- fActivePage = fWin.getActivePage();
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
- if (proj != null) {
- try {
- FileUtil.deleteProject(proj);
- } catch (Throwable e) {
- fail();
- }
- proj = null;
- }
- }
-
- /**
- * tests both of the following:
- * setEditorAreaVisible()
- * isEditorAreaVisible()
- */
- public void testGet_SetEditorAreaVisible() throws Throwable {
- fActivePage.setEditorAreaVisible(true);
- assertTrue(fActivePage.isEditorAreaVisible() == true);
-
- fActivePage.setEditorAreaVisible(false);
- assertTrue(fActivePage.isEditorAreaVisible() == false);
- }
-
- public void testGetPerspective() throws Throwable {
- assertNotNull(fActivePage.getPerspective());
-
- IWorkbenchPage page =
- fWin.openPage(EmptyPerspective.PERSP_ID, ResourcesPlugin.getWorkspace());
- assertEquals(EmptyPerspective.PERSP_ID, page.getPerspective().getId());
- }
-
- public void testSetPerspective() throws Throwable {
- IPerspectiveDescriptor per =
- PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(
- EmptyPerspective.PERSP_ID);
- fActivePage.setPerspective(per);
- assertEquals(per, fActivePage.getPerspective());
- }
-
- public void testGetLabel() {
- assertNotNull(fActivePage.getLabel());
- }
-
- public void testGetInput() throws Throwable {
- IAdaptable input = ResourcesPlugin.getWorkspace();
- IWorkbenchPage page = fWin.openPage(input);
- assertEquals(input, page.getInput());
- }
-
- public void testActivate() throws Throwable {
- MockViewPart part = (MockViewPart) fActivePage.showView(MockViewPart.ID);
- MockViewPart part2 = (MockViewPart) fActivePage.showView(MockViewPart.ID2);
-
- MockPartListener listener = new MockPartListener();
- fActivePage.addPartListener(listener);
- fActivePage.activate(part);
-
- CallHistory callTrace;
-
- callTrace = part2.getCallHistory();
- callTrace.clear();
- fActivePage.activate(part2);
- assertTrue(callTrace.contains("setFocus"));
- assertTrue(listener.getCallHistory().contains("partActivated"));
-
- callTrace = part.getCallHistory();
- callTrace.clear();
- fActivePage.activate(part);
- assertTrue(callTrace.contains("setFocus"));
- assertTrue(listener.getCallHistory().contains("partActivated"));
- }
-
- public void testBringToTop() throws Throwable {
- proj = FileUtil.createProject("testOpenEditor");
- IEditorPart part = fActivePage.openEditor(FileUtil.createFile("a.mock1", proj));
- IEditorPart part2 =
- fActivePage.openEditor(FileUtil.createFile("b.mock1", proj));
-
- MockPartListener listener = new MockPartListener();
- fActivePage.addPartListener(listener);
- CallHistory callTrace = listener.getCallHistory();
-
- //at this point, part2 is active
- fActivePage.bringToTop(part);
- assertEquals(callTrace.contains("partBroughtToTop"), true);
-
- callTrace.clear();
- fActivePage.bringToTop(part2);
- assertEquals(callTrace.contains("partBroughtToTop"), true);
- }
-
- public void testGetWorkbenchWindow() {
-/*
- * Commented out because until test case can be updated to work
- * with new window/page/perspective implementation
- *
- assertEquals(fActivePage.getWorkbenchWindow(), fWin);
- IWorkbenchPage page = openTestPage(fWin);
- assertEquals(page.getWorkbenchWindow(), fWin);
-*/
- }
-
- public void testShowView() throws Throwable {
- /*
- javadoc: Shows a view in this page and give it focus
- */
- MockViewPart view = (MockViewPart) fActivePage.showView(MockViewPart.ID);
- assertNotNull(view);
- assertTrue(
- view.getCallHistory().verifyOrder(
- new String[] { "init", "createPartControl", "setFocus" }));
-
- fActivePage.showView(MockViewPart.ID2 );
-
- /*
- javadoc: If the view is already visible, it is given focus
- */
- CallHistory callTrace = view.getCallHistory();
- callTrace.clear();
- assertEquals(fActivePage.showView(MockViewPart.ID), view );
- assertEquals(callTrace.contains( "setFocus" ), true );
- }
-
- /**
- * openEditor(IFile input)
- */
- public void testOpenEditor() throws Throwable {
- proj = FileUtil.createProject("testOpenEditor");
-
- /*
- javadoc: 1. The workbench editor registry is consulted to determine if an editor extension has been
- registered for the file type. If so, an instance of the editor extension is opened on the file
- */
- IFile file = FileUtil.createFile("test.mock1", proj);
- IEditorPart editor = fActivePage.openEditor(file);
- assertEquals(ArrayUtil.contains(fActivePage.getEditors(), editor), true);
- assertEquals(fActivePage.getActiveEditor(), editor);
- assertEquals(editor.getSite().getId(),
- fWorkbench.getEditorRegistry().getDefaultEditor(file).getId());
-
- /*
- javadoc: 2. Next, the native operating system will be consulted to determine if a native editor exists for
- the file type. If so, a new process is started and the native editor is opened on the file.
- */
- //can not be tested
-
- /*
- javadoc: 3. If all else fails the file will be opened in a default text editor.
- */
- // PR 1GkD5O0 - Fails on linux
- String platform = SWT.getPlatform();
- if (!platform.equals("motif")) {
- file = FileUtil.createFile("a.null and void", proj);
- editor = fActivePage.openEditor(file);
- assertEquals(ArrayUtil.contains(fActivePage.getEditors(), editor), true);
- assertEquals(fActivePage.getActiveEditor(), editor);
- assertEquals(editor.getSite().getId(), "org.eclipse.ui.DefaultTextEditor");
- }
-
- //open another editor to take the focus away from the first editor
- fActivePage.openEditor(FileUtil.createFile("test.mock2", proj));
-
- /*
- javadoc: If this page already has an editor open on the target object that editor is activated
- */
- //open the editor second time.
- assertEquals(editor, fActivePage.openEditor(file));
- assertEquals(editor, fActivePage.getActiveEditor());
- }
-
- /**
- * openEditor(IFile input, String editorID)
- */
- public void testOpenEditor2() throws Throwable {
- proj = FileUtil.createProject("testOpenEditor");
- final IFile file = FileUtil.createFile("asfasdasdf", proj);
- final String id = MockEditorPart.ID1;
-
- /*
- javadoc: The editor type is determined by mapping editorId to an editor extension registered with the workbench.
- */
- IEditorPart editor = fActivePage.openEditor(file, id);
- assertEquals(editor.getSite().getId(), id);
- assertEquals(ArrayUtil.contains(fActivePage.getEditors(), editor), true);
- assertEquals(fActivePage.getActiveEditor(), editor);
-
- //open another editor to take the focus away from the first editor
- fActivePage.openEditor(FileUtil.createFile("test.mock2", proj));
-
- /*
- javadoc: If this page already has an editor open on the target object that editor is activated
- */
- //open the first editor second time.
- assertEquals(fActivePage.openEditor(file, id), editor);
- assertEquals(fActivePage.getActiveEditor(), editor);
- }
-
- /**
- * openEditor(IEditorInput input,String editorId)
- */
- public void testOpenEditor3() throws Throwable {
- proj = FileUtil.createProject("testOpenEditor");
- final String id = MockEditorPart.ID1;
- IEditorInput input =
- new FileEditorInput(FileUtil.createFile("test.mock1", proj));
-
- /*
- javadoc: The editor type is determined by mapping editorId to an editor extension registered with the workbench
- */
- IEditorPart editor = fActivePage.openEditor(input, id);
- assertEquals(editor.getEditorInput(), input);
- assertEquals(editor.getSite().getId(), id);
- assertEquals(ArrayUtil.contains(fActivePage.getEditors(), editor), true);
- assertEquals(fActivePage.getActiveEditor(), editor);
-
- //open another editor to take the focus away from the first editor
- fActivePage.openEditor(FileUtil.createFile("test.mock2", proj));
-
- /*
- javadoc: If this page already has an editor open on the target object that editor is activated
- */
- //open the first editor second time.
- assertEquals(fActivePage.openEditor(input, id), editor);
- assertEquals(fActivePage.getActiveEditor(), editor);
- }
-
- /**
- * openEditor(IEditorInput input, String editorId, boolean activate)
- */
- public void testOpenEditor4() throws Throwable {
- proj = FileUtil.createProject("testOpenEditor");
- final String id = MockEditorPart.ID1;
- IEditorInput input =
- new FileEditorInput(FileUtil.createFile("test.mock1", proj));
- MockPartListener listener = new MockPartListener();
- fActivePage.addPartListener(listener);
- CallHistory callTrace = listener.getCallHistory();
-
- /*
- javadoc: The editor type is determined by mapping editorId to an editor extension
- registered with the workbench.
- javadoc: If activate == true the editor will be activated
- */
- //open an editor with activation
- IEditorPart editor = fActivePage.openEditor(input, id, true);
- assertEquals(editor.getEditorInput(), input);
- assertEquals(editor.getSite().getId(), id);
- assertEquals(ArrayUtil.contains(fActivePage.getEditors(), editor), true);
- assertEquals(fActivePage.getActiveEditor(), editor);
- assertEquals(callTrace.contains( "partActivated"), true);
- fActivePage.closeEditor(editor, false);
-
- //we need another editor so that the editor under test can receive events.
- //otherwise, events will be ignored.
- IEditorPart extra = fActivePage.openEditor(FileUtil.createFile("aaaaa", proj));
-
- //open an editor without activation
- callTrace.clear();
- editor = fActivePage.openEditor(input, id, false);
- assertEquals(editor.getEditorInput(), input);
- assertEquals(editor.getSite().getId(), id);
- assertEquals(ArrayUtil.contains(fActivePage.getEditors(), editor), true);
- assertEquals(callTrace.contains( "partActivated"), false);
- assertEquals(callTrace.contains( "partBroughtToTop"), true);
-
- fActivePage.activate(extra);
-
- /*
- javadoc: If this page already has an editor open on the target object that editor is brought to the front
- */
- //open the editor under test second time without activation
- callTrace.clear();
- assertEquals(fActivePage.openEditor(input, id, false), editor);
- assertEquals(callTrace.contains( "partBroughtToTop"), true);
- assertEquals(callTrace.contains( "partActivated"), false);
-
- //activate the other editor
- fActivePage.activate(extra);
-
- /*
- javadoc: If activate == true the editor will be activated
- */
- //open the editor under test second time with activation
- callTrace.clear();
- assertEquals(fActivePage.openEditor(input, id, true), editor);
- assertEquals(callTrace.contains( "partBroughtToTop"), true);
- assertEquals(callTrace.contains( "partActivated"), true);
- }
-
- /**
- * openEditor(IMarker marker)
- */
- public void testOpenEditor5() throws Throwable {
- proj = FileUtil.createProject("testOpenEditor");
- IMarker marker =
- FileUtil.createFile("aa.mock2", proj).createMarker(IMarker.TASK);
- CallHistory callTrace;
-
- /*
- javadoc: the cursor and selection state of the editor is then updated from information
- recorded in the marker.
- */
- //open the registered editor for the marker resource
- IEditorPart editor = fActivePage.openEditor(marker);
- callTrace = ((MockEditorPart) editor).getCallHistory();
- assertEquals(editor.getSite().getId(), MockEditorPart.ID2);
- assertEquals(ArrayUtil.contains(fActivePage.getEditors(), editor), true);
- assertEquals(fActivePage.getActiveEditor(), editor);
- assertEquals(callTrace.contains( "gotoMarker"), true);
- fActivePage.closeEditor(editor, false);
-
- /*
- javadoc: If the marker contains an EDITOR_ID_ATTR attribute the attribute value will be used to
- determine the editor type to be opened
- */
- marker.setAttribute(IWorkbenchPage.EDITOR_ID_ATTR, MockEditorPart.ID1);
- editor = fActivePage.openEditor(marker);
- callTrace = ((MockEditorPart) editor).getCallHistory();
- assertEquals(editor.getSite().getId(), MockEditorPart.ID1);
- assertEquals(ArrayUtil.contains(fActivePage.getEditors(), editor), true);
- assertEquals(fActivePage.getActiveEditor(), editor);
- assertEquals(callTrace.contains( "gotoMarker"), true);
- //do not close the editor this time
-
- /*
- javdoc: If this page already has an editor open on the target object that editor is activated
- */
- callTrace.clear();
- assertEquals(fActivePage.openEditor(marker), editor);
- assertEquals(fActivePage.getActiveEditor(), editor);
- assertEquals(callTrace.contains( "gotoMarker"), true);
- fActivePage.closeEditor(editor, false);
- }
-
- /**
- * openEditor(IMarker marker, boolean activate)
- */
- public void testOpenEditor6() throws Throwable {
- proj = FileUtil.createProject("testOpenEditor");
- IMarker marker =
- FileUtil.createFile("aa.mock2", proj).createMarker(IMarker.TASK);
- MockPartListener listener = new MockPartListener();
- fActivePage.addPartListener(listener);
- CallHistory listenerCall = listener.getCallHistory();
- CallHistory editorCall;
-
- //we need another editor so that the editor under test can receive events.
- //otherwise, events will be ignored.
- IEditorPart extra = fActivePage.openEditor(FileUtil.createFile("aaaaa", proj));
-
- /*
- javadoc: If activate == true the editor will be activated
- */
- //open the registered editor for the marker resource with activation
- IEditorPart editor = fActivePage.openEditor(marker, true);
- editorCall = ((MockEditorPart) editor).getCallHistory();
- assertEquals(editor.getSite().getId(), MockEditorPart.ID2);
- assertEquals(ArrayUtil.contains(fActivePage.getEditors(), editor), true);
- assertEquals(fActivePage.getActiveEditor(), editor);
-
- /*
- javadoc: the cursor and selection state of the editor is then updated from information
- recorded in the marker.
- */
- assertEquals(editorCall.contains( "gotoMarker"), true);
- fActivePage.closeEditor(editor, false);
-
- fActivePage.activate(extra);
-
- //open the registered editor for the marker resource without activation
- listenerCall.clear();
- editor = fActivePage.openEditor(marker, false);
- editorCall = ((MockEditorPart) editor).getCallHistory();
- assertEquals(editor.getSite().getId(), MockEditorPart.ID2);
- assertEquals(ArrayUtil.contains(fActivePage.getEditors(), editor), true);
- assertEquals(listenerCall.contains( "partBroughtToTop"), true);
- assertEquals(listenerCall.contains( "partActivated"), false);
- assertEquals(editorCall.contains( "gotoMarker"), true);
- fActivePage.closeEditor(editor, false);
-
- /*
- javadoc: If the marker contains an EDITOR_ID_ATTR attribute the attribute value will be used to
- determine the editor type to be opened
- */
- String id = MockEditorPart.ID1;
- marker.setAttribute(IWorkbenchPage.EDITOR_ID_ATTR, id);
-
- //open an editor with activation
- listenerCall.clear();
-
- editor = fActivePage.openEditor(marker, true);
- editorCall = ((MockEditorPart) editor).getCallHistory();
- assertEquals(editor.getSite().getId(), id);
- assertEquals(ArrayUtil.contains(fActivePage.getEditors(), editor), true);
- assertEquals(fActivePage.getActiveEditor(), editor);
- assertEquals(editorCall.contains( "gotoMarker"), true);
- fActivePage.closeEditor(editor, false);
-
- fActivePage.activate(extra);
-
- //open an editor without activation
- listenerCall.clear();
- editor = fActivePage.openEditor(marker, false);
- editorCall = ((MockEditorPart) editor).getCallHistory();
- assertEquals(editor.getSite().getId(), id);
- assertEquals(ArrayUtil.contains(fActivePage.getEditors(), editor), true);
- assertEquals(editorCall.contains( "gotoMarker"), true);
- assertEquals(listenerCall.contains( "partActivated"), false);
- assertEquals(listenerCall.contains( "partBroughtToTop"), true);
- //do not close the editor this time
-
- fActivePage.activate(extra);
-
- /*
- javadoc: If this page already has an editor open on the target object that editor is brought to front
- */
- //open the editor second time without activation
- listenerCall.clear();
- assertEquals(fActivePage.openEditor(marker, false), editor);
- assertEquals(listenerCall.contains( "partBroughtToTop"), true);
- assertEquals(listenerCall.contains( "partActivated"), false);
-
- fActivePage.activate(extra);
-
- /*
- javdoc: If activate == true the editor will be activated
- */
- //open the editor second time with activation
- listenerCall.clear();
- assertEquals(fActivePage.openEditor(marker, true), editor);
- assertEquals(editorCall.contains( "gotoMarker"), true);
- assertEquals(listenerCall.contains( "partBroughtToTop"), true);
- assertEquals(listenerCall.contains( "partActivated"), true);
- }
-
- public void testFindView() throws Throwable {
- String id = MockViewPart.ID3;
- //id of valid, but not open view
- assertNull(fActivePage.findView(id));
-
- IViewPart view = fActivePage.showView(id);
- assertEquals(fActivePage.findView(id), view);
-
- //close view
- fActivePage.hideView(view);
- assertNull(fActivePage.findView(id));
- }
-
- public void testGetViews() throws Throwable {
- int totalBefore = fActivePage.getViews().length;
-
- IViewPart view = fActivePage.showView(MockViewPart.ID2);
- assertEquals(ArrayUtil.contains(fActivePage.getViews(), view), true);
- assertEquals(fActivePage.getViews().length, totalBefore + 1);
-
- fActivePage.hideView(view);
- assertEquals(ArrayUtil.contains(fActivePage.getViews(), view), false);
- assertEquals(fActivePage.getViews().length, totalBefore);
- }
-
- public void testHideView() throws Throwable {
- IViewPart view = fActivePage.showView(MockViewPart.ID3);
-
- fActivePage.hideView(view);
- CallHistory callTrace = ((MockViewPart) view).getCallHistory();
- assertTrue(callTrace.contains( "dispose"));
- }
-
- public void testClose() throws Throwable {
- IWorkbenchPage page = openTestPage(fWin);
-
- proj = FileUtil.createProject("testOpenEditor");
- final IFile file = FileUtil.createFile("aaa.mock1", proj);
- IEditorPart editor = page.openEditor(file);
- CallHistory callTrace = ((MockEditorPart) editor).getCallHistory();
- callTrace.clear();
-
- /*
- javadoc: If the page has open editors with unsaved content and save is true, the user will be given the opportunity to save them
- */
- assertEquals(page.close(), true);
- assertEquals(
- callTrace.verifyOrder(new String[] { "isDirty", "dispose" }),
- true);
- assertEquals(fWin.getActivePage(), fActivePage);
- }
-
- public void testCloseEditor() throws Throwable {
- proj = FileUtil.createProject("testOpenEditor");
- final IFile file = FileUtil.createFile("test.mock1", proj);
- IEditorPart editor;
- CallHistory callTrace;
- MockEditorPart mock;
-
- /*
- javadoc: Parameters: save - true to save the editor contents if required (recommended)
- */
- //create a clean editor that needs to be saved on closing
- editor = fActivePage.openEditor(file);
- mock = (MockEditorPart) editor;
- mock.setSaveNeeded(true);
- callTrace = mock.getCallHistory();
- callTrace.clear();
- //close the editor with save confirmation
- assertEquals( fActivePage.closeEditor(editor, true), true );
- assertEquals(
- callTrace.verifyOrder(
- new String[] { "isDirty", "dispose" }),
- true);
-
- /*
- javadoc: If the editor has unsaved content and save is true, the user will be given the opportunity to save it.
- */
- //can't be tested
-
- /*
- javadoc: Parameters: save - false to discard any unsaved changes
- */
- //create a dirty editor
- editor = fActivePage.openEditor(file);
- mock = (MockEditorPart) editor;
- mock.setDirty(true);
- mock.setSaveNeeded(true);
- callTrace = mock.getCallHistory();
- callTrace.clear();
- //close the editor and discard changes
- assertEquals( fActivePage.closeEditor(editor, false), true );
- assertEquals(callTrace.contains( "isSaveOnCloseNeeded"), false);
- /*
- * It is possible that some action may query the isDirty value of
- * the editor to update its enabled state. There is nothing wrong
- * in doing that, so do not test for no isDirty call here.
- *
- * assertEquals(callTrace.contains( "isDirty"), false);
- */
- assertEquals(callTrace.contains( "doSave"), false);
- assertEquals(callTrace.contains( "dispose"), true);
- }
-
- public void testCloseAllEditors() throws Throwable
- {
- int total = 5;
- final IFile[] files = new IFile[total];
- IEditorPart[] editors = new IEditorPart[total];
- CallHistory[] callTraces = new CallHistory[total];
- MockEditorPart[] mocks = new MockEditorPart[total];
-
- proj = FileUtil.createProject("testOpenEditor");
- for (int i = 0; i < total; i++)
- files[i] = FileUtil.createFile(i + ".mock2", proj);
-
- /*
- javadoc: If the page has open editors with unsaved content and save is true, the user will be given the opportunity to save them.
- */
- //close all clean editors with confirmation
- for( int i = 0; i < total; i ++ ){
- editors[i] = fActivePage.openEditor(files[i]);
- callTraces[i] = ((MockEditorPart)editors[i]).getCallHistory();
- }
- assertEquals(fActivePage.closeAllEditors(true), true);
- for (int i = 0; i < total; i++) {
- assertEquals(callTraces[i].contains( "isDirty"), true);
- assertEquals(callTraces[i].contains( "doSave"), false);
- callTraces[i].clear();
- }
-
- //close all dirty editors with confirmation
- //can't be tested
-
- //close all dirty editors discarding them
- for( int i = 0; i < total; i ++ ){
- editors[i] = fActivePage.openEditor(files[i]);
- mocks[i] = (MockEditorPart) editors[i];
- mocks[i].setDirty(true);
- callTraces[i] = mocks[i].getCallHistory();
- }
- assertEquals(fActivePage.closeAllEditors(false), true);
- for (int i = 0; i < total; i++) {
- assertEquals(callTraces[i].contains("doSave"), false);
- }
- }
-
- public void testSaveEditor() throws Throwable {
- proj = FileUtil.createProject("testOpenEditor");
- final IFile file = FileUtil.createFile("test.mock1", proj);
- IEditorPart editor;
- CallHistory callTrace;
- MockEditorPart mock;
-
- //create a clean editor
- editor = fActivePage.openEditor(file);
- mock = (MockEditorPart) editor;
- callTrace = mock.getCallHistory();
- callTrace.clear();
-
- /*
- javadoc: Saves the contents of the given editor if dirty.
- If not, this method returns without effect
- */
- //save the clean editor with confirmation
- assertEquals(fActivePage.saveEditor(editor, true), true);
- assertEquals(callTrace.contains("isDirty"), true);
- assertEquals(callTrace.contains("doSave"), false);
-
- /*
- javadoc: If confirm is true the user is prompted to confirm the command.
- */
- //can't be tested
-
- /*
- javadoc: Otherwise, the save happens without prompt.
- */
- //save the clean editor without confirmation
- assertEquals(fActivePage.saveEditor(editor, false), true);
- assertEquals(callTrace.contains( "isDirty"), true);
- assertEquals(callTrace.contains("doSave"), false);
-
- //save the dirty editor without confirmation
- mock.setDirty(true);
- callTrace.clear();
- assertEquals(fActivePage.saveEditor(editor, false), true);
- assertEquals(
- callTrace.verifyOrder(new String[] { "isDirty", "doSave" }),
- true);
- }
-
- public void testSaveAllEditors() throws Throwable {
- int total = 3;
-
- final IFile[] files = new IFile[total];
- IEditorPart[] editors = new IEditorPart[total];
- CallHistory[] callTraces = new CallHistory[total];
- MockEditorPart[] mocks = new MockEditorPart[total];
-
- proj = FileUtil.createProject("testOpenEditor");
- for (int i = 0; i < total; i++) {
- files[i] = FileUtil.createFile(i + ".mock2", proj);
- editors[i] = fActivePage.openEditor(files[i]);
- mocks[i] = (MockEditorPart) editors[i];
- callTraces[i] = mocks[i].getCallHistory();
- }
-
- /*
- javadoc: If there are no dirty editors this method returns without effect.
- javadoc: If confirm is true the user is prompted to confirm the command
- */
- //save all clean editors with confirmation
- assertEquals(fActivePage.saveAllEditors(true), true);
- for (int i = 0; i < total; i++) {
- assertEquals(callTraces[i].contains( "isDirty"), true);
- assertEquals(callTraces[i].contains( "doSave"), false);
- callTraces[i].clear();
- }
-
- //save all dirty editors with confirmation can't be tested
-
- /*
- javadoc: Parameters: confirm - false to save unsaved changes without asking
- */
- //save all clean editors without confirmation
- assertEquals(fActivePage.saveAllEditors(false), true);
- for (int i = 0; i < total; i++) {
- assertEquals(callTraces[i].contains( "isDirty"), true);
- assertEquals(callTraces[i].contains( "doSave"), false);
- callTraces[i].clear();
- }
-
- //save all dirty editors without confirmation
- for (int i = 0; i < total; i++)
- mocks[i].setDirty(true);
- assertEquals(fActivePage.saveAllEditors(false), true);
- for (int i = 0; i < total; i++)
- assertEquals(
- callTraces[i].verifyOrder(new String[] { "isDirty", "doSave" }),
- true);
- }
-
- public void testGetEditors() throws Throwable {
- proj = FileUtil.createProject("testOpenEditor");
- int totalBefore = fActivePage.getEditors().length;
- int num = 3;
- IEditorPart[] editors = new IEditorPart[num];
-
- for (int i = 0; i < num; i++) {
- editors[i] = fActivePage.openEditor(FileUtil.createFile(i + ".mock2", proj));
- assertEquals(ArrayUtil.contains(fActivePage.getEditors(), editors[i]), true);
- }
- assertEquals(fActivePage.getEditors().length, totalBefore + num);
-
- fActivePage.closeEditor(editors[0], false);
- assertEquals(ArrayUtil.contains(fActivePage.getEditors(), editors[0]), false);
- assertEquals(fActivePage.getEditors().length, totalBefore + num - 1);
-
- fActivePage.closeAllEditors(false);
- assertEquals(fActivePage.getEditors().length, 0);
- }
-
- public void testShowActionSet() {
- String id = MockActionDelegate.ACTION_SET_ID;
- WorkbenchPage page = (WorkbenchPage) fActivePage;
-
- int totalBefore = page.getActionSets().length;
- fActivePage.showActionSet(id);
-
- IActionSetDescriptor[] sets = ((WorkbenchPage) fActivePage).getActionSets();
- boolean found = false;
- for (int i = 0; i < sets.length; i++)
- if (id.equals(sets[i].getId()))
- found = true;
- assertEquals(found, true);
-
- //check that the method does not add an invalid action set to itself
- id = IConstants.FakeID;
- fActivePage.showActionSet(id);
-
- sets = ((WorkbenchPage) fActivePage).getActionSets();
- found = false;
- for (int i = 0; i < sets.length; i++)
- if (id.equals(sets[i].getId()))
- found = true;
- assertEquals(found, false);
- assertEquals(page.getActionSets().length, totalBefore + 1);
- }
-
- public void testHideActionSet() {
- WorkbenchPage page = (WorkbenchPage) fActivePage;
- int totalBefore = page.getActionSets().length;
-
- String id = MockWorkbenchWindowActionDelegate.SET_ID;
- fActivePage.showActionSet( id );
- assertEquals(page.getActionSets().length, totalBefore + 1);
-
- fActivePage.hideActionSet(id );
- assertEquals(page.getActionSets().length, totalBefore );
-
- IActionSetDescriptor[] sets = page.getActionSets();
- boolean found = false;
- for (int i = 0; i < sets.length; i++)
- if (id.equals(sets[i].getId()))
- found = true;
- assertEquals(found, false);
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchPartSiteTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchPartSiteTest.java deleted file mode 100644 index 50ad80c99bd..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchPartSiteTest.java +++ /dev/null @@ -1,131 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.util.*;
-
-
-/**
- * Tests the site for an IWorkbenchPart.
- */
-public abstract class IWorkbenchPartSiteTest extends UITestCase {
-
- protected IWorkbenchWindow fWindow;
- protected IWorkbenchPage fPage;
-
- /**
- * Constructor for IWorkbenchPartSiteTest
- */
- public IWorkbenchPartSiteTest(String testName) {
- super(testName);
- }
-
- public void setUp() {
- fWindow = openTestWindow();
- fPage = fWindow.getActivePage();
- }
-
- public void testGetId() throws Throwable {
- // From Javadoc: "Returns the part registry extension id for
- // this workbench site's part."
-
- IWorkbenchPart part = createTestPart(fPage);
- IWorkbenchPartSite site = part.getSite();
- assertEquals(getTestPartId(), site.getId());
- }
-
- public void testGetPage() throws Throwable {
- // From Javadoc: "Returns the page containing this workbench
- // site's part."
-
- IWorkbenchPart part = createTestPart(fPage);
- IWorkbenchPartSite site = part.getSite();
- assertEquals(fPage, site.getPage());
- }
-
- public void testGetPluginId() throws Throwable {
- // From Javadoc: "Returns the unique identifier of the
- // plug-in that defines this workbench site's part."
-
- IWorkbenchPart part = createTestPart(fPage);
- IWorkbenchPartSite site = part.getSite();
- assertEquals(getTestPartPluginId(), site.getPluginId());
- }
-
- public void testGetRegisteredName() throws Throwable {
- // From Javadoc: "Returns the registered name for this
- // workbench site's part."
-
- IWorkbenchPart part = createTestPart(fPage);
- IWorkbenchPartSite site = part.getSite();
- assertEquals(getTestPartName(), site.getRegisteredName());
- }
-
- public void testGetShell() throws Throwable {
- // From Javadoc: "Returns the shell containing this
- // workbench site's part"
-
- IWorkbenchPart part = createTestPart(fPage);
- IWorkbenchPartSite site = part.getSite();
- assertEquals(fWindow.getShell(), site.getShell());
- }
-
- public void testGetWorkbenchWindow() throws Throwable {
- // From Javadoc: "Returns the workbench window
- // containing this workbench site's part."
-
- IWorkbenchPart part = createTestPart(fPage);
- IWorkbenchPartSite site = part.getSite();
- assertEquals(fWindow, site.getWorkbenchWindow());
- }
-
- public void testGetSelectionProvider() throws Throwable {
- // From Javadoc: "'Get' returns the selection provider
- // for this workbench site's part.
-
- IWorkbenchPart part = createTestPart(fPage);
- IWorkbenchPartSite site = part.getSite();
- assertTrue(part instanceof MockWorkbenchPart);
- MockWorkbenchPart mock = (MockWorkbenchPart)part;
- assertEquals(mock.getSelectionProvider(), site.getSelectionProvider());
- }
-
- public void testSetSelectionProvider() throws Throwable {
- // From Javadoc: 'Set' sets the selection provider.
-
- // Set selection provider to null.
- IWorkbenchPart part = createTestPart(fPage);
- IWorkbenchPartSite site = part.getSite();
- site.setSelectionProvider(null);
- assertNull(site.getSelectionProvider());
-
- // Set selection provider to real.
- MockSelectionProvider provider = new MockSelectionProvider();
- site.setSelectionProvider(provider);
- assertEquals(provider, site.getSelectionProvider());
- }
-
- /**
- * Creates a test part in the page.
- */
- abstract protected IWorkbenchPart createTestPart(IWorkbenchPage page)
- throws Throwable;
-
- /**
- * Returns the expected id for a test part.
- */
- abstract protected String getTestPartId() throws Throwable;
-
- /**
- * Returns the expected name for a test part.
- */
- abstract protected String getTestPartName() throws Throwable;
-
- /**
- * Returns the expected id for a test part plugin. Subclasses may
- * override this.
- */
- protected String getTestPartPluginId() throws Throwable {
- return "org.eclipse.ui.tests";
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchPartTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchPartTest.java deleted file mode 100644 index 01a345c6700..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchPartTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.jface.action.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.util.*;
-
-
-/**
- * This is a test for IWorkbenchPart. Since IWorkbenchPart is an
- * interface this test verifies the IWorkbenchPart lifecycle rather
- * than the implementation.
- */
-public abstract class IWorkbenchPartTest extends UITestCase {
-
- protected IWorkbenchWindow fWindow;
- protected IWorkbenchPage fPage;
-
- /**
- * Constructor for IActionDelegateTest
- */
- public IWorkbenchPartTest(String testName) {
- super(testName);
- }
-
- public void setUp() {
- fWindow = openTestWindow();
- fPage = fWindow.getActivePage();
- }
-
- public void testOpenAndClose() throws Throwable {
- // Open a part.
- MockWorkbenchPart part = openPart(fPage);
- CallHistory history = part.getCallHistory();
- assertTrue(history.verifyOrder(new String[] {
- "init", "createPartControl", "setFocus" }));
-
- // Close the part.
- closePart(fPage, part);
- assertTrue(history.verifyOrder(new String[] {
- "init", "createPartControl", "setFocus", "dispose"}));
- }
-
- /**
- * Opens a part. Subclasses should override
- */
- protected abstract MockWorkbenchPart openPart(IWorkbenchPage page)
- throws Throwable;
-
- /**
- * Closes a part. Subclasses should override
- */
- protected abstract void closePart(IWorkbenchPage page, MockWorkbenchPart part)
- throws Throwable;
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchTest.java deleted file mode 100644 index bdf0a759626..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchTest.java +++ /dev/null @@ -1,272 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.swt.SWT;
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.util.*;
-
-/**
- * Tests the IWorkbench interface.
- */
-public class IWorkbenchTest extends UITestCase {
-
- public IWorkbenchTest(String testName) {
- super(testName);
- }
-
- /**
- * Tests the activation of two windows.
- */
- public void testGetActiveWorkbenchWindow() throws Throwable {
- IWorkbenchWindow win1, win2;
-
- // PR 1GkD5O0 - Fails on linux.
- String platform = SWT.getPlatform();
- if (platform.equals("motif"))
- return;
-
- // Test initial window.
- win1 = fWorkbench.getActiveWorkbenchWindow();
- assertNotNull(win1);
-
- // Test open window.
- win1 = openTestWindow();
- assertEquals(win1, fWorkbench.getActiveWorkbenchWindow());
-
- // Test open second window.
- win2 = openTestWindow();
- assertEquals(win2, fWorkbench.getActiveWorkbenchWindow());
-
- // Test set focus.
- win1.getShell().forceFocus();
- assertEquals(win1, fWorkbench.getActiveWorkbenchWindow());
-
- // Test set focus.
- win2.getShell().forceFocus();
- assertEquals(win2, fWorkbench.getActiveWorkbenchWindow());
-
- // Cleanup in tearDown.
- }
-
- public void testGetEditorRegistry() throws Throwable {
- IEditorRegistry reg = fWorkbench.getEditorRegistry();
- assertNotNull(reg);
- }
-
- public void testGetPerspectiveRegistry() throws Throwable {
- IPerspectiveRegistry reg = fWorkbench.getPerspectiveRegistry();
- assertNotNull(reg);
- }
-
- public void testGetPrefereneManager() throws Throwable {
- PreferenceManager mgr = fWorkbench.getPreferenceManager();
- assertNotNull(mgr);
- }
-
- public void testGetSharedImages() throws Throwable {
- ISharedImages img = fWorkbench.getSharedImages();
- assertNotNull(img);
- }
-
- public void testGetWorkingSetManager() throws Throwable {
- IWorkingSetManager workingSetManager = fWorkbench.getWorkingSetManager();
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
-
- assertNotNull(workingSetManager);
-
- IWorkingSet workingSet = workingSetManager.createWorkingSet("ws1", new IAdaptable[] {workspace.getRoot()});
- workingSetManager.addWorkingSet(workingSet);
- workingSetManager = fWorkbench.getWorkingSetManager();
- assertEquals(1, workingSetManager.getWorkingSets().length);
- assertEquals(workingSet, workingSetManager.getWorkingSets()[0]);
- }
-
- public void testGetWorkbenchWindows() throws Throwable {
- IWorkbenchWindow[] wins = fWorkbench.getWorkbenchWindows();
- assertEquals(ArrayUtil.checkNotNull(wins), true);
- int oldTotal = wins.length;
- int num = 3;
-
- IWorkbenchWindow[] newWins = new IWorkbenchWindow[num];
- for (int i = 0; i < num; i++)
- newWins[i] = openTestWindow();
-
- wins = fWorkbench.getWorkbenchWindows();
- for (int i = 0; i < num; i++)
- assertTrue(ArrayUtil.contains(wins, newWins[i]));
-
- assertEquals(wins.length, oldTotal + num);
-
- closeAllTestWindows();
- wins = fWorkbench.getWorkbenchWindows();
- assertEquals(wins.length, oldTotal);
- }
-
- /**
- * openWorkbenchWindow(String, IAdaptable)
- */
- public void testOpenWorkbenchWindow() throws Throwable {
- // open a window with valid perspective
- IWorkbenchWindow win = null;
- try {
- win =
- fWorkbench.openWorkbenchWindow(
- EmptyPerspective.PERSP_ID,
- ResourcesPlugin.getWorkspace());
- assertNotNull(win);
- // PR 1GkD5O0 - Fails on linux.
- String platform = SWT.getPlatform();
- if (!platform.equals("motif")) {
- assertEquals(win, fWorkbench.getActiveWorkbenchWindow());
- }
- assertEquals(
- EmptyPerspective.PERSP_ID,
- win.getActivePage().getPerspective().getId());
- } finally {
- if (win != null)
- win.close();
- }
-
- // open a window with invalid perspective. WorkbenchException is expected.
- boolean exceptionOccured = false;
- try {
- win =
- fWorkbench.openWorkbenchWindow("afdasfdasf", ResourcesPlugin.getWorkspace());
- } catch (WorkbenchException ex) {
- exceptionOccured = true;
- }
-
- assertEquals(exceptionOccured, true);
- }
-
- /**
- * openWorkbenchWindow(IAdaptable)
- */
- public void testOpenWorkbenchWindow2() throws Throwable {
- // open a window with valid perspective
- IWorkbenchWindow win = null;
-
- try {
- win = fWorkbench.openWorkbenchWindow(ResourcesPlugin.getWorkspace());
- assertNotNull(win);
-
- // PR 1GkD5O0 - Fails on linux.
- String platform = SWT.getPlatform();
- if (!platform.equals("motif")) {
- assertEquals(win, fWorkbench.getActiveWorkbenchWindow());
- }
- String defaultID = fWorkbench.getPerspectiveRegistry().getDefaultPerspective();
- assertEquals(win.getActivePage().getPerspective().getId(), defaultID);
-
- } finally {
- if (win != null)
- win.close();
- }
- }
-
- public void testOpenPage1() throws Throwable {
- IWorkbenchWindow win = null;
- IWorkbenchPage page1, page2;
- try {
-/*
- * Commented out until test case can be updated to match new
- * implementation of single page per window
- *
- // Open test window.
- win = fWorkbench.openWorkbenchWindow(ResourcesPlugin.getWorkspace());
- assertNotNull(win);
-
- // Set platform pref for openPage.
- IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore();
- store.setValue(IPreferenceConstants.REUSE_PERSPECTIVES,
- true);
-
- // Call openPage twice with the same input.
- // Verify that we get the same page back both times.
- page1 = fWorkbench.openPage(ResourcesPlugin.getWorkspace());
- assertNotNull(page1);
- page2 = fWorkbench.openPage(ResourcesPlugin.getWorkspace());
- assertNotNull(page2);
- assertEquals("Pages should be equal", page1, page2);
-
- // Reset platform pref for openPage.
- store.setValue(IPreferenceConstants.REUSE_PERSPECTIVES,
- false);
-*/
- // Call openPage twice with the same input.
- // Verify that we get two different pages back.
-/*
- * Commented out until Nick has time to update this
- * test case to match new implementation of openPage
- * otherwise this test always fails.
- *
- page1 = fWorkbench.openPage(ResourcesPlugin.getWorkspace());
- assertNotNull(page1);
- page2 = fWorkbench.openPage(ResourcesPlugin.getWorkspace());
- assertNotNull(page2);
- assertTrue("Pages should be not equal", page1 != page2);
-*/
- } finally {
- // Close test window.
- if (win != null)
- win.close();
- }
- }
-
- public void testOpenPage2() throws Throwable {
- IWorkbenchWindow win = null;
- IWorkbenchPage page1, page2;
- try {
-/*
- * Commented out until test case can be updated to match new
- * implementation of single page per window
- *
- // Open test window.
- win = fWorkbench.openWorkbenchWindow(ResourcesPlugin.getWorkspace());
- assertNotNull(win);
-
- // Set platform pref for openPage.
- IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore();
- store.setValue(IPreferenceConstants.REUSE_PERSPECTIVES,
- true);
-
- // Call openPage twice with the same input.
- // Verify that we get the same page back both times.
- page1 = fWorkbench.openPage(EmptyPerspective.PERSP_ID,
- ResourcesPlugin.getWorkspace(), 0);
- assertNotNull(page1);
- page2 = fWorkbench.openPage(IWorkbenchConstants.DEFAULT_LAYOUT_ID,
- ResourcesPlugin.getWorkspace(), 0);
- assertNotNull(page2);
- assertEquals("Pages should be equal", page1, page2);
-
- // Reset platform pref for openPage.
- store.setValue(IPreferenceConstants.REUSE_PERSPECTIVES,
- false);
-
- // Call openPage twice with the same input.
- // Verify that we get two different pages back.
- page1 = fWorkbench.openPage(EmptyPerspective.PERSP_ID,
- ResourcesPlugin.getWorkspace(), 0);
- assertNotNull(page1);
- page2 = fWorkbench.openPage(IWorkbenchConstants.DEFAULT_LAYOUT_ID,
- ResourcesPlugin.getWorkspace(), 0);
- assertTrue("Pages should be not equal", page1 != page2);
-*/
- } finally {
- // Close test window.
- if (win != null)
- win.close();
- }
- }
-
- /**
- * close() couldn't be tested because calling close() would lead to early termination
- * to entire test suites
- */
- public void testClose() {
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchWindowActionDelegateTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchWindowActionDelegateTest.java deleted file mode 100644 index f33df723f5a..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchWindowActionDelegateTest.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.ui.tests.util.*;
-
-/**
- * Tests the lifecycle for a window action delegate.
- */
-public class IWorkbenchWindowActionDelegateTest extends IActionDelegateTest {
-
- /**
- * Constructor for IWorkbenchWindowActionDelegateTest
- */
- public IWorkbenchWindowActionDelegateTest(String testName) {
- super(testName);
- }
-
- public void testInit() throws Throwable {
- // Run the action.
- testRun();
-
- // Verify lifecycle.
- // The init, selectionChanged, and run methods should
- // be called, in that order.
- MockActionDelegate delegate = getDelegate();
- assertNotNull(delegate);
- assertTrue(delegate.callHistory.verifyOrder(
- new String [] {"init", "selectionChanged", "run"}));
- }
-
- public void testDispose() throws Throwable {
- // Run the action.
- testRun();
-
- // Get the action.
- MockActionDelegate delegate = getDelegate();
- assertNotNull(delegate);
-
- // Dispose action.
- // Verify that the dispose method is called.
- delegate.callHistory.clear();
- removeAction();
- assertTrue(delegate.callHistory.contains("dispose"));
- }
-
- /**
- * @see IActionDelegateTest#createActionWidget()
- */
- protected Object createActionWidget() throws Throwable {
- fPage.showActionSet("org.eclipse.ui.tests.api.MockActionSet");
- return null;
- }
-
- /**
- * @see IActionDelegateTest#runAction()
- */
- protected void runAction(Object widget) throws Throwable {
- ActionUtil.runActionWithLabel(this, fWindow, "Mock Action");
- }
-
- /**
- * @see IActionDelegateTest#fireSelection()
- */
- protected void fireSelection(Object widget) throws Throwable {
- MockViewPart view = (MockViewPart)fPage.showView(MockViewPart.ID);
- view.fireSelection();
- }
-
- /**
- * Removes the action.
- */
- protected void removeAction() {
- fPage.hideActionSet("org.eclipse.ui.tests.api.MockActionSet");
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchWindowTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchWindowTest.java deleted file mode 100644 index fee9a1360f1..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchWindowTest.java +++ /dev/null @@ -1,166 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.util.*;
-
-public class IWorkbenchWindowTest extends UITestCase {
-
- private IWorkbenchWindow fWin;
-
- public IWorkbenchWindowTest(String testName) {
- super(testName);
- }
-
- public void setUp() {
- fWin = openTestWindow();
- }
-
- public void testClose() throws Throwable {
- assertEquals(fWin.close(), true);
- assertEquals(ArrayUtil.contains(fWorkbench.getWorkbenchWindows(), fWin), false);
- }
-
- public void testGetActivePage() throws Throwable {
-/*
- * Commented out because until test case can be updated to work
- * with new window/page/perspective implementation
- *
- IWorkbenchPage page1, page2;
- page1 = openTestPage(fWin);
- assertEquals(fWin.getActivePage(), page1);
-
- page2 = openTestPage(fWin);
- assertEquals(fWin.getActivePage(), page2);
-
- fWin.setActivePage(page1);
- assertEquals(fWin.getActivePage(), page1);
-
- fWin.setActivePage(page2);
- assertEquals(fWin.getActivePage(), page2);
-
- //no pages
- closeAllPages(fWin);
- assertNull(fWin.getActivePage());
-*/
- }
-
- public void testSetActivePage() throws Throwable {
- openTestPage(fWin, 5);
- IWorkbenchPage[] pages = fWin.getPages();
-
- for (int i = 0; i < pages.length; i++) {
- fWin.setActivePage(pages[i]);
- assertEquals(pages[i], fWin.getActivePage());
- }
-
- fWin.setActivePage( null );
- assertNull( fWin.getActivePage() );
- }
-
- public void testGetPages() throws Throwable {
-/*
- * Commented out because until test case can be updated to work
- * with new window/page/perspective implementation
- *
- int totalBefore;
- IWorkbenchPage[] pages, domainPages;
-
- totalBefore = fWin.getPages().length;
- int num = 5;
- pages = openTestPage(fWin, num);
- assertEquals(fWin.getPages().length, totalBefore + num);
-
- domainPages = fWin.getPages();
- for (int i = 0; i < pages.length; i++)
- assertEquals(ArrayUtil.contains(domainPages, pages[i]), true);
-
- closeAllPages(fWin);
- assertEquals(fWin.getPages().length, 0);
-*/
- }
-
- public void testGetShell() {
- Shell sh = fWin.getShell();
- assertNotNull(sh);
- }
-
- public void testGetWorkbench() {
- IWorkbenchWindow win = fWorkbench.getActiveWorkbenchWindow();
- assertEquals(win.getWorkbench(), fWorkbench);
- }
-
- /**
- * tests openPage(String)
- */
- public void testOpenPage() throws Throwable {
-/*
- * Commented out because until test case can be updated to work
- * with new window/page/perspective implementation
- *
- IWorkbenchPage page = null;
- try {
- page = fWin.openPage(ResourcesPlugin.getWorkspace());
- assertNotNull(page);
- assertEquals(fWin.getActivePage(), page);
- } finally {
- if (page != null)
- page.close();
- }
-*/
- }
-
- /**
- * tests openPage(String, IAdaptable)
- */
- public void testOpenPage2() throws Throwable {
-/*
- * Commented out because until test case can be updated to work
- * with new window/page/perspective implementation
- *
- IWorkbenchPage page = null;
- try {
- page = fWin.openPage(EmptyPerspective.PERSP_ID, ResourcesPlugin.getWorkspace());
- assertNotNull(page);
- assertEquals(fWin.getActivePage(), page);
- assertEquals(
- fWin.getActivePage().getPerspective().getId(),
- EmptyPerspective.PERSP_ID);
- } finally {
- if (page != null)
- page.close();
- }
-
- //test openPage() fails
- try {
- page = fWin.openPage("*************", ResourcesPlugin.getWorkspace());
- fail();
- } catch (WorkbenchException ex) {
- }
-
- page.close();
-*/
- }
-
- public void testIsApplicationMenu() {
- String[] ids = {
- IWorkbenchActionConstants.M_FILE,
- IWorkbenchActionConstants.M_VIEW,
- IWorkbenchActionConstants.M_VIEW,
- IWorkbenchActionConstants.M_WORKBENCH,
- };
-
- for( int i = 0; i < ids.length; i ++ )
- assertEquals( fWin.isApplicationMenu( ids[ i ] ), true );
-
- ids = new String[] {
- IWorkbenchActionConstants.M_EDIT,
- IWorkbenchActionConstants.M_HELP,
- IWorkbenchActionConstants.M_LAUNCH
- };
-
- for( int i = 0; i < ids.length; i ++ )
- assertEquals( fWin.isApplicationMenu( ids[ i ] ), false );
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkingSetManagerTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkingSetManagerTest.java deleted file mode 100644 index b17d4dc92e3..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkingSetManagerTest.java +++ /dev/null @@ -1,186 +0,0 @@ -package org.eclipse.ui.tests.api; - -import junit.framework.TestCase; -import org.eclipse.jface.resource.*; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.core.resources.*; -import org.eclipse.core.runtime.*; -import org.eclipse.ui.tests.util.*; -import org.eclipse.ui.*; -import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog; -import org.eclipse.ui.internal.registry.*; - -public class IWorkingSetManagerTest extends UITestCase { - final static String WORKING_SET_NAME_1 = "ws1"; - final static String WORKING_SET_NAME_2 = "ws2"; - - IWorkingSetManager fWorkingSetManager; - IWorkspace fWorkspace; - IWorkingSet fWorkingSet; - String fChangeProperty; - Object fChangeNewValue; - Object fChangeOldValue; - - class TestPropertyChangeListener implements IPropertyChangeListener { - public void propertyChange(PropertyChangeEvent event) { - fChangeProperty = event.getProperty(); - fChangeNewValue = event.getNewValue(); - fChangeOldValue = event.getOldValue(); - } - } - - public IWorkingSetManagerTest(String testName) { - super(testName); - } - protected void setUp() throws Exception { - super.setUp(); - fWorkingSetManager = fWorkbench.getWorkingSetManager(); - fWorkspace = ResourcesPlugin.getWorkspace(); - fWorkingSet = fWorkingSetManager.createWorkingSet(WORKING_SET_NAME_1, new IAdaptable[] {fWorkspace.getRoot()}); - - IWorkingSet[] workingSets = fWorkingSetManager.getWorkingSets(); - for (int i = 0; i < workingSets.length; i++) { - fWorkingSetManager.removeWorkingSet(workingSets[i]); - } - } - void resetChangeData() { - fChangeProperty = ""; - fChangeNewValue = null; - fChangeOldValue = null; - } - - public void testAddPropertyChangeListener() throws Throwable { - IPropertyChangeListener listener = new TestPropertyChangeListener(); - fWorkingSetManager.addPropertyChangeListener(listener); - - resetChangeData(); - fWorkingSetManager.removeWorkingSet(fWorkingSet); -/* - Add back test once 21187 is fixed - assertEquals("", fChangeProperty); -*/ - resetChangeData(); - fWorkingSetManager.addWorkingSet(fWorkingSet); - assertEquals(IWorkingSetManager.CHANGE_WORKING_SET_ADD, fChangeProperty); - assertEquals(null, fChangeOldValue); - assertEquals(fWorkingSet, fChangeNewValue); - - resetChangeData(); - fWorkingSetManager.removeWorkingSet(fWorkingSet); - assertEquals(IWorkingSetManager.CHANGE_WORKING_SET_REMOVE, fChangeProperty); - assertEquals(fWorkingSet, fChangeOldValue); - assertEquals(null, fChangeNewValue); - - resetChangeData(); - fWorkingSet.setName(WORKING_SET_NAME_2); - assertEquals(IWorkingSetManager.CHANGE_WORKING_SET_NAME_CHANGE, fChangeProperty); - assertEquals(null, fChangeOldValue); - assertEquals(fWorkingSet, fChangeNewValue); - - resetChangeData(); - fWorkingSet.setElements(new IAdaptable[] {}); - assertEquals(IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE, fChangeProperty); - assertEquals(null, fChangeOldValue); - assertEquals(fWorkingSet, fChangeNewValue); - } - public void testAddRecentWorkingSet() throws Throwable { - fWorkingSetManager.addRecentWorkingSet(fWorkingSet); - assertTrue(ArrayUtil.equals(new IWorkingSet[] {fWorkingSet}, fWorkingSetManager.getRecentWorkingSets())); - - IWorkingSet workingSet2 = fWorkingSetManager.createWorkingSet(WORKING_SET_NAME_2, new IAdaptable[] {fWorkspace.getRoot()}); - fWorkingSetManager.addRecentWorkingSet(workingSet2); - assertTrue(ArrayUtil.equals(new IWorkingSet[] {workingSet2, fWorkingSet}, fWorkingSetManager.getRecentWorkingSets())); - } - public void testAddWorkingSet() throws Throwable { - fWorkingSetManager.addWorkingSet(fWorkingSet); - assertTrue(ArrayUtil.equals(new IWorkingSet[] {fWorkingSet}, fWorkingSetManager.getWorkingSets())); - - boolean exceptionThrown = false; - try { - fWorkingSetManager.addWorkingSet(fWorkingSet); - } - catch (RuntimeException exception) { - exceptionThrown = true; - } - assertTrue(exceptionThrown); - assertTrue(ArrayUtil.equals(new IWorkingSet[] {fWorkingSet}, fWorkingSetManager.getWorkingSets())); - } - public void testCreateWorkingSet() throws Throwable { - IWorkingSet workingSet2 = fWorkingSetManager.createWorkingSet(WORKING_SET_NAME_2, new IAdaptable[] {fWorkspace.getRoot()}); - assertEquals(WORKING_SET_NAME_2, workingSet2.getName()); - assertTrue(ArrayUtil.equals(new IAdaptable[] {fWorkspace.getRoot()}, workingSet2.getElements())); - - workingSet2 = fWorkingSetManager.createWorkingSet("", new IAdaptable[] {}); - assertEquals("", workingSet2.getName()); - assertTrue(ArrayUtil.equals(new IAdaptable[] {}, workingSet2.getElements())); - } - public void testCreateWorkingSetSelectionDialog() throws Throwable { - IWorkbenchWindow window = openTestWindow(); - IWorkingSetSelectionDialog dialog = fWorkingSetManager.createWorkingSetSelectionDialog(window.getShell(), true); - - assertNotNull(dialog); - } - public void testGetRecentWorkingSets() throws Throwable { - assertEquals(0, fWorkingSetManager.getRecentWorkingSets().length); - - fWorkingSetManager.addRecentWorkingSet(fWorkingSet); - assertTrue(ArrayUtil.equals(new IWorkingSet[] {fWorkingSet}, fWorkingSetManager.getRecentWorkingSets())); - - IWorkingSet workingSet2 = fWorkingSetManager.createWorkingSet(WORKING_SET_NAME_2, new IAdaptable[] {fWorkspace.getRoot()}); - fWorkingSetManager.addRecentWorkingSet(workingSet2); - assertTrue(ArrayUtil.equals(new IWorkingSet[] {workingSet2, fWorkingSet}, fWorkingSetManager.getRecentWorkingSets())); - - fWorkingSetManager.removeWorkingSet(workingSet2); - assertTrue(ArrayUtil.equals(new IWorkingSet[] {fWorkingSet}, fWorkingSetManager.getRecentWorkingSets())); - } - public void testGetWorkingSet() throws Throwable { - assertNull(fWorkingSetManager.getWorkingSet(WORKING_SET_NAME_1)); - - fWorkingSetManager.addWorkingSet(fWorkingSet); - assertNotNull(fWorkingSetManager.getWorkingSet(fWorkingSet.getName())); - - assertNull(fWorkingSetManager.getWorkingSet("")); - - assertNull(fWorkingSetManager.getWorkingSet(null)); - } - public void testGetWorkingSets() throws Throwable { - assertTrue(ArrayUtil.equals(new IWorkingSet[] {}, fWorkingSetManager.getWorkingSets())); - - fWorkingSetManager.addWorkingSet(fWorkingSet); - assertTrue(ArrayUtil.equals(new IWorkingSet[] {fWorkingSet}, fWorkingSetManager.getWorkingSets())); - - try { - fWorkingSetManager.addWorkingSet(fWorkingSet); - } - catch (RuntimeException exception) {} - assertTrue(ArrayUtil.equals(new IWorkingSet[] {fWorkingSet}, fWorkingSetManager.getWorkingSets())); - - IWorkingSet workingSet2 = fWorkingSetManager.createWorkingSet(WORKING_SET_NAME_2, new IAdaptable[] {fWorkspace.getRoot()}); - fWorkingSetManager.addWorkingSet(workingSet2); - assertTrue(ArrayUtil.contains(fWorkingSetManager.getWorkingSets(), workingSet2)); - assertTrue(ArrayUtil.contains(fWorkingSetManager.getWorkingSets(), fWorkingSet)); - } - public void testRemovePropertyChangeListener() throws Throwable { - IPropertyChangeListener listener = new TestPropertyChangeListener(); - - fWorkingSetManager.removePropertyChangeListener(listener); - - fWorkingSetManager.addPropertyChangeListener(listener); - fWorkingSetManager.removePropertyChangeListener(listener); - - resetChangeData(); - fWorkingSet.setName(WORKING_SET_NAME_1); - assertEquals("", fChangeProperty); - } - public void testRemoveWorkingSet() throws Throwable { - fWorkingSetManager.removeWorkingSet(fWorkingSet); - assertTrue(ArrayUtil.equals(new IWorkingSet[] {}, fWorkingSetManager.getWorkingSets())); - - fWorkingSetManager.addWorkingSet(fWorkingSet); - IWorkingSet workingSet2 = fWorkingSetManager.createWorkingSet(WORKING_SET_NAME_2, new IAdaptable[] {fWorkspace.getRoot()}); - fWorkingSetManager.addWorkingSet(workingSet2); - fWorkingSetManager.removeWorkingSet(fWorkingSet); - assertTrue(ArrayUtil.equals(new IWorkingSet[] {workingSet2}, fWorkingSetManager.getWorkingSets())); - } -}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkingSetTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkingSetTest.java deleted file mode 100644 index c039a862dd4..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkingSetTest.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.eclipse.ui.tests.api; - -import org.eclipse.core.resources.*; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.ui.IWorkingSet; -import org.eclipse.ui.IWorkingSetManager; -import org.eclipse.ui.tests.util.*; - -public class IWorkingSetTest extends UITestCase { - final static String WORKING_SET_NAME_1 = "ws1"; - final static String WORKING_SET_NAME_2 = "ws2"; - - IWorkspace fWorkspace; - IWorkingSet fWorkingSet; - - public IWorkingSetTest(String testName) { - super(testName); - } - protected void setUp() throws Exception { - super.setUp(); - IWorkingSetManager workingSetManager = fWorkbench.getWorkingSetManager(); - - fWorkspace = ResourcesPlugin.getWorkspace(); - fWorkingSet = workingSetManager.createWorkingSet(WORKING_SET_NAME_1, new IAdaptable[] {fWorkspace.getRoot()}); - } - public void testGetName() throws Throwable { - assertEquals(WORKING_SET_NAME_1, fWorkingSet.getName()); - } - public void testGetElements() throws Throwable { - assertEquals(fWorkspace.getRoot(), fWorkingSet.getElements()[0]); - } - public void testSetElements() throws Throwable { - boolean exceptionThrown = false; - - try { - fWorkingSet.setElements(null); - } - catch (RuntimeException exception) { - exceptionThrown = true; - } - assertTrue(exceptionThrown); - - IProject p1 = FileUtil.createProject("TP1"); - IFile f1 = FileUtil.createFile("f1.txt", p1); - IAdaptable[] elements = new IAdaptable[] {f1, p1}; - fWorkingSet.setElements(elements); - assertTrue(ArrayUtil.equals(elements, fWorkingSet.getElements())); - - fWorkingSet.setElements(new IAdaptable[] {f1}); - assertEquals(f1, fWorkingSet.getElements()[0]); - - fWorkingSet.setElements(new IAdaptable[] {}); - assertEquals(0, fWorkingSet.getElements().length); - } - public void testSetName() throws Throwable { - boolean exceptionThrown = false; - - try { - fWorkingSet.setName(null); - } - catch (RuntimeException exception) { - exceptionThrown = true; - } - assertTrue(exceptionThrown); - - fWorkingSet.setName(WORKING_SET_NAME_2); - assertEquals(WORKING_SET_NAME_2, fWorkingSet.getName()); - - fWorkingSet.setName(""); - assertEquals("", fWorkingSet.getName()); - - fWorkingSet.setName(" "); - assertEquals(" ", fWorkingSet.getName()); - } - -}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListContentProvider.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListContentProvider.java deleted file mode 100644 index d8697eadffb..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListContentProvider.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import java.util.List;
-import org.eclipse.jface.viewers.*;
-
-public class ListContentProvider implements IStructuredContentProvider {
-
- /**
- * @see IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object inputElement) {
- if (inputElement instanceof List) {
- return ((List)inputElement).toArray();
- }
- return new Object[0];
- }
-
- /**
- * @see IContentProvider#dispose()
- */
- public void dispose() {
- }
-
- /**
- * @see IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListElement.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListElement.java deleted file mode 100644 index c8c7284fb12..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListElement.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ui.IActionFilter;
-
-public class ListElement implements IAdaptable {
-
- private String name;
- private boolean flag;
-
- public ListElement(String name) {
- this(name, false);
- }
-
- public ListElement(String name, boolean flag) {
- this.name = name;
- this.flag = flag;
- }
-
- public String toString() {
- return name + ':' + flag;
- }
-
- public String getName() {
- return name;
- }
-
- public boolean getFlag() {
- return flag;
- }
-
- public Object getAdapter(Class adapter) {
- if (adapter == IActionFilter.class) {
- return ListElementActionFilter.getSingleton();
- }
- return null;
- }
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListElementActionFilter.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListElementActionFilter.java deleted file mode 100644 index 3104e0e2e87..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListElementActionFilter.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.ui.IActionFilter;
-
-public class ListElementActionFilter implements IActionFilter {
-
- private boolean called = false;
-
- public static final String ATTR_NAME = "name";
- public static final String ATTR_FLAG = "flag";
- public static final String VAL_TRUE = "true";
- public static final String VAL_FALSE = "false";
-
- private static ListElementActionFilter singleton;
-
- public static ListElementActionFilter getSingleton() {
- if (singleton == null)
- singleton = new ListElementActionFilter();
- return singleton;
- }
-
- private ListElementActionFilter() {
- super();
- }
-
- /**
- * @see IActionFilter#testAttribute(Object, String, String)
- */
- public boolean testAttribute(Object target, String name, String value) {
- called = true;
- ListElement le = (ListElement)target;
- if (name.equals(ATTR_NAME)) {
- return value.equals(le.getName());
- } else if (name.equals(ATTR_FLAG)) {
- boolean flag = le.getFlag();
- if (flag)
- return value.equals(VAL_TRUE);
- else
- return value.equals(VAL_FALSE);
- }
- return false;
- }
-
- public void clearCalled() {
- called = false;
- }
-
- public boolean getCalled() {
- return called;
- }
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListView.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListView.java deleted file mode 100644 index 372fe8231e6..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListView.java +++ /dev/null @@ -1,138 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import java.util.ArrayList;
-
-import junit.framework.TestCase;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.IWorkbenchActionConstants;
-
-/**
- * An ElementViewPart shows a bunch of elements in a list
- * viewer.
- */
-public class ListView extends MockViewPart
- implements IMenuListener
-{
-
- ListViewer viewer;
- ArrayList input;
- MenuManager menuMgr;
- Menu menu;
- Action addAction;
- String ADD_ACTION_ID = "addAction";
-
- /**
- * Constructor for ElementViewPart
- */
- public ListView() {
- super();
- input = new ArrayList();
- }
-
- /**
- * @see IWorkbenchPart#createPartControl(Composite)
- */
- public void createPartControl(Composite parent) {
- callTrace.add("createPartControl");
-
- // Create viewer.
- viewer = new ListViewer(parent);
- viewer.setLabelProvider(new LabelProvider());
- viewer.setContentProvider(new ListContentProvider());
- viewer.setInput(input);
-
- // Create popup menu.
- createPopupMenu();
-
- // Register stuff.
- getSite().setSelectionProvider(viewer);
- }
-
- /**
- * Creates a popup menu.
- */
- public void createPopupMenu() {
- // Create actions.
- addAction = new Action("Add Standard Items") {
- public void run() {
- addStandardItems();
- }
- };
- addAction.setId(ADD_ACTION_ID);
-
- // Create popup menu.
- IConfigurationElement config = getConfig();
- String str = config.getAttributeAsIs("menuType");
- if (str != null && str.equals("static"))
- createStaticPopupMenu();
- else
- createDynamicPopupMenu();
- }
-
- /**
- * Creates a dynamic popup menu.
- */
- public void createDynamicPopupMenu() {
- menuMgr = new MenuManager();
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(this);
- menu = menuMgr.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
- getSite().registerContextMenu(menuMgr, viewer);
- }
-
- /**
- * Creates a static popup menu.
- */
- public void createStaticPopupMenu() {
- menuMgr = new MenuManager();
- menu = menuMgr.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
- getSite().registerContextMenu(menuMgr, viewer);
- menuAboutToShow(menuMgr);
- }
-
- public void addElement(ListElement el) {
- input.add(el);
- viewer.refresh();
- viewer.getControl().update();
- }
-
- public void selectElement(ListElement el) {
- if (el == null)
- viewer.setSelection(new StructuredSelection());
- else
- viewer.setSelection(new StructuredSelection(el));
- }
-
- public MenuManager getMenuManager() {
- return menuMgr;
- }
-
- /**
- * @see IMenuListener#menuAboutToShow(IMenuManager)
- */
- public void menuAboutToShow(IMenuManager menuMgr) {
- menuMgr.add(addAction);
- menuMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
-
- /**
- * Tests that the menu mgr contains the expected actions.
- */
- public void verifyActions(TestCase test, IMenuManager menuMgr) {
- test.assertNotNull(menuMgr.find(ADD_ACTION_ID));
- }
-
- public void addStandardItems() {
- addElement(new ListElement("red"));
- addElement(new ListElement("blue"));
- addElement(new ListElement("green"));
- addElement(new ListElement("red", true));
- }
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockAction.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockAction.java deleted file mode 100644 index eb2746771cd..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockAction.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.tests.TestPlugin;
-
-public class MockAction extends Action {
-
- private boolean hasRun = false;
-
- /**
- * Constructor for MockAction
- */
- protected MockAction(String text) {
- super(text);
- TestPlugin plugin = TestPlugin.getDefault();
- setImageDescriptor(plugin.getImageDescriptor("anything.gif"));
- setToolTipText(text);
- }
-
- /**
- * Constructor for MockAction
- */
- protected MockAction(String text, ImageDescriptor image) {
- super(text, image);
- setToolTipText(text);
- }
-
- public void run() {
- hasRun = true;
- }
-
- public void clearRun() {
- hasRun = false;
- }
-
- public boolean getRun() {
- return hasRun;
- }
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockActionDelegate.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockActionDelegate.java deleted file mode 100644 index 66c75a5f6dd..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockActionDelegate.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.ui.tests.util.CallHistory;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-public class MockActionDelegate implements IWorkbenchWindowActionDelegate {
-
- public CallHistory callHistory;
- public static final String ACTION_SET_ID = "org.eclipse.ui.tests.api.MockActionSet";
- public static MockActionDelegate lastDelegate;
-
- public MockActionDelegate() {
- callHistory = new CallHistory(this);
- lastDelegate = this;
- }
-
- /*
- * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- callHistory.add("run");
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- callHistory.add("selectionChanged");
- }
-
- /*
- * @see IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- }
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorActionBarContributor.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorActionBarContributor.java deleted file mode 100644 index c32da0ce8c5..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorActionBarContributor.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.jface.action.IToolBarManager;
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.tests.util.CallHistory;
-import org.eclipse.ui.part.EditorActionBarContributor;
-
-public class MockEditorActionBarContributor
- extends EditorActionBarContributor
-{
- protected CallHistory callHistory;
- protected IEditorPart target;
- protected int ACTION_COUNT = 5;
- protected MockAction [] actions;
-
- /**
- * Constructor for MockEditorActionBarContributor
- */
- public MockEditorActionBarContributor() {
- super();
- callHistory = new CallHistory(this);
- }
-
- public CallHistory getCallHistory() {
- return callHistory;
- }
-
- /**
- * @see IEditorActionBarContributor#init(IActionBars)
- */
- public void init(IActionBars bars) {
- callHistory.add("init");
- actions = new MockAction[ACTION_COUNT];
- for (int nX = 0; nX < ACTION_COUNT; nX ++) {
- actions[nX] = new MockAction(Integer.toString(nX));
- if (nX % 2 > 0)
- actions[nX].setEnabled(false);
- }
- super.init(bars);
- }
-
- /**
- * @see EditorActionBarContributor#contributeToToolBar(IToolBarManager)
- */
- public void contributeToToolBar(IToolBarManager toolBarManager) {
- for (int i = 0; i < actions.length; ++i) {
- toolBarManager.add(actions[i]);
- }
- }
-
- /**
- * @see IEditorActionBarContributor#setActiveEditor(IEditorPart)
- */
- public void setActiveEditor(IEditorPart targetEditor) {
- callHistory.add("setActiveEditor");
- target = targetEditor;
- }
-
- /**
- * Returns the active editor.
- */
- public IEditorPart getActiveEditor() {
- return target;
- }
-
- /**
- * Returns the actions.
- */
- public MockAction [] getActions() {
- return actions;
- }
-
- /**
- * Set the enablement for all actions.
- */
- public void enableActions(boolean b) {
- for (int nX = 0; nX < ACTION_COUNT; nX ++) {
- actions[nX].setEnabled(b);
- }
- }
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorActionDelegate.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorActionDelegate.java deleted file mode 100644 index 396dcce1d55..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorActionDelegate.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.*;
-
-public class MockEditorActionDelegate extends MockActionDelegate
- implements IEditorActionDelegate
-{
- private IEditorPart target;
-
- /**
- * Constructor for MockEditorActionDelegate
- */
- public MockEditorActionDelegate() {
- super();
- }
-
- /**
- * @see IEditorActionDelegate#setActiveEditor(IAction, IEditorPart)
- */
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- callHistory.add("setActiveEditor");
- target = targetEditor;
- }
-
- /**
- * Returns the active editor.
- */
- public IEditorPart getActiveEditor() {
- return target;
- }
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorPart.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorPart.java deleted file mode 100644 index dfb03e26942..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorPart.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.util.*;
-
-public class MockEditorPart extends MockWorkbenchPart implements IEditorPart {
-
- private static final String BASE = "org.eclipse.ui.tests.api.MockEditorPart";
- public static final String ID1 = BASE + "1";
- public static final String ID2 = BASE + "2";
- public static final String NAME = "Mock Editor 1";
-
- private IEditorInput input;
- private boolean dirty = false;
- private boolean saveNeeded = false;
-
- public MockEditorPart() {
- super();
- }
-
- /**
- * @see IEditorPart#doSave(IProgressMonitor)
- */
- public void doSave(IProgressMonitor monitor) {
- dirty = false;
- callTrace.add( "doSave" );
- }
-
- /**
- * @see IEditorPart#doSaveAs()
- */
- public void doSaveAs() {
- }
-
- /**
- * @see IEditorPart#getEditorInput()
- */
- public IEditorInput getEditorInput() {
- return input;
- }
-
- /**
- * @see IEditorPart#getEditorSite()
- */
- public IEditorSite getEditorSite() {
- return (IEditorSite)getSite();
- }
-
- /**
- * @see IEditorPart#gotoMarker(IMarker)
- */
- public void gotoMarker(IMarker marker) {
- callTrace.add( "gotoMarker" );
- }
-
- /**
- * @see IEditorPart#init(IEditorSite, IEditorInput)
- */
- public void init(IEditorSite site, IEditorInput input)
- throws PartInitException {
- this.input = input;
- setSite(site);
- callTrace.add( "init" );
- }
-
- /**
- * @see IEditorPart#isDirty()
- */
- public boolean isDirty() {
- callTrace.add( "isDirty" );
- return dirty;
- }
-
- public void setDirty( boolean value )
- {
- dirty = value;
- }
-
- /**
- * @see IEditorPart#isSaveAsAllowed()
- */
- public boolean isSaveAsAllowed() {
- return false;
- }
-
- /**
- * @see IEditorPart#isSaveOnCloseNeeded()
- */
- public boolean isSaveOnCloseNeeded() {
- callTrace.add( "isSaveOnCloseNeeded" );
- return saveNeeded;
- }
-
- public void setSaveNeeded( boolean value )
- {
- saveNeeded = value;
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockPartListener.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockPartListener.java deleted file mode 100644 index 518e73458e3..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockPartListener.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.tests.util.*;
-
-public class MockPartListener implements IPartListener {
- private CallHistory callTrace;
-
- public MockPartListener() {
- callTrace = new CallHistory( this );
- }
-
- public CallHistory getCallHistory() {
- return callTrace;
- }
-
- /**
- * @see IPartListener#partActivated(IWorkbenchPart)
- */
- public void partActivated(IWorkbenchPart part) {
- callTrace.add("partActivated");
- }
-
- /**
- * @see IPartListener#partBroughtToTop(IWorkbenchPart)
- */
- public void partBroughtToTop(IWorkbenchPart part) {
- callTrace.add("partBroughtToTop");
- }
-
- /**
- * @see IPartListener#partClosed(IWorkbenchPart)
- */
- public void partClosed(IWorkbenchPart part) {
- callTrace.add( "partClosed");
- }
-
- /**
- * @see IPartListener#partDeactivated(IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part) {
- callTrace.add( "partDeactivated");
- }
-
- /**
- * @see IPartListener#partOpened(IWorkbenchPart)
- */
- public void partOpened(IWorkbenchPart part) {
- callTrace.add( "partOpened");
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockPropertyListener.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockPropertyListener.java deleted file mode 100644 index 597bbd31aff..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockPropertyListener.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.tests.util.*;
-
-public class MockPropertyListener implements IPropertyListener {
- private CallHistory callTrace;
- private Object sourceMask;
- private int sourceId;
-
- /**
- * @param source the event source that fires the event to this listener
- * @param id the property id for the event
- */
- public MockPropertyListener( Object source, int id )
- {
- sourceMask = source;
- sourceId = id;
- callTrace = new CallHistory(this);
- }
-
- /**
- * @see IPropertyListener#propertyChanged(Object, int)
- */
- public void propertyChanged(Object source, int propId) {
- if( source == sourceMask && propId == sourceId )
- callTrace.add( "propertyChanged" );
- }
-
- public CallHistory getCallHistory()
- {
- return callTrace;
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockSelectionProvider.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockSelectionProvider.java deleted file mode 100644 index 3f0ff9d2b7c..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockSelectionProvider.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import java.util.*;
-
-import org.eclipse.jface.viewers.*;
-
-public class MockSelectionProvider implements ISelectionProvider {
-
- private List listeners = new ArrayList(3);
-
- /**
- * Fires out a selection to all listeners.
- */
- public void fireSelection() {
- fireSelection(new SelectionChangedEvent(this,
- StructuredSelection.EMPTY));
- }
-
- /**
- * Fires out a selection to all listeners.
- */
- public void fireSelection(SelectionChangedEvent event) {
- Iterator iter = listeners.iterator();
- while (iter.hasNext()) {
- ((ISelectionChangedListener)iter.next()).selectionChanged(event);
- }
- }
-
- /**
- * @see ISelectionProvider#addSelectionChangedListener(ISelectionChangedListener)
- */
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- listeners.add(listener);
- }
-
- /**
- * @see ISelectionProvider#getSelection()
- */
- public ISelection getSelection() {
- return StructuredSelection.EMPTY;
- }
-
- /**
- * @see ISelectionProvider#removeSelectionChangedListener(ISelectionChangedListener)
- */
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- listeners.remove(listener);
- }
-
- /**
- * @see ISelectionProvider#setSelection(ISelection)
- */
- public void setSelection(ISelection selection) {
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockViewActionDelegate.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockViewActionDelegate.java deleted file mode 100644 index 182e0581fce..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockViewActionDelegate.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.ui.*;
-import org.eclipse.ui.IViewPart;
-
-/**
- * This mock is used to test IViewActionDelegate lifecycle.
- */
-public class MockViewActionDelegate extends MockActionDelegate
- implements IViewActionDelegate
-{
- /**
- * Constructor for MockWorkbenchWindowActionDelegate
- */
- public MockViewActionDelegate() {
- super();
- }
-
- /**
- * @see IViewActionDelegate#init(IViewPart)
- */
- public void init(IViewPart view) {
- callHistory.add("init");
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockViewPart.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockViewPart.java deleted file mode 100644 index 1fb49aed92e..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockViewPart.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.*;
-
-public class MockViewPart extends MockWorkbenchPart implements IViewPart {
- public static String ID = "org.eclipse.ui.tests.api.MockViewPart";
- public static String ID2 = ID + "2";
- public static String ID3 = ID + "3";
- public static String NAME = "Mock View 1";
-
- public MockViewPart()
- {
- super();
- }
-
- /**
- * @see IViewPart#getViewSite()
- */
- public IViewSite getViewSite() {
- return (IViewSite)getSite();
- }
-
- /**
- * @see IViewPart#init(IViewSite)
- */
- public void init(IViewSite site) throws PartInitException {
- setSite(site);
- callTrace.add("init" );
- }
-
- /**
- * @see IViewPart#init(IViewSite, IMemento)
- */
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- setSite(site);
- callTrace.add("init" );
- }
-
- /**
- * @see IViewPart#saveState(IMemento)
- */
- public void saveState(IMemento memento) {
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkbenchPart.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkbenchPart.java deleted file mode 100644 index 99afd71a033..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkbenchPart.java +++ /dev/null @@ -1,144 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import java.net.*;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.ui.tests.util.CallHistory;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.*;
-
-public abstract class MockWorkbenchPart implements IWorkbenchPart,
- IExecutableExtension
-{
- protected CallHistory callTrace;
-
- private IPropertyListener myListener;
- private Composite myParent;
- private IWorkbenchPartSite site;
- private String title;
- private MockSelectionProvider selectionProvider;
- private IConfigurationElement config;
- private Image titleImage;
-
- public MockWorkbenchPart() {
- callTrace = new CallHistory(this);
- selectionProvider = new MockSelectionProvider();
- }
-
- public CallHistory getCallHistory()
- {
- return callTrace;
- }
-
- public ISelectionProvider getSelectionProvider() {
- return selectionProvider;
- }
-
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- this.config = config;
- title = (String)config.getAttribute("name");
-
- // Icon.
- String strIcon = config.getAttribute("icon");//$NON-NLS-1$
- if (strIcon != null) {
- try {
- IPluginDescriptor pd = config.getDeclaringExtension()
- .getDeclaringPluginDescriptor();
- URL fullPathString = new URL(pd.getInstallURL(), strIcon);
- ImageDescriptor imageDesc = ImageDescriptor.createFromURL(fullPathString);
- titleImage = imageDesc.createImage();
- } catch (MalformedURLException e) {
- }
- }
- }
-
- public IConfigurationElement getConfig() {
- return config;
- }
-
- public void setSite(IWorkbenchPartSite site) {
- this.site = site;
- site.setSelectionProvider(selectionProvider);
- }
-
- public IWorkbenchPartSite getSite() {
- return site;
- }
-
- /**
- * @see IWorkbenchPart#addPropertyListener(IPropertyListener)
- */
- public void addPropertyListener(IPropertyListener listener) {
- myListener = listener;
- }
-
- /**
- * @see IWorkbenchPart#createPartControl(Composite)
- */
- public void createPartControl(Composite parent) {
- myParent = parent;
- callTrace.add("createPartControl" );
- Label label = new Label(parent, SWT.NONE);
- label.setText(title);
- }
-
- /**
- * @see IWorkbenchPart#dispose()
- */
- public void dispose() {
- callTrace.add("dispose" );
- }
-
- /**
- * @see IWorkbenchPart#getTitle()
- */
- public String getTitle() {
- return title;
- }
-
- /**
- * @see IWorkbenchPart#getTitleImage()
- */
- public Image getTitleImage() {
- return titleImage;
- }
-
- /**
- * @see IWorkbenchPart#getTitleToolTip()
- */
- public String getTitleToolTip() {
- return title;
- }
-
- /**
- * @see IWorkbenchPart#removePropertyListener(IPropertyListener)
- */
- public void removePropertyListener(IPropertyListener listener) {
- myListener = null;
- }
-
- /**
- * @see IWorkbenchPart#setFocus()
- */
- public void setFocus() {
- callTrace.add("setFocus" );
- }
-
- /**
- * @see IAdaptable#getAdapter(Class)
- */
- public Object getAdapter(Class arg0) {
- return null;
- }
-
- /**
- * Fires a selection out.
- */
- public void fireSelection() {
- selectionProvider.fireSelection();
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkbenchWindowActionDelegate.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkbenchWindowActionDelegate.java deleted file mode 100644 index bcae17ecd88..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkbenchWindowActionDelegate.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-
-public class MockWorkbenchWindowActionDelegate extends MockActionDelegate
- implements IWorkbenchWindowActionDelegate
-{
- public static MockWorkbenchWindowActionDelegate lastDelegate;
- public static String SET_ID = "org.eclipse.ui.tests.api.MockActionSet";
- public static String ID = "org.eclipse.ui.tests.api.MockWindowAction";
-
- /**
- * Constructor for MockWorkbenchWindowActionDelegate
- */
- public MockWorkbenchWindowActionDelegate() {
- super();
- lastDelegate = this;
- }
-
- /**
- * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
- callHistory.add("init");
- }
-
- /**
- * @see IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- callHistory.add("dispose");
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkingSetPage.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkingSetPage.java deleted file mode 100644 index 135c21c632a..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkingSetPage.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.eclipse.ui.tests.api; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.IWorkingSet; -import org.eclipse.ui.dialogs.IWorkingSetPage; - -/** - * Tests the org.eclipse.ui.workingSets extension point. - */ -public class MockWorkingSetPage extends WizardPage implements IWorkingSetPage { - private IWorkingSet workingSet; - - /** - * Creates a new instance of the receiver. - */ - public MockWorkingSetPage() { - super("MockWorkingSetPage", "Test Working Set", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$ $NON-NLS-2$ - } - /** - * Overrides method in WizardPage. - * - * @see org.eclipse.jface.wizard.WizardPage#createControl(Composite) - */ - public void createControl(Composite parent) { - } - /** - * Implements IWorkingSetPage. - * - * @see org.eclipse.ui.dialogs.IWorkingSetPage#getSelection() - */ - public IWorkingSet getSelection() { - return workingSet; - } - /** - * Implements IWorkingSetPage. - * - * @see org.eclipse.ui.dialogs.IWorkingSetPage#setSelection(IWorkingSet) - */ - public void setSelection(IWorkingSet workingSet) { - } - /** - * @see org.eclipse.ui.dialogs.IWorkingSetPage#finish() - */ - public void finish() { - } - -} diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkingSetTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkingSetTest.java deleted file mode 100644 index 12c97dc613f..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkingSetTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.eclipse.ui.tests.api; - -import junit.framework.TestCase; -import org.eclipse.ui.internal.WorkbenchPlugin; -import org.eclipse.ui.internal.registry.WorkingSetDescriptor; -import org.eclipse.ui.internal.registry.WorkingSetRegistry; - -/** - * Tests the WorkingSetDescriptor and WorkingSetRegistry. - */ -public class MockWorkingSetTest extends TestCase { - final static String WORKING_SET_ID = "org.eclipse.ui.tests.api.MockWorkingSet"; - final static String WORKING_SET_NAME = "Mock Working Set"; - final static String WORKING_SET_PAGE_CLASS_NAME = "org.eclipse.ui.tests.api.MockWorkingSetPage"; - - WorkingSetRegistry fRegistry; - - public MockWorkingSetTest(String name) { - super(name); - } - /** - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - fRegistry = WorkbenchPlugin.getDefault().getWorkingSetRegistry(); - } - public void testWorkingSetDescriptor() throws Throwable { - WorkingSetDescriptor workingSetDescriptor = fRegistry.getWorkingSetDescriptor(WORKING_SET_ID); - - assertNotNull(workingSetDescriptor.getIcon()); - assertEquals(WORKING_SET_ID, workingSetDescriptor.getId()); - assertEquals(WORKING_SET_NAME, workingSetDescriptor.getName()); - assertEquals(WORKING_SET_PAGE_CLASS_NAME, workingSetDescriptor.getPageClassName()); - } - public void testWorkingSetRegistry() throws Throwable { - WorkingSetDescriptor[] workingSetDescriptors = fRegistry.getWorkingSetDescriptors(); - /* - * Should have at least resourceWorkingSetPage and MockWorkingSet - */ - assertTrue(workingSetDescriptors.length >= 2); - - assertEquals(Class.forName(WORKING_SET_PAGE_CLASS_NAME), fRegistry.getWorkingSetPage(WORKING_SET_ID).getClass()); - } - -} - diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/PlatformUITest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/PlatformUITest.java deleted file mode 100644 index 0fdb22d23ac..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/PlatformUITest.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import junit.framework.*;
-import org.eclipse.ui.*;
-
-/**
- * Tests the PlatformUI class.
- */
-public class PlatformUITest extends TestCase {
-
- public PlatformUITest(String testName) {
- super(testName);
- }
-
- public void testGetWorkbench() throws Throwable {
- // From Javadoc: "Returns the workbench interface."
- IWorkbench wb = PlatformUI.getWorkbench();
- assertNotNull(wb);
- }
-
- public void testPLUGIN_ID() {
- // From Javadoc: "Identifies the workbench plugin."
- assertNotNull(PlatformUI.PLUGIN_ID);
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionCreateTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionCreateTest.java deleted file mode 100644 index 5bbc2531330..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionCreateTest.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.eclipse.ui.tests.api;
-import org.eclipse.core.resources.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.util.*;
-
-/**
- * SessionCreateTest runs the first half of our session
- * presistance tests.
- *
-*/
-public class SessionCreateTest extends UITestCase {
-
- private IWorkbenchWindow [] oldWindows;
- public static String TEST_PROJ = "sessionTest";
- public static String TEST_FILE_1 = "one.mock1";
- public static String TEST_FILE_2 = "two.mock1";
- public static String TEST_FILE_3 = "three.mock1";
-
- /**
- * Construct an instance.
- */
- public SessionCreateTest(String arg) {
- super(arg);
- }
-
/**
- * Generates a session state in the workbench.
- */
- public void testSessionCreation() throws Throwable {
- IWorkbenchWindow window;
- IWorkbenchPage page;
-
- // Save the original windows. We close all of
- // these at the end, after the test windows have
- // been created.
- saveOriginalWindows();
-
- // Create test window with empty perspective.
- window = fWorkbench.openWorkbenchWindow(
- EmptyPerspective.PERSP_ID,
- ResourcesPlugin.getWorkspace());
-
- // Create test window with empty perspective and
- // session perspective.
- window = fWorkbench.openWorkbenchWindow(
- EmptyPerspective.PERSP_ID,
- ResourcesPlugin.getWorkspace());
- page = window.openPage(
- SessionPerspective.ID,
- ResourcesPlugin.getWorkspace());
-
- // Create test window with two session perspectives.
- window = fWorkbench.openWorkbenchWindow(
- SessionPerspective.ID,
- ResourcesPlugin.getWorkspace());
- page = window.openPage(
- SessionPerspective.ID,
- ResourcesPlugin.getWorkspace());
-
- // Open 3 editors in last page.
- IProject proj = FileUtil.createProject(TEST_PROJ);
- IFile file = FileUtil.createFile(TEST_FILE_1, proj);
- page.openEditor(file, MockEditorPart.ID1);
- file = FileUtil.createFile(TEST_FILE_2, proj);
- page.openEditor(file, MockEditorPart.ID1);
- file = FileUtil.createFile(TEST_FILE_3, proj);
- page.openEditor(file, MockEditorPart.ID1);
-
- // Close the original windows.
- closeOriginalWindows();
- }
-
- /**
- * Saves the original window set.
- */
- private void saveOriginalWindows() {
- oldWindows = fWorkbench.getWorkbenchWindows();
- }
-
- /**
- * Closes the original window set.
- */
- private void closeOriginalWindows() {
- for (int nX = 0; nX < oldWindows.length; nX ++) {
- oldWindows[nX].close();
- }
- }
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionPerspective.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionPerspective.java deleted file mode 100644 index 9a7b21e27cc..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionPerspective.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.ui.*;
-
-/**
- * This class tests the persistance of a perspective.
- */
-public class SessionPerspective implements IPerspectiveFactory {
-
- public static String ID = "org.eclipse.ui.tests.api.SessionPerspective";
-
- /**
- * @see IPerspectiveFactory#createInitialLayout(IPageLayout)
- */
- public void createInitialLayout(IPageLayout layout) {
- String editorArea = layout.getEditorArea();
- layout.addView(SessionView.VIEW_ID, IPageLayout.LEFT,
- 0.33f, editorArea);
- }
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionRestoreTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionRestoreTest.java deleted file mode 100644 index 6ee581d2114..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionRestoreTest.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import org.eclipse.ui.tests.util.*;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.ui.*;
-
-/**
- * SessionRestoreTest runs the second half of our session
- * presistance tests.
- *
-*/
-public class SessionRestoreTest extends UITestCase {
-
- /**
- * Construct an instance.
- */
- public SessionRestoreTest(String arg) {
- super(arg);
- }
-
- /**
- * Generates a session state in the workbench.
- */
- public void testRestoreSession() throws Throwable {
- IWorkbenchWindow [] windows;
- IWorkbenchPage [] pages;
- IWorkbenchPage page;
-
- // Get windows.
- windows = fWorkbench.getWorkbenchWindows();
- assertEquals(windows.length, 3);
-
- // First window contains empty perspective.
- pages = windows[0].getPages();
- assertEquals(pages.length, 1);
- assertEquals(pages[0].getPerspective().getId(), EmptyPerspective.PERSP_ID);
-
- // Second window contains empty + session.
- pages = windows[1].getPages();
- assertEquals(pages.length, 2);
- assertEquals(pages[0].getPerspective().getId(), EmptyPerspective.PERSP_ID);
- assertEquals(pages[1].getPerspective().getId(), SessionPerspective.ID);
- testSessionView(pages[1]);
-
- // Third window contains 2 sessions.
- pages = windows[2].getPages();
- assertEquals(pages.length, 2);
- assertEquals(pages[0].getPerspective().getId(), SessionPerspective.ID);
- assertEquals(pages[1].getPerspective().getId(), SessionPerspective.ID);
- testSessionView(pages[0]);
- testSessionView(pages[1]);
-
- // Last page contains 3 editors.
- IEditorPart [] editors = pages[1].getEditors();
- assertEquals(editors.length, 3);
- testSessionEditor(editors[0], SessionCreateTest.TEST_FILE_1);
- testSessionEditor(editors[1], SessionCreateTest.TEST_FILE_2);
- testSessionEditor(editors[2], SessionCreateTest.TEST_FILE_3);
- }
-
- /**
- * Tests the session view within a page.
- */
- private void testSessionView(IWorkbenchPage page) {
- IViewPart view = page.findView(SessionView.VIEW_ID);
- assertNotNull(view);
- SessionView sessionView = (SessionView)view;
- sessionView.testMementoState(this);
- }
-
- /**
- * Tests the state of a session editor.
- */
- private void testSessionEditor(IEditorPart part, String fileName) {
- IEditorSite site = part.getEditorSite();
- assertEquals(site.getId(), MockEditorPart.ID1);
- IEditorInput input = part.getEditorInput();
- assertTrue(input instanceof IFileEditorInput);
- IFile file = ((IFileEditorInput)input).getFile();
- assertEquals(fileName, file.getName());
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionView.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionView.java deleted file mode 100644 index c68a6499513..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionView.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.eclipse.ui.tests.api;
-
-import junit.framework.TestCase;
-import org.eclipse.ui.*;
-
-/**
- * This view is used to test the creation and restoration of
- * view state between sessions.
- */
-public class SessionView extends MockViewPart {
-
- private IMemento memento;
-
- public static String VIEW_ID = "org.eclipse.ui.tests.api.SessionView";
- /**
- * Constructor for SessionView
- */
- public SessionView() {
- super();
- }
-
- /**
- * @see IViewPart#init(IViewSite, IMemento)
- */
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- super.init(site, memento);
- this.memento = memento;
- }
-
- /**
- * Create an IMemento.
- */
- public void saveState(IMemento memento) {
- createMementoState(memento);
- }
-
- /**
- * Creates an IMemento.
- */
- private void createMementoState(IMemento memento) {
- // Create float, integer and string.
- memento.putFloat("float", 0.50f);
- memento.putInteger("integer", 50);
- memento.putString("string", "50");
-
- // Create a single child.
- IMemento child = memento.createChild("single");
- child.putInteger("id", 1);
-
- // Create multiple children.
- int count = 10;
- for (int nX = 0; nX < count; nX ++) {
- child = memento.createChild("multiple");
- child.putInteger("id", nX);
- }
- memento.putInteger("multiple.count", count);
- }
-
- /**
- * Restore an IMemento.
- */
- public void testMementoState(TestCase testCase) {
- // Verify that the memento was passed to us in
- // constructor.
- testCase.assertNotNull(memento);
-
- // Read float.
- Float bigFloat = memento.getFloat("float");
- testCase.assertNotNull(bigFloat);
- testCase.assertEquals(bigFloat.floatValue(), 0.50f, 0.0001);
-
- // Read int.
- Integer bigInt = memento.getInteger("integer");
- testCase.assertEquals(bigInt, new Integer(50));
-
- // Read string.
- String str = memento.getString("string");
- testCase.assertEquals(str, "50");
-
- // Read single child.
- IMemento child = memento.getChild("single");
- testCase.assertNotNull(child);
- bigInt = child.getInteger("id");
- testCase.assertEquals(bigInt, new Integer(1));
-
- // Read multiple children.
- bigInt = memento.getInteger("multiple.count");
- testCase.assertNotNull(bigInt);
- int count = bigInt.intValue();
- IMemento [] children = memento.getChildren("multiple");
- testCase.assertEquals(count, children.length);
- for (int nX = 0; nX < count; nX ++) {
- child = children[nX];
- testCase.assertNotNull(child);
- bigInt = child.getInteger("id");
- testCase.assertEquals(bigInt, new Integer(nX));
- }
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ImportOperationTestCase.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ImportOperationTestCase.java deleted file mode 100644 index 625fcb00eb6..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ImportOperationTestCase.java +++ /dev/null @@ -1,124 +0,0 @@ -package org.eclipse.ui.tests.datatransfer;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.ui.dialogs.IOverwriteQuery;
-import org.eclipse.ui.tests.util.FileUtil;
-import org.eclipse.ui.tests.util.UITestCase;
-import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
-import org.eclipse.ui.wizards.datatransfer.ImportOperation;
-
-public class ImportOperationTestCase
- extends UITestCase
- implements IOverwriteQuery {
-
- private String localDirectory;
-
- private String[] directoryNames = { "dir1", "dir2" };
-
- private String[] fileNames = { "file1.txt", "file2.txt" };
-
- private IProject project;
-
- public ImportOperationTestCase(String testName) {
- super(testName);
- }
-
- public void setUp() throws Exception {
- Class testClass =
- Class.forName("org.eclipse.ui.tests.datatransfer.ImportOperationTestCase");
- InputStream stream = testClass.getResourceAsStream("tests.ini");
- Properties properties = new Properties();
- properties.load(stream);
- localDirectory = properties.getProperty("localSource");
- setUpDirectory();
- super.setUp();
- }
-
- public void testImportAll() throws Exception {
-
- project = FileUtil.createProject("ImportAll");
- File element = new File(localDirectory);
- List importElements = new ArrayList();
- importElements.add(element);
- ImportOperation operation =
- new ImportOperation(
- project.getFullPath(),
- FileSystemStructureProvider.INSTANCE,
- this,
- importElements);
- openTestWindow().run(true,true,operation);
- }
-
- /**
- * Set up the directories and files used for the test.
- */
-
- private void setUpDirectory() throws IOException {
- File rootDirectory = new File(localDirectory);
- rootDirectory.mkdir();
- for (int i = 0; i < directoryNames.length; i++) {
- createSubDirectory(localDirectory, directoryNames[i]);
- }
- }
-
- private void createSubDirectory(String parentName, String newDirName)
- throws IOException {
- String newDirPath = parentName + File.separatorChar + newDirName;
- File newDir = new File(newDirPath);
- newDir.mkdir();
- for (int i = 0; i < directoryNames.length; i++) {
- createFile(newDirPath, fileNames[i]);
- }
- }
-
- private void createFile(String parentName, String filePath)
- throws IOException {
- String newFilePath = parentName + File.separatorChar + filePath;
- File newFile = new File(newFilePath);
- newFile.createNewFile();
- }
-
- /*
- * @see IOverwriteQuery#queryOverwrite(String)
- */
- public String queryOverwrite(String pathString) {
- //Always return an empty String - we aren't
- //doing anything interesting
- return "";
- }
-
- /**
- * Tear down. Delete the project we created and all of the
- * files on the file system.
- */
- public void tearDown() throws Exception {
- super.tearDown();
- try {
- project.delete(true,true,null);
- File topDirectory = new File(localDirectory);
- deleteDirectory(topDirectory);
- }
- catch (CoreException e) {
- fail(e.toString());
- }
- }
-
- private void deleteDirectory(File directory){
- File[] children = directory.listFiles();
- for(int i = 0; i < children.length; i ++){
- if(children[i].isDirectory())
- deleteDirectory(children[i]);
- else
- children[i].delete();
- }
- directory.delete();
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/tests.ini b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/tests.ini deleted file mode 100644 index e4700399d9d..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/tests.ini +++ /dev/null @@ -1,2 +0,0 @@ -localSource=c:/test
-networkSource=q:/viper/team/test
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/DataTransferMessagesCopy.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/DataTransferMessagesCopy.java deleted file mode 100644 index 494e25c346f..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/DataTransferMessagesCopy.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-/* THIS IS A COPY OF DataTransferMessages
- * It is made available for UI testing.
- */
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Utility class which helps managing messages
- */
-public class DataTransferMessagesCopy {
- private static final String RESOURCE_BUNDLE= "org.eclipse.ui.wizards.datatransfer.messages";//$NON-NLS-1$
- private static ResourceBundle bundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
-private DataTransferMessagesCopy(){
- // prevent instantiation of class
-}
-/**
- * Returns the formatted message for the given key in
- * the resource bundle.
- *
- * @param key the resource name
- * @param args the message arguments
- * @return the string
- */
-public static String format(String key, Object[] args) {
- return MessageFormat.format(getString(key),args);
-}
-/**
- * Returns the resource object with the given key in
- * the resource bundle. If there isn't any value under
- * the given key, the key is returned.
- *
- * @param key the resource name
- * @return the string
- */
-public static String getString(String key) {
- try {
- return bundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- }
-}
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/DataTransferTestStub.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/DataTransferTestStub.java deleted file mode 100644 index 372586ec493..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/DataTransferTestStub.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.ui.IWorkbench;
-
-/**
- * FOR USE BY TESTS ONLY!
- * <p>
- * Stub class that provides access to classes visible to the package
- * <code>org.eclipse.ui.wizards.datatransfer</code>. For the purpose
- * of testing.
- * </p>
- * @private
- */
-public class DataTransferTestStub {
- //Prevent instantiation
- private DataTransferTestStub(){}
-
- /**
- * Gives access to an instance of WizardFileSystemResourceExportPage1.
- * @return IWizardPage an instance of WizardFileSystemResourceExportPage1
- */
-/**
- * 1GJWD2E: ITPUI:ALL - Test classes should not be released in public packages.
- *
- public static IWizardPage newFileSystemResourceExportPage1(IStructuredSelection selection) {
- return new WizardFileSystemResourceExportPage1(selection);
- }
- */
- /**
- * Gives access to an instance of WizardFileSystemResourceImportPage1.
- * @return IWizardPage an instance of WizardFileSystemResourceImportPage1
- */
-/**
- * 1GJWD2E: ITPUI:ALL - Test classes should not be released in public packages.
- *
- public static IWizardPage newFileSystemResourceImportPage1(IWorkbench workbench, IStructuredSelection selection) {
- return new WizardFileSystemResourceImportPage1(workbench, selection);
- }
- */
- /**
- * Gives access to an instance of WizardZipFileResourceExportPage1.
- * @return IWizardPage an instance of WizardZipFileResourceExportPage1
- */
-/**
- * 1GJWD2E: ITPUI:ALL - Test classes should not be released in public packages.
- *
- public static IWizardPage newZipFileResourceExportPage1(IStructuredSelection selection) {
- return new WizardZipFileResourceExportPage1(selection);
- }
- */
- /**
- * Gives access to an instance of WizardZipFileResourceImportPage1.
- * @return IWizardPage an instance of WizardZipFileResourceImportPage1
- */
-/**
- * 1GJWD2E: ITPUI:ALL - Test classes should not be released in public packages.
- *
- public static IWizardPage newZipFileResourceImportPage1(IStructuredSelection selection) {
- return new WizardZipFileResourceExportPage1(selection);
- }
- */
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/EnableTestPreferencePage.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/EnableTestPreferencePage.java deleted file mode 100644 index 0a30383823a..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/EnableTestPreferencePage.java +++ /dev/null @@ -1,139 +0,0 @@ -package org.eclipse.ui.tests.dialogs; - -import org.eclipse.jface.preference.*; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.widgets.*; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -public class EnableTestPreferencePage - extends FieldEditorPreferencePage - implements IWorkbenchPreferencePage { - - private BooleanFieldEditor be; - private ColorFieldEditor ce; - private FontFieldEditor fe; - private PathEditor pe; - private RadioGroupFieldEditor rg; - private StringFieldEditor se; - - private Composite beParent; - private Composite ceParent; - private Composite feParent; - private Composite peParent; - private Composite rgParent; - private Composite seParent; - - private boolean enabledState = true; - - public EnableTestPreferencePage() { - super(GRID); - } - - public void flipState() { - if (enabledState) - enabledState = false; - else - enabledState = true; - - be.setEnabled(enabledState, beParent); - ce.setEnabled(enabledState, ceParent); - fe.setEnabled(enabledState, feParent); - pe.setEnabled(enabledState, peParent); - rg.setEnabled(enabledState, rgParent); - se.setEnabled(enabledState, seParent); - - } - - /** - * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors() - */ - protected void createFieldEditors() { - - String[][] labelsAndValues = - new String[][] { { "Label 1", "Value 1" }, { - "Label 2", "Value 2" } - }; - - beParent = getFieldEditorParent(); - be = - new BooleanFieldEditor( - "BooleanValue", - "BooleanTest", - beParent); - addField(be); - - ceParent = getFieldEditorParent(); - ce = - new ColorFieldEditor( - "ColorValue", - "Color Test", - ceParent); - addField(ce); - - feParent = getFieldEditorParent(); - fe = - new FontFieldEditor( - "FontValue", - "Font Test", - feParent); - addField(fe); - - peParent = getFieldEditorParent(); - pe = - new PathEditor( - "PathValue", - "Path Test", - "C:\temp", - peParent); - addField(pe); - - rgParent = getFieldEditorParent(); - rg = - new RadioGroupFieldEditor( - "Radio Value", - "Radio Test", - 2, - labelsAndValues, - rgParent); - addField(rg); - - seParent = getFieldEditorParent(); - se = - new StringFieldEditor( - "String Value", - "String Editor", - seParent); - addField(se); - - } - - /* (non-Javadoc) - * Method declared on PreferencePage. - */ - protected Control createContents(Composite parent) { - Composite composite = (Composite) super.createContents(parent); - Button enabledButton = new Button(parent, SWT.PUSH); - enabledButton.setText("Switch Enabled State"); - - enabledButton.addSelectionListener(new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - flipState(); - } - - public void widgetDefaultSelected(SelectionEvent e) { - flipState(); - } - }); - return composite; - } - - /** - * @see org.eclipse.ui.IWorkbenchPreferencePage#init(IWorkbench) - */ - public void init(IWorkbench workbench) { - } - -}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/NavigatorTestStub.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/NavigatorTestStub.java deleted file mode 100644 index 5059bd2d242..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/NavigatorTestStub.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * FOR USE BY TESTS ONLY!
- * <p>
- * Stub class that provides access to classes visible to the package
- * <code>org.eclipse.ui.views.navigator</code>. For the purpose of
- * testing.
- * </p>
- * @private
- */
-
-public class NavigatorTestStub {
- //Prevent instantiation
- private NavigatorTestStub(){}
-
- /**
- * Gives access to an instance of GotoResourceDialog.
- * @return GotoResourceDialog an instance of GotoResourceDialog.
- */
-/**
- * 1GJWD2E: ITPUI:ALL - Test classes should not be released in public packages.
- *
- public static GotoResourceDialog newGotoResourceDialog(Shell parentShell,IResource[] resources) {
- return new GotoResourceDialog(parentShell, resources);
- }
- */
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/PreferenceDialogWrapper.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/PreferenceDialogWrapper.java deleted file mode 100644 index 6764205e7de..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/PreferenceDialogWrapper.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-import org.eclipse.jface.preference.*;
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.swt.widgets.Shell;
-
-public class PreferenceDialogWrapper extends PreferenceDialog {
-
- public PreferenceDialogWrapper(
- Shell parentShell,
- PreferenceManager manager) {
- super(parentShell, manager);
- }
- protected boolean showPage(IPreferenceNode node) {
- return super.showPage(node);
- }
-
- public IPreferencePage getPage(IPreferenceNode node) {
- if (node == null)
- return null;
-
- // Create the page if nessessary
- if (node.getPage() == null)
- node.createPage();
-
- if (node.getPage() == null)
- return null;
-
- return node.getPage();
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/PropertyDialogWrapper.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/PropertyDialogWrapper.java deleted file mode 100644 index 3892ceab0b1..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/PropertyDialogWrapper.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.internal.dialogs.PropertyDialog;
-
-
-public class PropertyDialogWrapper extends PropertyDialog {
-
- public PropertyDialogWrapper(Shell parentShell, PreferenceManager manager, ISelection selection) {
- super(parentShell, manager, selection);
- }
- protected boolean showPage(IPreferenceNode node) {
- return super.showPage(node);
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/ResourceMessagesCopy.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/ResourceMessagesCopy.java deleted file mode 100644 index ca72d4d065e..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/ResourceMessagesCopy.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Utility class which helps managing messages
- */
-public class ResourceMessagesCopy {
- private static final String RESOURCE_BUNDLE= "org.eclipse.ui.wizards.newresource.messages";//$NON-NLS-1$
- private static ResourceBundle bundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
-private ResourceMessagesCopy(){
- // prevent instantiation of class
-}
-/**
- * Returns the formatted message for the given key in
- * the resource bundle.
- *
- * @param key the resource name
- * @param args the message arguments
- * @return the string
- */
-public static String format(String key, Object[] args) {
- return MessageFormat.format(getString(key),args);
-}
-/**
- * Returns the resource object with the given key in
- * the resource bundle. If there isn't any value under
- * the given key, the key is returned.
- *
- * @param key the resource name
- * @return the string
- */
-public static String getString(String key) {
- try {
- return bundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- }
-}
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/ResourceNavigatorMessagesCopy.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/ResourceNavigatorMessagesCopy.java deleted file mode 100644 index af38ebaacad..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/ResourceNavigatorMessagesCopy.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-/* THIS IS A COPY OF ResourceNavigatorMessages Class
- * It is made available for UI testing.
- */
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Utility class which helps managing messages
- */
-public class ResourceNavigatorMessagesCopy {
- private static final String RESOURCE_BUNDLE= "org.eclipse.ui.views.navigator.messages";//$NON-NLS-1$
- private static ResourceBundle bundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
-private ResourceNavigatorMessagesCopy(){
- // prevent instantiation of class
-}
-/**
- * Returns the formatted message for the given key in
- * the resource bundle.
- *
- * @param key the resource name
- * @param args the message arguments
- * @return the string
- */
-public static String format(String key, Object[] args) {
- return MessageFormat.format(getString(key),args);
-}
-/**
- * Returns the resource object with the given key in
- * the resource bundle. If there isn't any value under
- * the given key, the key is returned.
- *
- * @param key the resource name
- * @return the string
- */
-public static String getString(String key) {
- try {
- return bundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- }
-}
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/TaskListTestStub.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/TaskListTestStub.java deleted file mode 100644 index 7592d8d0ba0..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/TaskListTestStub.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * FOR USE BY TESTS ONLY!
- * <p>
- * Stub class that provides access to classes visible to the package
- * <code>org.eclipse.ui.views.tasklist</code>. For the purpose
- * of testing.
- * </p>
- * @private
- */
-public class TaskListTestStub {
- //Prevent instantiation
- private TaskListTestStub(){}
-
- /**
- * Gives access to an instance of FiltersDialog.
- * @return FiltersDialog an instance of FiltersDialog.
- */
-/**
- * 1GJWD2E: ITPUI:ALL - Test classes should not be released in public packages.
- *
- public static FiltersDialog newFiltersDialog(Shell parentShell) {
- return new FiltersDialog(parentShell);
- }
- */
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/TextEditorTestStub.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/TextEditorTestStub.java deleted file mode 100644 index d7897b99edd..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/TextEditorTestStub.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * FOR USE BY TESTS ONLY!
- * <p>
- * Stub class that provides access to classes visible to the package
- * <code>org.eclipse.ui.texteditor</code>. For the purpose of
- * testing.
- * </p>
- * @private
- */
-
-public class TextEditorTestStub {
- //Prevent instantiation
- private TextEditorTestStub(){}
-
- /**
- * Gives access to an instance of FindReplaceDialog.
- * @return FindReplaceDialog an instance of FindReplaceDialog.
- */
-/**
- * 1GJWD2E: ITPUI:ALL - Test classes should not be released in public packages.
- *
- public static FindReplaceDialog newFindReplaceDialog(Shell parentShell) {
- return new FindReplaceDialog(parentShell);
- }
- */
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIAutomatedSuite.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIAutomatedSuite.java deleted file mode 100644 index e87fd2bd04d..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIAutomatedSuite.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-import junit.framework.*;
-import junit.textui.TestRunner;
-
-
-/**
- * Test all areas of the UI.
- */
-public class UIAutomatedSuite extends TestSuite {
-
- /**
- * Returns the suite. This is required to
- * use the JUnit Launcher.
- */
- public static Test suite() {
- return new UIAutomatedSuite();
- }
-
- /**
- * Construct the test suite.
- */
- public UIAutomatedSuite() {
- addTest(new TestSuite(UIDialogsAuto.class));
- addTest(new TestSuite(UIWizardsAuto.class));
- addTest(new TestSuite(UIPreferencesAuto.class));
- addTest(new TestSuite(UIMessageDialogsAuto.class));
- addTest(new TestSuite(UINewWorkingSetWizardAuto.class));
- addTest(new TestSuite(UIEditWorkingSetWizardAuto.class));
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogs.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogs.java deleted file mode 100644 index c01511ef0eb..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogs.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-import junit.framework.TestCase;
-import org.eclipse.core.resources.*;
-import org.eclipse.jface.dialogs.*;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.*;
-import org.eclipse.ui.dialogs.*;
-import org.eclipse.ui.internal.*;
-import org.eclipse.ui.internal.dialogs.*;
-import org.eclipse.ui.internal.model.AdaptableList;
-import org.eclipse.ui.internal.registry.*;
-import org.eclipse.ui.tests.util.DialogCheck;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-
-public class UIDialogs extends TestCase {
- private static final String PROJECT_SELECTION_MESSAGE = WorkbenchMessages.getString("BuildOrderPreference.selectOtherProjects");
- private static final String FILTER_SELECTION_MESSAGE = ResourceNavigatorMessagesCopy.getString("FilterSelection.message");
-
- public UIDialogs(String name) {
- super(name);
- }
- private Shell getShell() {
- return DialogCheck.getShell();
- }
- private IWorkbench getWorkbench() {
- return WorkbenchPlugin.getDefault().getWorkbench();
- }
- public void testAbout() {
- Dialog dialog = new AboutDialog( getShell() );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testAddProjects() {
- Dialog dialog = new ListSelectionDialog(getShell(),
- null,
- new SimpleListContentProvider(),
- new LabelProvider(),
- PROJECT_SELECTION_MESSAGE
- );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testCopyMoveProject() {
- IProject dummyProject = ResourcesPlugin.getWorkspace().getRoot().getProject("DummyProject");
- Dialog dialog = new ProjectLocationSelectionDialog(getShell(), dummyProject);
- DialogCheck.assertDialog(dialog, this);
- }
- public void testCopyMoveResource() {
- Dialog dialog = new ContainerSelectionDialog( getShell(), null, true, WorkbenchMessages.getString("CopyResourceAction.selectDestination") );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testEditActionSetsDialog() {
- Dialog dialog;
- Perspective persp = null;
- //Test perspective: use current perspective of test case
- try {/*fixme: should try to get current perspective, or default; currently only
- gets first perspective in the registry.*/
- persp = new Perspective((PerspectiveDescriptor)getWorkbench().getPerspectiveRegistry().getPerspectives()[0],
- (WorkbenchPage)getWorkbench().getActiveWorkbenchWindow().getActivePage()
- );
- dialog = new ActionSetSelectionDialog(getShell(), persp);
- } catch (WorkbenchException e) {
- dialog = null;
- }
- DialogCheck.assertDialog(dialog, this);
- if (persp != null) {
- persp.dispose();
- }
- }
- public void testEditorSelection() {
- Dialog dialog = new EditorSelectionDialog( getShell() );
- DialogCheck.assertDialog(dialog, this);
- }
-/**
- * 1GJWD2E: ITPUI:ALL - Test classes should not be released in public packages.
- *
- public void testFindReplace() {
- Dialog dialog = TextEditorTestStub.newFindReplaceDialog( getShell() );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testGotoResource() {
- Dialog dialog = NavigatorTestStub.newGotoResourceDialog(getShell(), new IResource[0]);
- DialogCheck.assertDialog(dialog, this);
- }
- */
- public void testNavigatorFilter() {
- Dialog dialog = new ListSelectionDialog(getShell(), null, new SimpleListContentProvider(), new LabelProvider(), FILTER_SELECTION_MESSAGE);
- DialogCheck.assertDialog(dialog, this);
- }
- public void testNewFileType() {
- Dialog dialog = new FileExtensionDialog( getShell() );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testProgressInformation() {
- ProgressMonitorDialog dialog = new ProgressMonitorDialog( getShell() );
- dialog.setBlockOnOpen(true);
- DialogCheck.assertDialog(dialog, this);
- }
- public void testSaveAll() {
- YesNoCancelListSelectionDialog dialog = new YesNoCancelListSelectionDialog(
- getShell(),
- new AdaptableList(),
- new WorkbenchContentProvider(),
- new WorkbenchPartLabelProvider(),
- WorkbenchMessages.getString("EditorManager.saveResourcesMessage")
- );
- dialog.setTitle(WorkbenchMessages.getString("EditorManager.saveResourcesTitle"));
- DialogCheck.assertDialog(dialog, this);
- }
- public void testSaveAs() {
- Dialog dialog = new SaveAsDialog( getShell() );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testSavePerspective() {
- PerspectiveRegistry reg = (PerspectiveRegistry)WorkbenchPlugin.getDefault().getPerspectiveRegistry();
- // Get persp name.
- SavePerspectiveDialog dialog = new SavePerspectiveDialog(getShell(), reg);
- IPerspectiveDescriptor description = reg.findPerspectiveWithId( getWorkbench().getActiveWorkbenchWindow().getActivePage().getPerspective().getId() );
- dialog.setInitialSelection(description);
- DialogCheck.assertDialog(dialog, this);
- }
- public void testSelectPerspective() {
- Dialog dialog = new SelectPerspectiveDialog(getShell(), PlatformUI.getWorkbench().getPerspectiveRegistry() );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testSelectTypes() {
- Dialog dialog = new TypeFilteringDialog(getShell(), null);
- DialogCheck.assertDialog(dialog, this);
- }
- public void testShowView() {
- Dialog dialog = new ShowViewDialog( getShell(), WorkbenchPlugin.getDefault().getViewRegistry() );
- DialogCheck.assertDialog(dialog, this);
- }
-/**
- * 1GJWD2E: ITPUI:ALL - Test classes should not be released in public packages.
- *
- public void testTaskFilters() {
- Dialog dialog = TaskListTestStub.newFiltersDialog( getShell() );
- DialogCheck.assertDialog(dialog, this);
- }
- */
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogsAuto.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogsAuto.java deleted file mode 100644 index a508f9d293f..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogsAuto.java +++ /dev/null @@ -1,147 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-import junit.framework.TestCase;
-import org.eclipse.core.resources.*;
-import org.eclipse.jface.dialogs.*;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.*;
-import org.eclipse.ui.dialogs.*;
-import org.eclipse.ui.internal.*;
-import org.eclipse.ui.internal.dialogs.*;
-import org.eclipse.ui.internal.model.AdaptableList;
-import org.eclipse.ui.internal.registry.*;
-import org.eclipse.ui.tests.util.DialogCheck;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-
-
-public class UIDialogsAuto extends TestCase {
- private static final String PROJECT_SELECTION_MESSAGE = WorkbenchMessages.getString("BuildOrderPreference.selectOtherProjects");
- private static final String FILTER_SELECTION_MESSAGE = ResourceNavigatorMessagesCopy.getString("FilterSelection.message");
-
- public UIDialogsAuto(String name) {
- super(name);
- }
- private Shell getShell() {
- return DialogCheck.getShell();
- }
- private IWorkbench getWorkbench() {
- return WorkbenchPlugin.getDefault().getWorkbench();
- }
-
- public void testAbout() {
- Dialog dialog = new AboutDialog( getShell() );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testAddProjects() {
- Dialog dialog = new ListSelectionDialog(getShell(),
- null,
- new SimpleListContentProvider(),
- new LabelProvider(),
- PROJECT_SELECTION_MESSAGE
- );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testCopyMoveProject() {
- IProject dummyProject = ResourcesPlugin.getWorkspace().getRoot().getProject("DummyProject");
- Dialog dialog = new ProjectLocationSelectionDialog(getShell(), dummyProject);
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testCopyMoveResource() {
- Dialog dialog = new ContainerSelectionDialog( getShell(), null, true, WorkbenchMessages.getString("CopyResourceAction.selectDestination") );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testEditActionSetsDialog() {
- Dialog dialog;
- Perspective persp = null;
- //Test perspective: use current perspective of test case
- try {/*fixme: should try to get current perspective, or default; currently only
- gets first perspective in the registry.*/
- persp = new Perspective((PerspectiveDescriptor)getWorkbench().getPerspectiveRegistry().getPerspectives()[0],
- (WorkbenchPage)getWorkbench().getActiveWorkbenchWindow().getActivePage()
- );
- dialog = new ActionSetSelectionDialog(getShell(), persp);
- } catch (WorkbenchException e) {
- dialog = null;
- }
- DialogCheck.assertDialogTexts(dialog, this);
- if (persp != null) {
- persp.dispose();
- }
- }
- public void testEditorSelection() {
- Dialog dialog = new EditorSelectionDialog( getShell() );
- DialogCheck.assertDialogTexts(dialog, this);
- }
-/**
- * 1GJWD2E: ITPUI:ALL - Test classes should not be released in public packages.
- *
- public void testFindReplace() {
- Dialog dialog = TextEditorTestStub.newFindReplaceDialog( getShell() );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testGotoResource() {
- Dialog dialog = NavigatorTestStub.newGotoResourceDialog(getShell(), new IResource[0]);
- DialogCheck.assertDialogTexts(dialog, this);
- }
- */
- public void testNavigatorFilter() {
- Dialog dialog = new ListSelectionDialog(getShell(), null, new SimpleListContentProvider(), new LabelProvider(), FILTER_SELECTION_MESSAGE);
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testNewFileType() {
- Dialog dialog = new FileExtensionDialog( getShell() );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testProgressInformation() {
- ProgressMonitorDialog dialog = new ProgressMonitorDialog( getShell() );
- dialog.setBlockOnOpen(true);
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testSaveAll() {
- YesNoCancelListSelectionDialog dialog = new YesNoCancelListSelectionDialog(
- getShell(),
- new AdaptableList(),
- new WorkbenchContentProvider(),
- new WorkbenchPartLabelProvider(),
- WorkbenchMessages.getString("EditorManager.saveResourcesMessage")
- );
- dialog.setTitle(WorkbenchMessages.getString("EditorManager.saveResourcesTitle"));
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testSaveAs() {
- Dialog dialog = new SaveAsDialog( getShell() );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testSavePerspective() {
- PerspectiveRegistry reg = (PerspectiveRegistry)WorkbenchPlugin.getDefault().getPerspectiveRegistry();
- // Get persp name.
- SavePerspectiveDialog dialog = new SavePerspectiveDialog(getShell(), reg);
- IPerspectiveDescriptor description = reg.findPerspectiveWithId( getWorkbench().getActiveWorkbenchWindow().getActivePage().getPerspective().getId() );
- dialog.setInitialSelection(description);
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testSelectPerspective() {
- Dialog dialog = new SelectPerspectiveDialog(getShell(), PlatformUI.getWorkbench().getPerspectiveRegistry() );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testSelectTypes() {
- Dialog dialog = new TypeFilteringDialog(getShell(), null);
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testShowView() {
- Dialog dialog = new ShowViewDialog( getShell(), WorkbenchPlugin.getDefault().getViewRegistry() );
- DialogCheck.assertDialogTexts(dialog, this);
- }
-/**
- * 1GJWD2E: ITPUI:ALL - Test classes should not be released in public packages.
- *
- public void testTaskFilters() {
- Dialog dialog = TaskListTestStub.newFiltersDialog( getShell() );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- */
-}
-
-
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIEditWorkingSetWizardAuto.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIEditWorkingSetWizardAuto.java deleted file mode 100644 index 2cdb6edb692..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIEditWorkingSetWizardAuto.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.eclipse.ui.tests.dialogs; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.TestCase; -import org.eclipse.core.resources.*; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.jface.viewers.*; -import org.eclipse.jface.wizard.*; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Table; -import org.eclipse.ui.*; -import org.eclipse.ui.dialogs.IWorkingSetPage; -import org.eclipse.ui.dialogs.WizardNewProjectReferencePage; -import org.eclipse.ui.help.WorkbenchHelp; -import org.eclipse.ui.internal.*; -import org.eclipse.ui.internal.dialogs.*; -import org.eclipse.ui.internal.registry.WorkingSetDescriptor; -import org.eclipse.ui.internal.registry.WorkingSetRegistry; -import org.eclipse.ui.tests.util.*; -import org.eclipse.ui.tests.util.ArrayUtil; -import org.eclipse.ui.tests.util.DialogCheck; -import org.eclipse.ui.wizards.newresource.*; - -/** - * Tests the WorkingSetEditWizard - * Tests input validation, presence of correct edit page and - * wizard page texts. - */ -public class UIEditWorkingSetWizardAuto extends UIWorkingSetWizardsAuto { - IWorkingSetPage fDefaultEditPage; - - public UIEditWorkingSetWizardAuto(String name) { - super(name); - } - - /** - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - WorkingSetRegistry registry = WorkbenchPlugin.getDefault().getWorkingSetRegistry(); - fDefaultEditPage = registry.getDefaultWorkingSetPage(); - fWizard = new WorkingSetEditWizard(fDefaultEditPage); - super.setUp(); - } - public void testEditPage() throws Throwable { - IWizardPage page = fWizardDialog.getCurrentPage(); - assertTrue(page instanceof IWorkingSetPage); - - /* - * Verify that correct working set edit page is displayed - */ - assertTrue(page.getClass() == fDefaultEditPage.getClass()); - /* - * Test initial page state - */ - assertTrue(page.canFlipToNextPage() == false); - assertTrue(fWizard.canFinish() == false); - assertNull(page.getErrorMessage()); - /* - * Test page state with preset page input - */ - IWorkingSetManager workingSetManager = fWorkbench.getWorkingSetManager(); - IWorkingSet workingSet = workingSetManager.createWorkingSet(WORKING_SET_NAME_1, new IAdaptable[] {p1, f2}); - ((WorkingSetEditWizard) fWizard).setSelection(workingSet); - - List widgets = getWidgets(fWizardDialog.getShell(), Text.class); - Text text = (Text) widgets.get(0); - assertEquals(WORKING_SET_NAME_1, text.getText()); - assertTrue(page.canFlipToNextPage() == false); - assertTrue(fWizard.canFinish() == false); - assertNull(page.getErrorMessage()); - widgets = getWidgets(fWizardDialog.getShell(), Tree.class); - Tree tree = (Tree) widgets.get(0); - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - assertEquals(workspace.getRoot().getProjects().length, tree.getItemCount()); - setTextWidgetText(WORKING_SET_NAME_2); - assertTrue(fWizard.canFinish()); - - /* - * Test page state with partial page input - */ - setTextWidgetText(""); - assertTrue(page.canFlipToNextPage() == false); - assertTrue(fWizard.canFinish() == false); - assertNotNull(page.getErrorMessage()); - - /* - * Test page state with complete page input - */ - setTextWidgetText(WORKING_SET_NAME_2); - checkTreeItems(); - assertTrue(page.canFlipToNextPage() == false); - assertTrue(fWizard.canFinish()); - assertNull(page.getErrorMessage()); - - fWizard.performFinish(); - workingSet = ((WorkingSetEditWizard) fWizard).getSelection(); - IAdaptable[] workingSetItems = workingSet.getElements(); - assertEquals(WORKING_SET_NAME_2, workingSet.getName()); - assertTrue(ArrayUtil.contains(workingSetItems, p1)); - assertTrue(ArrayUtil.contains(workingSetItems, p2)); - - DialogCheck.assertDialogTexts(fWizardDialog, this); - } -} - diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIInteractiveSuite.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIInteractiveSuite.java deleted file mode 100644 index 4e3f656d66f..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIInteractiveSuite.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-
-import junit.framework.*;
-import junit.textui.TestRunner;
-
-
-/**
- * Test all areas of the UI.
- */
-public class UIInteractiveSuite extends TestSuite {
-
- /**
- * Returns the suite. This is required to
- * use the JUnit Launcher.
- */
- public static Test suite() {
- return new UIInteractiveSuite();
- }
-
- /**
- * Construct the test suite.
- */
- public UIInteractiveSuite() {
- addTest(new TestSuite(UIPreferences.class));
- addTest(new TestSuite(UIWizards.class));
- addTest(new TestSuite(UIDialogs.class));
- addTest(new TestSuite(UIMessageDialogs.class));
- }
-
-
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIMessageDialogs.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIMessageDialogs.java deleted file mode 100644 index 6a942dd2535..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIMessageDialogs.java +++ /dev/null @@ -1,405 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-import java.util.ResourceBundle;
-
-import junit.framework.TestCase;
-import org.eclipse.ui.tests.util.DialogCheck;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.internal.WorkbenchMessages;
-
-public class UIMessageDialogs extends TestCase {
- private static final String DUMMY_RESOURCE = "Dummy.resource";
- private static final String DUMMY_PROJECT = "DummyProject";
- private static final String DUMMY_ABSOLUTE_PATH = "C:\\Dummypath\\Dummy.resource";
- private static final String DUMMY_RELATIVE_PATH = "\\" + DUMMY_PROJECT + "\\" + DUMMY_RESOURCE;
-
- public UIMessageDialogs(String name) {
- super(name);
- }
-
- private Shell getShell() {
- return DialogCheck.getShell();
- }
-
- /**
- * Returns the given string from the Text Editor's resource bundle.
- * Should call org.eclipse.ui.texteditor.EditorMessages directly,
- * but it has package visibility.
- */
- private String getEditorString(String id) {
- ResourceBundle bundle = ResourceBundle.getBundle("org.eclipse.ui.texteditor.EditorMessages");
- assertNotNull("EditorMessages", bundle);
- String string = bundle.getString(id);
- assertNotNull(id, string);
- return string;
- }
-
- /*
- * Convenience method simliar to org.eclipse.jface.dialogs.MessageDialog::openConfirm.
- * The method will return the dialog instead of opening.
- * @param title the dialog's title, or <code>null</code> if none.
- * @param message the message.
- * @return Dialog the confirm dialog.
- */
- private MessageDialog getConfirmDialog(String title, String message) {
- return new MessageDialog(
- getShell(),
- title,
- null,
- message,
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL},
- 0);
- }
- /*
- * Convenience method simliar to org.eclipse.jface.dialogs.MessageDialog::openError.
- * The method will return the dialog instead of opening.
- * @param title the dialog's title, or <code>null</code> if none.
- * @param message the message.
- * @return MessageDialog the error confirm dialog.
- */
- private MessageDialog getErrorDialog(String title, String message) {
- return new MessageDialog(
- getShell(),
- title,
- null,
- message,
- MessageDialog.ERROR,
- new String[] {IDialogConstants.OK_LABEL},
- 0);
- }
- /*
- * Convenience method simliar to org.eclipse.jface.dialogs.MessageDialog::openInformation.
- * The method will return the dialog instead of opening.
- * @param title the dialog's title, or <code>null</code> if none.
- * @param message the message.
- * @return MessageDialog the information dialog.
- */
- private MessageDialog getInformationDialog(String title, String message) {
- return new MessageDialog(
- getShell(),
- title,
- null,
- message,
- MessageDialog.INFORMATION,
- new String[] { IDialogConstants.OK_LABEL },
- 0);
- }
- /*
- * Convenience method simliar to org.eclipse.jface.dialogs.MessageDialog::openQuestion.
- * The method will return the dialog instead of opening.
- * @param title the dialog's title, or <code>null</code> if none.
- * @param message the message.
- * @return MessageDialog the question dialog.
- */
- private MessageDialog getQuestionDialog(String title, String message) {
- return new MessageDialog(
- getShell(),
- title,
- null,
- message,
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL},
- 0);
- }
- /*
- * Convenience method simliar to org.eclipse.jface.dialogs.MessageDialog::getWarningDialog.
- * The method will return the dialog instead of opening.
- * @param title the dialog's title, or <code>null</code> if none.
- * @param message the message.
- * @return MessageDialog the confirm dialog.
- */
- private MessageDialog getWarningDialog(String title, String message) {
- return new MessageDialog(
- getShell(),
- title,
- null,
- message,
- MessageDialog.WARNING,
- new String[] {IDialogConstants.OK_LABEL},
- 0);
- }
-
- public void testAbortPageFlipping() {
- Dialog dialog = getWarningDialog(
- JFaceResources.getString("AbortPageFlippingDialog.title"),
- JFaceResources.getString("AbortPageFlippingDialog.message") );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testCloseFileDeleted() {
- Dialog dialog = getConfirmDialog(
- getEditorString("Editor.error.activated.deleted.close.title"),
- getEditorString("Editor.error.activated.deleted.close.message") );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testCopyOverwrite() {
- Dialog dialog = getQuestionDialog(
- WorkbenchMessages.getString("CopyResourceAction.resourceExists"),
- WorkbenchMessages.format("CopyResourceAction.overwriteQuestion", new Object[] {DUMMY_RELATIVE_PATH}) );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testDeleteProject() {
- String title = WorkbenchMessages.getString("DeleteResourceAction.titleProject");
- String msg = WorkbenchMessages.format("DeleteResourceAction.confirmProject1", new Object[] {DUMMY_PROJECT, DUMMY_ABSOLUTE_PATH});
- Dialog dialog = new MessageDialog(
- getShell(),
- title,
- null, // accept the default window icon
- msg,
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL},
- 0);
- DialogCheck.assertDialog(dialog, this);
- }
- public void testDeleteReadOnlyCheck() {
- Dialog dialog = new MessageDialog(
- getShell(),
- WorkbenchMessages.getString("DeleteResourceAction.checkDelete"),
- null,
- WorkbenchMessages.format("DeleteResourceAction.readOnlyQuestion", new Object[] {DUMMY_RESOURCE}),
- MessageDialog.QUESTION,
- new String[] {
- IDialogConstants.YES_LABEL,
- IDialogConstants.YES_TO_ALL_LABEL,
- IDialogConstants.NO_LABEL,
- IDialogConstants.CANCEL_LABEL },
- 0);
- DialogCheck.assertDialog(dialog, this);
- }
- public void testDeleteResource() {
- Dialog dialog = getQuestionDialog(
- WorkbenchMessages.getString("DeleteResourceAction.title"),
- WorkbenchMessages.format("DeleteResourceAction.confirm1", new Object[] {DUMMY_RESOURCE}) );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testDeleteResources() {
- Dialog dialog = getQuestionDialog(
- WorkbenchMessages.getString("DeleteResourceAction.title"),
- WorkbenchMessages.format("DeleteResourceAction.confirmN", new Object[] {DUMMY_RESOURCE}) );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testDropOverwrite() {
- Dialog dialog = new MessageDialog(
- getShell(),
- ResourceNavigatorMessagesCopy.getString("DropAdapter.question"),
- null,
- ResourceNavigatorMessagesCopy.format("DropAdapter.overwriteQuery", new Object[] {DUMMY_RELATIVE_PATH}),
- MessageDialog.QUESTION,
- new String[] {
- IDialogConstants.YES_LABEL,
- IDialogConstants.YES_TO_ALL_LABEL,
- IDialogConstants.NO_LABEL,
- IDialogConstants.CANCEL_LABEL},
- 0);
- DialogCheck.assertDialog(dialog, this);
- }
- public void testErrorClosing() {
- Dialog dialog = getQuestionDialog(
- WorkbenchMessages.getString("Error"),
- WorkbenchMessages.getString("ErrorClosingNoArg") );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testFileChanged() {
- MessageDialog dialog = getQuestionDialog(
- getEditorString("Editor.error.activated.outofsync.title"),
- getEditorString("Editor.error.activated.outofsync.message") );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testFileExtensionEmpty() {
- Dialog dialog = getInformationDialog(
- WorkbenchMessages.getString("FileEditorPreference.extensionEmptyTitle"),
- WorkbenchMessages.getString("FileEditorPreference.extensionEmptyMessage") );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testFileNameWrong() {
- Dialog dialog = getInformationDialog(
- WorkbenchMessages.getString("FileEditorPreference.fileNameInvalidTitle"),
- WorkbenchMessages.getString("FileEditorPreference.fileNameInvalidMessage") );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testFileTypeExists() {
- Dialog dialog = getInformationDialog(
- WorkbenchMessages.getString("FileEditorPreference.existsTitle"),
- WorkbenchMessages.getString("FileEditorPreference.existsMessage") );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testInvalidType_1() {
- Dialog dialog = getWarningDialog(
- WorkbenchMessages.getString("FileExtension.invalidTitle"),
- WorkbenchMessages.getString("FileExtension.invalidMessage") );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testInvalidType_2() {
- Dialog dialog = getWarningDialog(
- WorkbenchMessages.getString("FileExtension.invalidType"),
- WorkbenchMessages.getString("FileExtension.invalidTypeMessage") );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testMoveReadOnlyCheck() {
- Dialog dialog = new MessageDialog(
- getShell(),
- WorkbenchMessages.getString("MoveResourceAction.title"),
- null,
- WorkbenchMessages.format("MoveResourceAction.checkMoveMessage", new Object[] {DUMMY_RESOURCE}),
- MessageDialog.QUESTION,
- new String[] {
- IDialogConstants.YES_LABEL,
- IDialogConstants.YES_TO_ALL_LABEL,
- IDialogConstants.NO_LABEL,
- IDialogConstants.CANCEL_LABEL },
- 0);
- DialogCheck.assertDialog(dialog, this);
- }
- /*
- public void testNoBuilders() {
- Dialog dialog = getWarningDialog(
- WorkbenchMessages.getString("BuildAction.warning"),
- WorkbenchMessages.getString("BuildAction.noBuilders") );
- DialogCheck.assertDialog(dialog, this);
- }
- */
- /*
- public void testNoGlobalBuildersDialog() {
- Dialog dialog = getWarningDialog(
- WorkbenchMessages.getString("GlobalBuildAction.warning"),
- WorkbenchMessages.getString("GlobalBuildAction.noBuilders") );
- DialogCheck.assertDialog(dialog, this);
- }
- */
- public void testNoPropertyPage() {
- Dialog dialog = getInformationDialog(
- WorkbenchMessages.getString("PropertyDialog.messageTitle"),
- WorkbenchMessages.format("PropertyDialog.noPropertyMessage", new Object[] {"DummyPropertyPage"}) );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testNoSelectedExportResources() {
- Dialog dialog = getInformationDialog(
- DataTransferMessagesCopy.getString("DataTransfer.information"),
- DataTransferMessagesCopy.getString("FileExport.noneSelected") );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testNoSelectedImportResources() {
- Dialog dialog = getInformationDialog(
- DataTransferMessagesCopy.getString("DataTransfer.information"),
- DataTransferMessagesCopy.getString("FileImport.noneSelected") );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testOperationNotAvailable() {
- Dialog dialog = getInformationDialog(
- WorkbenchMessages.getString("Information"),
- WorkbenchMessages.getString("PluginActino.operationNotAvailableMessage") );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testOverwritePerspective() {
- Dialog dialog = new MessageDialog(
- getShell(),
- WorkbenchMessages.getString("SavePerspective.overwriteTitle"),
- null,
- WorkbenchMessages.format("SavePerspective.overwriteQuestion", new Object[] {"Dummy Perspective"}),
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL},
- 0);
- DialogCheck.assertDialog(dialog, this);
- }
- public void testRefreshDeleteProject() {
- Dialog dialog = new MessageDialog(
- getShell(),
- WorkbenchMessages.getString("RefreshAction.dialogTitle"),
- null,
- WorkbenchMessages.format("RefreshAction.locationDeletedMessage", new Object[] {DUMMY_PROJECT, "c:\\dummypath\\" + DUMMY_PROJECT}),
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL},
- 0);
- DialogCheck.assertDialogTexts(dialog, this);
- DialogCheck.assertDialog(dialog, this);
- }
- public void testRenameOverwrite() {
- Dialog dialog = getQuestionDialog(
- WorkbenchMessages.getString("RenameResourceAction.resourceExists"),
- WorkbenchMessages.format("RenameResourceAction.overwriteQuestion", new Object[] {DUMMY_RELATIVE_PATH}) );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testResetPerspective() {
- Dialog dialog = new MessageDialog(
- getShell(),
- WorkbenchMessages.getString("ResetPerspective.title"),
- null,
- WorkbenchMessages.format("ResetPerspective.message", new Object[] {"Dummy Perspective"}),
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL},
- 0);
- DialogCheck.assertDialog(dialog, this);
- }
- public void testSaveAsOverwrite() {
- Dialog dialog = new MessageDialog(
- getShell(),
- WorkbenchMessages.getString("Question"),
- null,
- WorkbenchMessages.format("SaveAsDialog.overwriteQuestion", new Object[] {DUMMY_RELATIVE_PATH}),
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL},
- 0);
- DialogCheck.assertDialog(dialog, this);
- }
- public void testSaveChanges() {
- Dialog dialog = new MessageDialog(
- getShell(),
- WorkbenchMessages.getString("Save_Resource"),
- null,
- WorkbenchMessages.format("EditorManager.saveChangesQuestion", new Object[] {DUMMY_RESOURCE}),
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL},
- 0);
- DialogCheck.assertDialog(dialog, this);
- }
- public void testSaveFileDeleted() {
- MessageDialog dialog = new MessageDialog(
- getShell(),
- getEditorString("Editor.error.activated.deleted.save.title"),
- null,
- getEditorString("Editor.error.activated.deleted.save.message"),
- MessageDialog.QUESTION,
- new String[] {
- getEditorString("Editor.error.activated.deleted.save.button.save"),
- getEditorString("Editor.error.activated.deleted.save.button.close")},
- 0);
- DialogCheck.assertDialog(dialog, this);
- }
- public void testUpdateConflict() {
- MessageDialog dialog = getQuestionDialog(
- getEditorString("Editor.error.save.outofsync.title"),
- getEditorString("Editor.error.save.outofsync.message") );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testWizardClosing() {
- Dialog dialog = new MessageDialog(
- getShell(),
- JFaceResources.getString("WizardClosingDialog.title"),
- null,
- JFaceResources.getString("WizardClosingDialog.message"),
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.OK_LABEL},
- 0);
- DialogCheck.assertDialog(dialog, this);
- }
- public void testWizardOverwrite() {
- Dialog dialog = new MessageDialog(
- getShell(),
- WorkbenchMessages.getString("Question"),
- null,
- WorkbenchMessages.format("WizardDataTransfer.existsQuestion", new Object[] {DUMMY_ABSOLUTE_PATH}),
- MessageDialog.QUESTION,
- new String[] {
- IDialogConstants.YES_LABEL,
- IDialogConstants.YES_TO_ALL_LABEL,
- IDialogConstants.NO_LABEL,
- IDialogConstants.CANCEL_LABEL},
- 0);
- DialogCheck.assertDialog(dialog, this);
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIMessageDialogsAuto.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIMessageDialogsAuto.java deleted file mode 100644 index 02941fc3bcf..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIMessageDialogsAuto.java +++ /dev/null @@ -1,404 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-import java.util.ResourceBundle;
-
-import junit.framework.TestCase;
-import org.eclipse.jface.dialogs.*;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.internal.WorkbenchMessages;
-import org.eclipse.ui.tests.util.DialogCheck;
-
-
-public class UIMessageDialogsAuto extends TestCase {
- private static final String DUMMY_RESOURCE = "Dummy.resource";
- private static final String DUMMY_PROJECT = "DummyProject";
- private static final String DUMMY_ABSOLUTE_PATH = "C:\\Dummypath\\Dummy.resource";
- private static final String DUMMY_RELATIVE_PATH = "\\" + DUMMY_PROJECT + "\\" + DUMMY_RESOURCE;
-
- public UIMessageDialogsAuto(String name) {
- super(name);
- }
- private Shell getShell() {
- return DialogCheck.getShell();
- }
-
- /*
- * Convenience method simliar to org.eclipse.jface.dialogs.MessageDialog::openConfirm.
- * The method will return the dialog instead of opening.
- * @param title the dialog's title, or <code>null</code> if none.
- * @param message the message.
- * @return Dialog the confirm dialog.
- */
- private MessageDialog getConfirmDialog(String title, String message) {
- return new MessageDialog(
- getShell(),
- title,
- null,
- message,
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL},
- 0);
- }
- /*
- * Convenience method simliar to org.eclipse.jface.dialogs.MessageDialog::openError.
- * The method will return the dialog instead of opening.
- * @param title the dialog's title, or <code>null</code> if none.
- * @param message the message.
- * @return MessageDialog the error confirm dialog.
- */
- private MessageDialog getErrorDialog(String title, String message) {
- return new MessageDialog(
- getShell(),
- title,
- null,
- message,
- MessageDialog.ERROR,
- new String[] {IDialogConstants.OK_LABEL},
- 0);
- }
- /*
- * Convenience method simliar to org.eclipse.jface.dialogs.MessageDialog::openInformation.
- * The method will return the dialog instead of opening.
- * @param title the dialog's title, or <code>null</code> if none.
- * @param message the message.
- * @return MessageDialog the information dialog.
- */
- private MessageDialog getInformationDialog(String title, String message) {
- return new MessageDialog(
- getShell(),
- title,
- null,
- message,
- MessageDialog.INFORMATION,
- new String[] { IDialogConstants.OK_LABEL },
- 0);
- }
- /*
- * Convenience method simliar to org.eclipse.jface.dialogs.MessageDialog::openQuestion.
- * The method will return the dialog instead of opening.
- * @param title the dialog's title, or <code>null</code> if none.
- * @param message the message.
- * @return MessageDialog the question dialog.
- */
- private MessageDialog getQuestionDialog(String title, String message) {
- return new MessageDialog(
- getShell(),
- title,
- null,
- message,
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL},
- 0);
- }
- /*
- * Convenience method simliar to org.eclipse.jface.dialogs.MessageDialog::getWarningDialog.
- * The method will return the dialog instead of opening.
- * @param title the dialog's title, or <code>null</code> if none.
- * @param message the message.
- * @return MessageDialog the confirm dialog.
- */
- private MessageDialog getWarningDialog(String title, String message) {
- return new MessageDialog(
- getShell(),
- title,
- null,
- message,
- MessageDialog.WARNING,
- new String[] {IDialogConstants.OK_LABEL},
- 0);
- }
-
- public void testAbortPageFlipping() {
- Dialog dialog = getWarningDialog (
- JFaceResources.getString("AbortPageFlippingDialog.title"),
- JFaceResources.getString("AbortPageFlippingDialog.message") );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testCloseFileDeleted() {
- Dialog dialog = null;
- ResourceBundle bundle = ResourceBundle.getBundle("org.eclipse.ui.texteditor.EditorMessages");
- if (bundle != null) {
- dialog = getConfirmDialog(
- bundle.getString("Editor.error.activated.deleted.close.title"),
- bundle.getString("Editor.error.activated.deleted.close.message") );
- }
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testCopyOverwrite() {
- Dialog dialog = getQuestionDialog(
- WorkbenchMessages.getString("CopyResourceAction.resourceExists"),
- WorkbenchMessages.format("CopyResourceAction.overwriteQuestion", new Object[] {DUMMY_RELATIVE_PATH}) );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testDeleteProject() {
- String title = WorkbenchMessages.getString("DeleteResourceAction.titleProject");
- String msg = WorkbenchMessages.format("DeleteResourceAction.confirmProject1", new Object[] {DUMMY_PROJECT, DUMMY_ABSOLUTE_PATH});
- Dialog dialog = new MessageDialog(
- getShell(),
- title,
- null, // accept the default window icon
- msg,
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL},
- 0);
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testDeleteReadOnlyCheck() {
- Dialog dialog = new MessageDialog(
- getShell(),
- WorkbenchMessages.getString("DeleteResourceAction.checkDelete"),
- null,
- WorkbenchMessages.format("DeleteResourceAction.readOnlyQuestion", new Object[] {DUMMY_RESOURCE}),
- MessageDialog.QUESTION,
- new String[] {
- IDialogConstants.YES_LABEL,
- IDialogConstants.YES_TO_ALL_LABEL,
- IDialogConstants.NO_LABEL,
- IDialogConstants.CANCEL_LABEL },
- 0);
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testDeleteResource() {
- Dialog dialog = getQuestionDialog(
- WorkbenchMessages.getString("DeleteResourceAction.title"),
- WorkbenchMessages.format("DeleteResourceAction.confirm1", new Object[] {DUMMY_RESOURCE}) );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testDeleteResources() {
- Dialog dialog = getQuestionDialog(
- WorkbenchMessages.getString("DeleteResourceAction.title"),
- WorkbenchMessages.format("DeleteResourceAction.confirmN", new Object[] {DUMMY_RESOURCE}) );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testDropOverwrite() {
- Dialog dialog = new MessageDialog(
- getShell(),
- ResourceNavigatorMessagesCopy.getString("DropAdapter.question"),
- null,
- ResourceNavigatorMessagesCopy.format("DropAdapter.overwriteQuery", new Object[] {DUMMY_RELATIVE_PATH}),
- MessageDialog.QUESTION,
- new String[] {
- IDialogConstants.YES_LABEL,
- IDialogConstants.YES_TO_ALL_LABEL,
- IDialogConstants.NO_LABEL,
- IDialogConstants.CANCEL_LABEL},
- 0);
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testErrorClosing() {
- Dialog dialog = getQuestionDialog(
- WorkbenchMessages.getString("Error"),
- WorkbenchMessages.getString("ErrorClosingNoArg") );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testFileChanged() {
- MessageDialog dialog = null;
- ResourceBundle bundle = ResourceBundle.getBundle("org.eclipse.ui.texteditor.EditorMessages");
- if (bundle != null) {
- dialog = getQuestionDialog(
- bundle.getString("Editor.error.activated.outofsync.title"),
- bundle.getString("Editor.error.activated.outofsync.message") );
- }
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testFileExtensionEmpty() {
- Dialog dialog = getInformationDialog(
- WorkbenchMessages.getString("FileEditorPreference.extensionEmptyTitle"),
- WorkbenchMessages.getString("FileEditorPreference.extensionEmptyMessage") );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testFileNameWrong() {
- Dialog dialog = getInformationDialog(
- WorkbenchMessages.getString("FileEditorPreference.fileNameInvalidTitle"),
- WorkbenchMessages.getString("FileEditorPreference.fileNameInvalidMessage") );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testFileTypeExists() {
- Dialog dialog = getInformationDialog(
- WorkbenchMessages.getString("FileEditorPreference.existsTitle"),
- WorkbenchMessages.getString("FileEditorPreference.existsMessage") );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testInvalidType_1() {
- Dialog dialog = getWarningDialog(
- WorkbenchMessages.getString("FileExtension.invalidTitle"),
- WorkbenchMessages.getString("FileExtension.invalidMessage") );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testInvalidType_2() {
- Dialog dialog = getWarningDialog(
- WorkbenchMessages.getString("FileExtension.invalidType"),
- WorkbenchMessages.getString("FileExtension.invalidTypeMessage") );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testMoveReadOnlyCheck() {
- Dialog dialog = new MessageDialog(
- getShell(),
- WorkbenchMessages.getString("MoveResourceAction.title"),
- null,
- WorkbenchMessages.format("MoveResourceAction.checkMoveMessage", new Object[] {DUMMY_RESOURCE}),
- MessageDialog.QUESTION,
- new String[] {
- IDialogConstants.YES_LABEL,
- IDialogConstants.YES_TO_ALL_LABEL,
- IDialogConstants.NO_LABEL,
- IDialogConstants.CANCEL_LABEL },
- 0);
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testNoBuilders() {
- Dialog dialog = getWarningDialog(
- WorkbenchMessages.getString("BuildAction.warning"),
- WorkbenchMessages.getString("BuildAction.noBuilders") );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testNoGlobalBuildersDialog() {
- Dialog dialog = getWarningDialog(
- WorkbenchMessages.getString("GlobalBuildAction.warning"),
- WorkbenchMessages.getString("GlobalBuildAction.noBuilders") );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testNoPropertyPage() {
- Dialog dialog = getInformationDialog(
- WorkbenchMessages.getString("PropertyDialog.messageTitle"),
- WorkbenchMessages.format("PropertyDialog.noPropertyMessage", new Object[] {"DummyPropertyPage"}) );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testNoSelectedExportResources() {
- Dialog dialog = getInformationDialog(
- DataTransferMessagesCopy.getString("DataTransfer.information"),
- DataTransferMessagesCopy.getString("FileExport.noneSelected") );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testNoSelectedImportResources() {
- Dialog dialog = getInformationDialog(
- DataTransferMessagesCopy.getString("DataTransfer.information"),
- DataTransferMessagesCopy.getString("FileImport.noneSelected") );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testOperationNotAvailable() {
- Dialog dialog = getInformationDialog(
- WorkbenchMessages.getString("Information"),
- WorkbenchMessages.getString("PluginActino.operationNotAvailableMessage") );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testOverwritePerspective() {
- Dialog dialog = new MessageDialog(
- getShell(),
- WorkbenchMessages.getString("SavePerspective.overwriteTitle"),
- null,
- WorkbenchMessages.format("SavePerspective.overwriteQuestion", new Object[] {"Dummy Perspective"}),
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL},
- 0);
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testRefreshDeleteProject() {
- Dialog dialog = new MessageDialog(
- getShell(),
- WorkbenchMessages.getString("RefreshAction.dialogTitle"),
- null,
- WorkbenchMessages.format("RefreshAction.locationDeletedMessage", new Object[] {DUMMY_PROJECT, "c:\\dummypath\\" + DUMMY_PROJECT}),
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL},
- 0);
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testRenameOverwrite() {
- Dialog dialog = getQuestionDialog(
- WorkbenchMessages.getString("RenameResourceAction.resourceExists"),
- WorkbenchMessages.format("RenameResourceAction.overwriteQuestion", new Object[] {DUMMY_RELATIVE_PATH}) );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testResetPerspective() {
- Dialog dialog = new MessageDialog(
- getShell(),
- WorkbenchMessages.getString("ResetPerspective.title"),
- null,
- WorkbenchMessages.format("ResetPerspective.message", new Object[] {"Dummy Perspective"}),
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL},
- 0);
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testSaveAsOverwrite() {
- Dialog dialog = new MessageDialog(
- getShell(),
- WorkbenchMessages.getString("Question"),
- null,
- WorkbenchMessages.format("SaveAsDialog.overwriteQuestion", new Object[] {DUMMY_RELATIVE_PATH}),
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL},
- 0);
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testSaveChanges() {
- Dialog dialog = new MessageDialog(
- getShell(),
- WorkbenchMessages.getString("Save_Resource"),
- null,
- WorkbenchMessages.format("EditorManager.saveChangesQuestion", new Object[] {DUMMY_RESOURCE}),
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL},
- 0);
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testSaveFileDeleted() {
- MessageDialog dialog = null;
- ResourceBundle bundle = ResourceBundle.getBundle("org.eclipse.ui.texteditor.EditorMessages");
- if (bundle != null) {
- dialog= new MessageDialog(
- getShell(),
- bundle.getString("Editor.error.activated.deleted.save.title"),
- null,
- bundle.getString("Editor.error.activated.deleted.save.message"),
- MessageDialog.QUESTION,
- new String[] {
- bundle.getString("Editor.error.activated.deleted.save.button.save"),
- bundle.getString("Editor.error.activated.deleted.save.button.close")},
- 0);
- }
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testUpdateConflict() {
- MessageDialog dialog = null;
- ResourceBundle bundle = ResourceBundle.getBundle("org.eclipse.ui.texteditor.EditorMessages");
- if (bundle != null) {
- dialog = getQuestionDialog(
- bundle.getString("Editor.error.save.outofsync.title"),
- bundle.getString("Editor.error.save.outofsync.message") );
- }
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testWizardClosing() {
- Dialog dialog = new MessageDialog(
- getShell(),
- JFaceResources.getString("WizardClosingDialog.title"),
- null,
- JFaceResources.getString("WizardClosingDialog.message"),
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.OK_LABEL},
- 0);
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testWizardOverwrite() {
- Dialog dialog = new MessageDialog(
- getShell(),
- WorkbenchMessages.getString("Question"),
- null,
- WorkbenchMessages.format("WizardDataTransfer.existsQuestion", new Object[] {DUMMY_ABSOLUTE_PATH}),
- MessageDialog.QUESTION,
- new String[] {
- IDialogConstants.YES_LABEL,
- IDialogConstants.YES_TO_ALL_LABEL,
- IDialogConstants.NO_LABEL,
- IDialogConstants.CANCEL_LABEL},
- 0);
- DialogCheck.assertDialogTexts(dialog, this);
- }
-
-
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UINewWorkingSetWizardAuto.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UINewWorkingSetWizardAuto.java deleted file mode 100644 index 418ee670af3..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UINewWorkingSetWizardAuto.java +++ /dev/null @@ -1,159 +0,0 @@ -package org.eclipse.ui.tests.dialogs; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.TestCase; -import org.eclipse.core.resources.*; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.jface.viewers.*; -import org.eclipse.jface.wizard.*; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Table; -import org.eclipse.ui.*; -import org.eclipse.ui.dialogs.IWorkingSetPage; -import org.eclipse.ui.dialogs.WizardNewProjectReferencePage; -import org.eclipse.ui.help.WorkbenchHelp; -import org.eclipse.ui.internal.*; -import org.eclipse.ui.internal.dialogs.*; -import org.eclipse.ui.internal.registry.WorkingSetDescriptor; -import org.eclipse.ui.internal.registry.WorkingSetRegistry; -import org.eclipse.ui.tests.util.*; -import org.eclipse.ui.tests.util.ArrayUtil; -import org.eclipse.ui.tests.util.DialogCheck; -import org.eclipse.ui.wizards.newresource.*; - -/** - * Tests the WorkingSetNewWizard. - * Tests input validation, presence of type page and correct edit page - * and wizard page texts. - */ -public class UINewWorkingSetWizardAuto extends UIWorkingSetWizardsAuto { - - public UINewWorkingSetWizardAuto(String name) { - super(name); - } - /** - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - fWizard = new WorkingSetNewWizard(); - super.setUp(); - } - public void testTypePage() throws Throwable { - IWizardPage page = fWizardDialog.getCurrentPage(); - assertTrue((page instanceof WorkingSetTypePage) == fWorkingSetDescriptors.length > 1); - - /* - * Should have at least resourceWorkingSetPage and MockWorkingSet - */ - assertTrue(fWorkingSetDescriptors.length >= 2); - if (page instanceof WorkingSetTypePage) { - WorkingSetTypePage typePage = (WorkingSetTypePage) page; - List widgets = getWidgets(fWizardDialog.getShell(), Table.class); - Table table = (Table) widgets.get(0); - /* - * Test initial page state - */ - assertEquals(fWorkingSetDescriptors.length, table.getItemCount()); - assertTrue(typePage.canFlipToNextPage() == false); - assertTrue(fWizard.canFinish() == false); - /* - * Test page state with page complete input - */ - table.setSelection(fWorkingSetDescriptors.length - 1); - table.notifyListeners(SWT.Selection, new Event()); - assertTrue(typePage.canFlipToNextPage()); - assertTrue(fWizard.canFinish() == false); - - /* - * Check page texts - */ - DialogCheck.assertDialogTexts(fWizardDialog, this); - } - } - public void testEditPage() throws Throwable { - final int workingSetTypeIndex = fWorkingSetDescriptors.length - 1; - WorkingSetRegistry registry = WorkbenchPlugin.getDefault().getWorkingSetRegistry(); - IWizardPage page = fWizardDialog.getCurrentPage(); - IWizardPage defaultEditPage = registry.getDefaultWorkingSetPage(); - assertTrue((page instanceof WorkingSetTypePage) == fWorkingSetDescriptors.length > 1); - - if (page instanceof WorkingSetTypePage) { - /* - * Select the default (Resource) working set type - * and advance to edit page. - */ - WorkingSetTypePage typePage = (WorkingSetTypePage) page; - List widgets = getWidgets(fWizardDialog.getShell(), Table.class); - Table table = (Table) widgets.get(0); - TableItem[] items = table.getItems(); - String workingSetName = null; - for (int descriptorIndex = 0; descriptorIndex < fWorkingSetDescriptors.length; descriptorIndex++) { - Class pageClass = Class.forName(fWorkingSetDescriptors[descriptorIndex].getPageClassName()); - if (pageClass == defaultEditPage.getClass()) { - workingSetName = fWorkingSetDescriptors[descriptorIndex].getName(); - break; - } - } - for (int i = 0; i < items.length; i++) { - if (items[i].getText().equals(workingSetName)) { - table.setSelection(i); - break; - } - } - fWizardDialog.showPage(fWizard.getNextPage(page)); - } - page = fWizardDialog.getCurrentPage(); - assertTrue(page instanceof IWorkingSetPage); - - /* - * Verify that correct working set edit page is displayed - */ - assertTrue(page.getClass() == defaultEditPage.getClass()); - /* - * Test initial page state - */ - assertTrue(page.canFlipToNextPage() == false); - assertTrue(fWizard.canFinish() == false); - assertNull(page.getErrorMessage()); - /* - * Test page state with partial page input - */ - setTextWidgetText(WORKING_SET_NAME_1); - assertTrue(page.canFlipToNextPage() == false); - assertTrue(fWizard.canFinish() == false); - assertNotNull(page.getErrorMessage()); - - /* - * Test page state with page complete input - */ - checkTreeItems(); - assertTrue(page.canFlipToNextPage() == false); - assertTrue(fWizard.canFinish()); - assertNull(page.getErrorMessage()); - - fWizard.performFinish(); - IWorkingSet workingSet = ((WorkingSetNewWizard) fWizard).getSelection(); - IAdaptable[] workingSetItems = workingSet.getElements(); - assertEquals(WORKING_SET_NAME_1, workingSet.getName()); - - List widgets = getWidgets(fWizardDialog.getShell(), Tree.class); - Tree tree = (Tree) widgets.get(0); - assertEquals(workingSetItems.length, tree.getItemCount()); - assertTrue(ArrayUtil.contains(workingSetItems, p1)); - assertTrue(ArrayUtil.contains(workingSetItems, p2)); - - /* - * Check page texts - */ - DialogCheck.assertDialogTexts(fWizardDialog, this); - } -} - diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIPreferences.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIPreferences.java deleted file mode 100644 index 0ad3f8fe74a..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIPreferences.java +++ /dev/null @@ -1,154 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.*;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.internal.*;
-import org.eclipse.ui.internal.dialogs.*;
-import org.eclipse.ui.tests.util.DialogCheck;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-public class UIPreferences extends TestCase {
- private IProject _project;
- private static final String PROJECT_NAME = "DummyProject";
-
- public UIPreferences(String name) {
- super(name);
- }
- private Shell getShell() {
- return DialogCheck.getShell();
- }
- private IProject getDummyProject() {
- try {
- IProject projects[] = WorkbenchPlugin.getPluginWorkspace().getRoot().getProjects();
- for (int i = 0; i < projects.length; i++) {
- if ( projects[i].getName().equals(PROJECT_NAME) ) {
- projects[i].delete(true, null);
- break;
- }
- }
- _project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- _project.create(null);
- } catch (CoreException e) {
- System.out.println(e);
- }
- return _project;
- }
- private void deleteDummyProject(){
- try {
- if (_project != null) {
- _project.delete(true, null);
- }
- } catch (CoreException e) {
- System.out.println(e);
- }
- }
- private PreferenceDialog getPreferenceDialog(String id) {
- PreferenceDialogWrapper dialog = null;
- PreferenceManager manager = WorkbenchPlugin.getDefault().getPreferenceManager();
- if (manager != null) {
- dialog = new PreferenceDialogWrapper(getShell(), manager);
- dialog.create();
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.PREFERENCE_DIALOG});
-
- for (Iterator iterator = manager.getElements(PreferenceManager.PRE_ORDER).iterator();
- iterator.hasNext();)
- {
- IPreferenceNode node = (IPreferenceNode)iterator.next();
- if ( node.getId().equals(id) ) {
- dialog.showPage(node);
- break;
- }
- }
- }
- return dialog;
- }
- private PropertyDialog getPropertyDialog(String id) {
- PropertyDialogWrapper dialog = null;
-
- PropertyPageManager manager = new PropertyPageManager();
- String title = "";
- String name = "";
-
-
- IProject element = getDummyProject();
- if (element == null) {
- return null;
- }
- // load pages for the selection
- // fill the manager with contributions from the matching contributors
- PropertyPageContributorManager.getManager().contribute(manager, element);
-
- IWorkbenchAdapter adapter = (IWorkbenchAdapter)element.getAdapter(IWorkbenchAdapter.class);
- if (adapter != null) {
- name = adapter.getLabel(element);
- }
-
- // testing if there are pages in the manager
- Iterator pages = manager.getElements(PreferenceManager.PRE_ORDER).iterator();
- if (!pages.hasNext()) {
- return null;
- } else {
- title = WorkbenchMessages.format("PropertyDialog.propertyMessage", new Object[] {name});
- dialog = new PropertyDialogWrapper(getShell(), manager, new StructuredSelection(element));
- dialog.create();
- dialog.getShell().setText(title);
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.PROPERTY_DIALOG});
- for (Iterator iterator = manager.getElements(PreferenceManager.PRE_ORDER).iterator();
- iterator.hasNext();)
- {
- IPreferenceNode node = (IPreferenceNode)iterator.next();
- if ( node.getId().equals(id) ) {
- dialog.showPage(node);
- break;
- }
- }
- }
- return dialog;
- }
-
- public void testWorkbenchPref() {
- Dialog dialog = getPreferenceDialog("org.eclipse.ui.preferencePages.Workbench");
- DialogCheck.assertDialog(dialog, this);
- }
- public void testAppearancePref() {
- Dialog dialog = getPreferenceDialog("org.eclipse.ui.preferencePages.Views");
- DialogCheck.assertDialog(dialog, this);
- }
- public void testCompareViewersPref() {
- Dialog dialog = getPreferenceDialog("org.eclipse.compare.internal.ComparePreferencePage");
- DialogCheck.assertDialog(dialog, this);
- }
- public void testDefaultTextEditorPref() {
- Dialog dialog = getPreferenceDialog("org.eclipse.ui.preferencePages.TextEditor");
- DialogCheck.assertDialog(dialog, this);
- }
- public void testFileEditorsPref() {
- Dialog dialog = getPreferenceDialog("org.eclipse.ui.preferencePages.FileEditors");
- DialogCheck.assertDialog(dialog, this);
- }
- public void testLocalHistoryPref() {
- Dialog dialog = getPreferenceDialog("org.eclipse.ui.preferencePages.FileStates");
- DialogCheck.assertDialog(dialog, this);
- }
- public void testPerspectivesPref() {
- Dialog dialog = getPreferenceDialog("org.eclipse.ui.preferencePages.Perspectives");
- DialogCheck.assertDialog(dialog, this);
- }
- public void testInfoProp() {
- Dialog dialog = getPropertyDialog("org.eclipse.ui.propertypages.info.file");
- DialogCheck.assertDialog(dialog, this);
- }
- public void testProjectReferencesProp() {
- Dialog dialog = getPropertyDialog("org.eclipse.ui.propertypages.project.reference");
- DialogCheck.assertDialog(dialog, this);
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIPreferencesAuto.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIPreferencesAuto.java deleted file mode 100644 index 41ecaae0a6c..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIPreferencesAuto.java +++ /dev/null @@ -1,226 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.*;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.internal.*;
-import org.eclipse.ui.internal.dialogs.*;
-import org.eclipse.ui.tests.util.DialogCheck;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-public class UIPreferencesAuto extends TestCase {
-
- private IProject _project;
- private static final String PROJECT_NAME = "DummyProject";
-
- public UIPreferencesAuto(String name) {
- super(name);
- }
- private Shell getShell() {
- return DialogCheck.getShell();
- }
-
- private IProject getDummyProject() {
- try {
- IProject projects[] =
- WorkbenchPlugin.getPluginWorkspace().getRoot().getProjects();
- for (int i = 0; i < projects.length; i++) {
- if (projects[i].getName().equals(PROJECT_NAME)) {
- projects[i].delete(true, null);
- break;
- }
- }
- _project =
- ResourcesPlugin.getWorkspace().getRoot().getProject(
- PROJECT_NAME);
- _project.create(null);
- } catch (CoreException e) {
- System.out.println(e);
- }
- return _project;
- }
- private void deleteDummyProject() {
- try {
- if (_project != null) {
- _project.delete(true, null);
- }
- } catch (CoreException e) {
- System.out.println(e);
- }
- }
- private PreferenceDialog getPreferenceDialog(String id) {
- PreferenceDialogWrapper dialog = null;
- PreferenceManager manager =
- WorkbenchPlugin.getDefault().getPreferenceManager();
- if (manager != null) {
- dialog = new PreferenceDialogWrapper(getShell(), manager);
- dialog.create();
- WorkbenchHelp.setHelp(
- dialog.getShell(),
- new Object[] { IHelpContextIds.PREFERENCE_DIALOG });
-
- for (Iterator iterator =
- manager.getElements(PreferenceManager.PRE_ORDER).iterator();
- iterator.hasNext();
- ) {
- IPreferenceNode node = (IPreferenceNode) iterator.next();
- if (node.getId().equals(id)) {
- dialog.showPage(node);
- break;
- }
- }
- }
- return dialog;
- }
- private PropertyDialog getPropertyDialog(String id) {
- PropertyDialogWrapper dialog = null;
-
- PropertyPageManager manager = new PropertyPageManager();
- String title = "";
- String name = "";
-
- IProject element = getDummyProject();
- if (element == null) {
- return null;
- }
- // load pages for the selection
- // fill the manager with contributions from the matching contributors
- PropertyPageContributorManager.getManager().contribute(
- manager,
- element);
-
- IWorkbenchAdapter adapter =
- (IWorkbenchAdapter) element.getAdapter(IWorkbenchAdapter.class);
- if (adapter != null) {
- name = adapter.getLabel(element);
- }
-
- // testing if there are pages in the manager
- Iterator pages =
- manager.getElements(PreferenceManager.PRE_ORDER).iterator();
- if (!pages.hasNext()) {
- return null;
- } else {
- title =
- WorkbenchMessages.format(
- "PropertyDialog.propertyMessage",
- new Object[] { name });
- dialog =
- new PropertyDialogWrapper(
- getShell(),
- manager,
- new StructuredSelection(element));
- dialog.create();
- dialog.getShell().setText(title);
- WorkbenchHelp.setHelp(
- dialog.getShell(),
- new Object[] { IHelpContextIds.PROPERTY_DIALOG });
- for (Iterator iterator =
- manager.getElements(PreferenceManager.PRE_ORDER).iterator();
- iterator.hasNext();
- ) {
- IPreferenceNode node = (IPreferenceNode) iterator.next();
- if (node.getId().equals(id)) {
- dialog.showPage(node);
- break;
- }
- }
- }
- return dialog;
- }
-
- public void testWorkbenchPref() {
- Dialog dialog =
- getPreferenceDialog("org.eclipse.ui.preferencePages.Workbench");
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testAppearancePref() {
- Dialog dialog =
- getPreferenceDialog("org.eclipse.ui.preferencePages.Views");
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testCompareViewersPref() {
- Dialog dialog =
- getPreferenceDialog("org.eclipse.compare.internal.ComparePreferencePage");
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testDefaultTextEditorPref() {
- Dialog dialog =
- getPreferenceDialog("org.eclipse.ui.preferencePages.TextEditor");
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testFileEditorsPref() {
- Dialog dialog =
- getPreferenceDialog("org.eclipse.ui.preferencePages.FileEditors");
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testLocalHistoryPref() {
- Dialog dialog =
- getPreferenceDialog("org.eclipse.ui.preferencePages.FileStates");
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testPerspectivesPref() {
- Dialog dialog = getPreferenceDialog("org.eclipse.ui.preferencePages.Perspectives");
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testInfoProp() {
- /*
- * Commented out because it generates a failure
- * of expect and actual width values. Suspect this
- * is an SWT issue.
- *
- Dialog dialog = getPropertyDialog("org.eclipse.ui.propertypages.info.file");
- DialogCheck.assertDialogTexts(dialog, this);
- */
- }
- public void testProjectReferencesProp() {
- /*
- * Commented out because it generates a failure
- * of expect and actual width values. Suspect this
- * is an SWT issue.
- *
- Dialog dialog = getPropertyDialog("org.eclipse.ui.propertypages.project.reference");
- DialogCheck.assertDialogTexts(dialog, this);
- */
- }
-
- /**
- * Test the editors preference page and toggle the
- * enable state twice to be sure there are no errors.
- */
- public void testFieldEditorEnablePref() {
-
- PreferenceDialogWrapper dialog = null;
- PreferenceManager manager =
- WorkbenchPlugin.getDefault().getPreferenceManager();
- if (manager != null) {
- dialog = new PreferenceDialogWrapper(getShell(), manager);
- dialog.create();
-
- for (Iterator iterator =
- manager.getElements(PreferenceManager.PRE_ORDER).iterator();
- iterator.hasNext();
- ) {
- IPreferenceNode node = (IPreferenceNode) iterator.next();
- if (node
- .getId()
- .equals("org.eclipse.ui.tests.dialogs.EnableTestPreferencePage")) {
- dialog.showPage(node);
- EnableTestPreferencePage page =
- (EnableTestPreferencePage) dialog.getPage(node);
- page.flipState();
- page.flipState();
- break;
- }
- }
- }
-
- }
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWizards.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWizards.java deleted file mode 100644 index 7048afe1144..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWizards.java +++ /dev/null @@ -1,204 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-import junit.framework.TestCase;
-import org.eclipse.jface.dialogs.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jface.wizard.*;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.*;
-import org.eclipse.ui.dialogs.WizardNewProjectReferencePage;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.internal.*;
-import org.eclipse.ui.internal.dialogs.*;
-import org.eclipse.ui.tests.util.DialogCheck;
-import org.eclipse.ui.wizards.newresource.*;
-
-
-public class UIWizards extends TestCase {
- private static final int SIZING_WIZARD_WIDTH = 470;
- private static final int SIZING_WIZARD_HEIGHT = 550;
- private static final int SIZING_WIZARD_WIDTH_2 = 500;
- private static final int SIZING_WIZARD_HEIGHT_2 = 500;
-
- public UIWizards(String name) {
- super(name);
- }
- private Shell getShell() {
- return DialogCheck.getShell();
- }
- private IWorkbench getWorkbench() {
- return WorkbenchPlugin.getDefault().getWorkbench();
- }
- private WizardDialog exportWizard(IWizardPage page) {
- ExportWizard wizard = new ExportWizard();
- wizard.init(getWorkbench(), null);
- IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault().getDialogSettings();
- IDialogSettings wizardSettings = workbenchSettings.getSection("ExportResourcesAction");
- if(wizardSettings == null)
- wizardSettings = workbenchSettings.addNewSection("ExportResourcesAction");
- wizard.setDialogSettings(wizardSettings);
- wizard.setForcePreviousAndNextButtons(true);
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- dialog.getShell().setSize( Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT );
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.EXPORT_WIZARD});
-
- if (page != null) {
- page.setWizard(wizard);
- dialog.showPage(page);
- }
- return dialog;
- }
- private WizardDialog importWizard(IWizardPage page) {
- ImportWizard wizard = new ImportWizard();
- wizard.init(getWorkbench(), null);
- IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault().getDialogSettings();
- IDialogSettings wizardSettings = workbenchSettings.getSection("ImportResourcesAction");
- if(wizardSettings==null)
- wizardSettings = workbenchSettings.addNewSection("ImportResourcesAction");
- wizard.setDialogSettings(wizardSettings);
- wizard.setForcePreviousAndNextButtons(true);
-
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- dialog.getShell().setSize( Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT );
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.IMPORT_WIZARD});
-
- if (page != null) {
- page.setWizard(wizard);
- dialog.showPage(page);
- }
- return dialog;
- }
-
- public void testExportResources() {//reference: ExportResourcesAction
- Dialog dialog = exportWizard(null);
- DialogCheck.assertDialog(dialog, this);
- }
-/**
- * 1GJWD2E: ITPUI:ALL - Test classes should not be released in public packages.
- *
- public void testFileSystemExport() {
- Dialog dialog = exportWizard( DataTransferTestStub.newFileSystemResourceExportPage1(null) );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testZipFileExport() {
- Dialog dialog = exportWizard( DataTransferTestStub.newZipFileResourceExportPage1(null) );
- DialogCheck.assertDialog(dialog, this);
- }
- */
- public void testImportResources() {//reference: ImportResourcesAction
- Dialog dialog = importWizard(null);
- DialogCheck.assertDialog(dialog, this);
- }
-/**
- * 1GJWD2E: ITPUI:ALL - Test classes should not be released in public packages.
- *
- public void testFileSystemImport() {
- Dialog dialog = importWizard( DataTransferTestStub.newFileSystemResourceImportPage1(WorkbenchPlugin.getDefault().getWorkbench(), StructuredSelection.EMPTY) );
- DialogCheck.assertDialog(dialog, this);
- }
- public void testZipFileImport() {
- Dialog dialog = importWizard( DataTransferTestStub.newZipFileResourceImportPage1(null) );
- DialogCheck.assertDialog(dialog, this);
- }
- */
- public void testNewFile() {
- BasicNewFileResourceWizard wizard = new BasicNewFileResourceWizard();
- wizard.init( PlatformUI.getWorkbench(), new StructuredSelection() );
- wizard.setNeedsProgressMonitor(true);
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- dialog.getShell().setText(WorkbenchMessages.getString("CreateFileAction.title")); //$NON-NLS-1$
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.NEW_FILE_WIZARD});
- DialogCheck.assertDialog(dialog, this);
- }
- public void testNewFolder() {
- BasicNewFolderResourceWizard wizard = new BasicNewFolderResourceWizard();
- wizard.init( PlatformUI.getWorkbench(), new StructuredSelection() );
- wizard.setNeedsProgressMonitor(true);
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- dialog.getShell().setText(WorkbenchMessages.getString("CreateFolderAction.title")); //$NON-NLS-1$
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.NEW_FOLDER_WIZARD});
- DialogCheck.assertDialog(dialog, this);
- }
- public void testNewProjectPage1() {
- BasicNewProjectResourceWizard wizard = new BasicNewProjectResourceWizard();
- wizard.init(PlatformUI.getWorkbench(), null);
- wizard.setNeedsProgressMonitor(true);
-
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- dialog.getShell().setSize( Math.max(SIZING_WIZARD_WIDTH_2, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT_2 );
- dialog.getShell().setText(WorkbenchMessages.getString("CreateFileAction.title")); //$NON-NLS-1$
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.NEW_PROJECT_WIZARD});
- DialogCheck.assertDialog(dialog, this);
- }
- public void testNewProjectPage2() {
- BasicNewProjectResourceWizard wizard = new BasicNewProjectResourceWizard();
- wizard.init(PlatformUI.getWorkbench(), null);
- wizard.setNeedsProgressMonitor(true);
-
- WizardNewProjectReferencePage page = new WizardNewProjectReferencePage("basicReferenceProjectPage");//$NON-NLS-1$
- page.setTitle(ResourceMessagesCopy.getString("NewProject.refeerenceTitle")); //$NON-NLS-1$
- page.setDescription(ResourceMessagesCopy.getString("NewProject.referenceDescription")); //$NON-NLS-1$
- page.setWizard(wizard);
-
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- dialog.getShell().setSize( Math.max(SIZING_WIZARD_WIDTH_2, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT_2 );
- dialog.getShell().setText(WorkbenchMessages.getString("CreateFileAction.title")); //$NON-NLS-1$
- dialog.showPage(page);
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.NEW_PROJECT_WIZARD});
- DialogCheck.assertDialog(dialog, this);
- }
- public void testNewProject() {
- // Create wizard selection wizard.
- NewWizard wizard = new NewWizard();
- wizard.setProjectsOnly(true);
- ISelection selection = getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- IStructuredSelection selectionToPass = null;
- if (selection instanceof IStructuredSelection)
- selectionToPass = (IStructuredSelection) selection;
- else
- selectionToPass = StructuredSelection.EMPTY;
- wizard.init(getWorkbench(), selectionToPass);
- IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault().getDialogSettings();
- IDialogSettings wizardSettings = workbenchSettings.getSection("NewWizardAction");//$NON-NLS-1$
- if(wizardSettings==null)
- wizardSettings = workbenchSettings.addNewSection("NewWizardAction");//$NON-NLS-1$
- wizard.setDialogSettings(wizardSettings);
- wizard.setForcePreviousAndNextButtons(true);
-
- // Create wizard dialog.
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- dialog.getShell().setSize( Math.max(SIZING_WIZARD_WIDTH_2, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT_2 );
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.NEW_PROJECT_WIZARD});
- DialogCheck.assertDialog(dialog, this);
- }
- public void testNewResource() {
- NewWizard wizard = new NewWizard();
- ISelection selection = getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- IStructuredSelection selectionToPass = null;
- if (selection instanceof IStructuredSelection)
- selectionToPass = (IStructuredSelection) selection;
- else
- selectionToPass = StructuredSelection.EMPTY;
- wizard.init(getWorkbench(), selectionToPass);
- IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault().getDialogSettings();
- IDialogSettings wizardSettings = workbenchSettings.getSection("NewWizardAction");//$NON-NLS-1$
- if(wizardSettings==null)
- wizardSettings = workbenchSettings.addNewSection("NewWizardAction");//$NON-NLS-1$
- wizard.setDialogSettings(wizardSettings);
- wizard.setForcePreviousAndNextButtons(true);
-
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- dialog.getShell().setSize( Math.max(SIZING_WIZARD_WIDTH_2, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT_2 );
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.NEW_WIZARD});
- DialogCheck.assertDialog(dialog, this);
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWizardsAuto.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWizardsAuto.java deleted file mode 100644 index 7017c3fb21a..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWizardsAuto.java +++ /dev/null @@ -1,205 +0,0 @@ -package org.eclipse.ui.tests.dialogs;
-
-import junit.framework.TestCase;
-import org.eclipse.jface.dialogs.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jface.wizard.*;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.*;
-import org.eclipse.ui.dialogs.WizardNewProjectReferencePage;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.internal.*;
-import org.eclipse.ui.internal.dialogs.*;
-import org.eclipse.ui.tests.util.DialogCheck;
-import org.eclipse.ui.wizards.newresource.*;
-
-public class UIWizardsAuto extends TestCase {
- private static final int SIZING_WIZARD_WIDTH = 470;
- private static final int SIZING_WIZARD_HEIGHT = 550;
- private static final int SIZING_WIZARD_WIDTH_2 = 500;
- private static final int SIZING_WIZARD_HEIGHT_2 = 500;
-
- public UIWizardsAuto(String name) {
- super(name);
- }
- private Shell getShell() {
- return DialogCheck.getShell();
- }
- private IWorkbench getWorkbench() {
- return WorkbenchPlugin.getDefault().getWorkbench();
- }
-
- private WizardDialog exportWizard(IWizardPage page) {
- ExportWizard wizard = new ExportWizard();
- wizard.init(getWorkbench(), null);
- IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault().getDialogSettings();
- IDialogSettings wizardSettings = workbenchSettings.getSection("ExportResourcesAction");
- if(wizardSettings == null)
- wizardSettings = workbenchSettings.addNewSection("ExportResourcesAction");
- wizard.setDialogSettings(wizardSettings);
- wizard.setForcePreviousAndNextButtons(true);
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- dialog.getShell().setSize( Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT );
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.EXPORT_WIZARD});
-
- if (page != null) {
- page.setWizard(wizard);
- dialog.showPage(page);
- }
- return dialog;
- }
- private WizardDialog importWizard(IWizardPage page) {
- ImportWizard wizard = new ImportWizard();
- wizard.init(getWorkbench(), null);
- IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault().getDialogSettings();
- IDialogSettings wizardSettings = workbenchSettings.getSection("ImportResourcesAction");
- if(wizardSettings==null)
- wizardSettings = workbenchSettings.addNewSection("ImportResourcesAction");
- wizard.setDialogSettings(wizardSettings);
- wizard.setForcePreviousAndNextButtons(true);
-
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- dialog.getShell().setSize( Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT );
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.IMPORT_WIZARD});
-
- if (page != null) {
- page.setWizard(wizard);
- dialog.showPage(page);
- }
- return dialog;
- }
-
- public void testExportResources() {//reference: ExportResourcesAction
- Dialog dialog = exportWizard(null);
- DialogCheck.assertDialogTexts(dialog, this);
- }
-/**
- * 1GJWD2E: ITPUI:ALL - Test classes should not be released in public packages.
- *
- public void testFileSystemExport() {
- Dialog dialog = exportWizard( DataTransferTestStub.newFileSystemResourceExportPage1(null) );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testZipFileExport() {
- Dialog dialog = exportWizard( DataTransferTestStub.newZipFileResourceExportPage1(null) );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- */
- public void testImportResources() {//reference: ImportResourcesAction
- Dialog dialog = importWizard(null);
- DialogCheck.assertDialogTexts(dialog, this);
- }
-/**
- * 1GJWD2E: ITPUI:ALL - Test classes should not be released in public packages.
- *
- public void testFileSystemImport() {
- Dialog dialog = importWizard( DataTransferTestStub.newFileSystemResourceImportPage1(WorkbenchPlugin.getDefault().getWorkbench(), StructuredSelection.EMPTY) );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testZipFileImport() {
- Dialog dialog = importWizard( DataTransferTestStub.newZipFileResourceImportPage1(null) );
- DialogCheck.assertDialogTexts(dialog, this);
- }
- */
- public void testNewFile() {
- BasicNewFileResourceWizard wizard = new BasicNewFileResourceWizard();
- wizard.init( PlatformUI.getWorkbench(), new StructuredSelection() );
- wizard.setNeedsProgressMonitor(true);
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- dialog.getShell().setText(WorkbenchMessages.getString("CreateFileAction.title")); //$NON-NLS-1$
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.NEW_FILE_WIZARD});
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testNewFolder() {
- BasicNewFolderResourceWizard wizard = new BasicNewFolderResourceWizard();
- wizard.init( PlatformUI.getWorkbench(), new StructuredSelection() );
- wizard.setNeedsProgressMonitor(true);
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- dialog.getShell().setText(WorkbenchMessages.getString("CreateFolderAction.title")); //$NON-NLS-1$
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.NEW_FOLDER_WIZARD});
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testNewProjectPage1() {
- BasicNewProjectResourceWizard wizard = new BasicNewProjectResourceWizard();
- wizard.init(PlatformUI.getWorkbench(), null);
- wizard.setNeedsProgressMonitor(true);
-
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- dialog.getShell().setSize( Math.max(SIZING_WIZARD_WIDTH_2, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT_2 );
- dialog.getShell().setText(WorkbenchMessages.getString("CreateFileAction.title")); //$NON-NLS-1$
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.NEW_PROJECT_WIZARD});
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testNewProjectPage2() {
- BasicNewProjectResourceWizard wizard = new BasicNewProjectResourceWizard();
- wizard.init(PlatformUI.getWorkbench(), null);
- wizard.setNeedsProgressMonitor(true);
-
- WizardNewProjectReferencePage page = new WizardNewProjectReferencePage("basicReferenceProjectPage");//$NON-NLS-1$
- page.setTitle(ResourceMessagesCopy.getString("NewProject.refeerenceTitle")); //$NON-NLS-1$
- page.setDescription(ResourceMessagesCopy.getString("NewProject.referenceDescription")); //$NON-NLS-1$
- page.setWizard(wizard);
-
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- dialog.getShell().setSize( Math.max(SIZING_WIZARD_WIDTH_2, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT_2 );
- dialog.getShell().setText(WorkbenchMessages.getString("CreateFileAction.title")); //$NON-NLS-1$
- dialog.showPage(page);
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.NEW_PROJECT_WIZARD});
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testNewProject() {
- // Create wizard selection wizard.
- NewWizard wizard = new NewWizard();
- wizard.setProjectsOnly(true);
- ISelection selection = getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- IStructuredSelection selectionToPass = null;
- if (selection instanceof IStructuredSelection)
- selectionToPass = (IStructuredSelection) selection;
- else
- selectionToPass = StructuredSelection.EMPTY;
- wizard.init(getWorkbench(), selectionToPass);
- IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault().getDialogSettings();
- IDialogSettings wizardSettings = workbenchSettings.getSection("NewWizardAction");//$NON-NLS-1$
- if(wizardSettings==null)
- wizardSettings = workbenchSettings.addNewSection("NewWizardAction");//$NON-NLS-1$
- wizard.setDialogSettings(wizardSettings);
- wizard.setForcePreviousAndNextButtons(true);
-
- // Create wizard dialog.
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- dialog.getShell().setSize( Math.max(SIZING_WIZARD_WIDTH_2, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT_2 );
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.NEW_PROJECT_WIZARD});
- DialogCheck.assertDialogTexts(dialog, this);
- }
- public void testNewResource() {
- NewWizard wizard = new NewWizard();
- ISelection selection = getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- IStructuredSelection selectionToPass = null;
- if (selection instanceof IStructuredSelection)
- selectionToPass = (IStructuredSelection) selection;
- else
- selectionToPass = StructuredSelection.EMPTY;
- wizard.init(getWorkbench(), selectionToPass);
- IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault().getDialogSettings();
- IDialogSettings wizardSettings = workbenchSettings.getSection("NewWizardAction");//$NON-NLS-1$
- if(wizardSettings==null)
- wizardSettings = workbenchSettings.addNewSection("NewWizardAction");//$NON-NLS-1$
- wizard.setDialogSettings(wizardSettings);
- wizard.setForcePreviousAndNextButtons(true);
-
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- dialog.getShell().setSize( Math.max(SIZING_WIZARD_WIDTH_2, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT_2 );
- WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.NEW_WIZARD});
- DialogCheck.assertDialogTexts(dialog, this);
- }
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWorkingSetWizardsAuto.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWorkingSetWizardsAuto.java deleted file mode 100644 index d3f931803a4..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWorkingSetWizardsAuto.java +++ /dev/null @@ -1,130 +0,0 @@ -package org.eclipse.ui.tests.dialogs; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.TestCase; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.jface.viewers.*; -import org.eclipse.jface.wizard.*; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Table; -import org.eclipse.ui.*; -import org.eclipse.ui.dialogs.IWorkingSetPage; -import org.eclipse.ui.dialogs.WizardNewProjectReferencePage; -import org.eclipse.ui.help.WorkbenchHelp; -import org.eclipse.ui.internal.*; -import org.eclipse.ui.internal.dialogs.*; -import org.eclipse.ui.internal.registry.WorkingSetDescriptor; -import org.eclipse.ui.internal.registry.WorkingSetRegistry; -import org.eclipse.ui.tests.util.*; -import org.eclipse.ui.tests.util.DialogCheck; -import org.eclipse.ui.tests.util.FileUtil; -import org.eclipse.ui.wizards.newresource.*; - -/** - * Abstract test class for the working set wizard tests. - */ -public abstract class UIWorkingSetWizardsAuto extends UITestCase { - protected static final int SIZING_WIZARD_WIDTH = 470; - protected static final int SIZING_WIZARD_HEIGHT = 550; - protected static final int SIZING_WIZARD_WIDTH_2 = 500; - protected static final int SIZING_WIZARD_HEIGHT_2 = 500; - protected static final String WORKING_SET_NAME_1 = "ws1"; - protected static final String WORKING_SET_NAME_2 = "ws2"; - - protected WizardDialog fWizardDialog; - protected Wizard fWizard; - protected WorkingSetDescriptor[] fWorkingSetDescriptors; - protected IProject p1; - protected IProject p2; - protected IFile f1; - protected IFile f2; - - public UIWorkingSetWizardsAuto(String name) { - super(name); - } - protected void checkTreeItems() { - List widgets = getWidgets(fWizardDialog.getShell(), Tree.class); - Tree tree = (Tree) widgets.get(0); - TreeItem[] treeItems = tree.getItems(); - for (int i = 0; i < treeItems.length; i++) { - treeItems[i].setChecked(true); - Event event = new Event(); - event.detail = SWT.CHECK; - event.item = treeItems[i]; - tree.notifyListeners(SWT.Selection, event); - } - } - private void deleteResources() throws CoreException { - if (p1 != null) { - FileUtil.deleteProject(p1); - } - if (p2 != null) { - FileUtil.deleteProject(p2); - } - } - private Shell getShell() { - return DialogCheck.getShell(); - } - protected List getWidgets(Composite composite, Class clazz) { - Widget[] children = composite.getChildren(); - List selectedChildren = new ArrayList(); - - for (int i = 0; i < children.length; i++) { - Widget child = children[i]; - if (child.getClass() == clazz) { - selectedChildren.add(child); - } - if (child instanceof Composite) { - selectedChildren.addAll(getWidgets((Composite) child, clazz)); - } - } - return selectedChildren; - } - /** - * <code>fWizard</code> must be initialized by subclasses prior to calling setUp. - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - fWizardDialog = new WizardDialog(getShell(), fWizard); - fWizardDialog.create(); - Shell dialogShell = fWizardDialog.getShell(); - dialogShell.setSize(Math.max(SIZING_WIZARD_WIDTH_2, dialogShell.getSize().x), SIZING_WIZARD_HEIGHT_2); - WorkbenchHelp.setHelp(fWizardDialog.getShell(), IHelpContextIds.WORKING_SET_NEW_WIZARD); - - WorkingSetRegistry registry = WorkbenchPlugin.getDefault().getWorkingSetRegistry(); - fWorkingSetDescriptors = registry.getWorkingSetDescriptors(); - - setupResources(); - } - private void setupResources() throws CoreException { - p1 = FileUtil.createProject("TP1"); - p2 = FileUtil.createProject("TP2"); - f1 = FileUtil.createFile("f1.txt", p1); - f2 = FileUtil.createFile("f2.txt", p2); - } - protected void setTextWidgetText(String text) { - List widgets = getWidgets(fWizardDialog.getShell(), Text.class); - Text textWidget = (Text) widgets.get(0); - textWidget.setText(text); - textWidget.notifyListeners(SWT.Modify, new Event()); - } - /** - * @see junit.framework.TestCase#tearDown() - */ - protected void tearDown() throws Exception { - deleteResources(); - super.tearDown(); - } - -} - diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ActionExpressionTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ActionExpressionTest.java deleted file mode 100644 index 8b2bba5d37e..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ActionExpressionTest.java +++ /dev/null @@ -1,238 +0,0 @@ -package org.eclipse.ui.tests.internal;
-
-import org.eclipse.ui.tests.util.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.internal.WorkbenchWindow;
-import org.eclipse.ui.tests.api.*;
-
-
-/**
- * This class contains tests for popup menu enablement
- */
-public abstract class ActionExpressionTest extends UITestCase {
- protected IWorkbenchWindow fWindow;
- protected IWorkbenchPage fPage;
- protected String VIEW_ID = "org.eclipse.ui.tests.internal.ActionExpressionTest";
-
- ListElement red = new ListElement("red");
- ListElement blue = new ListElement("blue");
- ListElement redTrue = new ListElement("red", true);
-
- public ActionExpressionTest(String testName) {
- super(testName);
- }
-
- public void setUp() {
- fWindow = openTestWindow();
- fPage = fWindow.getActivePage();
- }
-
- public void testAllAction() throws Throwable
- {
- // Setup.
- ListView view = showListView();
- MenuManager mgr = getActionMenuManager(view);
-
- // Test null selection.
- selectAndUpdateMenu(view, null, mgr);
- testAction(mgr, "allAction_v2", false);
-
- // Test red selection.
- selectAndUpdateMenu(view, red, mgr);
- testAction(mgr, "allAction_v2", true);
-
- // Test blue selection.
- selectAndUpdateMenu(view, blue, mgr);
- testAction(mgr, "allAction_v2", true);
-
- // Test red + true selection.
- selectAndUpdateMenu(view, redTrue, mgr);
- testAction(mgr, "allAction_v2", true);
- }
-
- public void testRedAction() throws Throwable
- {
- // Setup.
- ListView view = showListView();
- MenuManager mgr = getActionMenuManager(view);
-
- // Test null selection.
- selectAndUpdateMenu(view, null, mgr);
- testAction(mgr, "redAction_v2", false);
-
- // Test red selection.
- selectAndUpdateMenu(view, red, mgr);
- testAction(mgr, "redAction_v2", true);
-
- // Test blue selection.
- selectAndUpdateMenu(view, blue, mgr);
- testAction(mgr, "redAction_v2", false);
-
- // Test red + true selection.
- selectAndUpdateMenu(view, redTrue, mgr);
- testAction(mgr, "redAction_v2", true);
- }
-
- public void testNotRedAction() throws Throwable
- {
- // Setup.
- ListView view = showListView();
- MenuManager mgr = getActionMenuManager(view);
-
- // Test null selection.
- selectAndUpdateMenu(view, null, mgr);
- testAction(mgr, "notRedAction_v2", false);
-
- // Test red selection.
- selectAndUpdateMenu(view, red, mgr);
- testAction(mgr, "notRedAction_v2", false);
-
- // Test blue selection.
- selectAndUpdateMenu(view, blue, mgr);
- testAction(mgr, "notRedAction_v2", true);
-
- // Test red + true selection.
- selectAndUpdateMenu(view, redTrue, mgr);
- testAction(mgr, "notRedAction_v2", false);
- }
-
- public void testTrueAction() throws Throwable
- {
- // Setup.
- ListView view = showListView();
- MenuManager mgr = getActionMenuManager(view);
-
- // Test null selection.
- selectAndUpdateMenu(view, null, mgr);
- testAction(mgr, "trueAction_v2", false);
-
- // Test red selection.
- selectAndUpdateMenu(view, red, mgr);
- testAction(mgr, "trueAction_v2", false);
-
- // Test blue selection.
- selectAndUpdateMenu(view, blue, mgr);
- testAction(mgr, "trueAction_v2", false);
-
- // Test red + true selection.
- selectAndUpdateMenu(view, redTrue, mgr);
- testAction(mgr, "trueAction_v2", true);
- }
-
- public void testRedOrBlueAction() throws Throwable
- {
- // Setup.
- ListView view = showListView();
- MenuManager mgr = getActionMenuManager(view);
-
- // Test null selection.
- selectAndUpdateMenu(view, null, mgr);
- testAction(mgr, "redOrBlueAction_v2", false);
-
- // Test red selection.
- selectAndUpdateMenu(view, red, mgr);
- testAction(mgr, "redOrBlueAction_v2", true);
-
- // Test blue selection.
- selectAndUpdateMenu(view, blue, mgr);
- testAction(mgr, "redOrBlueAction_v2", true);
-
- // Test red + true selection.
- selectAndUpdateMenu(view, redTrue, mgr);
- testAction(mgr, "redOrBlueAction_v2", true);
- }
-
- public void testRedAndTrueAction() throws Throwable
- {
- // Setup.
- ListView view = showListView();
- MenuManager mgr = getActionMenuManager(view);
-
- // Test null selection.
- selectAndUpdateMenu(view, null, mgr);
- testAction(mgr, "redAndTrueAction_v2", false);
-
- // Test red selection.
- selectAndUpdateMenu(view, red, mgr);
- testAction(mgr, "redAndTrueAction_v2", false);
-
- // Test blue selection.
- selectAndUpdateMenu(view, blue, mgr);
- testAction(mgr, "redAndTrueAction_v2", false);
-
- // Test red + true selection.
- selectAndUpdateMenu(view, redTrue, mgr);
- testAction(mgr, "redAndTrueAction_v2", true);
- }
-
- public void testPluginStateActions() throws Throwable
- {
- // Setup.
- ListView view = showListView();
- MenuManager mgr = getActionMenuManager(view);
-
- // Open the menu and test actions.
- selectAndUpdateMenu(view, red, mgr);
- testAction(mgr, "pluginNotInstalledAction_v2", false);
- testAction(mgr, "pluginInstalledAction_v2", true);
- testAction(mgr, "pluginNotActivatedAction_v2", false);
- testAction(mgr, "pluginActivatedAction_v2", true);
- }
-
- public void testSystemPropertyAction() throws Throwable
- {
- // Setup.
- ListView view = showListView();
- MenuManager mgr = getActionMenuManager(view);
-
- // Clear the system property, refresh the menu,
- // and test the action.
- System.setProperty("ActionExpressionVar", "");
- selectAndUpdateMenu(view, red, mgr);
- testAction(mgr, "systemPropertyAction_v2", false);
-
- // Set the system property, refresh the menu,
- // and test the action.
- System.setProperty("ActionExpressionVar", "bubba");
- selectAndUpdateMenu(view, blue, mgr);
- testAction(mgr, "systemPropertyAction_v2", true);
- }
-
- /**
- * Creates the list view.
- */
- protected ListView showListView() throws Throwable
- {
- ListView view = (ListView)(fPage.showView(VIEW_ID));
- red = new ListElement("red");
- blue = new ListElement("blue");
- redTrue = new ListElement("red", true);
- view.addElement(red);
- view.addElement(blue);
- view.addElement(redTrue);
- return view;
- }
-
- /**
- * Select an object and fire about to show.
- */
- protected void selectAndUpdateMenu(ListView view, ListElement element,
- MenuManager mgr) throws Throwable
- {
- view.selectElement(element);
- ActionUtil.fireAboutToShow(mgr);
- }
-
- /**
- * Returns the menu manager containing the actions.
- */
- protected abstract MenuManager getActionMenuManager(ListView view)
- throws Throwable;
-
- /**
- * Tests the enablement / visibility of an action.
- */
- protected abstract void testAction(MenuManager mgr, String action, boolean expected)
- throws Throwable;
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ActionSetExpressionTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ActionSetExpressionTest.java deleted file mode 100644 index 23d767fc1e4..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ActionSetExpressionTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.eclipse.ui.tests.internal;
-
-import org.eclipse.ui.tests.util.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.internal.WorkbenchWindow;
-import org.eclipse.ui.tests.api.*;
-
-
-/**
- * This class contains tests for action set enablement
- */
-public class ActionSetExpressionTest extends ActionExpressionTest {
-
- public ActionSetExpressionTest(String testName) {
- super(testName);
- }
-
- /**
- * Opens the action set. Returns the menu manager containing it.
- */
- protected MenuManager getActionMenuManager(ListView view)
- throws Throwable
- {
- fPage.showActionSet("org.eclipse.ui.tests.internal.ListElementActions");
- WorkbenchWindow win = (WorkbenchWindow)fWindow;
- IContributionItem item = win.getMenuBarManager().find("org.eclipse.ui.tests.internal.ListElementMenu");
- while (item instanceof SubContributionItem) {
- item = ((SubContributionItem)item).getInnerItem();
- if (item instanceof MenuManager)
- return (MenuManager)item;
- }
- fail("Unable to find menu manager");
- return null;
- }
-
- /**
- * Tests the enablement of an action.
- */
- protected void testAction(MenuManager mgr, String action, boolean expected)
- throws Throwable
- {
- assertEquals(action, expected, ActionUtil.getActionWithLabel(mgr, action).isEnabled());
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/EditorActionBarsTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/EditorActionBarsTest.java deleted file mode 100644 index 0657c367c8f..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/EditorActionBarsTest.java +++ /dev/null @@ -1,157 +0,0 @@ -package org.eclipse.ui.tests.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-
-import org.eclipse.jface.action.*;
-
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.internal.*;
-import org.eclipse.ui.tests.api.*;
-import org.eclipse.ui.tests.util.FileUtil;
-import org.eclipse.ui.tests.util.UITestCase;
-
-
-/**
- * This class contains tests for the editor action bars
- * implementation.
- */
-public class EditorActionBarsTest extends UITestCase {
-
- protected IWorkbenchWindow fWindow;
- protected IWorkbenchPage fPage;
- private String EDITOR_ID = "org.eclipse.ui.tests.internal.EditorActionBarsTest";
-
- /**
- * Constructor for IEditorPartTest
- */
- public EditorActionBarsTest(String testName) {
- super(testName);
- }
-
- public void setUp() {
- fWindow = openTestWindow();
- fPage = fWindow.getActivePage();
- }
-
- /**
- * Test action enablement / disablement when a
- * part is active.
- * <p>
- * Created for PR 1GJNB52: ToolItems in EditorToolBarManager can get
- * out of synch with the state of the IAction
- * </p>
- */
- public void testActionEnablementWhenActive() throws Throwable {
- // Open an editor.
- MockEditorPart editor = openEditor(fPage, "1");
- MockEditorActionBarContributor contributor =
- (MockEditorActionBarContributor)editor.getEditorSite().getActionBarContributor();
-
- // Enable all actions.
- contributor.enableActions(true);
- verifyToolItemState(contributor, true);
-
- // Disable all actions.
- contributor.enableActions(false);
- verifyToolItemState(contributor, false);
- }
-
- /**
- * Test action enablement / disablement when a
- * part is inactive.
- * <p>
- * Created for PR 1GJNB52: ToolItems in EditorToolBarManager can get
- * out of synch with the state of the IAction
- * </p>
- */
- public void testActionEnablementWhenInactive() throws Throwable {
- // Open an editor.
- MockEditorPart editor = openEditor(fPage, "2");
- MockEditorActionBarContributor contributor =
- (MockEditorActionBarContributor)editor.getEditorSite().getActionBarContributor();
-
- // Enable all actions.
- contributor.enableActions(true);
- verifyToolItemState(contributor, true);
-
- // Activate some other part. Disable the actions.
- // Then activate the editor and test tool item state.
- fPage.showView(MockViewPart.ID);
- contributor.enableActions(false);
- fPage.activate(editor);
- verifyToolItemState(contributor, false);
-
- // Activate some other part. Enable the actions.
- // Then activate the editor and test tool item state.
- fPage.showView(MockViewPart.ID);
- contributor.enableActions(true);
- fPage.activate(editor);
- verifyToolItemState(contributor, true);
- }
-
- /**
- * Open a test editor.
- */
- protected MockEditorPart openEditor(IWorkbenchPage page, String suffix)
- throws Throwable
- {
- IProject proj = FileUtil.createProject("IEditorActionBarsTest");
- IFile file = FileUtil.createFile("test" + suffix + ".txt", proj);
- return (MockEditorPart)page.openEditor(file, EDITOR_ID);
- }
-
- /**
- * Tests whether actions are enabled.
- */
- protected void verifyToolItemState(MockEditorActionBarContributor ctr,
- boolean enabled)
- {
- MockAction [] actions = ctr.getActions();
- for (int nX = 0; nX < actions.length; nX ++)
- verifyToolItemState(actions[nX], enabled);
- }
-
- /**
- * Tests whether an action is enabled.
- */
- protected void verifyToolItemState(IAction action, boolean enabled) {
- String actionText = action.getText();
- IToolBarManager tbm = ((WorkbenchWindow)fWindow).getToolsManager();
- if (tbm instanceof ToolBarManager) {
- ToolBar tb = ((ToolBarManager) tbm).getControl();
- ToolItem [] items = tb.getItems();
- for (int i = 0; i < items.length; i ++) {
- String itemText = items[i].getToolTipText();
- if (actionText.equals(itemText)) {
- assertEquals(enabled, items[i].getEnabled());
- return;
- }
- }
- }
- else if (tbm instanceof CoolBarManager) {
- IContributionItem[] coolItems = tbm.getItems();
- for (int i = 0; i < coolItems.length; ++i) {
- if (coolItems[i] instanceof CoolBarContributionItem) {
- CoolBarContributionItem coolItem = (CoolBarContributionItem) coolItems[i];
- ToolBarManager citbm = coolItem.getToolBarManager();
- ToolBar tb = ((ToolBarManager) citbm).getControl();
- ToolItem [] items = tb.getItems();
- for (int j = 0; j < items.length; j ++) {
- String itemText = items[j].getToolTipText();
- if (actionText.equals(itemText)) {
- assertEquals(enabled, items[j].getEnabled());
- return;
- }
- }
- }
- }
- }
- fail("Action for " + actionText + " not found");
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedSourceViewer.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedSourceViewer.java deleted file mode 100644 index 6cd17e0f7b1..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedSourceViewer.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.eclipse.ui.tests.internal;
-
-import org.eclipse.jface.text.source.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-
-public class ExtendedSourceViewer extends SourceViewer {
-
- /**
- * Constructs a new source viewer. The vertical ruler is initially visible.
- * The viewer has not yet been initialized with a source viewer configuration.
- *
- * @param parent the parent of the viewer's control
- * @param ruler the vertical ruler used by this source viewer
- * @param styles the SWT style bits
- */
- public ExtendedSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
- super(parent, ruler, styles);
- }
-
- /*
- * @see Viewer#getSelection()
- */
- public ISelection getSelection() {
- Point p= getSelectedRange();
- if (p.x == -1 || p.y == -1)
- return ExtendedTextSelection.emptySelection();
-
- return new ExtendedTextSelection(getDocument(), p.x, p.y);
- }
-
- /**
- * Sends out a selection changed event to all registered listeners.
- *
- * @param offset the offset of the newly selected range
- * @param length the length of the newly selected range
- */
- protected void selectionChanged(int offset, int length) {
- ISelection selection= new ExtendedTextSelection(getDocument(), offset, length);
- SelectionChangedEvent event= new SelectionChangedEvent(this, selection);
- fireSelectionChanged(event);
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedTextEditor.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedTextEditor.java deleted file mode 100644 index f77ebd24bdc..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedTextEditor.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.eclipse.ui.tests.internal;
-
-import org.eclipse.jface.text.source.*;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.editors.text.TextEditor;
-
-public class ExtendedTextEditor extends TextEditor {
-
- /**
- * Constructor for TextSelectionActionFilterEditor.
- */
- public ExtendedTextEditor() {
- super();
- }
-
- /**
- * Creates the source viewer to be used by this editor.
- * Subclasses may re-implement this method.
- *
- * @param parent the parent control
- * @param ruler the vertical ruler
- * @param styles style bits
- * @return the source viewer
- */
- protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
- return new ExtendedSourceViewer(parent, ruler, styles);
- }
-
- public boolean isDirty() {
- return false;
- }
-
- /**
- * Set the text in the editor.
- */
- public void setText(String text) {
- ExtendedSourceViewer viewer = (ExtendedSourceViewer)getSourceViewer();
- StyledText widget = viewer.getTextWidget();
- widget.setText(text);
- viewer.setSelectedRange(0, text.length());
- }
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedTextSelection.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedTextSelection.java deleted file mode 100644 index a7889db2106..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedTextSelection.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.eclipse.ui.tests.internal;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.text.*;
-import org.eclipse.ui.IActionFilter;
-
-public class ExtendedTextSelection extends TextSelection
- implements IAdaptable
-{
- static private ExtendedTextSelectionActionFilter filter =
- new ExtendedTextSelectionActionFilter();
-
- /**
- * Constructor for ExtendedTextSelection.
- * @param offset
- * @param length
- */
- public ExtendedTextSelection(int offset, int length) {
- super(offset, length);
- }
-
- /**
- * Constructor for ExtendedTextSelection.
- * @param document
- * @param offset
- * @param length
- */
- public ExtendedTextSelection(IDocument document, int offset, int length) {
- super(document, offset, length);
- }
-
- /*
- * @see IAdaptable#getAdapter(Class)
- */
- public Object getAdapter(Class adapter) {
- if (adapter == IActionFilter.class) {
- return filter;
- }
- return null;
- }
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedTextSelectionActionFilter.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedTextSelectionActionFilter.java deleted file mode 100644 index fb0ce4d0ed6..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedTextSelectionActionFilter.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.eclipse.ui.tests.internal;
-
-import org.eclipse.ui.*;
-import org.eclipse.jface.text.ITextSelection;
-
-public class ExtendedTextSelectionActionFilter implements IActionFilter {
-
- /**
- * An attribute indicating the selection length (value <code>"isEmpty"</code>).
- * The attribute value in xml must be one of <code>"true" or "false"</code>.
- */
- public static final String IS_EMPTY = "isEmpty"; //$NON-NLS-1$
-
- /**
- * An attribute indicating the selection text (value <code>"text"</code>).
- * The attribute value in xml is unconstrained.
- */
- public static final String TEXT = "text"; //$NON-NLS-1$
-
- /**
- * An attribute indicating the selection text (value <code>"text"</code>).
- * The attribute value in xml is unconstrained.
- */
- public static final String CASE_INSENSITIVE_TEXT = "caseInsensitiveText"; //$NON-NLS-1$
-
- /*
- * @see IActionFilter#testAttribute(Object, String, String)
- */
- public boolean testAttribute(Object target, String name, String value) {
- ITextSelection sel = (ITextSelection)target;
- if (name.equals(IS_EMPTY)) {
- return (sel.getLength() == 0);
- } else if (name.equals(TEXT)) {
- String text = sel.getText();
- return (text.indexOf(value) >= 0);
- } else if (name.equals(CASE_INSENSITIVE_TEXT)) {
- String text = sel.getText().toLowerCase();
- value = value.toLowerCase();
- return (text.indexOf(value) >= 0);
- }
- return false;
- }
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/InternalTestSuite.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/InternalTestSuite.java deleted file mode 100644 index 24f65fc9c38..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/InternalTestSuite.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.eclipse.ui.tests.internal;
-
-import junit.framework.*;
-
-/**
- * Test all areas of the UI Implementation.
- */
-public class InternalTestSuite extends TestSuite {
-
- /**
- * Returns the suite. This is required to
- * use the JUnit Launcher.
- */
- public static Test suite() {
- return new InternalTestSuite();
- }
-
- /**
- * Construct the test suite.
- */
- public InternalTestSuite() {
- addTest(new TestSuite(EditorActionBarsTest.class));
- addTest(new TestSuite(ActionSetExpressionTest.class));
- addTest(new TestSuite(PopupMenuExpressionTest.class));
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/PopupMenuExpressionTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/PopupMenuExpressionTest.java deleted file mode 100644 index b31cf1be3e7..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/PopupMenuExpressionTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.eclipse.ui.tests.internal;
-
-import org.eclipse.ui.tests.util.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.internal.WorkbenchWindow;
-import org.eclipse.ui.tests.api.*;
-
-
-/**
- * This class contains tests for popup menu visibility
- */
-public class PopupMenuExpressionTest extends ActionExpressionTest {
-
- public PopupMenuExpressionTest(String testName) {
- super(testName);
- }
-
- /**
- * Returns the menu manager containing the actions.
- */
- protected MenuManager getActionMenuManager(ListView view)
- throws Throwable
- {
- return view.getMenuManager();
- }
-
- /**
- * Tests the visibility of an action.
- */
- protected void testAction(MenuManager mgr, String action, boolean expected)
- throws Throwable
- {
- if (expected)
- assertNotNull(action, ActionUtil.getActionWithLabel(mgr, action));
- else
- assertNull(action, ActionUtil.getActionWithLabel(mgr, action));
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/TextSelectionActionExpressionTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/TextSelectionActionExpressionTest.java deleted file mode 100644 index 8d6d9480f31..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/TextSelectionActionExpressionTest.java +++ /dev/null @@ -1,164 +0,0 @@ -package org.eclipse.ui.tests.internal;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.ui.tests.util.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.text.IFindReplaceTarget;
-import org.eclipse.ui.*;
-import org.eclipse.ui.internal.WorkbenchWindow;
-
-
-/**
- * This class contains tests for text selection action enablement
- */
-public class TextSelectionActionExpressionTest extends UITestCase
-{
- protected IWorkbenchWindow fWindow;
- protected IWorkbenchPage fPage;
-
- public TextSelectionActionExpressionTest(String testName) {
- super(testName);
- }
-
- public void setUp() {
- fWindow = openTestWindow();
- fPage = fWindow.getActivePage();
- }
-
- public void testAnyTextAction() throws Throwable
- {
- // Setup.
- ExtendedTextEditor editor = showTextEditor("anyText.exttxt");
- MenuManager mgr = getActionMenuManager(editor);
-
- // Test empty selection.
- selectAndUpdateMenu(editor, "", mgr);
- testAction(mgr, "anyText", true);
-
- // Test full selection.
- selectAndUpdateMenu(editor, "bob", mgr);
- testAction(mgr, "anyText", true);
-
- // Activate another view.
- fPage.showView(IPageLayout.ID_BOOKMARKS);
- testAction(mgr, "anyText", false);
-
- // Activate editor.
- // Test old selection.
- fPage.activate(editor);
- testAction(mgr, "anyText", true);
-
- // Test empty selection.
- selectAndUpdateMenu(editor, "", mgr);
- testAction(mgr, "anyText", true);
- }
-
- public void testEmptyTextAction() throws Throwable
- {
- // Setup.
- ExtendedTextEditor editor = showTextEditor("emptyText.exttxt");
- MenuManager mgr = getActionMenuManager(editor);
-
- // Test empty selection.
- selectAndUpdateMenu(editor, "", mgr);
- testAction(mgr, "emptyText", true);
-
- // Test full selection.
- selectAndUpdateMenu(editor, "bob", mgr);
- testAction(mgr, "emptyText", false);
-
- // Activate another view.
- fPage.showView(IPageLayout.ID_BOOKMARKS);
- testAction(mgr, "emptyText", false);
-
- // Activate editor.
- // Test old selection.
- fPage.activate(editor);
- testAction(mgr, "emptyText", false);
-
- // Test empty selection.
- selectAndUpdateMenu(editor, "", mgr);
- testAction(mgr, "emptyText", true);
- }
-
- public void testHelloTextAction() throws Throwable
- {
- // Setup.
- ExtendedTextEditor editor = showTextEditor("helloText.exttxt");
- MenuManager mgr = getActionMenuManager(editor);
-
- // Test empty selection.
- selectAndUpdateMenu(editor, "", mgr);
- testAction(mgr, "helloText", false);
-
- // Test wrong selection.
- selectAndUpdateMenu(editor, "bob", mgr);
- testAction(mgr, "helloText", false);
-
- // Test right selection.
- selectAndUpdateMenu(editor, "Hello", mgr);
- testAction(mgr, "helloText", true);
-
- // Activate another view.
- fPage.showView(IPageLayout.ID_BOOKMARKS);
- testAction(mgr, "helloText", false);
-
- // Activate editor.
- // Test old selection.
- fPage.activate(editor);
- testAction(mgr, "helloText", true);
-
- // Test wrong selection.
- selectAndUpdateMenu(editor, "bob", mgr);
- testAction(mgr, "helloText", false);
- }
-
- /**
- * Creates the list view.
- */
- private ExtendedTextEditor showTextEditor(String fileName) throws Throwable
- {
- ExtendedTextEditor editor = null;
- IProject proj = FileUtil.createProject("TextSelectionActionExpressionTest");
- IFile file = FileUtil.createFile(fileName, proj);
- return (ExtendedTextEditor)fPage.openEditor(file);
- }
-
- /**
- * Select an object and fire about to show.
- */
- private void selectAndUpdateMenu(ExtendedTextEditor editor, String str,
- MenuManager mgr) throws Throwable
- {
- editor.setText(str);
- fPage.saveEditor(editor, false);
- ActionUtil.fireAboutToShow(mgr);
- }
-
- /**
- * Returns the menu manager containing the actions.
- */
- private MenuManager getActionMenuManager(ExtendedTextEditor editor)
- throws Throwable
- {
- fPage.showActionSet("org.eclipse.ui.tests.internal.TextSelectionActions");
- WorkbenchWindow win = (WorkbenchWindow)fWindow;
- IContributionItem item = win.getMenuBarManager().find("org.eclipse.ui.tests.internal.TextSelectionMenu");
- while (item instanceof SubContributionItem) {
- item = ((SubContributionItem)item).getInnerItem();
- if (item instanceof MenuManager)
- return (MenuManager)item;
- }
- fail("Unable to find menu manager");
- return null;
- }
-
- /**
- * Tests the enablement / visibility of an action.
- */
- private void testAction(MenuManager mgr, String action,
- boolean expected) throws Throwable
- {
- assertEquals(action, expected, ActionUtil.getActionWithLabel(mgr, action).isEnabled());
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/AbstractNavigatorTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/AbstractNavigatorTest.java deleted file mode 100644 index 8c0da4357f3..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/AbstractNavigatorTest.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.eclipse.ui.tests.navigator;
-
-import java.io.ByteArrayInputStream;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.ui.tests.util.UITestCase;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.views.navigator.ResourceNavigator;
-
-/**
- * The AbstractNavigatorTest is the abstract superclass
- * of tests that use a populated Resource Navigator.
- */
-abstract class AbstractNavigatorTest extends UITestCase {
-
- private static final String NAVIGATOR_VIEW_ID = "org.eclipse.ui.views.ResourceNavigator";
-
- protected IProject testProject;
- protected IFolder testFolder;
- protected IFile testFile;
- protected ResourceNavigator navigator;
-
- public AbstractNavigatorTest(String testName) {
- super(testName);
- }
-
- protected void createTestProject() throws CoreException {
- if (testProject == null) {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- testProject = workspace.getRoot().getProject("TestProject");
- testProject.create(null);
- testProject.open(null);
- }
- }
-
- protected void createTestFolder() throws CoreException {
- if (testFolder == null) {
- createTestProject();
- testFolder = testProject.getFolder("TestFolder");
- testFolder.create(false, false, null);
- }
- }
-
- protected void createTestFile() throws CoreException {
- if (testFile == null) {
- createTestFolder();
- testFile = testFolder.getFile("Foo.txt");
- testFile.create(new ByteArrayInputStream("Some content.".getBytes()), false, null);
- }
- }
-
- /** Shows the Navigator in a new test window. */
- protected void showNav() throws PartInitException {
- IWorkbenchWindow window = openTestWindow();
- navigator = (ResourceNavigator) window.getActivePage().showView(NAVIGATOR_VIEW_ID);
- }
-
- public void tearDown() throws Exception {
- if (testProject != null) {
- try {
- testProject.delete(true, null);
- }
- catch (CoreException e) {
- fail(e.toString());
- }
- testProject = null;
- testFolder = null;
- testFile = null;
- }
- super.tearDown();
- navigator = null;
- }
-
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/DecoratorTestCase.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/DecoratorTestCase.java deleted file mode 100644 index 0e1f68bc278..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/DecoratorTestCase.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.eclipse.ui.tests.navigator;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.LabelProviderChangedEvent;
-import org.eclipse.ui.internal.*;
-
-/**
- * @version 1.0
- */
-public class DecoratorTestCase
- extends AbstractNavigatorTest
- implements ILabelProviderListener {
-
- private DecoratorDefinition definition;
- private boolean updated = false;
-
- /**
- * Constructor for DecoratorTestCase.
- * @param testName
- */
- public DecoratorTestCase(String testName) {
- super(testName);
- }
-
- /**
- * Sets up the hierarchy.
- */
- protected void setUp() throws Exception {
- createTestFile();
- showNav();
-
- WorkbenchPlugin.getDefault().getDecoratorManager().addListener(this);
-
- DecoratorDefinition[] definitions =
- WorkbenchPlugin.getDefault().getDecoratorManager().getDecoratorDefinitions();
- for (int i = 0; i < definitions.length; i++) {
- if (definitions[i].getId().equals("org.eclipse.ui.tests.adaptable.decorator"))
- definition = definitions[i];
- }
- }
-
- private DecoratorManager getDecoratorManager() {
- return WorkbenchPlugin.getDefault().getDecoratorManager();
- }
-
- /**
- * Remove the listener.
- */
-
- public void tearDown() throws Exception {
- super.tearDown();
- getDecoratorManager().removeListener(this);
- }
-
- /**
- * Make a label changed event for resource.
- */
- private LabelProviderChangedEvent getLabelChangedEvent(IResource resource) {
- return new LabelProviderChangedEvent(getDecoratorManager(), resource);
- }
-
- /**
- * Test enabling the contributor
- */
- public void testEnableDecorator() throws CoreException{
- definition.setEnabled(true);
- getDecoratorManager().reset();
-
- }
-
- /**
- * Test disabling the contributor
- */
- public void testDisableDecorator() throws CoreException{
- definition.setEnabled(false);
- getDecoratorManager().reset();
- }
-
- /**
- * Refresh the test decorator.
- */
- public void testRefreshContributor() throws CoreException{
-
- updated = false;
- definition.setEnabled(true);
- getDecoratorManager().reset();
-
- assertTrue("Got an update", updated);
- updated = false;
-
- }
-
- /*
- * @see ILabelProviderListener#labelProviderChanged(LabelProviderChangedEvent)
- */
- public void labelProviderChanged(LabelProviderChangedEvent event) {
- updated = true;
- }
-
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/NavigatorTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/NavigatorTest.java deleted file mode 100644 index b92e5d4fc08..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/NavigatorTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.eclipse.ui.tests.navigator;
-
-import java.io.ByteArrayInputStream;
-import java.io.StringBufferInputStream;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.util.UITestCase;
-import org.eclipse.ui.views.navigator.ResourceNavigator;
-
-/**
- * Tests the Resource Navigator view.
- */
-public class NavigatorTest extends AbstractNavigatorTest {
-
- public NavigatorTest(String testName) {
- super(testName);
- }
-
- /**
- * Tests that the Navigator is initially populated with
- * the correct elements from the workspace.
- */
- public void testInitialPopulation() throws CoreException, PartInitException {
- createTestFile();
- showNav();
-
- // test its initial content by setting and getting selection on the file
- ISelectionProvider selProv = navigator.getSite().getSelectionProvider();
- StructuredSelection sel = new StructuredSelection(testFile);
- selProv.setSelection(sel);
- assertEquals(sel, selProv.getSelection());
- }
-
- /**
- * Tests that the Navigator updates properly when a file is added to the workbench.
- */
- public void testFileAddition() throws CoreException, PartInitException {
- createTestFolder(); // create the project and folder before the Navigator is shown
- showNav();
- createTestFile(); // create the file after the Navigator is shown
-
- // test its initial content by setting and getting selection on the file
- ISelectionProvider selProv = navigator.getSite().getSelectionProvider();
- StructuredSelection sel = new StructuredSelection(testFile);
- selProv.setSelection(sel);
- assertEquals(sel, selProv.getSelection());
- }
-
-}
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/NavigatorTestSuite.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/NavigatorTestSuite.java deleted file mode 100644 index 683c98677e9..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/NavigatorTestSuite.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.eclipse.ui.tests.navigator;
-
-import junit.framework.*;
-
-
-public class NavigatorTestSuite extends TestSuite {
-
- /**
- * Returns the suite. This is required to
- * use the JUnit Launcher.
- */
- public static Test suite() {
- return new NavigatorTestSuite();
- }
-
- /**
- * Construct the test suite.
- */
- public NavigatorTestSuite() {
- addTest(new TestSuite(ResourceNavigatorTest.class));
- addTest(new TestSuite(NavigatorTest.class));
- addTest(new TestSuite(DecoratorTestCase.class));
- }
-
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/ResourceNavigatorTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/ResourceNavigatorTest.java deleted file mode 100644 index a2f2a850a49..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/ResourceNavigatorTest.java +++ /dev/null @@ -1,147 +0,0 @@ -package org.eclipse.ui.tests.navigator;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.*;
-import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.ui.tests.util.*;
-import org.eclipse.ui.views.navigator.ResourceNavigator;
-
-public class ResourceNavigatorTest extends UITestCase {
- private IWorkbenchPage activePage;
- private IWorkbenchWindow workbenchWindow;
- private IViewPart view;
- private IProject p1;
- private IProject p2;
- private IFile f1;
- private IFile f2;
-
- /**
- * Constructor for ResourceNavigatorTest.
- * @param testName
- */
- public ResourceNavigatorTest(String testName) {
- super(testName);
- }
-
- public void setUp() {
- workbenchWindow = openTestWindow();
- activePage = workbenchWindow.getActivePage();
- }
-
- private void setupView() throws Throwable {
- view = activePage.showView("org.eclipse.ui.views.ResourceNavigator");
- }
-
- private void setupResources() throws Throwable {
- if (p1 == null) {
- p1 = FileUtil.createProject("TP1");
- f1 = null;
- }
- if (p2 == null) {
- p2 = FileUtil.createProject("TP2");
- f2 = null;
- }
- if (f1 == null)
- f1 = FileUtil.createFile("f1.txt", p1);
- if (f2 == null)
- f2 = FileUtil.createFile("f2.txt", p2);
- }
-
- public void testGlobalBookmarkAction() throws Throwable {
- setupView();
- setupResources();
-
- // Select a file
- IStructuredSelection sel = new StructuredSelection(f1);
- ((ResourceNavigator) view).selectReveal(sel);
-
- // Remember the previous marker count on the file
- int oldCount = (f1.findMarkers(IMarker.BOOKMARK, true, IResource.DEPTH_INFINITE)).length;
-
- // Now try the bookmark action
- ActionUtil.runActionUsingPath(this, workbenchWindow, IWorkbenchActionConstants.M_EDIT + '/' + IWorkbenchActionConstants.BOOKMARK);
-
- // Make sure the resource was bookmarked
- int newCount = (f1.findMarkers(IMarker.BOOKMARK, true, IResource.DEPTH_INFINITE)).length;
- assertTrue("Selected file was not bookmarked via Edit->Bookmark action.", oldCount + 1 == newCount);
- }
-
-/*
- * This test should be moved to an interactive test suite as this
- * test causes a dialog to popup when the resource is deleted by
- * the delete action
- *
- public void testGlobalDeleteAction() throws Throwable {
- setupView();
- setupResources();
-
- // Select a file
- IStructuredSelection sel = new StructuredSelection(f1);
- ((ResourceNavigator) view).selectReveal(sel);
-
- // Now try the delete action
- ActionUtil.runActionUsingPath(this, workbenchWindow, IWorkbenchActionConstants.M_EDIT + '/' + IWorkbenchActionConstants.DELETE);
-
- // Make sure the resource was deleted
- assertTrue("Selected file was not deleted via Edit->Delete action.", p1.findMember(f1.getName()) == null);
- f1 = null;
- }
-*/
-
- public void testSelectReveal() throws Throwable {
- setupView();
- setupResources();
-
- ISetSelectionTarget part = (ISetSelectionTarget) view;
- TreeViewer tree = ((ResourceNavigator) view).getViewer();
-
- // Set the selection in the navigator
- IStructuredSelection sel1 = new StructuredSelection(f1);
- part.selectReveal(sel1);
- // Get the selection the tree has
- IStructuredSelection treeSel1 = (IStructuredSelection) tree.getSelection();
- assertTrue("First selection wrong size, should be only one.", treeSel1.size() == 1);
- IResource resource1 = (IResource) treeSel1.getFirstElement();
- assertTrue("First selection contains wrong file resource.", resource1.equals(f1));
-
- // Set the selection in the navigator
- IStructuredSelection sel2 = new StructuredSelection(p2);
- part.selectReveal(sel2);
- // Get the selection the tree has
- IStructuredSelection treeSel2 = (IStructuredSelection) tree.getSelection();
- assertTrue("Second selection wrong size, should be only one.", treeSel2.size() == 1);
- IResource resource2 = (IResource) treeSel2.getFirstElement();
- assertTrue("Second selection contains wrong project resource.", resource2.equals(p2));
- }
-
- public void testWorkingSet() throws Throwable {
- setupView();
- setupResources();
-
- ResourceNavigator navigator = ((ResourceNavigator) view);
- IWorkingSetManager workingSetManager = fWorkbench.getWorkingSetManager();
- IWorkingSet workingSet = workingSetManager.createWorkingSet("ws1", new IAdaptable[] {f1});
-
- assertNull(navigator.getWorkingSet());
-
- navigator.setWorkingSet(workingSet);
- assertEquals(workingSet, navigator.getWorkingSet());
-
- navigator.setWorkingSet(null);
- assertNull(navigator.getWorkingSet());
-
- FileUtil.createFile("f11.txt", p1);
- navigator.setWorkingSet(workingSet);
- TreeViewer viewer = navigator.getTreeViewer();
- viewer.expandAll();
- TreeItem[] items = viewer.getTree().getItems();
- assertEquals(p1, items[0].getData());
- items = items[0].getItems();
- assertEquals(f1, items[0].getData());
- }
-}
-
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/TestDecoratorContributor.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/TestDecoratorContributor.java deleted file mode 100644 index 2c146873d67..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/TestDecoratorContributor.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.eclipse.ui.tests.navigator;
-
-import java.util.*;
-
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.graphics.Image;
-
-public class TestDecoratorContributor implements ILabelDecorator {
-
- public static TestDecoratorContributor contributor;
- private Set listeners = new HashSet();
- public static String DECORATOR_SUFFIX = "_SUFFIX";
-
- public TestDecoratorContributor() {
- contributor = this;
- }
-
- /*
- * @see ILabelDecorator#decorateText(String, Object)
- */
- public String decorateText(String text, Object element) {
- return text + DECORATOR_SUFFIX;
- }
- /*
- * @see ILabelDecorator#decorateImage(Image, Object)
- */
- public Image decorateImage(Image image, Object element) {
- return image;
- }
-
- /*
- * @see IBaseLabelProvider#addListener(ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener) {
- listeners.add(listener);
- }
-
- /*
- * @see IBaseLabelProvider#dispose()
- */
- public void dispose() {
- contributor = null;
- listeners = new HashSet();
- }
-
- /*
- * @see IBaseLabelProvider#isLabelProperty(Object, String)
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /*
- * @see IBaseLabelProvider#removeListener(ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener) {
- listeners.remove(listener);
- }
-
- /**
- * Refresh the listeners to update the decorators for
- * element.
- */
-
- public void refreshListeners(Object element) {
- Iterator iterator = listeners.iterator();
- while (iterator.hasNext()) {
- LabelProviderChangedEvent event = new LabelProviderChangedEvent(this, element);
- ((ILabelProviderListener) iterator.next()).labelProviderChanged(event);
- }
- }
-
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/propertysheet/PropertySheetAuto.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/propertysheet/PropertySheetAuto.java deleted file mode 100644 index f04455b3316..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/propertysheet/PropertySheetAuto.java +++ /dev/null @@ -1,222 +0,0 @@ -package org.eclipse.ui.tests.propertysheet;
-
-import java.util.*;
-
-import org.eclipse.ui.tests.util.UITestCase;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.*;
-import org.eclipse.ui.tests.SelectionProviderView;
-import org.eclipse.ui.views.properties.*;
-/**
- * The class implements a test for the workbench's default
- * property sheet page. It does this by firing a sequence of
- * selection events. The property sheet view receives these events
- * and displays the properties for the selected objects.
- * We are able to test the property sheet code which displays
- * properties and handles the transition to another set of
- * properties.
- */
-
-public class PropertySheetAuto extends UITestCase {
-
- /**
- * This car serves as a simple porperty source.
- * The only interesting behavior it has is that if
- * one of its properties has a "null" value then
- * it does not include that property in its list
- * of property descriptors.
- */
- private class Car implements IPropertySource {
- private int modelYear = 0;
- private RGB color = null;
- private String manufacturer = null;
- private String model = null;
- private double engineSize = 0.0;
-
- // property ids
- private final static String prefix = "org.eclipse.ui.tests.standardcomponents.propertysheetauto.";
- private final static String MODEL_YEAR = prefix + "modelyear";
- private final static String COLOR = prefix + "color";
- private final static String MANUFACTURER = prefix + "manufacturer";
- private final static String MODEL = prefix + "model";
- private final static String ENGINE_SIZE = prefix + "enginesize";
-
- private IPropertyDescriptor[] descriptors;
-
- public Car(int carModelYear, RGB carColor,
- String carManufacturer, String carModel, double carEngineSize) {
- modelYear = carModelYear;
- color = carColor;
- manufacturer = carManufacturer;
- model = carModel;
- engineSize = carEngineSize;
-
- createDescriptors();
- }
- /**
- * Creates the property descriptors.
- * If one of the properties has a "null" value then
- * that property is not included in the list of
- * property descriptors.
- */
- private void createDescriptors() {
- ArrayList list = new ArrayList(5);
- if (modelYear != 0)
- list.add(new TextPropertyDescriptor(MODEL_YEAR, "model year"));
- if (color != null)
- list.add(new ColorPropertyDescriptor(COLOR, "color"));
- if (manufacturer != null)
- list.add(new TextPropertyDescriptor(MANUFACTURER, "make"));
- if (model != null)
- list.add(new TextPropertyDescriptor(MODEL, "model"));
- if (engineSize != 0.0)
- list.add(new TextPropertyDescriptor(ENGINE_SIZE, "engine"));
- descriptors = (IPropertyDescriptor[])list.toArray(new IPropertyDescriptor[list.size()]);
- }
- public Object getEditableValue() {
- return this;
- }
- public IPropertyDescriptor[] getPropertyDescriptors() {
- return descriptors;
- }
- public Object getPropertyValue(Object id) {
- if (id.equals(MODEL_YEAR))
- return Integer.toString(modelYear);
- if (id.equals(COLOR))
- return color;
- if (id.equals(MANUFACTURER))
- return manufacturer;
- if (id.equals(MODEL))
- return model;
- if (id.equals(ENGINE_SIZE))
- return Double.toString(engineSize);
- return null;
- }
- public boolean isPropertySet(Object id) {
- return false;
- }
- public void resetPropertyValue(Object id) {
- return;
- }
- public void setPropertyValue(Object id, Object value) {
- if (id.equals(MODEL_YEAR))
- modelYear = new Integer((String)value).intValue();
- if (id.equals(COLOR))
- color = (RGB)value;
- if (id.equals(MANUFACTURER))
- manufacturer = (String)value;
- if (id.equals(MODEL))
- model = (String)value;
- if (id.equals(ENGINE_SIZE))
- engineSize = new Double((String)value).doubleValue();
- }
- public String toString() {
- StringBuffer s = new StringBuffer();
- s.append("<");
- if (modelYear != 0) {
- s.append(modelYear);
- s.append(" ");
- }
- if (color != null) {
- s.append(color);
- s.append(" ");
- }
- if (manufacturer != null) {
- s.append(manufacturer);
- s.append(" ");
- }
- if (model != null) {
- s.append(model);
- s.append(" ");
- }
- if (engineSize != 0.0) {
- s.append(engineSize);
- s.append(" ");
- }
- s.append(">");
- return s.toString();
- }
- }
- private IWorkbenchPage activePage;
- private IWorkbenchWindow workbenchWindow;
- private SelectionProviderView selectionProviderView;
- private Car[] cars;
- private Random random = new Random();
- private static final int NUMBER_OF_CARS = 10;
- private static final int NUMBER_OF_SELECTIONS = 100;
- private static final String[] makers = new String[] {"Ford", "GM", "Chrysler", "BMW", "Toyota", "Nissan", "Honda", "Volvo"};
- private static final String[] models = new String[] {"Thunderbird", "Deville", "Viper", "320i", "Camry", "Ultima", "Prelude", "V70"};
- public PropertySheetAuto(String name) {
- super(name);
- }
- /**
- * Creates a array of car objects
- */
- private void createCars() {
- cars = new Car[NUMBER_OF_CARS];
- for (int i = 0; i < cars.length; i++) {
- cars[i] = createCar();
- }
- }
- /**
- * Creates a car initialized with random values
- */
- private Car createCar() {
- int modelYear = 0;
- RGB color = null;
- String manufacturer = null;
- String model = null;
- double engineSize = 0.0;
- // only set 25% of the properties
- int FACTOR = 4;
- if (random.nextInt(FACTOR) < FACTOR - 1)
- modelYear = 1990 + random.nextInt(15);
- if (random.nextInt(FACTOR) < FACTOR - 1)
- color = new RGB(random.nextInt(256), random.nextInt(256), random.nextInt(256));
- if (random.nextInt(FACTOR) < FACTOR - 1)
- manufacturer = makers[random.nextInt(makers.length)];
- if (random.nextInt(FACTOR) < FACTOR - 1)
- model = models[random.nextInt(models.length)];
- if (random.nextInt(FACTOR) < FACTOR - 1)
- engineSize = random.nextDouble() * 6;
- return new Car(modelYear, color, manufacturer, model, engineSize);
- }
-
- public void setUp() {
- workbenchWindow = openTestWindow();
- activePage = workbenchWindow.getActivePage();
- }
-
- protected IWorkbenchPart createTestPart(IWorkbenchPage page) throws Throwable {
- IViewPart view = page.showView("org.eclipse.ui.views.PropertySheet");
- selectionProviderView = (SelectionProviderView)page.showView(SelectionProviderView.ID);
- return view;
-
- }
-
- /**
- * Supply selection events with a random car selection
- */
- public void testInput() throws Throwable {
- IWorkbenchPart part = createTestPart(activePage);
- createCars();
- for (int i=0; i < NUMBER_OF_SELECTIONS; i++) {
- // create the selection
- int numberToSelect = random.nextInt(NUMBER_OF_CARS - 2);
- ArrayList selection = new ArrayList(numberToSelect);
- while (selection.size() < numberToSelect) {
- int j = random.nextInt(NUMBER_OF_CARS);
- if (!selection.contains(cars[j]))
- selection.add(cars[j]);
- }
- StructuredSelection structuredSelection = new StructuredSelection(selection);
- // fire the selection
- selectionProviderView.setSelection(structuredSelection);
- while(Display.getCurrent().readAndDispatch());
- }
- }
-}
-
-
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/propertysheet/PropertySheetTestSuite.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/propertysheet/PropertySheetTestSuite.java deleted file mode 100644 index ecc8b743342..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/propertysheet/PropertySheetTestSuite.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.eclipse.ui.tests.propertysheet;
-
-import junit.framework.*;
-import junit.textui.TestRunner;
-import org.eclipse.swt.SWT;
-
-/**
- * Test areas of the Property Sheet API.
- */
-public class PropertySheetTestSuite extends TestSuite {
-
- /**
- * Returns the suite. This is required to
- * use the JUnit Launcher.
- */
- public static Test suite() {
- return new PropertySheetTestSuite();
- }
-
- /**
- * Construct the test suite.
- */
- public PropertySheetTestSuite() {
- addTest(new TestSuite(PropertySheetAuto.class));
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ActivateTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ActivateTest.java deleted file mode 100644 index a0777e29179..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ActivateTest.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.eclipse.ui.tests.zoom; -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. and others. -All rights reserved. This program and the accompanying materials -are made available under the terms of the Common Public License v0.5 -which accompanies this distribution, and is available at -http://www.eclipse.org/legal/cpl-v05.html -**********************************************************************/ -import junit.framework.Assert; -import org.eclipse.ui.IViewPart; - -public class ActivateTest extends ZoomTestCase { - public ActivateTest(String name) { - super(name); - } - - // activate a regular view when a view is zoomed - public void test1() { - IViewPart view1 = showRegularView(view1Id); - IViewPart view2 = showRegularView(view2Id); - zoom(view1); - Assert.assertTrue(isZoomed(view1)); - page.activate(view2); - Assert.assertTrue(noZoom()); - } - // activate a fast view when a view is zoomed - public void test2() { - IViewPart view1 = showRegularView(view1Id); - IViewPart view2 = showFastView(view2Id); - zoom(view1); - Assert.assertTrue(isZoomed(view1)); - page.activate(view2); - Assert.assertTrue(isZoomed(view1)); - } - // activate an editor when a view is zoomed - public void test3() { - IViewPart view = showRegularView(view1Id); - page.activate(view); - zoom(view); - Assert.assertTrue(isZoomed(view)); - page.activate(editor1); - Assert.assertTrue(noZoom()); - } - //activate a regular view when an editor is zoomed - public void test4() { - IViewPart view = showRegularView(view1Id); - zoom(editor1); - Assert.assertTrue(isZoomed(editor1)); - page.activate(view); - Assert.assertTrue(noZoom()); - } - // activate a fast view when an editor is zoomed - public void test5() { - IViewPart view = showFastView(view1Id); - zoom(editor1); - Assert.assertTrue(isZoomed(editor1)); - page.activate(view); - Assert.assertTrue(isZoomed(editor1)); - } - // activate an editor in the same workbench as the zoomed editor - public void test6() { - zoom(editor1); - Assert.assertTrue(isZoomed(editor1)); - page.activate(editor2); - Assert.assertTrue(isZoomed(editor2)); - } - // activate an editor in a different workbench than the zoomed editor - public void test7() { - differentWorkbookSetUp(); - zoom(editor1); - Assert.assertTrue(isZoomed(editor1)); - page.activate(editor2); - Assert.assertTrue(noZoom()); - } -} diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/CloseEditorTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/CloseEditorTest.java deleted file mode 100644 index 8b8f3829121..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/CloseEditorTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.eclipse.ui.tests.zoom; -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. and others. -All rights reserved. This program and the accompanying materials -are made available under the terms of the Common Public License v0.5 -which accompanies this distribution, and is available at -http://www.eclipse.org/legal/cpl-v05.html -**********************************************************************/ -import junit.framework.Assert; -import org.eclipse.ui.IViewPart; - -public class CloseEditorTest extends ZoomTestCase { - public CloseEditorTest(String name) { - super(name); - } - - // closing the editor activates a regular view - public void test1() { - IViewPart view = showRegularView(view1Id); - page.closeEditor(editor2, false); - zoom(editor1); - Assert.assertTrue(isZoomed(editor1)); - page.closeEditor(editor1, false); - Assert.assertTrue(page.getActivePart() == view); - Assert.assertTrue(noZoom()); - } - // closing the editor activates an editor in the same workbook - public void test2() { - zoom(editor1); - Assert.assertTrue(isZoomed(editor1)); - page.closeEditor(editor1, false); - Assert.assertTrue(page.getActivePart() == editor2); - Assert.assertTrue(isZoomed(editor2)); - } - // closing the editor activates an editor in a different workbook - public void test3() { - differentWorkbookSetUp(); - zoom(editor1); - Assert.assertTrue(isZoomed(editor1)); - page.closeEditor(editor1, false); - Assert.assertTrue(page.getActivePart() == editor2); - Assert.assertTrue(noZoom()); - } -} diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/HideViewTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/HideViewTest.java deleted file mode 100644 index 38b597fcba4..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/HideViewTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.eclipse.ui.tests.zoom; -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. and others. -All rights reserved. This program and the accompanying materials -are made available under the terms of the Common Public License v0.5 -which accompanies this distribution, and is available at -http://www.eclipse.org/legal/cpl-v05.html -**********************************************************************/ -import junit.framework.Assert; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IViewPart; - -public class HideViewTest extends ZoomTestCase { - public HideViewTest(String name) { - super(name); - } - - // hiding a fast view causes a zoomed regular view to be activated - public void test1() { - IViewPart view1 = showFastView(view1Id); - zoom(editor1); - Assert.assertTrue(isZoomed(editor1)); - page.hideView(view1); - Assert.assertTrue(page.getActivePart() == editor1); - Assert.assertTrue(isZoomed(editor1)); - } - // hiding a fast view causes a zoomed regular view to be activated - public void test2() { - IViewPart view1 = showRegularView(view1Id); - IViewPart view2 = showFastView(view2Id); - zoom(view1); - Assert.assertTrue(isZoomed(view1)); - page.hideView(view2); - Assert.assertTrue(page.getActivePart() == view1); - Assert.assertTrue(isZoomed(view1)); - } - // hiding a regular view causes another regular view to be activated - public void test3() { - IViewPart view1 = showRegularView(view1Id); - IViewPart view2 = showRegularView(view2Id); - zoom(view1); - Assert.assertTrue(isZoomed(view1)); - page.hideView(view1); - Assert.assertTrue(page.getActivePart() == view2); - Assert.assertTrue(noZoom()); - } - // hiding view causes an editor to be activated - public void test4() { - IViewPart view1 = showRegularView(view1Id); - zoom(view1); - Assert.assertTrue(isZoomed(view1)); - page.hideView(view1); - Assert.assertTrue(page.getActivePart() instanceof IEditorPart); - Assert.assertTrue(noZoom()); - } -} diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/OpenEditorTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/OpenEditorTest.java deleted file mode 100644 index 80ebc0257c0..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/OpenEditorTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.eclipse.ui.tests.zoom; -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. and others. -All rights reserved. This program and the accompanying materials -are made available under the terms of the Common Public License v0.5 -which accompanies this distribution, and is available at -http://www.eclipse.org/legal/cpl-v05.html -**********************************************************************/ -import junit.framework.Assert; -import org.eclipse.ui.IViewPart; - -public class OpenEditorTest extends ZoomTestCase { - public OpenEditorTest(String name) { - super(name); - } - - // open an editor when a view is zoomed - public void test1() { - IViewPart view = showRegularView(view1Id); - zoom(view); - openEditor(file1); - Assert.assertTrue(noZoom()); - } - // open an editor in the same workbook as the zoomed editor - public void test2() { - zoom(editor1); - openEditor(file2); - Assert.assertTrue(isZoomed(editor2)); - } - // open an editor in a different workbook than the zoomed editor - public void test3() { - differentWorkbookSetUp(); - zoom(editor1); - openEditor(file2); - Assert.assertTrue(noZoom()); - } - // open a new editor while another editor is zoomed - public void test4() { - page.closeEditor(editor2, false); - zoom(editor1); - openEditor(file2); - Assert.assertTrue(isZoomed(editor2)); - } -} diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ShowViewTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ShowViewTest.java deleted file mode 100644 index a53867d35f5..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ShowViewTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.eclipse.ui.tests.zoom; - -import junit.framework.Assert; -import org.eclipse.ui.IViewPart; - -public class ShowViewTest extends ZoomTestCase { - public ShowViewTest(String name) { - super(name); - } - - // a view is zoomed, a regular view is shown - public void test1() { - IViewPart view1 = showRegularView(view1Id); - IViewPart view2 = showRegularView(view2Id); - zoom(view1); - Assert.assertTrue(isZoomed(view1)); - showRegularView(view2Id); - Assert.assertTrue(noZoom()); - } - // a view is zoomed, a fast view is shown - public void test2() { - IViewPart view1 = showRegularView(view1Id); - zoom(view1); - Assert.assertTrue(isZoomed(view1)); - showFastView(view2Id); - Assert.assertTrue(isZoomed(view1)); - } - // an editor is zoomed, a regular view is shown - public void test3() { - zoom(editor1); - Assert.assertTrue(isZoomed(editor1)); - showRegularView(view1Id); - Assert.assertTrue(noZoom()); - } - // an editor is zoomed, a fast view is shown - public void test4() { - zoom(editor1); - Assert.assertTrue(isZoomed(editor1)); - showFastView(view1Id); - Assert.assertTrue(isZoomed(editor1)); - } -} diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ZoomTestCase.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ZoomTestCase.java deleted file mode 100644 index 46fa0c18a8f..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ZoomTestCase.java +++ /dev/null @@ -1,117 +0,0 @@ -package org.eclipse.ui.tests.zoom; -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. and others. -All rights reserved. This program and the accompanying materials -are made available under the terms of the Common Public License v0.5 -which accompanies this distribution, and is available at -http://www.eclipse.org/legal/cpl-v05.html -**********************************************************************/ -import junit.framework.Assert; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.ui.*; -import org.eclipse.ui.internal.*; -import org.eclipse.ui.tests.api.MockEditorPart; -import org.eclipse.ui.tests.util.FileUtil; -import org.eclipse.ui.tests.util.UITestCase; - -public class ZoomTestCase extends UITestCase { - private static final String projectName = "Test"; - private static final String file1Name = "TestFile1"; - private static final String file2Name = "TestFile2"; - protected static final String view1Id = IPageLayout.ID_RES_NAV; - protected static final String view2Id = IPageLayout.ID_OUTLINE; - - protected WorkbenchWindow window; - protected WorkbenchPage page; - protected IProject project; - protected IFile file1, file2; - protected IEditorPart editor1, editor2; - - public ZoomTestCase(String name) { - super(name); - } - - public void setUp() { - window = (WorkbenchWindow)openTestWindow(); - page = (WorkbenchPage)window.getActivePage(); - IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore(); - store.setDefault(IPreferenceConstants.OPEN_VIEW_MODE, IPreferenceConstants.OVM_FAST); - try { - project = FileUtil.createProject("IEditorPartTest"); - file1 = FileUtil.createFile("Test1.java", project); - file2 = FileUtil.createFile("Test2.java", project); - editor1 = page.openEditor(file1, MockEditorPart.ID1); - editor2 = page.openEditor(file2, MockEditorPart.ID2); - } catch(PartInitException e) { - } catch(CoreException e) { - } - } - - // opens editor2 in a seperate workbook - protected void differentWorkbookSetUp() { - EditorPane pane = (EditorPane)((PartSite)editor1.getSite()).getPane(); - EditorArea area = pane.getWorkbook().getEditorArea(); - EditorWorkbook workbook = new EditorWorkbook(area); - - area.add(workbook, IPageLayout.BOTTOM, (float) 0.5, pane.getWorkbook()); - workbook.add(pane); - - EditorPane pane1 = (EditorPane)((EditorSite)editor1.getSite()).getPane(); - EditorPane pane2 = (EditorPane)((EditorSite)editor2.getSite()).getPane(); - Assert.assertTrue(!pane1.getWorkbook().equals(pane2.getWorkbook())); - } - - // zooms the given part - protected void zoom(IWorkbenchPart part) { - if (part == null) - throw new NullPointerException(); - page.toggleZoom(part); - Assert.assertTrue(page.isZoomed()); - } - // open the given file in an editor - protected void openEditor(IFile file) { - try { - if(file == file1) - editor1 = page.openEditor(file); - if(file == file2) - editor2 = page.openEditor(file); - } catch(PartInitException e) { - } - } - // show the given view as a regular view - protected IViewPart showRegularView(String id) { - try { - IViewPart view = page.showView(id); - if(page.isFastView(view)) - page.removeFastView(view); - return view; - } catch(PartInitException e) { - } ; - return null; - } - // show the given view - protected IViewPart showFastView(String id) { - try { - IViewPart view = page.showView(id); - Assert.assertTrue(page.isFastView(view)); - return view; - } catch(PartInitException e) { - } ; - return null; - } - // returns whether this part is zoomed - protected boolean isZoomed(IWorkbenchPart part) { - PartSite site = (PartSite)part.getSite(); - PartPane pane = site.getPane(); - return pane.isZoomed(); - } - // returns true if the page is not zoomed, false otherwise - protected boolean noZoom() { - if (page.isZoomed()) - return false; - return true; - } -} diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ZoomTestSuite.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ZoomTestSuite.java deleted file mode 100644 index dcb0eb99974..00000000000 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ZoomTestSuite.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.eclipse.ui.tests.zoom; -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. and others. -All rights reserved. This program and the accompanying materials -are made available under the terms of the Common Public License v0.5 -which accompanies this distribution, and is available at -http://www.eclipse.org/legal/cpl-v05.html -**********************************************************************/ -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * A test suite to test the zooming behavior of Eclipse. - */ -public class ZoomTestSuite extends TestSuite { - /** - * Returns the suite. This is required to - * use the JUnit Launcher. - */ - public static Test suite() { - return new ZoomTestSuite(); - } - - /** - * Construct the test suite. - */ - public ZoomTestSuite() { - addTest(new TestSuite(ActivateTest.class)); - addTest(new TestSuite(CloseEditorTest.class)); - addTest(new TestSuite(HideViewTest.class)); - addTest(new TestSuite(OpenEditorTest.class)); - addTest(new TestSuite(ShowViewTest.class)); - } -} diff --git a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/AccessibilityTestPass.java b/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/AccessibilityTestPass.java deleted file mode 100644 index 59afde49eeb..00000000000 --- a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/AccessibilityTestPass.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.eclipse.ui.tests.internal.util;
-
-
-import java.util.ArrayList;
-
-
-public class AccessibilityTestPass implements IDialogTestPass {
- private static final int CHECKLIST_SIZE = 5;
-
- /**
- * @see IDialogTestPass#title()
- */
- public String title() {
- return "Test Pass: Accessibility";
- }
- /**
- * @see IDialogTestPass#description()
- */
- public String description() {
- return "Verify the accessibility of the dialogs.";
- }
- /**
- * @see IDialogTestPass#label()
- */
- public String label() {
- return "&Accessibility";
- }
- /**
- * @see IDialogTestPass#checkListTexts()
- */
- public ArrayList checkListTexts() {
- ArrayList list = new ArrayList(CHECKLIST_SIZE);
- list.add("&1) all widgets are accessible by tabbing.");
- list.add("&2) forwards and backwards tabbing is in a logical order");
- list.add("&3) all the widgets with labels have an appropriate mnemonic.");
- list.add("&4) there are no duplicate mnemonics.");
- list.add("&5) selectable widgets can be selected using the spacebar.");
- return list;
- }
- /**
- * @see IDialogTestPass#failureTexts()
- * Size of the return array must be the same size as the checkListTexts'
- * ArrayList.
- */
- public String[] failureTexts() {
- String[] failureText = new String[CHECKLIST_SIZE];
- failureText[0] = "Some widgets aren't accessible by tabbing.";
- failureText[1] = "Tabbing order is illogical.";
- failureText[2] = "Missing or inappropriate mnemonics.";
- failureText[3] = "Duplicate mnemonics.";
- failureText[4] = "Some widgets cannot be selected using the spacebar.";
- return failureText;
- }
- /**
- * @see IDialogTestPass#queryText()
- */
- public String queryText() {
- return "Is the accessibility of the dialog acceptable?";
- }
- /**
- * @see IDialogTestPass#getID()
- */
- public int getID() {
- return VerifyDialog.TEST_ACCESS;
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/FailureDialog.java b/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/FailureDialog.java deleted file mode 100644 index 9274071f53c..00000000000 --- a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/FailureDialog.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.eclipse.ui.tests.internal.util;
-
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-
-/*
- * A dialog for collecting notes from the tester regarding
- * the failure of a test.
- */
-public class FailureDialog extends Dialog {
- private Text _text;
- private String _log;
- private int SIZING_TEXT_WIDTH = 400;
- private int SIZING_TEXT_HEIGHT = 200;
-
- /**
- * Constructor for FailureDialog
- */
- public FailureDialog(Shell parentShell) {
- super(parentShell);
- }
- /* (non-Javadoc)
- * Method declared on Window.
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText("Dialog Test Failed");
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, IDialogConstants.OK_ID, "&OK", true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected Control createDialogArea(Composite parent) {
- // page group
- Composite composite = (Composite)super.createDialogArea(parent);
- composite.setSize( composite.computeSize(SWT.DEFAULT, SWT.DEFAULT) );
-
- Label label = new Label(composite, SWT.WRAP);
- label.setText("&Enter a note regarding the failure:");
-
- _text = new Text(composite, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- _text.setFont( JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT) );
- GridData data = new GridData(GridData.FILL_BOTH);
- data.widthHint = SIZING_TEXT_WIDTH;
- data.heightHint = SIZING_TEXT_HEIGHT;
- _text.setLayoutData(data);
-
- return composite;
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected void okPressed() {
- _log = _text.getText();
- super.okPressed();
- }
- /*
- * @return String the text contained in the input area of
- * the dialog.
- */
- String getText() {
- if (_log == null) {
- return "Empty entry.";
- } else {
- return _log;
- }
- }
- /*
- * Sets the text of the input area. This should only be
- * called to set the initial text so only call before invoking
- * open().
- */
- void setText(String text) {
- _text.setText(text);
- }
- /*
- * Returns a string representation of this class which
- * the text contained in the input area of the dialog.
- */
- public String toString() {
- return getText();
- }
-}
-
-
diff --git a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/FocusTestPass.java b/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/FocusTestPass.java deleted file mode 100644 index 6a4d9c28104..00000000000 --- a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/FocusTestPass.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.eclipse.ui.tests.internal.util;
-
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.ArrayList;
-
-
-/*
- * This test pass verifies the initial focus of a dialog
- * when it is given focus.
- */
-public class FocusTestPass implements IDialogTestPass {
- private static final int CHECKLIST_SIZE = 1;
-
-
- /**
- * @see IDialogTestPass#title()
- */
- public String title() {
- return "Test Pass: Initial Focus";
- }
- /**
- * @see IDialogTestPass#description()
- */
- public String description() {
- return "Verify the initial focus of the dialogs.";
- }
- /**
- * @see IDialogTestPass#label()
- */
- public String label() {
- return "&Initial Focus";
- }
- /**
- * @see IDialogTestPass#checkListTexts()
- */
- public ArrayList checkListTexts() {
- ArrayList list = new ArrayList(CHECKLIST_SIZE);
- list.add("&1) the initial focus is appropriate.");
- return list;
- }
- /**
- * @see IDialogTestPass#failureTexts()
- * Size of the return array must be the same size as the checkListTexts'
- * ArrayList.
- */
- public String[] failureTexts() {
- String[] failureText = new String[CHECKLIST_SIZE];
- failureText[0] = "The initial focus is inappropriate.";
- return failureText;
- }
- /**
- * @see IDialogTestPass#queryText()
- */
- public String queryText() {
- return "Is the initial focus of the dialog correct?";
- }
- /**
- * @see IDialogTestPass#getID()
- */
- public int getID() {
- return VerifyDialog.TEST_FOCUS;
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/IDialogTestPass.java b/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/IDialogTestPass.java deleted file mode 100644 index 97055ec4251..00000000000 --- a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/IDialogTestPass.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.eclipse.ui.tests.internal.util;
-
-
-import java.util.ArrayList;
-
-
-/*
- * Interface to describe a visual test pass for a dialog test.
- */
-public interface IDialogTestPass {
- /*
- * @return String The title of the test pass.
- */
- public String title();
- /*
- * @return String The description of the test pass.
- */
- public String description();
- /*
- * @return String The label of the test pass to be used
- * in a selection list. The return includes an '&'
- * if a mnemonic is desired.
- */
- public String label();
- /*
- * @return ArrayList A list of items to appear in a checklist.
- * The items in the list must be Strings and should include an
- * '&' if a mnemonic is desired.
- */
- public ArrayList checkListTexts();
- /*
- * @return String[] Associated failure messages that correspond
- * to the checklist items. The size of this array should be the
- * same size as the checklist.
- */
- public String[] failureTexts();
- /*
- * @return String The test that corresponds to the test pass to
- * which the tester will respond with a 'yes' or 'no'.
- */
- public String queryText();
- /*
- * @return int A unique number that identifies the test pass.
- */
- public int getID();
-}
-
-
diff --git a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/SizingTestPass.java b/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/SizingTestPass.java deleted file mode 100644 index b744b474778..00000000000 --- a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/SizingTestPass.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.eclipse.ui.tests.internal.util;
-
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.ArrayList;
-
-
-/*
- * This test pass verifies visually the sizing of the dialog and its
- * widgets.
- */
-class SizingTestPass implements IDialogTestPass {
- private static final int CHECKLIST_SIZE = 5;
-
-
- /**
- * @see IDialogTestPass#title()
- */
- public String title() {
- return "Test Pass: Sizing and Display";
- }
- /**
- * @see IDialogTestPass#description()
- */
- public String description() {
- return "Verify the sizing and display of the dialogs and widgets.";
- }
- /**
- * @see IDialogTestPass#label()
- */
- public String label() {
- return "&Sizing and Display";
- }
- /**
- * @see IDialogTestPass#checkListTexts()
- */
- public ArrayList checkListTexts() {
- ArrayList list = new ArrayList(CHECKLIST_SIZE);
- list.add("&1) the correct dialog displays.");
- list.add("&2) the dialog is an appropriate size for the required resolution (1024x768).");
- list.add("&3) the texts are correct and not cut off.");
- list.add("&4) all strings have been externalized properly.");
- list.add("&5) all the widgets are viewable and not cut off.");
- return list;
- }
- /**
- * @see IDialogTestPass#failureTexts()
- * Size of the return array must be the same size as the checkListTexts'
- * ArrayList.
- */
- public String[] failureTexts() {
- String[] failureText = new String[CHECKLIST_SIZE];
- failureText[0] = "The wrong dialog displayed.";
- failureText[1] = "The dialog is too large for the required resolution.";
- failureText[2] = "Text labels are wrong or cut off.";
- failureText[3] = "Some strings have not been externalized properly.";
- failureText[4] = "Some widgets are cut off.";
- return failureText;
- }
- /**
- * @see IDialogTestPass#queryText()
- */
- public String queryText() {
- return "Is the sizing and display of the dialog correct?";
- }
- /**
- * @see IDialogTestPass#getID()
- */
- public int getID() {
- return VerifyDialog.TEST_SIZING;
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/VerifyDialog.java b/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/VerifyDialog.java deleted file mode 100644 index c06338b7ad3..00000000000 --- a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/internal/util/VerifyDialog.java +++ /dev/null @@ -1,305 +0,0 @@ -package org.eclipse.ui.tests.internal.util;
-
-
-import java.util.Iterator;
-
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.ShellAdapter;
-import org.eclipse.swt.events.ShellEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-
-/*
- * This dialog is intended to verify a dialogs in a testing
- * environment. The tester can test for sizing, initial focus,
- * or accessibility.
- */
-public class VerifyDialog extends TitleAreaDialog {
- private int SIZING_WIDTH = 400;
-
- private static int TEST_TYPE;
- public static final int TEST_SIZING = 0;
- public static final int TEST_FOCUS = 1;
- public static final int TEST_ACCESS = 2;
- private IDialogTestPass _dialogTests[] = new IDialogTestPass[3];
-
-
- private Dialog _testDialog; //the dialog to test
- private Point _testDialogSize;
-
- private Label _queryLabel;
- private Button _yesButton;
- private Button _noButton;
- private Button _checkList[];
- private String _failureText;
-
- /*
- * Create an instance of the verification dialog.
- */
- public VerifyDialog(Shell parent) {
- super(parent);
- if ( !(TEST_TYPE <= 2) && !(TEST_TYPE >= 0) ) {
- TEST_TYPE = TEST_SIZING;
- }
- _failureText = "";
- _dialogTests[0] = new SizingTestPass();
- _dialogTests[1] = new FocusTestPass();
- _dialogTests[2] = new AccessibilityTestPass();
- }
-
- /* (non-Javadoc)
- * Method declared on Window.
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText("Dialog Verification");
- setShellStyle(SWT.NONE);
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected void createButtonsForButtonBar(Composite parent) {
- _yesButton = createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, true);
- _noButton = createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, false);
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected void buttonPressed(int buttonId) {
- if (IDialogConstants.YES_ID == buttonId) {
- setReturnCode(IDialogConstants.YES_ID);
- if (_testDialog.getShell() != null) {
- _testDialog.close();
- }
- close();
- } else if (IDialogConstants.NO_ID == buttonId) {
- handleFailure();
- }
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected Control createDialogArea(Composite parent) {
- // top level composite
- Composite parentComposite = (Composite)super.createDialogArea(parent);
-
-
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parentComposite, SWT.NONE);
- composite.setSize(SIZING_WIDTH, SWT.DEFAULT);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-
- createTestSelectionGroup(composite);
- createCheckListGroup(composite);
-
-
- _queryLabel = new Label(composite, SWT.NONE);
- _queryLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- initializeTest();
- return composite;
- }
- /*
- * Group for selecting type of test.
- */
- private void createTestSelectionGroup(Composite parent) {
- Group group = new Group(parent, SWT.SHADOW_NONE);
- group.setText("Testing:");
- group.setLayout( new GridLayout() );
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- group.setLayoutData(data);
-
- for (int i = 0; i < _dialogTests.length; i++) {
- Button radio = new Button(group, SWT.RADIO);
- radio.setText( _dialogTests[i].label() );
- final int testID = _dialogTests[i].getID();
- radio.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- TEST_TYPE = testID;
- initializeTest();
- _yesButton.setEnabled(true);
- }
- });
- if ( TEST_TYPE == _dialogTests[i].getID() ) {
- radio.setSelection(true);
- }
- }
- }
- /*
- * Initializes the checklist with empty checks.
- */
- private void createCheckListGroup(Composite parent) {
- Group group = new Group(parent, SWT.SHADOW_NONE);
- group.setText("Verify that:");
- group.setLayout( new GridLayout() );
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- group.setLayoutData(data);
-
- int checkListSize = 0;
- for (int i = 0; i < _dialogTests.length; i++) {
- int size = _dialogTests[i].checkListTexts().size();
- if (size > checkListSize) {
- checkListSize = size;
- }
- }
- _checkList = new Button[checkListSize];
- SelectionAdapter selectionAdapter = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- checkYesEnable();
- }
- };
- for (int i = 0; i < checkListSize; i++) {
- _checkList[i] = new Button(group, SWT.CHECK);
- _checkList[i].addSelectionListener(selectionAdapter);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.grabExcessHorizontalSpace = true;
- _checkList[i].setLayoutData(data);
- }
- }
- /*
- * Disables the yes button if any of the items in the checklist
- * are unchecked. Enables the yes button otherwise.
- */
- private void checkYesEnable() {
- boolean enable = true;
- for (int i = 0; i < _checkList.length; i++) {
- if ( !_checkList[i].getSelection() ) {
- enable = false;
- }
- }
- _yesButton.setEnabled(enable);
- }
- /*
- * Initializes the checklist, banner texts, and query label
- */
- private void initializeTest() {
- IDialogTestPass test = _dialogTests[TEST_TYPE];
- setTitle( test.title() );
- setMessage( test.description() );
- Iterator iterator = test.checkListTexts().iterator();
- for (int i = 0; i < _checkList.length; i++) {
- if ( iterator.hasNext() ) {
- _checkList[i].setText( iterator.next().toString() );
- _checkList[i].setVisible(true);
- _checkList[i].update();
- } else {
- _checkList[i].setVisible(false);
- _checkList[i].update();
- }
- _checkList[i].setSelection(true);
- }
- _queryLabel.setText( test.queryText() );
- }
- public String getFailureText() {
- return _failureText;
- }
- /*
- * Can't open the verification dialog without a specified
- * test dialog, this simply returns a failure and prevents
- * opening. Should use open(Dialog) instead.
- *
- */
- public int open() {
- _failureText = "Testing dialog is required, use VerifyDialog::open(Dialog)";
- return IDialogConstants.NO_ID;
- }
- /*
- * Opens the verification dialog to test the specified dialog.
- */
- public int open(Dialog testDialog) {
- if (getShell() == null) {
- create();
- }
- getShell().setLocation(0, 0);
- getShell().setSize(Math.max(SIZING_WIDTH, getShell().getSize().x), getShell().getSize().y);
- _testDialog = testDialog;
- if (_testDialog.getShell() == null) {
- _testDialog.create();
- }
- _testDialogSize = _testDialog.getShell().getSize();
- openNewTestDialog();
-
- return super.open();
- }
- /*
- * Opens the dialog to be verified.
- */
- private void openNewTestDialog() {
- if (_testDialog.getShell() == null) {
- _testDialog.create();
- }
- _testDialog.setBlockOnOpen(false);
- _testDialog.getShell().setLocation(getShell().getSize().x + 1, 0);
- _testDialog.getShell().setSize(_testDialogSize);
- _testDialog.getShell().addShellListener(new ShellAdapter() {
- public void shellClosed(ShellEvent e) {
- e.doit = false;
- }
-
- });
- _testDialog.open();
- }
- /*
- * The test dialog failed, open the failure dialog.
- */
- private void handleFailure() {
- IDialogTestPass test = _dialogTests[TEST_TYPE];
- StringBuffer text = new StringBuffer();
- String label = test.label();
- label = label.substring(0, label.indexOf("&")) +
- label.substring(label.indexOf("&") + 1);
- text.append(label).
- append(" failed on the ").
- append(SWT.getPlatform()).
- append(" platform:\n");
-
- String failureMessages[] = test.failureTexts();
- for (int i = 0; i < test.checkListTexts().size(); i++) {
- if ( !_checkList[i].getSelection() ) {
- text.append("- ").append(failureMessages[i]).append("\n");
- }
- }
- FailureDialog dialog = new FailureDialog( getShell() );
- dialog.create();
- String temp = text.toString();
- dialog.setText( text.toString() );
- if (dialog.open() == IDialogConstants.OK_ID) {
- _failureText = dialog.toString();
- setReturnCode(IDialogConstants.NO_ID);
- if (_testDialog.getShell() != null) {
- _testDialog.close();
- }
- close();
- }
- }
- /*
- * In case the shell was closed by a means other than
- * the NO button.
- */
- protected void handleShellCloseEvent() {
- handleFailure();
- }
-}
-
-
diff --git a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/ActionUtil.java b/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/ActionUtil.java deleted file mode 100644 index 9f082c7a5b2..00000000000 --- a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/ActionUtil.java +++ /dev/null @@ -1,150 +0,0 @@ -package org.eclipse.ui.tests.util;
-import java.lang.reflect.Method;
-import junit.framework.TestCase;
-import org.eclipse.jface.action.*;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.internal.WorkbenchWindow;
-
-
-/**
- * <code>ActionUtil</code> contains methods to run actions
- * in the workbench.
- */
-public class ActionUtil {
-
-
- /**
- * Runs an action contribution.
- *
- * @param test the current test case
- * @param item an action contribution item
- */
- public static void runAction(TestCase test,
- IContributionItem item)
- {
- test.assertTrue(item instanceof ActionContributionItem);
- ((ActionContributionItem)item).getAction().run();
- }
-
- /**
- * Runs the first action found in a menu manager with a
- * particular label.
- *
- * @param test the current test case
- * @param mgr the containing menu manager
- * @param label the action label
- */
- public static void runActionWithLabel(TestCase test,
- IMenuManager mgr, String label)
- {
- IContributionItem [] items = mgr.getItems();
- for (int nX = 0; nX < items.length; nX ++) {
- IContributionItem item = items[nX];
- if (item instanceof SubContributionItem)
- item = ((SubContributionItem)item).getInnerItem();
- if (item instanceof ActionContributionItem) {
- IAction action = ((ActionContributionItem)item).getAction();
- if (label.equals(action.getText())) {
- action.run();
- return;
- }
- }
- }
- test.fail("Unable to find action: " + label);
- }
-
-
- /**
- * Runs the first action found in a window with a
- * particular label.
- *
- * @param test the current test case
- * @param win the containing window
- * @param label the action label
- */
- public static void runActionWithLabel(TestCase test,
- IWorkbenchWindow win, String label)
- {
- WorkbenchWindow realWin = (WorkbenchWindow)win;
- IMenuManager mgr = realWin.getMenuManager();
- runActionWithLabel(test, mgr, label);
- }
-
- /**
- * Runs an action identified by an id path in a
- * menu manager.
- *
- * @param test the current test case
- * @param mgr the containing menu manager
- * @param label the action label
- */
- public static void runActionUsingPath(TestCase test,
- IMenuManager mgr, String idPath)
- {
- IContributionItem item = mgr.findUsingPath(idPath);
- test.assertNotNull(item);
- runAction(test, item);
- }
-
- /**
- * Runs an action identified by an id path in a
- * window.
- *
- * @param test the current test case
- * @param win the containing window
- * @param label the action label
- */
- public static void runActionUsingPath(TestCase test,
- IWorkbenchWindow win, String idPath)
- {
- WorkbenchWindow realWin = (WorkbenchWindow)win;
- IMenuManager mgr = realWin.getMenuManager();
- runActionUsingPath(test, mgr, idPath);
- }
-
- /**
- * Returns the first action found in a menu manager with a
- * particular label.
- *
- * @param mgr the containing menu manager
- * @param label the action label
- * @return the first action with the label, or <code>null</code>
- * if it is not found.
- */
- public static IAction getActionWithLabel(IMenuManager mgr,
- String label)
- {
- IContributionItem [] items = mgr.getItems();
- for (int nX = 0; nX < items.length; nX ++) {
- IContributionItem item = items[nX];
- if (item instanceof SubContributionItem)
- item = ((SubContributionItem)item).getInnerItem();
- if (item instanceof ActionContributionItem) {
- IAction action = ((ActionContributionItem)item).getAction();
- if (label.equals(action.getText())) {
- return action;
- }
- }
- }
- return null;
- }
-
- /**
- * Fire the "handleAboutToShow" method in a menu manager.
- * This triggers the same behavior as when a user opens a menu.
- * The menu to be populated with actions and those
- * actions to be enacted in SWT widgets.
- *
- * @param mgr the menu manager to open
- */
- public static void fireAboutToShow(MenuManager mgr)
- throws Throwable
- {
- Class clazz = mgr.getClass();
- Method method = clazz.getDeclaredMethod("handleAboutToShow", new Class [0]);
- method.setAccessible(true);
- method.invoke(mgr, new Object[0]);
- }
-}
-
-
diff --git a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/ArrayUtil.java b/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/ArrayUtil.java deleted file mode 100644 index d65b28a64e2..00000000000 --- a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/ArrayUtil.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.eclipse.ui.tests.util;
-import java.util.Random;
-
-
-/**
- * <code>ArrayUtil</code> contains methods for array
- * examination.
- */
-public class ArrayUtil
-{
- private static Random randomBox = new Random();
-
-
- /**
- * Returns a random object chosen from an array.
- *
- * @param array the input array
- * @return a random object in the array
- */
- public static Object pickRandom(Object[] array) {
- int num = randomBox.nextInt(array.length);
- return array[num];
- }
-
-
- /**
- * Returns whether an array is not null and
- * each object in the array is not null.
- *
- * @param array the input array
- * @return <code>true or false</code>
- */
- public static boolean checkNotNull(Object[] array) {
- if (array == null)
- return false;
- else {
- for (int i = 0; i < array.length; i++)
- if (array[i] == null)
- return false;
- return true;
- }
- }
-
-
- /**
- * Returns whether an array contains a given object.
- *
- * @param array the input array
- * @param element the test object
- * @return <code>true</code> if the array contains the object,
- * <code>false</code> otherwise.
- */
- public static boolean contains(Object[] array, Object element) {
- if (array == null || element == null)
- return false;
- else {
- for (int i = 0; i < array.length; i++)
- if( array[ i ] == element )
- return true;
- return false;
- }
- }
-
-
- /**
- * Returns whether two arrays are equal. They must
- * have the same size and the same contents.
- *
- * @param one the first array
- * @param two the second array
- * @return <code>true</code> if the array are equal,
- * <code>false</code> otherwise.
- */
- public static boolean equals(Object[] one, Object[] two) {
- if (one.length != two.length)
- return false;
- else {
- for (int i = 0; i < one.length; i++)
- if (one[i] != two[i])
- return false;
- return true;
- }
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/CallHistory.java b/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/CallHistory.java deleted file mode 100644 index 93c01b6d54a..00000000000 --- a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/CallHistory.java +++ /dev/null @@ -1,139 +0,0 @@ -package org.eclipse.ui.tests.util;
-import java.util.*;
-import java.lang.*;
-import java.lang.reflect.*;
-
-
-/**
- * <code>CallHistory</code> is used to record the invocation
- * of methods within a target object. This is useful during
- * lifecycle testing for an object.
- * <p>
- * To use <code>CallHistory</code> ..
- * <ol>
- * <li>Create a CallHistory in the target or pass one in.</li>
- * <li>Invoke some test scenario. </li>
- * <li>If a method is called on the target record the invocation
- * in the call history</li>
- * <li>Verify the call history after the test scenario is
- * complete.</li>
- * </ol>
- * </p><p>
- * Each <code>CallHistory</code> has a target which is used to
- * verify the method names passed to the history. If an invalid
- * name is passed an <code>IllegalArgumentException</code> will
- * be thrown.
- * </p>
- */
-public class CallHistory {
- private ArrayList methodList;
- private Class classType;
-
-
- /**
- * Creates a new call history for an object.
- *
- * @param target the call history target.
- */
- public CallHistory( Object target )
- {
- methodList = new ArrayList();
- classType = target.getClass();
- }
-
- /**
- * Throws an exception if the method name is invalid
- * for the given target class.
- */
- private void testMethodName(String methodName) {
- Method[] methods = classType.getMethods();
- for( int i = 0; i < methods.length; i ++ )
- if( methods[ i ].getName().equals( methodName ) )
- return;
- throw new IllegalArgumentException("Target class ("
- + classType.getName()
- + ") does not contain method: "
- + methodName);
- }
-
- /**
- * Adds a method name to the call history.
- *
- * @param methodName the name of a method
- */
- public void add(String methodName)
- {
- testMethodName(methodName);
- methodList.add( methodName );
- }
-
- /**
- * Clears the call history.
- */
- public void clear()
- {
- methodList.clear();
- }
-
- /**
- * Returns whether a list of methods have been called in
- * order.
- *
- * @param testNames an array of the method names in the order they are expected
- * @return <code>true</code> if the methods were called in order
- */
- public boolean verifyOrder(String[] testNames ) throws IllegalArgumentException
- {
- int testIndex = 0;
- int testLength = testNames.length;
- if (testLength == 0)
- return true;
- for (int nX = 0; nX < methodList.size(); nX ++) {
- String methodName = (String)methodList.get(nX);
- String testName = testNames[testIndex];
- testMethodName(testName);
- if(testName.equals(methodName))
- ++ testIndex;
- if (testIndex >= testLength)
- return true;
- }
- return false;
- }
-
- /**
- * Returns whether a method has been called.
- *
- * @param methodName a method name
- * @return <code>true</code> if the method was called
- */
- public boolean contains(String methodName )
- {
- testMethodName(methodName);
- return methodList.contains( methodName );
- }
-
- /**
- * Returns whether a list of methods were called.
- *
- * @param methodNames a list of methods
- * @return <code>true</code> if the methods were called
- */
- public boolean contains(String[] methodNames )
- {
- for( int i = 0; i < methodNames.length; i ++ ) {
- testMethodName(methodNames[ i ] );
- if(!methodList.contains( methodNames[ i ] ))
- return false;
- }
- return true;
- }
-
- /**
- * Prints the call history to the console.
- */
- public void printToConsole()
- {
- for( int i = 0; i < methodList.size(); i ++ )
- System.out.println( methodList.get( i ) );
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/DialogCheck.java b/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/DialogCheck.java deleted file mode 100644 index b961172daac..00000000000 --- a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/DialogCheck.java +++ /dev/null @@ -1,219 +0,0 @@ -package org.eclipse.ui.tests.util;
-
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-
-import junit.framework.Assert;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.internal.WorkbenchPlugin;
-import org.eclipse.ui.tests.internal.util.VerifyDialog;
-
-
-/**
- * A <code>DialogCheck</code> is used test a dialog in
- * various ways.
- * <p>
- * For interactive tests use <code>assertDialog</code>.
- * For automated tests use <code>assert DialogTexts</code>.
- * </p>
- */
-public class DialogCheck {
- private DialogCheck() {
- }
- private static VerifyDialog _verifyDialog;
-
-
- /**
- * Asserts that a given dialog is not null and that it passes
- * certain visual tests. These tests will be verified manually
- * by the tester using an input dialog. Use this assert method
- * to verify a dialog's sizing, initial focus, or accessiblity.
- * To ensure that both the input dialog and the test dialog are
- * accessible by the tester, the getShell() method should be used
- * when creating the test dialog.
- *
- * Example usage:
- * <code>Dialog dialog = new AboutDialog( DialogCheck.getShell() );
- * DialogCheck.assertDialog(dialog, this);</code>
- *
- * @param dialog the test dialog to be verified.
- * @param assert this is the test case object, assertions will be
- * executed on this object.
- */
- public static void assertDialog(Dialog dialog, Assert assert) {
- assert.assertNotNull(dialog);
- if (_verifyDialog.getShell() == null) {
- //force the creation of the verify dialog
- getShell();
- }
- if (_verifyDialog.open(dialog) == IDialogConstants.NO_ID) {
- assert.assertTrue(_verifyDialog.getFailureText(), false);
- }
- }
-
-
- /**
- * Automated test that checks all the labels and buttons of a dialog
- * to make sure there is enough room to display all the text. Any
- * text that wraps is only approximated and is currently not accurate.
- *
- * @param dialog the test dialog to be verified.
- * @param assert this is the test case object, assertions will be
- * executed on this object.
- */
- public static void assertDialogTexts(Dialog dialog, Assert assert) {
- assert.assertNotNull(dialog);
- dialog.setBlockOnOpen(false);
- dialog.open();
- Shell shell = dialog.getShell();
- verifyCompositeText(shell, assert);
- dialog.close();
- }
-
-
- /**
- * This method should be called when creating dialogs to test. This
- * ensures that the dialog's parent shell will be that of the
- * verification dialog.
- *
- * @return Shell The shell of the verification dialog to be used as
- * the parent shell of the test dialog.
- */
- public static Shell getShell() {
- Shell shell =
- WorkbenchPlugin
- .getDefault()
- .getWorkbench()
- .getActiveWorkbenchWindow()
- .getShell();
- _verifyDialog = new VerifyDialog(shell);
- _verifyDialog.create();
- return _verifyDialog.getShell();
- }
-
-
- /*
- * Looks at all the child widgets of a given composite and
- * verifies the text on all labels and widgets.
- * @param composite The composite to look through
- * @param assert The object to invoke assertions on.
- */
- private static void verifyCompositeText(Composite composite, Assert assert) {
- Control children[] = composite.getChildren();
- for (int i = 0; i < children.length; i++) {
- try {
- //verify the text if the child is a button
- verifyButtonText((Button) children[i], assert);
- } catch (ClassCastException exNotButton) {
- try {
- //child is not a button, maybe a label
- verifyLabelText((Label) children[i], assert);
- } catch (ClassCastException exNotLabel) {
- try {
- //child is not a label, make a recursive call if it is a composite
- verifyCompositeText((Composite) children[i], assert);
- } catch (ClassCastException exNotComposite) {
- //the child is not a button, label, or composite - ignore it.
- }
- }
- }
- }
- }
-
- /*
- * Verifies that a given button is large enough to display its text.
- * @param button The button to verify,
- * @param assert The object to invoke assertions on.
- */
- private static void verifyButtonText(Button button, Assert assert) {
- String widget = button.toString();
- Point size = button.getSize();
-
-
- //compute the size with no line wrapping
- Point preferred = button.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- //if (size.y/preferred.y) == X, then label spans X lines, so divide
- //the calculated value of preferred.x by X
- if (preferred.y * size.y > 0) {
- preferred.y /= countLines(button.getText()); //check for '\n\'
- if (size.y / preferred.y > 1) {
- preferred.x /= (size.y / preferred.y);
- }
- }
-
-
- String message =
- new StringBuffer("Warning: ")
- .append(widget)
- .append("\n\tActual Width -> ")
- .append(size.x)
- .append("\n\tRecommended Width -> ")
- .append(preferred.x)
- .toString();
- if (preferred.x > size.x) {
- //close the dialog
- button.getShell().dispose();
- assert.assertTrue(message.toString(), false);
- }
- }
-
- /*
- * Verifies that a given label is large enough to display its text.
- * @param label The label to verify,
- * @param assert The object to invoke assertions on.
- */
- private static void verifyLabelText(Label label, Assert assert) {
- String widget = label.toString();
- Point size = label.getSize();
-
-
- //compute the size with no line wrapping
- Point preferred = label.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- //if (size.y/preferred.y) == X, then label spans X lines, so divide
- //the calculated value of preferred.x by X
- if (preferred.y * size.y > 0) {
- preferred.y /= countLines(label.getText());
- if (size.y / preferred.y > 1) {
- preferred.x /= (size.y / preferred.y);
- }
- }
- String message =
- new StringBuffer("Warning: ")
- .append(widget)
- .append("\n\tActual Width -> ")
- .append(size.x)
- .append("\n\tRecommended Width -> ")
- .append(preferred.x)
- .toString();
- if (preferred.x > size.x) {
- //close the dialog
- label.getShell().dispose();
- assert.assertTrue(message.toString(), false);
- }
- }
-
- /*
- * Counts the number of lines in a given String.
- * For example, if a string contains one (1) newline character,
- * a value of two (2) would be returned.
- * @param text The string to look through.
- * @return int the number of lines in text.
- */
- private static int countLines(String text) {
- int newLines = 1;
- for (int i = 0; i < text.length(); i++) {
- if (text.charAt(i) == '\n') {
- newLines++;
- }
- }
- return newLines;
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/EmptyPerspective.java b/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/EmptyPerspective.java deleted file mode 100644 index 75e617070df..00000000000 --- a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/EmptyPerspective.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.eclipse.ui.tests.util;
-
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ui.*;
-import org.eclipse.ui.part.*;
-import org.eclipse.ui.part.*;
-import org.eclipse.swt.SWT;
-
-
-/**
- * This perspective is used for testing api. It defines an initial
- * layout with no parts, just an editor area.
- */
-public class EmptyPerspective implements IPerspectiveFactory {
-
- /**
- * The perspective id.
- */
- public static final String PERSP_ID = "org.eclipse.ui.tests.util.EmptyPerspective";
-
- /**
- * Constructs a new Default layout engine.
- */
- public EmptyPerspective() {
- super();
- }
-
- /**
- * Defines the initial layout for a perspective.
- *
- * Implementors of this method may add additional views to a
- * perspective. The perspective already contains an editor folder
- * with <code>ID = ILayoutFactory.ID_EDITORS</code>. Add additional views
- * to the perspective in reference to the editor folder.
- *
- * This method is only called when a new perspective is created. If
- * an old perspective is restored from a persistence file then
- * this method is not called.
- *
- * @param factory the factory used to add views to the perspective
- */
- public void createInitialLayout(IPageLayout layout) {
- //layout.addView( MockViewPart.ID, IPageLayout.BOTTOM, 0.5f, layout.getEditorArea() );
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/FileUtil.java b/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/FileUtil.java deleted file mode 100644 index 9f4c5da4645..00000000000 --- a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/FileUtil.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.eclipse.ui.tests.util;
-
-
-import java.io.*;
-
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.CoreException;
-
-
-/**
- * <code>FileUtil</code> contains methods to create and
- * delete files and projects.
- */
-public class FileUtil {
-
-
- /**
- * Creates a new project.
- *
- * @param name the project name
- */
- public static IProject createProject(String name)
- throws CoreException
- {
- IWorkspace ws = ResourcesPlugin.getWorkspace();
- IWorkspaceRoot root = ws.getRoot();
- IProject proj = root.getProject(name);
- if (!proj.exists())
- proj.create(null);
- if (!proj.isOpen())
- proj.open(null);
- return proj;
- }
-
-
- /**
- * Deletes a project.
- *
- * @param proj the project
- */
- public static void deleteProject(IProject proj)
- throws CoreException
- {
- proj.delete(true, null);
- }
-
- /**
- * Creates a new file in a project.
- *
- * @param name the new file name
- * @param proj the existing project
- * @return the new file
- */
- public static IFile createFile(String name, IProject proj)
- throws CoreException
- {
- IWorkspace ws = ResourcesPlugin.getWorkspace();
- IWorkspaceRoot root = ws.getRoot();
- IFile file = proj.getFile(name);
- if (!file.exists()) {
- String str = " ";
- InputStream in = new ByteArrayInputStream(str.getBytes());
- file.create(in, true, null);
- }
- return file;
- }
-
-}
-
-
diff --git a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/UITestCase.java b/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/UITestCase.java deleted file mode 100644 index 9f80b018b04..00000000000 --- a/tests/org.eclipse.ui.tests/UI Test Utils/org/eclipse/ui/tests/util/UITestCase.java +++ /dev/null @@ -1,116 +0,0 @@ -package org.eclipse.ui.tests.util;
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-
-import junit.framework.TestCase;
-import org.eclipse.core.resources.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.IWorkbenchPage;
-
-
-/**
- * <code>UITestCase</code> is a useful super class for most
- * UI tests cases. It contains methods to create new windows
- * and pages. It will also automatically close the test
- * windows when the tearDown method is called.
- */
-public abstract class UITestCase extends TestCase
-{
- protected IWorkbench fWorkbench;
- private List testWindows;
-
-
- public UITestCase(String testName) {
- super(testName);
- fWorkbench = PlatformUI.getWorkbench();
- testWindows = new ArrayList(3);
- }
-
-
- /**
- * Tear down. May be overridden.
- */
- protected void tearDown() throws Exception {
- closeAllTestWindows();
- }
-
-
- /**
- * Open a test window with the empty perspective.
- */
- public IWorkbenchWindow openTestWindow() {
- try {
- IWorkbenchWindow win =
- fWorkbench.openWorkbenchWindow(
- EmptyPerspective.PERSP_ID,
- ResourcesPlugin.getWorkspace());
- testWindows.add(win);
- return win;
- } catch (WorkbenchException e) {
- fail();
- return null;
- }
- }
-
-
- /**
- * Close all test windows.
- */
- public void closeAllTestWindows() {
- Iterator iter = testWindows.iterator();
- IWorkbenchWindow win;
- while (iter.hasNext()) {
- win = (IWorkbenchWindow) iter.next();
- win.close();
- }
- testWindows.clear();
- }
-
-
- /**
- * Open a test page with the empty perspective in a window.
- */
- public IWorkbenchPage openTestPage(IWorkbenchWindow win)
- {
- IWorkbenchPage[] pages = openTestPage(win, 1);
- if( pages != null )
- return pages[0];
- else
- return null;
- }
-
-
- /**
- * Open "n" test pages with the empty perspectie in a window.
- */
- public IWorkbenchPage[] openTestPage(IWorkbenchWindow win, int pageTotal) {
- try{
- IWorkbenchPage[] pages = new IWorkbenchPage[pageTotal];
- IWorkspace work = ResourcesPlugin.getWorkspace();
-
-
- for (int i = 0; i < pageTotal; i++)
- pages[i] = win.openPage(EmptyPerspective.PERSP_ID, work);
- return pages;
- }
- catch( WorkbenchException e )
- {
- fail();
- return null;
- }
- }
-
-
- /**
- * Close all pages within a window.
- */
- public void closeAllPages(IWorkbenchWindow window) {
- IWorkbenchPage[] pages = window.getPages();
- for (int i = 0; i < pages.length; i++)
- pages[i].close();
- }
-}
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/about.html b/tests/org.eclipse.ui.tests/about.html deleted file mode 100644 index 9db411aab99..00000000000 --- a/tests/org.eclipse.ui.tests/about.html +++ /dev/null @@ -1,30 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> -<html> -<head> -<title>About</title> -<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1"> -</head> -<body lang="EN-US"> -<h2>About This Content</h2> - -<p>20th June, 2002</p> -<h3>License</h3> -<p>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 <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>. -For purposes of the CPL, "Program" will mean the Content.</p> - -<h3>Contributions</h3> - -<p>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.</p> - -<p>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.</p> - -</body> -</html>
\ No newline at end of file diff --git a/tests/org.eclipse.ui.tests/build.properties b/tests/org.eclipse.ui.tests/build.properties deleted file mode 100644 index 644bf6912c8..00000000000 --- a/tests/org.eclipse.ui.tests/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -source.uitests.jar = Eclipse JFace Tests/,\
- Eclipse UI Tests/,\
- UI Test Utils/
-bin.includes = icons/,\
- doc/,\
- plugin.properties,\
- plugin.xml,\
- *.html,\
- *.jar,\
- .options,\
- *.xml,\
- uiSniff,\
- uiSniff.bat
diff --git a/tests/org.eclipse.ui.tests/doc/Introduction.html b/tests/org.eclipse.ui.tests/doc/Introduction.html deleted file mode 100644 index f85852b4a55..00000000000 --- a/tests/org.eclipse.ui.tests/doc/Introduction.html +++ /dev/null @@ -1,133 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="Build">
- <meta name="GENERATOR" content="Mozilla/4.5 [en] (WinNT; I) [Netscape]">
- <title>The Workbench Test Framework</title>
-</head>
-<body>
-
-<h2>
-The Workbench Test Suite</h2>
-Dave Springgay
-<br>September 2001
-<h3>
-In Brief</h3>
-This document describes the UI Test Suite. This test suite is available
-from <tt>org.eclipse.ui.tests</tt> in the desktop repository and consist
-of a series of non-interactive sniff tests which are run after a build,
-plus a set of interactive tests which require human feedback. You
-can run any of these from the JUnit Eclipse Plugin Tests launcher or from
-the command line.
-<p>The <tt>org.eclipse.ui.tests</tt> project is organized in hierarchical
-fashion. The root is <tt>UiTestSuite</tt> in <tt>org.eclipse.ui.tests</tt>.
-This test suite contains a collection of "specialized suites" which test
-specific areas of functionality or components in the workbench. Currently
-there is only one suite, <tt>ApiTestSuite
-</tt>in<tt> org.eclipse.ui.tests.api</tt>,
-which contains a number of test cases which deal specifically with workbench
-API. A <tt>uiTest</tt> extension is declared for each suite so that
-you can run every test in the workbench or a subset of the tests.
-<p>To run the UiTestSuite from within Eclipse just select UiTestSuite.java
-in the navigator and invoke Run > JUnit Eclipse Plugin Tests. The
-results of the test suite will appear in the JUnit view.
-<h3>
-Automated Sniff Tests</h3>
-The following process is used to run the workbench UI sniff tests after
-a build.
-<p>To create the sniff test files ..
-<ol>
-<li>
-Export the 4 test projects into a zip file. The options in the export
-wizard should be set to "Compress the contents of the file" and not "Create
-directory Structure".</li>
-</ol>
-To run the sniff tests in a fresh build of Eclipse ..
-<ol>
-<li>
-Unzip the zip file in the Eclipse plugins directory.</li>
-
-<li>
-On Windows copy uiSniff.bat in the org.eclipse.ui.tests plugin directory
-to the Eclipse home directory. On Linux copy uiSniff instead.</li>
-
-<li>
-Run uiSniff.bat ( or uiSniff ). Redirect the results into a file.</li>
-</ol>
-
-<h3>
-Test Patterns</h3>
-In our own testing we have discovered a number of common test patterns.
-In order to encourage a consistent approach for testing they are published
-below.
-<p><b>Simple Setters, Getters and Commands</b>
-<p>Scenario: You want to test setters, commands and getters on an interface.
-<p>Method: Call the setter or command which affects the object state.
-Call the getter to verify that state.
-<p><b>Top Down Coverage</b>
-<p>Scenario: You want to demonstrate thorough coverage of a component.
-<p>Method: Start at the object root of the instance hierarchy and test
-every class downwards to the leaf classes. Stop when you encounter
-a layer which already has JUnit test cases. For instance, in the
-workbench UI don't test JFace, SWT, or core. They should have their
-own test suites and are assumed to work.
-<p><b>Superclass Subclass</b>
-<p>Scenario: You want to test D, which is a subclass of B.
-<p>Method: Implement a test case for B called BTest. Then create
-a subclass of BTest called DTest which tests D. If B is an abstract
-class use a factory method in BTest to create the test object.
-<p><b>Listener Source</b>
-<p>Scenario: You want to test S, a class which fires events when a particular
-situation occurs.
-<p>Method: Implement a listener for S which records the reception of events.
-Then write a test class for S called STest which does something which should
-cause those events to fire. Verify the reception of events afterwards.
-<p><b>Multiple Session</b>
-<p>Scenario: You want to test the persistance of state from one session
-to the next.
-<p>Method: You need to create two test suites. One test suite will
-set up the state. The other will verify the state. Run them
-sequentially in two separate processes.
-<p><b>Global State</b>
-<p>Scenario: In Eclipse the workbench is a global object. Unfortunately,
-this means that one test case may modify that state and affect the outcome
-of another unrelated test case. How can you avoid this problem?
-<p>Method: If the test case modifies the state of a window or something
-in the window you should create a new window as part of the setUp for the
-test case. Run the test code within that window and then close the
-test window in the tearDown method. The modified state will be discarded
-when the window is closed
-<p><b>Lifecycle</b>
-<p>Scenario: Within the workbench there are various interfaces, such as
-IViewPart, which are defined as API and implemented by plugin code.
-There is no need to test the implementation of the interface, but it is
-good to test the lifecycle as implemented by objects which call the interface.
-<p>Method: Define a class X which implements the interface and records
-the invocation of various methods. Create a scenario where this class
-is loaded and should receive events. Afterwards, test that those
-methods were called.
-<p><b>Piercing the Encapsulation</b>
-<p>Scenario: To test the behavior of commands which modify the state of
-the object when there are no public interfaces to query that state.
-<p>Method: If possible, cast the interface to a concrete class with additional
-public methods. For instance, in the workbench the underlying structure
-for IWorkbench is exposed in Workbench. Given a Workbench object,
-you can get the menu, toolbar, etc, and interact directly with the actions
-to verify their state or invoke them directly. This is also a useful
-way to simulate action invocation from the UI.
-<p><b>Mock Objects</b>
-<p>Scenario: To test the implementation of an interface which instantiates
-an extension. For instance, in the test case for IWorkbenchPage we
-need to open views and editors.
-<p>Method: If we reference views and editors which exist within the Workbench
-UI Standard Components project the test case is vulnerable to change in
-those components. In this case we're not testing the components,
-we're testing IWorkbenchPage, so we implemented some light weight mock
-views and editors which do nothing more than record their own creation
-and lifecycle.
-<br>
-<br>
-<br>
-</body>
-</html>
diff --git a/tests/org.eclipse.ui.tests/doc/JUnitPractices.html b/tests/org.eclipse.ui.tests/doc/JUnitPractices.html deleted file mode 100644 index 5d9c99b17ba..00000000000 --- a/tests/org.eclipse.ui.tests/doc/JUnitPractices.html +++ /dev/null @@ -1,118 +0,0 @@ -<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="Build">
- <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
- <title>The Workbench Test Framework</title>
-</head>
-<body>
-
-<h3>
-Plugin Test Practices</h3>
-In our own testing we have discovered a number of common test patterns.
-In order to encourage a consistent approach for testing they are published
-below.
-<p><b>Setters, Getters and Commands</b>
-<p>Scenario: You want to test setters, getters, and commands in an interface.
-<p>Method: Call the setter or command which affects the object state.
-Call the getter to verify that state. If you can't see this state
-see to "Piercing an Interface".
-<p><b>Subclass Superclass</b>
-<p>Scenario: You want to test D, which is a subclass of B.
-<p>Method: Implement a test case for B called BTest. Then create
-a subclass of BTest called DTest which tests D the additional methods on
-D. Add a factory method to BTest to create any required test objects
-which may be specific to the test case and override it in DTest.
-When this approach is taken you inherit all of the BTest methods within
-the subclass DTest.
-<p><b>Event Notification</b>
-<p>Scenario: You want to test Source, a class which fires events when a
-particular situation occurs.
-<p>Method: Implement a listener for Source which can record the reception
-of events. Then write a test class for Source called SourceTest which does
-something which should cause those events to fire. Verify the reception
-of events afterwards.
-<p>Additional Tips: The CallHistory class in org.eclipse.ui.tests.util can
-be used to record the methods invoked in a target object. If the
-listener can be added then test the removal of the listener also.
-Make sure that events are not received after the listener has been removed.
-<p><b>Avoiding Global State</b>
-<p>Scenario: In Eclipse the workbench is a global object. Unfortunately,
-this means that one test case may modify that state of the workbench and
-affect the outcome of other unrelated test cases. How can you avoid
-this problem?
-<p>Method: If the test case modifies the state of a window or something
-in the window you should create a new window as part of the setUp for the
-test case. Run the test code within that window and then close the
-test window in the tearDown method. The modified state will be discarded
-when the window is closed.
-<p>Additional Tips: The UITestCase class in org.eclipse.ui.tests.util can
-be used as a superclass for your test case. It provides useful methods
-for the creation of new windows, pages, etc, and their disposal.
-<p><b>Piercing the Encapsulation</b>
-<p>Scenario: To test the behavior of commands which modify the state of
-the object when there are no public interfaces to query that state.
-<p>Method: If possible, cast the interface to a concrete class with additional
-public methods. For instance, in the workbench the underlying structure
-for IWorkbench is exposed in Workbench. Given a Workbench object,
-you can get the menu, toolbar, etc, and interact directly with those objects
-to verify their state or invoke them directly.
-<p>Additional Tips: The ActionUtil class in org.eclipse.ui.tests.util can
-be used to invoke actions within a window or menu manager.
-<p><b>Extension Creation</b>
-<p>Scenario: You want to test the creation of an extension. For instance,
-the IWorkbenchPage has a method called openEditor which creates an editor
-extension, and another called showView which creates a view extension.
-How do you test these?
-<p>Method: Obviously we can test these methods by invoking them.
-However, each of them take an editor or view id. Which id's do we
-use? If we reference views and editors which exist within the Workbench
-UI Standard Components project the test case is vulnerable to change in
-those components. But we're not testing those standard components,
-we're actually testing IWorkbenchPage, so it is better to implement some
-light weight mock views and editors which do nothing more than record their
-own creation and lifecycle.
-<p><b>Extension Lifecycle</b>
-<p>Scenario: Within the workbench there are various interfaces, such as
-IViewPart, which are defined as API and implemented by plugin code.
-There is no need to test the implementation of an interface like this if
-you define it and expect others to implement it. However, it is important
-to test the lifecycle of the object as implemented by those objects which
-create and call the interface implementation.
-<p>Method: Define a class X which implements the interface and records
-the invocation of various methods. Create a scenario where this class
-is instantiated and should receive events. Afterwards, test that
-those methods were called.
-<p>Additional Tips: The CallHistory class in org.eclipse.ui.tests.util can
-be used to record the methods invoked in a target object.
-<p><b>Session Persistence</b>
-<p>Scenario: You want to test the persistence of state from one session
-to the next.
-<p>Method: You need to create two test cases. One test case will
-set up the state. The other will verify the state. Run them
-sequentially in two separate processes.
-<p><b>Testing Mixins</b>
-<p>Scenario: Within the workbench there are many classes which implement
-a particular interface. Given the responsability defined by the class
-and the interfaces separately, how do you organize the test cases?
-<p>Method: You may choose to use a one to one rule of thumb. Create
-one test case class for each class or interface in the mixin. This
-hierarchical separation makes it easier to reuse each test case when an
-interface is implemented by more than one class. It also simplifies
-the accounting required to track which test cases have been written.
-<p><b>Where Do I Stop?</b>
-<p>Scenario: The workbench has many layers. If you are a plugin developer
-what are the bounds of the area you should test?
-<p>Method: In general, you should assume that everything you rely upon
-works. If you don't take this approach you will spend endless hours
-testing code written by other people. For instance, in the workbench UI
-we don't test JFace, SWT, or core. They have their own test suites
-and are assumed to work. On the other hand, you should at least write
-tests for every API which you provide to others. In Eclipse we have
-very strong rules for API compatability, and your own test cases allow
-you to change the implementation of API with some confidence.
-<br>
-<br>
-</body>
-</html>
diff --git a/tests/org.eclipse.ui.tests/icons/anything.gif b/tests/org.eclipse.ui.tests/icons/anything.gif Binary files differdeleted file mode 100644 index efc77a7f754..00000000000 --- a/tests/org.eclipse.ui.tests/icons/anything.gif +++ /dev/null diff --git a/tests/org.eclipse.ui.tests/icons/mockeditorpart1.gif b/tests/org.eclipse.ui.tests/icons/mockeditorpart1.gif Binary files differdeleted file mode 100644 index efc77a7f754..00000000000 --- a/tests/org.eclipse.ui.tests/icons/mockeditorpart1.gif +++ /dev/null diff --git a/tests/org.eclipse.ui.tests/icons/mockeditorpart2.gif b/tests/org.eclipse.ui.tests/icons/mockeditorpart2.gif Binary files differdeleted file mode 100644 index efc77a7f754..00000000000 --- a/tests/org.eclipse.ui.tests/icons/mockeditorpart2.gif +++ /dev/null diff --git a/tests/org.eclipse.ui.tests/icons/view.gif b/tests/org.eclipse.ui.tests/icons/view.gif Binary files differdeleted file mode 100644 index efc77a7f754..00000000000 --- a/tests/org.eclipse.ui.tests/icons/view.gif +++ /dev/null diff --git a/tests/org.eclipse.ui.tests/plugin.xml b/tests/org.eclipse.ui.tests/plugin.xml deleted file mode 100644 index 4db7b8c4394..00000000000 --- a/tests/org.eclipse.ui.tests/plugin.xml +++ /dev/null @@ -1,549 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!-- File written by PDE 1.0 -->
-<plugin
- id="org.eclipse.ui.tests"
- name="Eclipse UI Tests"
- version="2.0.0"
- provider-name="Eclipse.org"
- class="org.eclipse.ui.tests.TestPlugin">
-
-<requires>
- <import plugin="org.eclipse.core.boot"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.swt"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.junit"/>
-</requires>
-
-<runtime>
- <library name="uitests.jar"/>
-</runtime>
-
-<!-- Utils -->
-
-<extension
- point="org.eclipse.ui.perspectives">
- <perspective
- id="org.eclipse.ui.tests.util.EmptyPerspective"
- name="Empty Perspective"
- class="org.eclipse.ui.tests.util.EmptyPerspective">
- </perspective>
-</extension>
-
-<!-- Utils End -->
-
-<extension
- point="org.eclipse.ui.perspectives">
- <perspective
- id="org.eclipse.ui.tests.api.SessionPerspective"
- name="Session Perspective"
- class="org.eclipse.ui.tests.api.SessionPerspective">
- </perspective>
-</extension>
-
-<extension
- point="org.eclipse.ui.views">
- <view
- id="org.eclipse.ui.tests.api.MockViewPart"
- name="Mock View 1"
- icon="icons\view.gif"
- class="org.eclipse.ui.tests.api.MockViewPart"/>
- <view
- id="org.eclipse.ui.tests.api.MockViewPart2"
- name="Mock View 2"
- icon="icons\view.gif"
- class="org.eclipse.ui.tests.api.MockViewPart"/>
- <view
- id="org.eclipse.ui.tests.api.MockViewPart3"
- name="Mock View 3"
- icon="icons\view.gif"
- class="org.eclipse.ui.tests.api.MockViewPart"/>
- <view
- id="org.eclipse.ui.tests.api.SessionView"
- name="Session Test View"
- icon="icons\view.gif"
- class="org.eclipse.ui.tests.api.SessionView"/>
- <view
- id="org.eclipse.ui.tests.api.IViewActionDelegateTest"
- name="IViewActionDelegateTest View"
- icon="icons\view.gif"
- class="org.eclipse.ui.tests.api.MockViewPart"/>
- <view
- id="org.eclipse.ui.tests.api.IActionFilterTest1"
- name="Action Filter Test View 1"
- icon="icons\view.gif"
- class="org.eclipse.ui.tests.api.ListView"
- menuType="static"/>
- <view
- id="org.eclipse.ui.tests.internal.ActionExpressionTest"
- name="Action Expression Test View"
- icon="icons\view.gif"
- class="org.eclipse.ui.tests.api.ListView"/>
- <view
- id="org.eclipse.ui.tests.api.IActionFilterTest2"
- name="Action Filter Test View 2"
- icon="icons\view.gif"
- class="org.eclipse.ui.tests.api.ListView"
- menuType="dynamic"/>
- <view
- id="org.eclipse.ui.tests.SelectionProviderView"
- name="Selection Provider Test View"
- icon="icons\view.gif"
- class="org.eclipse.ui.tests.SelectionProviderView"/>
- <view
- id="org.eclipse.ui.tests.SelectionProviderView2"
- name="Selection Provider Test View 2"
- icon="icons\view.gif"
- class="org.eclipse.ui.tests.SelectionProviderView"/>
- <view
- id="org.eclipse.ui.tests.adaptable.adaptedHierarchy"
- name="Adapted Resource Navigator"
- icon="icons\view.gif"
- class="org.eclipse.ui.tests.adaptable.AdaptedResourceNavigator"/>
-</extension>
-
-<extension
- point = "org.eclipse.ui.editors">
- <editor id ="org.eclipse.ui.tests.api.MockEditorPart1"
- name="Mock Editor 1"
- extensions="mock1"
- icon="icons\mockeditorpart1.gif"
- class="org.eclipse.ui.tests.api.MockEditorPart">
- </editor>
- <editor id ="org.eclipse.ui.tests.api.MockEditorPart2"
- name="Mock Editor 2"
- extensions="mock2"
- icon="icons\mockeditorpart2.gif"
- class="org.eclipse.ui.tests.api.MockEditorPart">
- </editor>
- <editor id ="org.eclipse.ui.tests.api.IEditorActionBarContributorTest"
- name="IEditorActionBarContributorTest"
- extensions="mock3"
- icon="icons\mockeditorpart2.gif"
- class="org.eclipse.ui.tests.api.MockEditorPart"
- contributorClass="org.eclipse.ui.tests.api.MockEditorActionBarContributor">
- </editor>
- <editor id ="org.eclipse.ui.tests.api.IEditorActionDelegateTest"
- name="IEditorActionDelegateTest"
- extensions="mock3"
- icon="icons\mockeditorpart2.gif"
- class="org.eclipse.ui.tests.api.MockEditorPart"
- contributorClass="org.eclipse.ui.tests.api.MockEditorActionBarContributor">
- </editor>
- <editor id ="org.eclipse.ui.tests.internal.EditorActionBarsTest"
- name="IEditorActionBarsTest"
- extensions="mock3"
- icon="icons\mockeditorpart2.gif"
- class="org.eclipse.ui.tests.api.MockEditorPart"
- contributorClass="org.eclipse.ui.tests.api.MockEditorActionBarContributor">
- </editor>
- <editor id ="org.eclipse.ui.tests.ExtendedTextEditor"
- name="ExtendedTextEditor"
- icon="icons\mockeditorpart2.gif"
- extensions="exttxt"
- class="org.eclipse.ui.tests.internal.ExtendedTextEditor"
- contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor">
- </editor>
-</extension>
-
-<extension point = "org.eclipse.ui.actionSets">
- <actionSet id="org.eclipse.ui.tests.api.MockActionSet"
- label="Mock Action Set">
- <action id="org.eclipse.ui.tests.api.MockWindowAction"
- label="Mock Action"
- menubarPath="additions"
- class = "org.eclipse.ui.tests.api.MockWorkbenchWindowActionDelegate">
- </action>
- </actionSet>
-</extension>
-
-<extension point="org.eclipse.ui.viewActions">
- <viewContribution
- id="va1"
- targetID="org.eclipse.ui.tests.api.IViewActionDelegateTest">
- <action id="a1"
- label="Mock Action"
- menubarPath="additions"
- class="org.eclipse.ui.tests.api.MockViewActionDelegate">
- </action>
- </viewContribution>
-</extension>
-
-<extension point="org.eclipse.ui.editorActions">
- <editorContribution
- id="ea1"
- targetID="org.eclipse.ui.tests.api.IEditorActionDelegateTest">
- <action id="a1"
- label="Mock Action"
- menubarPath="additions"
- class="org.eclipse.ui.tests.api.MockEditorActionDelegate">
- </action>
- </editorContribution>
-</extension>
-
-<extension point="org.eclipse.ui.popupMenus">
- <objectContribution id="oc1"
- objectClass="org.eclipse.ui.tests.api.ListElement">
- <filter name="name" value="red"/>
- <action id="oc1" label="redAction_v1"
- class="org.eclipse.ui.tests.api.MockActionDelegate"/>
- </objectContribution>
- <objectContribution id="oc2"
- objectClass="org.eclipse.ui.tests.api.ListElement">
- <filter name="name" value="blue"/>
- <action id="oc2" label="blueAction_v1"
- class="org.eclipse.ui.tests.api.MockActionDelegate"/>
- </objectContribution>
- <objectContribution id="oc3"
- objectClass="org.eclipse.ui.tests.api.ListElement">
- <filter name="flag" value="true"/>
- <action id="oc3" label="trueAction_v1"
- class="org.eclipse.ui.tests.api.MockActionDelegate"/>
- </objectContribution>
- <objectContribution id="oc4"
- objectClass="org.eclipse.ui.tests.api.ListElement">
- <filter name="flag" value="false"/>
- <action id="oc4" label="falseAction_v1"
- class="org.eclipse.ui.tests.api.MockActionDelegate"/>
- </objectContribution>
- <objectContribution id="oc5"
- objectClass="org.eclipse.ui.tests.api.ListElement">
- <filter name="name" value="red"/>
- <filter name="flag" value="true"/>
- <action id="oc5" label="redTrueAction_v1"
- class="org.eclipse.ui.tests.api.MockActionDelegate"/>
- </objectContribution>
-
- <!-- Adaptable test-->
- <objectContribution
- objectClass="org.eclipse.core.resources.IResource"
- id="org.eclipse.ui.tests.adaptable.ResourceContributions"
- adaptable = "true">
- <action
- label="Resource Action"
- class="org.eclipse.ui.tests.adaptable.ResourceAction"
- menubarPath="org.eclipse.ui.OpenFileAction"
- id="resource action">
- </action>
- </objectContribution>
-</extension>
-
-<extension point = "org.eclipse.ui.actionSets">
-
- <!-- ActionSetExpressionTest -->
-
- <actionSet id="org.eclipse.ui.tests.internal.ListElementActions"
- label="List Element">
- <menu id="org.eclipse.ui.tests.internal.ListElementMenu"
- label="List Element"
- path="additions">
- <separator name="group1"/>
- </menu>
- <action id="org.eclipse.ui.tests.internal.ac1"
- label="allAction_v2"
- menubarPath="org.eclipse.ui.tests.internal.ListElementMenu/group1"
- class="org.eclipse.ui.tests.api.MockActionDelegate"
- enablesFor="1">
- <enablement>
- <objectClass name="org.eclipse.ui.tests.api.ListElement"/>
- </enablement>
- </action>
- <action id="org.eclipse.ui.tests.internal.ac2"
- label="redAction_v2"
- menubarPath="org.eclipse.ui.tests.internal.ListElementMenu/group1"
- class="org.eclipse.ui.tests.api.MockActionDelegate"
- enablesFor="1">
- <enablement>
- <and>
- <objectClass name="org.eclipse.ui.tests.api.ListElement"/>
- <objectState name="name" value="red"/>
- </and>
- </enablement>
- </action>
- <action id="org.eclipse.ui.tests.internal.ac3"
- label="notRedAction_v2"
- menubarPath="org.eclipse.ui.tests.internal.ListElementMenu/group1"
- class="org.eclipse.ui.tests.api.MockActionDelegate"
- enablesFor="1">
- <enablement>
- <and>
- <objectClass name="org.eclipse.ui.tests.api.ListElement"/>
- <not>
- <objectState name="name" value="red"/>
- </not>
- </and>
- </enablement>
- </action>
- <action id="org.eclipse.ui.tests.internal.ac4"
- label="trueAction_v2"
- menubarPath="org.eclipse.ui.tests.internal.ListElementMenu/group1"
- class="org.eclipse.ui.tests.api.MockActionDelegate"
- enablesFor="1">
- <enablement>
- <and>
- <objectClass name="org.eclipse.ui.tests.api.ListElement"/>
- <objectState name="flag" value="true"/>
- </and>
- </enablement>
- </action>
- <action id="org.eclipse.ui.tests.internal.ac5"
- label="redOrBlueAction_v2"
- menubarPath="org.eclipse.ui.tests.internal.ListElementMenu/group1"
- class="org.eclipse.ui.tests.api.MockActionDelegate"
- enablesFor="1">
- <enablement>
- <or>
- <and>
- <objectClass name="org.eclipse.ui.tests.api.ListElement"/>
- <objectState name="name" value="red"/>
- </and>
- <and>
- <objectClass name="org.eclipse.ui.tests.api.ListElement"/>
- <objectState name="name" value="blue"/>
- </and>
- </or>
- </enablement>
- </action>
- <action id="org.eclipse.ui.tests.internal.ac6"
- label="redAndTrueAction_v2"
- menubarPath="org.eclipse.ui.tests.internal.ListElementMenu/group1"
- class="org.eclipse.ui.tests.api.MockActionDelegate"
- enablesFor="1">
- <enablement>
- <and>
- <objectClass name="org.eclipse.ui.tests.api.ListElement"/>
- <objectState name="name" value="red"/>
- <objectState name="flag" value="true"/>
- </and>
- </enablement>
- </action>
- <action id="org.eclipse.ui.tests.internal.ac7"
- label="pluginNotInstalledAction_v2"
- menubarPath="org.eclipse.ui.tests.internal.ListElementMenu/group1"
- class="org.eclipse.ui.tests.api.MockActionDelegate">
- <enablement>
- <pluginState id="7777xxf" value="installed"/>
- </enablement>
- </action>
- <action id="org.eclipse.ui.tests.internal.ac8"
- label="pluginInstalledAction_v2"
- menubarPath="org.eclipse.ui.tests.internal.ListElementMenu/group1"
- class="org.eclipse.ui.tests.api.MockActionDelegate">
- <enablement>
- <pluginState id="org.eclipse.ui" value="installed"/>
- </enablement>
- </action>
- <action id="org.eclipse.ui.tests.internal.ac9"
- label="pluginNotActivatedAction_v2"
- menubarPath="org.eclipse.ui.tests.internal.ListElementMenu/group1"
- class="org.eclipse.ui.tests.api.MockActionDelegate">
- <enablement>
- <pluginState id="org.eclipse.update" value="activated"/>
- </enablement>
- </action>
- <action id="org.eclipse.ui.tests.internal.ac10"
- label="pluginActivatedAction_v2"
- menubarPath="org.eclipse.ui.tests.internal.ListElementMenu/group1"
- class="org.eclipse.ui.tests.api.MockActionDelegate">
- <enablement>
- <pluginState id="org.eclipse.ui" value="activated"/>
- </enablement>
- </action>
- <action id="org.eclipse.ui.tests.internal.ac11"
- label="systemPropertyAction_v2"
- menubarPath="org.eclipse.ui.tests.internal.ListElementMenu/group1"
- class="org.eclipse.ui.tests.api.MockActionDelegate">
- <enablement>
- <systemProperty name="ActionExpressionVar" value="bubba"/>
- </enablement>
- </action>
- </actionSet>
-
- <!-- TextSelectionActionFilterText -->
-
- <actionSet id="org.eclipse.ui.tests.internal.TextSelectionActions"
- label="Text Selection Tests">
- <menu id="org.eclipse.ui.tests.internal.TextSelectionMenu"
- label="Text Selection Tests"
- path="additions">
- <separator name="group1"/>
- </menu>
- <action id="org.eclipse.ui.tests.internal.as_1"
- label="anyText"
- menubarPath="org.eclipse.ui.tests.internal.TextSelectionMenu/group1"
- class="org.eclipse.ui.tests.api.MockActionDelegate"
- enablesFor="1">
- <selection class="org.eclipse.jface.text.ITextSelection"/>
- </action>
- <action id="org.eclipse.ui.tests.internal.ac_2"
- label="emptyText"
- menubarPath="org.eclipse.ui.tests.internal.TextSelectionMenu/group1"
- class="org.eclipse.ui.tests.api.MockActionDelegate">
- <enablement>
- <and>
- <objectClass name="org.eclipse.jface.text.ITextSelection"/>
- <objectState name="isEmpty" value="true"/>
- </and>
- </enablement>
- </action>
- <action id="org.eclipse.ui.tests.internal.ac_3"
- label="helloText"
- menubarPath="org.eclipse.ui.tests.internal.TextSelectionMenu/group1"
- class="org.eclipse.ui.tests.api.MockActionDelegate">
- <enablement>
- <and>
- <objectClass name="org.eclipse.jface.text.ITextSelection"/>
- <objectState name="text" value="Hello"/>
- </and>
- </enablement>
- </action>
- </actionSet>
-</extension>
-
-<extension point="org.eclipse.ui.popupMenus">
-
- <!-- PopupMenuExpressionTest -->
-
- <objectContribution id="oc1"
- objectClass="org.eclipse.ui.tests.api.ListElement">
- <action id="oc1" label="allAction_v2"
- class="org.eclipse.ui.tests.api.MockActionDelegate"/>
- </objectContribution>
- <objectContribution id="oc2"
- objectClass="org.eclipse.ui.tests.api.ListElement">
- <visibility>
- <objectState name="name" value="red"/>
- </visibility>
- <action id="oc2" label="redAction_v2"
- class="org.eclipse.ui.tests.api.MockActionDelegate"/>
- </objectContribution>
- <objectContribution id="oc3"
- objectClass="org.eclipse.ui.tests.api.ListElement">
- <visibility>
- <not>
- <objectState name="name" value="red"/>
- </not>
- </visibility>
- <action id="oc3" label="notRedAction_v2"
- class="org.eclipse.ui.tests.api.MockActionDelegate"/>
- </objectContribution>
- <objectContribution id="oc4"
- objectClass="org.eclipse.ui.tests.api.ListElement">
- <visibility>
- <objectState name="flag" value="true"/>
- </visibility>
- <action id="oc4" label="trueAction_v2"
- class="org.eclipse.ui.tests.api.MockActionDelegate"/>
- </objectContribution>
- <objectContribution id="oc5"
- objectClass="org.eclipse.ui.tests.api.ListElement">
- <visibility>
- <or>
- <objectState name="name" value="red"/>
- <objectState name="name" value="blue"/>
- </or>
- </visibility>
- <action id="oc4" label="redOrBlueAction_v2"
- class="org.eclipse.ui.tests.api.MockActionDelegate"/>
- </objectContribution>
- <objectContribution id="oc6"
- objectClass="org.eclipse.ui.tests.api.ListElement">
- <visibility>
- <and>
- <objectState name="name" value="red"/>
- <objectState name="flag" value="true"/>
- </and>
- </visibility>
- <action id="oc4" label="redAndTrueAction_v2"
- class="org.eclipse.ui.tests.api.MockActionDelegate"/>
- </objectContribution>
- <objectContribution id="oc7"
- objectClass="org.eclipse.ui.tests.api.ListElement">
- <visibility>
- <pluginState id="7777xxf" value="installed"/>
- </visibility>
- <action id="oc4" label="pluginNotInstalledAction_v2"
- class="org.eclipse.ui.tests.api.MockActionDelegate"/>
- </objectContribution>
- <objectContribution id="oc8"
- objectClass="org.eclipse.ui.tests.api.ListElement">
- <visibility>
- <pluginState id="org.eclipse.ui" value="installed"/>
- </visibility>
- <action id="oc4" label="pluginInstalledAction_v2"
- class="org.eclipse.ui.tests.api.MockActionDelegate"/>
- </objectContribution>
- <objectContribution id="oc9"
- objectClass="org.eclipse.ui.tests.api.ListElement">
- <visibility>
- <pluginState id="org.eclipse.update" value="activated"/>
- </visibility>
- <action id="oc4" label="pluginNotActivatedAction_v2"
- class="org.eclipse.ui.tests.api.MockActionDelegate"/>
- </objectContribution>
- <objectContribution id="oc10"
- objectClass="org.eclipse.ui.tests.api.ListElement">
- <visibility>
- <pluginState id="org.eclipse.ui" value="activated"/>
- </visibility>
- <action id="oc4" label="pluginActivatedAction_v2"
- class="org.eclipse.ui.tests.api.MockActionDelegate"/>
- </objectContribution>
- <objectContribution id="oc11"
- objectClass="org.eclipse.ui.tests.api.ListElement">
- <visibility>
- <systemProperty name="ActionExpressionVar" value="bubba"/>
- </visibility>
- <action id="oc4" label="systemPropertyAction_v2"
- class="org.eclipse.ui.tests.api.MockActionDelegate"/>
- </objectContribution>
-</extension>
-
-
-<!-- Decorator tests -->
-
-<extension
- point="org.eclipse.ui.decorators">
- <decorator
- id="org.eclipse.ui.tests.adaptable.decorator"
- label="Test Decorator"
- state="true"
- tooltip="No tip"
- class="org.eclipse.ui.tests.navigator.TestDecoratorContributor"
- description="The test decorator"
- objectClass="org.eclipse.core.resources.IResource">
- </decorator>
- <decorator
- id="org.eclipse.ui.tests.adaptable.nulldecorator"
- label="Null Decorator"
- state="true"
- tooltip="No tip"
- adaptable="true"
- description="A null test decorator"
- class="org.eclipse.ui.tests.adaptable.NullLabelDecorator"
- objectClass="org.eclipse.core.resources.IResource">
- </decorator>
-</extension>
-
-<!-- Working set tests -->
-<extension
- point="org.eclipse.ui.workingSets">
- <workingSet
- id="org.eclipse.ui.tests.api.MockWorkingSet"
- name="Mock Working Set"
- icon="icons/anything.gif"
- pageClass="org.eclipse.ui.tests.api.MockWorkingSetPage">
- </workingSet>
-</extension>
-
-<!-- Preference Enablement tests -->
-<extension point="org.eclipse.ui.preferencePages">
- <page
- name="Editors Test"
- class="org.eclipse.ui.tests.dialogs.EnableTestPreferencePage"
- id="org.eclipse.ui.tests.dialogs.EnableTestPreferencePage">
- </page>
- </extension>
-
-</plugin>
diff --git a/tests/org.eclipse.ui.tests/test.xml b/tests/org.eclipse.ui.tests/test.xml deleted file mode 100644 index 3e308aac2ae..00000000000 --- a/tests/org.eclipse.ui.tests/test.xml +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <property name="eclipse-home" value="${basedir}\..\.."/>
-
- <!-- sets the properties eclipse-home, and library-file -->
- <property name="plugin-name" value="org.eclipse.ui.tests"/>
- <property name="library-file"
- value="${eclipse-home}/plugins/org.eclipse.test/library.xml"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <property name="session-folder"
- value="${eclipse-home}/ui_session_sniff_folder"/>
- <delete dir="${session-folder}" quiet="true"/>
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${session-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname"
- value="org.eclipse.ui.tests.api.SessionCreateTest"/>
- </ant>
-
- <!-- Commented out until source of problem found (not reusing same workspace dir)
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${session-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname"
- value="org.eclipse.ui.tests.api.SessionRestoreTest"/>
- </ant>
- -->
-
- <property name="sniff-folder"
- value="${eclipse-home}/ui_sniff_folder"/>
- <delete dir="${sniff-folder}" quiet="true"/>
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${sniff-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname"
- value="org.eclipse.ui.tests.UiTestSuite"/>
- </ant>
-
- <property name="jface-sniff-folder"
- value="${eclipse-home}/jface_sniff_folder"/>
- <delete dir="${jface-sniff-folder}" quiet="true"/>
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${jface-sniff-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname"
- value="org.eclipse.jface.tests.viewers.AllTests"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org*.xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-
-</project>
diff --git a/tests/org.eclipse.ui.tests/uiSniff b/tests/org.eclipse.ui.tests/uiSniff deleted file mode 100644 index e2d47e4c9ec..00000000000 --- a/tests/org.eclipse.ui.tests/uiSniff +++ /dev/null @@ -1,10 +0,0 @@ -echo Running ui.TestSuite
-rm -rf 'ui_sniff_folder'
-./jre/bin/java -cp startup.jar org.eclipse.core.launcher.UIMain -application org.eclipse.ui.junit.runner -dev bin -data %LOCATION% -testPluginName org.eclipse.ui.tests -className org.eclipse.ui.tests.UiTestSuite -console
-
-echo Running ui.api.SessionCreateTest
-rm -rf ui_session_sniff_folder
-./jre/bin/java -cp startup.jar org.eclipse.core.launcher.UIMain -application org.eclipse.ui.junit.runner -dev bin -data %LOCATION% -testPluginName org.eclipse.ui.tests -className org.eclipse.ui.tests.api.SessionCreateTest -console
-
-echo Running ui.api.SessionRestoreTest
-./jre/bin/java -cp startup.jar org.eclipse.core.launcher.UIMain -application org.eclipse.ui.junit.runner -dev bin -data %LOCATION% -testPluginName org.eclipse.ui.tests -className org.eclipse.ui.tests.api.SessionRestoreTest -console
diff --git a/tests/org.eclipse.ui.tests/uiSniff.bat b/tests/org.eclipse.ui.tests/uiSniff.bat deleted file mode 100644 index 84fbc084c95..00000000000 --- a/tests/org.eclipse.ui.tests/uiSniff.bat +++ /dev/null @@ -1,17 +0,0 @@ -@echo off
-rem This is the UI Sniff test batch file.
-
-set CLASSPATH=startup.jar
-
-set LOCATION=ui_sniff_folder
-del /Q /S %LOCATION%
-echo Running UiTestSuite
-.\jre\bin\java -cp %CLASSPATH% org.eclipse.core.launcher.UIMain -application org.eclipse.ui.junit.runner -dev bin -data %LOCATION% -testPluginName org.eclipse.ui.tests -className org.eclipse.ui.tests.UiTestSuite -console
-
-set LOCATION=ui_session_sniff_folder
-del /Q /S %LOCATION%
-echo Running SessionCreateTest
-.\jre\bin\java -cp %CLASSPATH% org.eclipse.core.launcher.UIMain -application org.eclipse.ui.junit.runner -dev bin -data %LOCATION% -testPluginName org.eclipse.ui.tests -className org.eclipse.ui.tests.api.SessionCreateTest -console
-echo Running SessionRestoreTest
-.\jre\bin\java -cp %CLASSPATH% org.eclipse.core.launcher.UIMain -application org.eclipse.ui.junit.runner -dev bin -data %LOCATION% -testPluginName org.eclipse.ui.tests -className org.eclipse.ui.tests.api.SessionRestoreTest -console
-
|