Here is an example showing how to configure a node based on java.util.Properties
object:
<node type-name="java.util.Properties"> <jar url="file:PropertiesPlugin.jar" /> <wrapper> <code>org.objectweb.util.browser.plugins.java.JavaPropertiesContext</code> </wrapper> <icon> <code>org.objectweb.util.browser.plugins.java.PropertiesIconProvider</code> </icon> <panel> <code>org.objectweb.util.browser.plugins.java.PropertiesPanel</code> </panel> <menu> <item label="Add a property"> <code>org.objectweb.util.browser.plugins.java.AddPropertyAction</code> </item> <item label="Remove" tree-child-visible="true"> <code>org.objectweb.util.browser.plugins.java.RemovePropertyAction</code> </item> </menu> <drop-action java-class="org.objectweb.util.browser.plugins.java.AddPropertyDropAction" /> </node>
This configuration allows to obtain the following graphical representation when browsing a java.util.Properties
instance.
Several elements have been configured:
JavaPropertiesContext
class provides the children nodes of the Java Properties when users
expand the java.util.Properties
. Users can find all the defined properties. PropertiesIconProvider
) has been defined for this kind of object.
This one builds an icon depending on the number of properties contained by the java.util.Properties
instance.PropertiesPanel
) has also been defined in order to represent data of this instance. It presents a javax.swing.Jtable containing
also the defined properties with their associated values. AddPropertyAction
class allows to add a new property
into the java.util.Properties
object.