public class DynamicTreeWidget extends Object
Modifier and Type | Field and Description |
---|---|
protected static int |
CLOSE |
protected static int |
CLOSE_ALL |
protected NavigatorPageIF |
context |
protected static int |
EXPAND_ALL |
protected String |
imageurl |
protected String |
nodepage |
protected static int |
OPEN |
protected String |
ownpage |
protected QueryProcessorIF |
processor |
protected String |
staticurl |
protected static int |
WINDOW_SIZE |
protected int |
windowSize |
Constructor and Description |
---|
DynamicTreeWidget()
PUBLIC: Sets up the widget ready for use.
|
DynamicTreeWidget(TopicMapIF topicmap,
String tablequery,
String ownpage,
String nodepage)
PUBLIC: Sets up the widget ready for use.
|
Modifier and Type | Method and Description |
---|---|
protected void |
endRender(Writer out)
PUBLIC: Called after the tree has been rendered.
|
protected String |
escapeName(String name) |
protected String |
getId(TopicIF topic) |
protected String |
getQualifiedId(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 |
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.
|
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 |
setChildrenComparator(Comparator childrenComparator) |
void |
setDebug(boolean debug)
INTERNAL: Debug flag.
|
void |
setDependentWidgets(String[] widget_names)
PUBLIC: The name of the session key in which the set of open nodes is
stored.
|
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 |
setOwnPageUrl(String ownPageUrl)
PUBLIC: The URL of the page the widget is on.
|
void |
setTableQuery(String tablequery)
EXPERIMENTAL: The name of the HTML frame in which to open links
to nodes.
|
void |
setTableQueryString(String tablequery)
PUBLIC: Sets the tolog query that generates the entire tree.
|
void |
setTopicMap(TopicMapIF topicmap)
PUBLIC: Sets the topic map used by the widget.
|
void |
setTopQuery(String topquery) |
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 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 String imageurl
protected int windowSize
protected NavigatorPageIF context
protected String ownpage
public DynamicTreeWidget(TopicMapIF topicmap, String tablequery, String ownpage, String nodepage) throws InvalidQueryException
topicmap
- The topic map being displayed.tablequery
- A tolog query that generates the entire tree. The
query must have at least two columns, where the first column
contains all the parent nodes and the second column contains the
children of those parents. Any further columns will be used to
populate the data attribute of the tree nodes.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.InvalidQueryException
public DynamicTreeWidget()
public void setTopicMap(TopicMapIF topicmap)
public void setTableQueryString(String tablequery)
public void setOwnPageUrl(String ownPageUrl)
public void setNodePageUrl(String nodePageUrl)
public void setDebug(boolean debug)
public void setWidgetName(String name)
public void setDependentWidgets(String[] widget_names)
public void setImageUrl(String imageurl)
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 setTableQuery(String tablequery)
public void setChildrenComparator(Comparator childrenComparator)
public void setTopQuery(String topquery)
public void run(javax.servlet.http.HttpServletRequest request, Writer writer) throws IOException, InvalidQueryException, NavigatorRuntimeException
IOException
InvalidQueryException
NavigatorRuntimeException
protected void initializeContext(javax.servlet.http.HttpServletRequest request)
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 startRender(Writer out) throws IOException
IOException
protected void endRender(Writer out) throws IOException
IOException
protected String makeNodeUrl(TopicTreeNode node)