Procedure

This scenario will test out the features and behavior of the JTabbedPane container.

Setup

 

Create a new empty Visual Class (extending Object).  Drop a JTabbedPane on the free form and resize it to take up 3/4ths of the Canvas.

Basic Functionality Inspection

Adding children to the Tab Pane
Initially the Tab Pane is just a blank area.
Choose a JPanel and drop it on the Tab Pane.
Verify that a tab handle is created visually for the new tab.

Highlight the JPanel on the beans view.
Verify that tab icon, tab title and tab tooltip text are on the tab component's property sheet.

Set the tab title property to "Panel" on the PS.
Drop a JTable on JScrollPane onto the tab handle area of the Tab Pane.
Verify the dropped Table is displayed properly.

Resize the JTabbedPane vertically so that the Table will need to scroll.
Verify the scroll bar shows up properly.


Resize the tab pane to a usable size.
Set the tab title property on the Scroll Pane to "Table on Scroll"
Drop a JSplitPane and JTree on the Tab Pane from the Beans View.  Set their respective tab titles.
Verify that the dropped beans appear correctly in the Tab Pane.

Selecting child components
Select the JPanel bean on the Beans View.
Verify the selected bean becomes viewable in the contents of the tab pane, and the selected bean's tab handle is selected.

Select the JTable (not the JScrollPane) on the Beans View.
Verify that the scroll pane and table are brought to front as the selected tab in the tab pane and the JTable is the selected object.

Select the first bean in the tab pane.
Right-click in the tab handle area.
Verify that the "Switch to" menu is present on the popup menu.
Verify that options for each tab is available from the menu, with the list matching the tab titles.
Verify the "Previous" option is not selectable.

Switch to the last tab using the "Switch to" context menu by selecting the last tab title.
Verify the "Next" option is now not selectable from the "Switch to" menu, and that "Previous" is.

Fool around with the various options on the "Switch to" menu
Verify switching functionality.

Delete one of the children tab components.
Verify the tab handle is removed on the canvas, and that the tab is no longer an option on the "Switch to" menu.

Exercising Tab Handles
Select a tab component and set it's tab icon on the property sheet.
Verify the chosen icon is displayed properly on the canvas.

Switch to another tab component
Verify the icon continues to be shown properly when the tab handle is not selected.

Set the tab tool tip text property on the component.
Verify the generated code is valid.

Change the tab title to a very long string. ( eg "Table on Scrollxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" )
Verify that the tab handles are redrawn into multiple rows correctly.


Select the JTabbedPane and change the tabPlacement property to BOTTOM
Verify the tab handles are drawn properly at the bottom of the Tab Pane.

Change the long tab title back to a reasonable length.
Change the tabPlacement property to LEFT
Verify the tab handles are drawn properly on the left of the Tab Pane.

Add many more beans to the Tab Pane until the tab handles need an additional column
Verify that the tab handles are redrawn into multiple columns correctly.

Change the tabPlacement property to RIGHT
Verify the tab handles are drawn properly on the right of the Tab Pane.

Cull the tab children back to a reasonable number and change the tabPlacement back to TOP

Appearance
Select the Tab Pane and set the backgroundColor.
Verify the unselected tabs handles match the newly selected color.

Set the opaque property to true.
Verify the background area of the tab handles match the newly selected color

Change the font and the foreground properties
Verify the tab titles match the newly selected values.

Source code
Rearrange the order of  the add statements of the tabs.
Verify the canvas and Beans Viewer reflect the new order.

Context Menu Support
MB2 over the JTabbedPane and be Verify the popup menu contains a "Switch to" menu item.
Here's an example of the popup menu with 3 pages:


Verify
the "Switch to" menu item is disabled if there is one or less pages.
If there are pages, Verify the menu items are the titles of the pages.
Verify the page selected is NOT included in the list of popup items.
Verify the Next and Previous menu items are also on the popup if there is more than one page.
Verify selecting the Next, Previous, or specific page will switch to the actual page.