|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjetbrains.buildServer.web.util.lazytree.LazyTree
public class LazyTree
Represents the front-end for browsing arbitrary large tree.
The lazy tree can be used in a special dedicated controller, or plugged into a page controller. In either case you should bind the tree to the HTTP session and handle tree-related requests with it. Example controller:
protected ModelAndView doHandle(HttpServletRequest request,
HttpServletResponse response) throws Exception {
HttpSession session = request.getSession();
LazyTree tree = (LazyTree) session.getAttribute(TREE_NAME);
if (tree == null) {
tree = new LazyTree(new FileSystemBrowser("/"));
session.setAttribute(TREE_NAME, tree);
}
if (tree.isUpdateTreeRequest(request)) {
return tree.handleUpdateTreeRequest(request, response);
}
...
}
Also consider storing the tree on a soft reference to avoid memory leaks.
There could be not more than one tree per controller. If you wish to show several lazy trees on a page, use a separate controller for each of them.
In a HTML or JSP page you have to:
BS.LazyTree.loadTree("id");
BS.LazyTree.treeUrl = window['base_uri'] + "/myController.html";
Browser| Constructor Summary | |
|---|---|
LazyTree(Browser browser)
Construct the lazy tree to show the info provided by browser. |
|
LazyTree(Browser browser,
LazyTreeElementRenderer renderer)
Construct the lazy tree to show the info provided by browser. |
|
| Method Summary | |
|---|---|
Browser |
getBrowser()
Returns the reference to the tree browser. |
org.springframework.web.servlet.ModelAndView |
handleUpdateTreeRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Processes the tree-related request, prints the required dynamic data to the response and returns null. |
boolean |
isUpdateTreeRequest(javax.servlet.http.HttpServletRequest request)
Returns true if the request is a special AJAX request and should be
processed using handleUpdateTreeRequest method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LazyTree(@NotNull
Browser browser,
@NotNull
LazyTreeElementRenderer renderer)
browser.
The elements are rendered using renderer.
browser - the browserrenderer - the renderer
public LazyTree(@NotNull
Browser browser)
browser.
browser - the browser| Method Detail |
|---|
public boolean isUpdateTreeRequest(@NotNull
javax.servlet.http.HttpServletRequest request)
request is a special AJAX request and should be
processed using handleUpdateTreeRequest method.
request - http request
handleUpdateTreeRequest(HttpServletRequest, HttpServletResponse)
@Nullable
public org.springframework.web.servlet.ModelAndView handleUpdateTreeRequest(@NotNull
javax.servlet.http.HttpServletRequest request,
@NotNull
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException
request - http requestresponse - http response.
java.io.IOException - if I/O error occursisUpdateTreeRequest(HttpServletRequest)@NotNull public Browser getBrowser()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||