Here is an example showing how to configure a node based on java.util.Properties
object:
<node type-name="java.util.Map"> <jar url="file:build/lib/map-plugin.jar" /> <wrapper> <code>org.objectweb.util.explorer.plugin.java.map.MapContext</code> </wrapper> <icon> <code>org.objectweb.util.explorer.plugin.java.map.swing.MapIconProvider</code> </icon> <panel> <panel> <code>org.objectweb.util.explorer.plugin.java.map.swing.MapTitlePanel</code> </panel> <table> <code>org.objectweb.util.explorer.plugin.java.map.MapTable</code> </table> </panel> <menu> <item label="Clear this map"> <code>org.objectweb.util.explorer.plugin.java.map.MapClearAction</code> <accelerator ctrl="true" char="c" /> </item> <item label="Delete this entry" tree-child-visible="true"> <code>org.objectweb.util.explorer.plugin.java.map.MapRemoveEntryAction</code> <icon><icon-file url="delete.png" /></icon> <accelerator ctrl="true" char="d" /> <mnemonic char="d" /> </item> </menu> <drop-action label="Add an object"><code>org.objectweb.util.explorer.plugin.java.map.MapAddObjectOnDropAction</code></drop-action> <info><code>org.objectweb.util.explorer.plugin.java.map.MapInfo</code></info> </node>
This configuration allows to obtain the following graphical representation when browsing a java.util.Map
instance.
Several elements have been configured:
MapContext
class provides the children nodes of the Map when users
expand the java.util.Map
.MapIconProvider
) has been defined for this kind of object.
This one builds an icon depending on the number of properties contained in the java.util.Map
instance.javax.swing.JTable
containing
the mappings contained in the map instance.