public class TreeWidget extends Object
Modifier and Type | Class and Description |
---|---|
protected class |
TreeWidget.UniversalSet |
Modifier and Type | Field and Description |
---|---|
protected Collection |
ancestors |
protected static int |
CLOSE |
protected static int |
CLOSE_ALL |
protected NavigatorPageIF |
context |
protected static int |
EXPAND_ALL |
protected String |
imageurl |
protected Map |
map |
protected String |
nodeFrame |
protected String |
nodepage |
protected static int |
OPEN |
protected Set |
openNodes |
protected String |
ownpage |
protected QueryProcessorIF |
processor |
protected ParsedQueryIF |
query |
protected String |
staticurl |
protected TopicMapIF |
topicmap |
protected String |
topquery |
protected static int |
WINDOW_SIZE |
protected int |
windowSize |
Constructor and Description |
---|
TreeWidget()
PUBLIC: Sets up the widget ready for use.
|
TreeWidget(TopicMapIF topicmap,
String query,
String topquery,
String ownpage,
String nodepage)
PUBLIC: Sets up the widget ready for use.
|
Modifier and Type | Method and Description |
---|---|
protected TopicTreeNode |
buildTree() |
protected void |
endRender(Writer out)
PUBLIC: Called after the tree has been rendered.
|
protected QueryResultIF |
getChildren(TopicIF topic) |
protected String |
getId(TopicIF topic) |
protected TMObjectIF |
getObjectById(String id) |
protected TopicIF |
getTopic(String id) |
protected void |
initializeContext(javax.servlet.http.HttpServletRequest request) |
protected String |
list(Set nodes) |
protected String |
makeNodeUrl(TopicTreeNode node)
PUBLIC: Produces the URL to the given node.
|
protected void |
parseQueries() |
protected void |
process(TopicTreeNode parent) |
protected void |
renderAdditionalOnBottomExpandCloseLine(Writer out,
int topline)
PUBLIC: Performs any additional rendering on the bottom line of the
open-all and close-all buttons.
|
protected void |
renderAdditionalOnTopExpandCloseLine(Writer out,
int topline)
PUBLIC: Performs any additional rendering on the top line of the open-all
and close-all buttons.
|
protected void |
renderBackButton(Writer out,
int topline)
PUBLIC: Renders the back button at the top/bottom of the form.
|
protected void |
renderCloseAllButton(Writer out,
int topline)
PUBLIC: Renders the close all button at the top/bottom of the form.
|
protected void |
renderExpandAllButton(Writer out,
int topline)
PUBLIC: Renders the expand all button at the top/bottom of the form.
|
protected void |
renderForwardButton(Writer out,
int topline)
PUBLIC: Renders the close all button at the top/bottom of the form.
|
protected void |
renderNode(TopicTreeNode node,
Writer out)
PUBLIC: This method renders the tree node, including its link, but
not the button in front of the node.
|
protected void |
renderNodeButton(int topline,
int level,
int action,
String id,
Writer out)
PUBLIC: Renders the +/- button in front of the node.
|
protected void |
renderTree(TopicTreeNode node,
int topline,
Writer writer) |
void |
run(javax.servlet.http.HttpServletRequest request,
Writer writer)
PUBLIC: Runs the widget, producing the output.
|
void |
run(javax.servlet.jsp.PageContext ctxt,
Writer writer)
PUBLIC: Runs the widget, producing the output.
|
void |
setAddAnchor(boolean addAnchor)
PUBLIC: If set to true the widget will add anchors on all links that
open/close nodes in the tree.
|
void |
setImageUrl(String imageurl)
PUBLIC: The URL at which the graphics used by the widget are found.
|
void |
setNodeFrame(String nodeFrame)
PUBLIC: The name of the HTML frame in which to open links to nodes.
|
void |
setNodePageUrl(String nodePageUrl)
PUBLIC: The URL of of the page that shows the nodes.
|
void |
setNodeQueryString(String nodeQuery)
PUBLIC: Sets the tolog query that given a node generates its
children.
|
void |
setOwnPageUrl(String ownPageUrl)
PUBLIC: The URL of the page the widget is on.
|
void |
setTopicMap(TopicMapIF topicmap)
PUBLIC: Sets the topic map used by the widget.
|
void |
setTopQueryString(String topQuery)
PUBLIC: Sets the tolog query that generates the list of top
nodes.
|
void |
setWidgetName(String name)
PUBLIC: The name of the session key in which the set of open nodes is
stored.
|
void |
setWindowSize(int windowSize)
PUBLIC: Sets the maximum number of nodes displayed by the widget at once.
|
protected void |
startRender(Writer out)
PUBLIC: Called before rendering of the tree begins.
|
String |
toString(TopicIF topic) |
protected int |
writeNode(TopicTreeNode node,
int topline,
Writer writer,
int level,
int lineno,
boolean indoc) |
protected static final int OPEN
protected static final int CLOSE
protected static final int EXPAND_ALL
protected static final int CLOSE_ALL
protected static final int WINDOW_SIZE
protected QueryProcessorIF processor
protected String nodepage
protected String staticurl
protected Set openNodes
protected String imageurl
protected int windowSize
protected NavigatorPageIF context
protected Collection ancestors
protected ParsedQueryIF query
protected TopicMapIF topicmap
protected Map map
protected String topquery
protected String ownpage
protected String nodeFrame
public TreeWidget()
public TreeWidget(TopicMapIF topicmap, String query, String topquery, String ownpage, String nodepage)
topicmap
- The topic map being displayed.query
- A tolog query that given a node generates its
children. Use the %parent% parameter to reference the parent node
in the query. Make sure the query produces a 1-column result.topquery
- A tolog query that generates the list of top
nodes. Make sure the query produces a 1-column result.ownpage
- The URL of the page the widget is on. The widget
will append request parameters in the form "a=b&c=d&e=f..."nodepage
- The URL of of the page that shows the nodes.public void setTopicMap(TopicMapIF topicmap)
public void setWidgetName(String name)
public void setTopQueryString(String topQuery)
public void setNodeQueryString(String nodeQuery)
public void setOwnPageUrl(String ownPageUrl)
public void setNodePageUrl(String nodePageUrl)
public void setImageUrl(String imageurl)
public void setAddAnchor(boolean addAnchor)
public void setWindowSize(int windowSize)
public void setNodeFrame(String nodeFrame)
public void run(javax.servlet.jsp.PageContext ctxt, Writer writer) throws IOException, InvalidQueryException, NavigatorRuntimeException
public void run(javax.servlet.http.HttpServletRequest request, Writer writer) throws IOException, InvalidQueryException, NavigatorRuntimeException
IOException
InvalidQueryException
NavigatorRuntimeException
protected void parseQueries() throws InvalidQueryException
InvalidQueryException
protected void initializeContext(javax.servlet.http.HttpServletRequest request)
protected TopicTreeNode buildTree() throws InvalidQueryException
InvalidQueryException
protected QueryResultIF getChildren(TopicIF topic) throws InvalidQueryException
InvalidQueryException
protected void process(TopicTreeNode parent) throws InvalidQueryException
InvalidQueryException
protected void renderTree(TopicTreeNode node, int topline, Writer writer) throws IOException
IOException
protected int writeNode(TopicTreeNode node, int topline, Writer writer, int level, int lineno, boolean indoc) throws IOException
IOException
protected TMObjectIF getObjectById(String id)
protected void renderNode(TopicTreeNode node, Writer out) throws IOException
IOException
protected void renderNodeButton(int topline, int level, int action, String id, Writer out) throws IOException
IOException
protected void renderBackButton(Writer out, int topline) throws IOException
IOException
protected void renderExpandAllButton(Writer out, int topline) throws IOException
IOException
protected void renderCloseAllButton(Writer out, int topline) throws IOException
IOException
protected void renderForwardButton(Writer out, int topline) throws IOException
IOException
protected void renderAdditionalOnTopExpandCloseLine(Writer out, int topline) throws IOException
IOException
protected void renderAdditionalOnBottomExpandCloseLine(Writer out, int topline) throws IOException
IOException
protected void startRender(Writer out) throws IOException
IOException
protected void endRender(Writer out) throws IOException
IOException
protected String makeNodeUrl(TopicTreeNode node)