|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hyperic.hq.bizapp.explorer.ExplorerManager
public class ExplorerManager
This manager provides a registry and utility methods when dealing with
ExplorerItems and trees.
The manager is also used to traverse an item hierarchy. The methods
findAllChildren(ExplorerContext, ExplorerItem)
and
findChild(ExplorerContext, ExplorerItem, String)
can be used
to deal with item children.
ExporerItem
s essentially have 2 sets of children .. ones which
are implicit to them ExplorerItem.getChildren()
and ones which
are adopted, and specified by some other ExplorerItemType
. Calling
the hierarchy methods from the manager ensures that both sets of children
are accounted for.
The major players in the Explorer code is the ExplorerManager
,
the ExplorerItemType
, and ExplorerViewProvider
.
There are 2 main phases in dealing with the explorer.
First part: Generating a tree
1 - Querying ExplorerManager (via findAllChildren(), you can create a
tree represented by ExplorerItems
2 - To fill out this tree of ExplorerItems, the manager talks to
ExplorerTypes which have been registered, asking if they have children
for the currently processed node.
Second part: After selecting an ExplorerItem, getting the views
1 - Once an ExplorerItem is obtained, you can ask the ExplorerManager
which views it has onto that item.
2 - The ExplorerManager then asks all the registered ExplorerViewProviders
for their views of that item, and returns them in a list.
Finally, the UI can take that list of views and present their associated
content in the right-hand side.
Method Summary | |
---|---|
java.lang.String |
composePathTo(ExplorerItem item)
Compose a path of codes leading up to (and including) the item. |
java.util.List |
findAllChildren(ExplorerContext ctx,
ExplorerItem parent)
Find all children of a given parent, adopted and otherwise. |
ExplorerItem |
findChild(ExplorerContext ctx,
ExplorerItem parent,
java.lang.String code)
Find a child of the given parent. |
ExplorerItem |
findItem(ExplorerContext ctx,
java.lang.String path)
Find an item by code, given a full path. |
java.util.Collection |
getAllTypes()
Get a collection of all ExplorerItemType s |
static ExplorerManager |
getInstance()
|
ExplorerItemType |
getType(java.lang.String name)
Get an item type by name |
java.util.List |
getViewsFor(ExplorerContext ctx,
ExplorerItem item)
Get a list of ExplorerView s relevant to the specified item. |
void |
registerProvider(HQUGroupProvider provider)
|
void |
registerType(ExplorerItemType type)
Register an item type which can be used for filling out explorer trees. |
void |
unregisterProvider(java.lang.String providerName)
|
void |
unregisterType(java.lang.String name)
Unregister a previously registered item type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void registerProvider(HQUGroupProvider provider)
public void unregisterProvider(java.lang.String providerName)
public java.util.List getViewsFor(ExplorerContext ctx, ExplorerItem item)
ExplorerView
s relevant to the specified item.
ExplorerView
spublic void registerType(ExplorerItemType type)
ExplorerItemType.getName()
, so any
item type previously using that name will be unregistered.
public void unregisterType(java.lang.String name)
name
- the name of the item type, as from
ExplorerItemType.getName()
public ExplorerItemType getType(java.lang.String name)
ExplorerItemType.getName()
public java.util.Collection getAllTypes()
ExplorerItemType
s
public ExplorerItem findChild(ExplorerContext ctx, ExplorerItem parent, java.lang.String code)
public java.util.List findAllChildren(ExplorerContext ctx, ExplorerItem parent)
public java.lang.String composePathTo(ExplorerItem item)
public ExplorerItem findItem(ExplorerContext ctx, java.lang.String path)
public static ExplorerManager getInstance()
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |