TS 61 MenuDesigner

Menu Designer in NetBeans 6.1

Author: Jana Maleckova
Version: 6.1
Last update: 2008/01/29
Introduction: This test specification should show how does the menu designer works and how easy user can design it's menu in Matisse
Comments:

Contents


Test suite: Adding Menu Bar in Frame

Purpose: There are listed all way how to insert Menu Bar in Frame
Setup: Start IDE with clear userdir. Create new J2SE project with new JFrame.

  1. Insert Menu Bar by drag & drop
    1. Expand Swing Menu section in palette (as it hasn't been already done)
    2. Drag Menu Bar and drop it in Frame (in design)
    • EXPECTED RESULT: Swing Menu section should contained these components: Menu Bar, Menu Item, Menu Item/CheckBox, Menu, Popup Menu, Menu Item/RadioButton, Separator. After mouse drag and drop into Frame, Menu Bar should be automatically on the top of the Frame. Menu Bar contains two Menus with text - File and Edit.
  2. Delete Menu Bar from Frame
    1. Select Menu Bar in Frame (inserted from previous test case)
    2. Press delete on keyboard
    • EXPECTED RESULT: Menu Bar is deleted from Frame and no exception is thrown
  3. Insert Menu Bar by pick & plop
    1. Click on Menu Bar by mouse in palette
    2. Move mouse (without holding any mouse button) in Frame (design)
    3. Click somewhere in Frame
    • EXPECTED RESULT: Menu Bar is placed on the top of the Frame.
  4. Move Menu Bar in other components
    1. Select Menu Bar in the Palette
    2. Move it in white space in design
    • EXPECTED RESULT: Menu Bar is not visible in design and is moved to Other Components in Navigator
  5. Insert Menu Bar from Navigator
    1. Select node Frame in Navigator window
    2. Invoke contextual menu and choose "Add from Palette|Swing Menus|Menu Bar"
    • EXPECTED RESULT: Menu Bar is inserted into Frame and it is placed on the top of the Frame
  6. Delete Menu Bar from Navigator
    1. Select item Menu Bar in Navigator window
    2. Invoke contextual menu and choose delete
    • EXPECTED RESULT: Menu Bar is deleted from Frame and no exception is thrown
  7. Insert Menu Bar by ToolBar button
    1. Right-click Designer's ToolBar
    2. Check "Show Add Button" (if it is not already checked)
    3. Push "+" button and select "Swing Menus|Menu Bar"
    4. Click somewhere in Frame
    • EXPECTED RESULT: Menu Bar is inserted into Frame and it is placed on the top of the Frame
  8. Insert Menu Bar from contextual Menu invoked in design
    1. Do right-mouse click on new Frame in design
    2. Select Add From Palette -> Swing Menus -> Menu Bar
    • EXPECTED RESULT: Menu Bar is inserted and placed on the top of the Frame


Test suite: Adding Menu components into Menu Bar

Purpose: Test for adding JMenu, JMenuItems, JCheckBoxMenuItem, JRadioButtonMenuItem, JSeparator
Setup: Start IDE with clear userdir. Create new J2SE project with new JFrame and insert Menu Bar in it.

  1. Add JMenu by drag & drop
    1. Expand Swing Menu section in palette (as it hasn't been already done)
    2. Drag JMenu and drop it in Menu Bar next to "Edit" JMenu (in design)
    • EXPECTED RESULT: Swing Menu section should contained these components: Menu Bar, Menu Item, Menu Item/CheckBox, Menu, Popup Menu, Menu Item/RadioButton, Separator. After mouse drag and drop into Frame, JMenu should be added in the Menu Bar next to JMenu "Edit".
  2. Insert JMenu by pick & plop
    1. Click on JMenu by mouse in palette
    2. Move mouse (without holding any mouse button) on Menu Bar next to JMenu "Edit" in design and do click
    • EXPECTED RESULT: JMenu should be added in the Menu Bar next to JMenu "Edit".
  3. Insert JMenu from Navigator
    1. Select node Menu Bar in Navigator window
    2. Invoke contextual menu and choose "Add Menu"
    • EXPECTED RESULT: Contextual menu should contain action "Add Menu" instead of Add From Palette. JMenu should be added in Menu Bar next to JMenu "Edit"
  4. Delete JMenu from Navigator
    1. Select JMenu node in Navigator window
    2. Invoke contextual menu and choose delete
    • EXPECTED RESULT: JMenu is deleted from Menu Bar and no exception is thrown
  5. Delete JMenu from Design
    1. Select some JMenu on Menu Bar in design
    2. Press delete
    • EXPECTED RESULT: JMenu is deleted from Menu Bar and no exception is thrown
  6. Add Menu Item by drag & drop
    1. Expand Swing Menu section in palette (as it hasn't been already done)
    2. Drag Menu Item and drop it in Menu Bar under "Edit" JMenu (in design)
    • EXPECTED RESULT: Swing Menu section should contained these components: Menu Bar, Menu Item, Menu Item/CheckBox, Menu, Popup Menu, Menu Item/RadioButton, Separator. After mouse drag and drop into Menu Bar, submenu under Edit menu should be created and should contain inserted Menu Item.
  7. Insert Menu Item by pick & plop
    1. Click on Menu Item by mouse in palette
    2. Move mouse (without holding any mouse button) on JMenu "Edit" in Menu Bar (in design) and do click
    • EXPECTED RESULT: Submenu under Edit menu should be created and should contain inserted Menu Item.
  8. Insert Menu Item from Navigator
    1. Select node JMenu "Edit" in Navigator window
    2. Invoke contextual menu and choose action "Add From Palette -> Swing Menus -> Menu Item"
    • EXPECTED RESULT: New node (jMenuItem) should be created under appropriate Edit menu.
  9. Delete JMenu from Navigator
    1. Select JMenu node in Navigator window
    2. Invoke contextual menu and choose delete
    • EXPECTED RESULT: JMenu is deleted from Menu Bar and no exception is thrown
  10. Delete Menu Item from Design
    1. Select some Menu Item in Menu in design
    2. Press delete
    • EXPECTED RESULT: Menu Item is deleted from Menu and no exception is thrown
  11. Do all 6-10 test cases for other menu components
    1. Do previous 6-10 test cases for Menu Item/ CheckBox
    2. Do previous 6-10 test cases for Menu Item/ RadioButton
    3. Do previous 7-9 test cases for Separator - it has a little bit different behavior.
    • EXPECTED RESULT: Results should be the same as they are described in each test cases


Test suite: Editing of Menu components

Purpose: Test text editing, adding icons, setting accelerators
Setup: Start IDE with clear userdir. Create new J2SE project with new JFrame.

  1. Edit text property of menu item from property sheet
    1. Insert Menu Bar in Frame (use one of the test cases, listed in previous test suite)
    2. Select Menu - File
    3. Open Custom Editor for text property of Menu in Property sheet
    4. Write new string - e. g. "MyFile"
    5. Confirm Custom Editor
    • EXPECTED RESULT: String "File" should be rewritten to new string "MyFile". This is visible in text property in property sheet as in design
  2. Edit text property of Menu by in-place editing
    1. Select Edit Menu in design
    2. Press key space on your keyboard
    3. Write down some string e.g. "MyEdit"
    • EXPECTED RESULT: String "Edit" should be rewritten to new string "MyEdit". This is visible in text property in property sheet as in design
  3. Edit text property of Menu from contextual menu
    1. Select Menu in palette
    2. Drag it from palette and drop it in Menu Bar
    3. Select item for inserted Menu in Navigator
    4. Invoke contextual menu on it and choose "Edit Text"
    5. Write some text
    6. Press Enter
    • EXPECTED RESULT: When "Edit Text" is chosen from contextual menu, text of Menu should be automatically editable in design and ready for writing. After Enter, edited text is saved.
  4. Test all this ways of text editing for other menu components
    1. test text editing for Menu Item
    2. test text editing for Menu Item/ CheckBox
    3. test text editing for Menu Item / RadioButton
    • EXPECTED RESULT: Results should be the same as they are described in each test cases
  5. Add imported Icon to Menu Item
    1. Delete Menu Bar from previous test cases and insert new one
    2. Drag Menu Item from palette and insert it under menu "File"
    3. Do mouse double-click on place for icon - File:ItemPlaceForIcon.png
    4. Push button "Import to Project"...
    5. Select some icon from your disc and choose place in project, where the icon should be saved
    6. Press Finish
    7. Press OK
    • EXPECTED RESULT: When Menu Item is drag from palette and moved above the File menu in design, This File Menu should be rounded with square and at that time, this signalizes, Menu Item will be placed under it when it's dropped. If all steps which leads to icon's import are passed, chosen icon should be automatically copied in wanted package and displayed on the left side of Menu Item in design. Frame should be possible to compile and no exception is thrown during this test case.
  6. Add icon to Menu Item which is already imported in the project
    1. Drag Menu Item from palette and insert it under menu "File"
    2. Invoke custom editor of its icon property in property sheet.
    3. Check checkbox "Image within the Project"
    4. Select package where wanted icon is placed
    5. Then select wanted icon from combobox named "File"
    6. Press OK
    • EXPECTED RESULT: When package is selected, combobox "File" should automatically contain list of all icons which are placed in it. Chosen icon is displayed on the left side of Menu Item in design after confirmation (pressing OK button on Image editor)
  7. Set no Icon for Menu Item
    1. Select previous added Menu Item with icon
    2. Do double mouse click on icon
    3. Check radio button "No image"
    4. Press OK
    • EXPECTED RESULT: Menu Item should not have set any icon and should look like this File:MenuItemNoIco.png
  8. Set Accelerator for Menu Item
    1. Drag Menu Item from palette and insert it under menu "File"
    2. Do double click on place on the really right side of Menu Item
    3. Have focus on "Key Stroke" text field
    4. Press Ctrl+Alt+D on keyboard
    5. Press OK
    • EXPECTED RESULT: After double click, an editor for Accelerator is opened. Editor contains Virtual Key combobox, Checkboxes for modifier keys and text field Key Stroke. When shortcut is pressed, Key stroke should contains "Ctrl+Alt+P", checkbox modifiers - ctrl and alt should be checked and Virtual combobox has selected "VK_P". New accelerator should be displayed on the right side of Menu Item. Example: File:MenuItemShortcut.png
  9. Set together text, icon, accelerator for Menu Item
    1. Drag new Menu Item from palette and insert it under menu "File"
    2. Do mouse double-click on place for icon - File:ItemPlaceForIcon.png
    3. Check checkbox "Image within the Project"
    4. Select package where wanted icon is placed
    5. Then select wanted icon from combobox named "File"
    6. Press OK
    7. Select Menu Item again
    8. Press space on keyboard
    9. Write some text
    10. Do double click on place on the really right side of Menu Item
    11. Select VK_X from list in Virtual Key combobox
    12. Press OK
    • EXPECTED RESULT: After these steps, Menu Item contains icon displayed on its left side, filled text and on the right side there is accelerator.
  10. Deleting of Menu Item from design
    1. Select previous Menu Item in design
    2. Press delete on keyboard
    • EXPECTED RESULT: Menu Item is completely deleted from from. No exception is thrown
  11. Deleting of Menu Item from Navigator
    1. Do the whole test case No. 9
    2. Select Menu Item in Navigator
    3. Invoke contextual menu on this item and select delete
    • EXPECTED RESULT: Menu Item is completely deleted from from. No exception is thrown
  12. Do all 5-11 test cases for other menu components
    1. Do previous 5-11 test cases for Menu Item/ CheckBox
    2. Do previous 5-11 test cases for Menu Item/ RadioButton
    3. Do previous 5-11 test cases for Menu
    • EXPECTED RESULT: Results should be the same as they are described in each test cases


Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo