·        Procedure:

This scenario will test the ability of the Visual Editor to function with icons (ImageCellEditor) upon SWT components.

·        Setup:

Get the latest build, and create a Java project with the additional Standard Widget Toolkit (SWT) Library.

Do this by creating a new Java Project by pressing the ‘New’ button on the tool bar…

Select ‘Java’ from the list, and the ‘Java Project’ on the right. Click Next…

Name the java project, and click next…

Select the ‘Libraries’ tab and click on the ‘Add Library…’ button;

Choose Standard Widget Toolkit (SWT), then click ‘Finish’. And then ‘Finish’ again.

 

Create a new Visual Class and choose to extend ‘other’ and use the default superclassjava.lang.Object’. Then select ‘Finish’.

 

·        Basic Functionality:

o        Import some images into the java project…


Then on to the canvas drop a ‘Shell’ from the SWT Palette…


Go to the ‘Properties’ view, and select the cell editor button ‘Image’  -
This should launch the ‘Select an Image File’ dialog.
Select to ‘Browse in’ ‘Project’. Check the ‘Search sub-directories’ box. And select an image from either the ‘Files’ window or the Available Images pane.

Select OK.
Verify that the image appears in the title bar of the ‘Shell’.


 

o        On the same shell, drop a Button from the SWT palette.
Then select the and select the cell editor button ‘Image’ to launch the ‘Select an Image File’ dialog.
Select to ‘Browse in’ the 'File System'.
Go to a ‘Location’ where you wish to get your image from.
A list of images should then appear in the ‘Files’ pane, and all of the images should have thumbnails previewed in the ‘Available images’ pane.
Select the desired image and press the OK button.
Verify that the image should now appear upon the Button.

o        Save the visual class and verify that the source has been updated with code to include the image upon the SWT component?



o        Using the last example, bring up the dialog box, and verify the following…

·         Verify that by selecting either the ‘Project’ or ‘File System’ the location view will change to the appropriate location as expected?

·         Verify that by selecting the ‘Search sub-directories’, that all the images are found in the selected director and that these files preview in the ‘Files’ and ‘Available images’ window?

·         Verify that ‘Filter:’ combobox works as expected. That when ‘*.jpg’ is selected, only JPG files become available? And that you’re able to input your own filter like ‘*.bmp’?

·         Verify that which ever image file is selected it previews in the ‘Selected Image’ pane.

·         Verify that the ‘Path:’ reads the appropriate path.

 

·         Drop from the SWT palette on to a content pane. And verify that an image can be added via the image property and that visual class will save without errors. And verify that the source has been updated with code to include the image:

o        Shell

o        Button

o        CheckBox

o        RadioButton

o        Label