Example - Property Sheet


The Property Sheet Example adds an editor for files with the .usr extension and also demonstrates how to add properties and outline views on a file.

Running the example

To start using the Property Sheet Example, create a file with extension .usr.   Open the file and the Outline and Properties views to see the example in action.  Click on items in the Outline view and look in the Properties view for details of the selected item in the Outline view.  The people items in the list show the most detail in the Properties view.

Creating a new usr file

Create a new file with file extension .usr.  From the File menu, select New and then select Other... from the sub-menu.  Click on Simple in the wizard, then select
File in the list on the left.  Click on Next to supply the file name (make sure the extension is .usr) and the folder in which the file should be contained.


The Property Sheet Example demonstrates how to provide properties to the Property Sheet View.

The tree viewer of the Content Outline View contains and presents OrganizationElements. When an element is selected in the Content Outline View the Workspace will invoke getAdapter on the selected OrganizationElement. If an adapter is requested for IPropertySource, the OrganizationElement returns itself as it impements IPropertySource The Property Sheet View then use the Organization Element as it source.