Window Actions

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.

Setup:

  1. Install Eclipse Platform.
  2. Delete the metadata for org.eclipse.ui.
Testing the File Menu:
  1. Start the workbench.
  2. 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.
  3. 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.
  4. Open one.txt within a text editor.  Verify that File > Close and Save As are enabled.  Verify that Save is disabled.
  5. Add the following text to the file..

  6. File One
     

  7. 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.
  8. Open two.txt.  Add the following text to the file..

  9. File Two
     

  10. Open three.txt and add the following text to the file..

  11. File Three
     

  12. 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.
  13. 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.
  14. Verify that File > Close, Close All, Save, Save As, and Save All are disabled.
Testing the Edit Menu:
  1. The edit actions should target the active view or editor.  To test this ..
    1. 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.
    2. 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.
    3. 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.
  2. 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.
  3. Open one.txt in an editor.  Verify that the java editor actions are no longer visible in the workbench.
  4. Activate the java editor and verify that its contributions appear once again.
  5. Close the java editor and verify that the contributions disappear.