Adding property setting controls directly to componentsAdded by IBM on October 5, 2011 | Version 1 (Original)
|To make your component's properties even more obvious to application assemblers, you can provide controls for setting the properties that are visible in the user interface of the component itself, when the application assembler is editing it in the Composite Application Editor.
To make your component's properties even more obvious to application assemblers, you can provide controls for setting the properties that are visible in the user interface of the component itself, when the application assembler is editing it in the Composite Application Editor.
To add this additional user interface, do the following in the code for your component class:
Parent topic: Making components configurable
- Check that the value of the com.ibm.rcp.editingApplication property is true before displaying the additional user interface you are providing.
- Make your ViewPart class implement the com.ibm.rcp.ca.utils.componentconfig.IComponentConfigurator interface:
public class MyView extends ViewPart implements IComponentConfigurator
- Implement the setSaveablePropertyManager(ISaveablePropertyManager propMgr) method.
When the component is added to a composite application, the Composite Application Editor checks to see if the component view implements the IsaveablePropertyManager interface. If it does, the editor calls the setSaveablePropertyManager method, passing in a property manager. This property manager allows the user to get and set properties and save or save and refresh. Calling the save or save and refresh method tells the editor to save or save and refresh the application, saving all changes to the composite application XML.
Note: In practice, you could include a member variable of type ISaveablePropertyManager in your ViewPart class and set that variable in the implemented setSaveablePropertyManager method. However, note that the variable will be null until the view user interface has been created. This is why you must check the editingApplication property as noted above, to know whether you must display the additional user interface.