Styled widgets setup instructionsAdded by IBM on September 9, 2010 | Version 1 (Original)
|To run the sample, you must import the sample into your workspace, configure it, and then start the sample.
To run the sample, you must import the sample into your workspace, configure it, and then start the sample.
Follow these steps:
- To import the sample:
- Select File > Import.
- From the Import Wizard, select General and then select Existing Projects into Workspace. Click Next.
- Select the Archive file radio button.
- Enter the name of the sample jar file, swidgets.jar, or browse to the com.ibm.rcp.tools.samplegallery2 plug-in directory and select the jar file from the archive directory.
- The dialog shows the projects present in the archive jar file. Select Finish to install the projects into your workspace.
This sample includes code to demonstrate database migration. To show the database migration, you must launch the platform twice, the second time with changes to demonstrate the migration.
- To configure and run the sample:
- Select Run > Run Configurations... from the main menu.
- Select Client Services and click New.
- Type a unique name for your configuration, such as Styled Widgets.
- Select the Plug-ins tab and verify that the com.ibm.rcp.samples.swidgets and com.ibm.rcp.samples.swidgets.theme plug-ins are selected.
- Select the Arguments tab and verify that –console is in the Program Arguments field.
- Click Apply and then Run.
This sample contributes an item to the application launcher:
- Select Open > Styled Widgets Sample Application.
The application (perspective) opens and displays two views – one containing Styled Widgets, and one containing SWT Widgets.
Select the tabs in the views to switch from SButton (Button), StoolBar(ToolBar), and SCoolBar, (CoolBar).
Moving the mouse over the various objects in the view displays a tooltip identifying the particular style. In addition, listeners were added to the widgets so the events fired are displayed in the Events text area.
- There is a Menu associated with the Styled Widgets view that provides actions to change the theme being used. (The Menu is located immediately next to the views minimize/maximize buttons.) Select Sample Theme to switch to the theme provided by the sample. Notice background colors, button colors, and toolbar/coolbar colors switch from the default setting to a shade of blue. To return to the default theme, select Default Theme from the view's menu.
If the View menu disappeared after changing the theme, do one of the following:
- Close and reopen the application.
- Cause the perspective to resize by changing the window size.
- Move the sash displayed between the two views.
Parent topic: Styled widgets: XPD622