Composite application developers and assemblers may wish to provide support for additional views to be opened within their application either through a user action or programmatically.
By default, when a view is opened within the Eclipse and Expeditor runtime, the view renders in the lower right hand corner of the composite application page. In most applications, this is not very useful as many applications usually contain a stack or folder of views. This is common in a document based application where a user may open multiple documents or in composite applications where a single Eclipse view contains an entire application (such as a Web application).
Configuring components for folder support
In order to support the ability to have dynamically opened views open as a tab in your existing folder you must first edit your component properties in the Composite Application Editor (CAE) tool.
- From the Advanced tab you can add, delete, and modify properties. Add a new property here called com.ibm.rcp.folderPlaceholders.
- In your component properties find the property com.ibm.rcp.viewId. Copy the value of this property and paste it into the value for the property you just created. This causes any new instances of your current component to open up in this folder. Use a different view ID for other views instances if you wish. Append the characters ":*" to the value.
The new property should look like com.ibm.rcp.folderPlaceholders = com.ibm.rcp.myview.id:*. The wild card character allows for any view that matches the full ID of com.ibm.rcp.myview.id: to open in this folder.
- Now that the component is configured for the folder you must create the folder. Since the CAE does not support a “folder” component, you can create a view stack by dragging another instance of the current component from the palette on top of your existing component. Edit the component properties for this new component and click the Advanced tab. Find the property entitled com.ibm.rcp.visible. The value for this property defaults to true. Change this value to false.
Your component folder is now configured to render dynamically opened views within itself. It is also worth noting that the property com.ibm.rcp.folderPlaceholders
can have multiple placeholder values set in it. You do this by delimiting each entry with a double colon (::
). The value of the property may look like the following:
com.ibm.rcp.folderPlaceholders = com.ibm.myview:*::com.ibm.yourview:*
Parent topic: Exploring more advanced functionality of composite applications: XPD622