Interface LazyTreeElementRenderer
-
- All Known Implementing Classes:
DefaultLazyTreeElementRenderer
public interface LazyTreeElementRendererA control allowing to customize the way the tree element is shown in UI.- Since:
- 6.0
- Author:
- Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetCssClassForElement(Element element)Returns the CSS class of the element to use.StringgetCustomHtmlForElement(Element element, String id)Returns the custom HTML (instead of standardspansequence) representing the element.StringgetHrefForDirectoryDownload(Element element)Returns a link which can be used to downloaded directory content or null if no such link should be provided.StringgetHrefForLeaf(Element leaf)Returns thehrefattribute value of the element's link.StringgetOnClickForLeaf(Element leaf)Returns theonclickhandler of the element's link.StringgetOnClickForNonLeaf(Element element)Returns theonclickhandler of the non-leaf element's link.StringgetTextForElement(Element element)Returns the text representation of an element (usually name).booleanignoreElement(Element element)If returns true, theelementand its subtree won't appear in web UI.voidprepareForRequest(javax.servlet.http.HttpServletRequest request)Allows the renderer to customize its behaviour depending on currentrequest.
-
-
-
Method Detail
-
prepareForRequest
void prepareForRequest(@NotNull javax.servlet.http.HttpServletRequest request)Allows the renderer to customize its behaviour depending on currentrequest.- Parameters:
request- http request
-
ignoreElement
boolean ignoreElement(@NotNull Element element)If returns true, theelementand its subtree won't appear in web UI. Useful for filtering redundant elements, such as".svn".- Parameters:
element- the element- Returns:
- true if the element should be ignored, false otherwise
-
getTextForElement
@NotNull String getTextForElement(@NotNull Element element)
Returns the text representation of an element (usually name). Default implementation returns:StringUtil.escapeHTML(element.getName(), false)).- Parameters:
element- the element to render- Returns:
- string representation of the element
-
getOnClickForLeaf
@Nullable String getOnClickForLeaf(@NotNull Element leaf)
Returns theonclickhandler of the element's link. Method is optional. Applies only to leaf elements.- Parameters:
leaf- the element to render- Returns:
- string representation of the onclick handler, or null
-
getOnClickForNonLeaf
@Nullable String getOnClickForNonLeaf(@NotNull Element element)
Returns theonclickhandler of the non-leaf element's link. Method is optional.- Parameters:
element- the non-leaf element to render- Returns:
- string representation of the onclick handler, or null if default handler should be used
- Since:
- 7.1
-
getHrefForLeaf
@Nullable String getHrefForLeaf(@NotNull Element leaf)
Returns thehrefattribute value of the element's link. Method is optional. Applies only to leaf elements.Updated in 7.0: some leaf elements can act as non-leaf ones (e.g. archives). Technically they are not leaves in a tree, but the
hrefattribute is still valid for them.- Parameters:
leaf- the element to render- Returns:
- string representation of the href attribute, or null
-
getHrefForDirectoryDownload
@Nullable String getHrefForDirectoryDownload(@NotNull Element element)
Returns a link which can be used to downloaded directory content or null if no such link should be provided.- Parameters:
element- the element to get link for- Returns:
- see above
-
getCssClassForElement
@Nullable String getCssClassForElement(@NotNull Element element)
Returns the CSS class of the element to use. May be applied to all elements.- Parameters:
element- the element to render- Returns:
- CSS class, or null if no additional class should be used
- Since:
- 7.0
-
getCustomHtmlForElement
@Nullable String getCustomHtmlForElement(@NotNull Element element, @NotNull String id)
Returns the custom HTML (instead of standardspansequence) representing the element. Note that in this case therendereris responsible to attach proper javascript handlers.- Parameters:
element- the element (can be a leaf, can be an intermediate one)id- its id- Returns:
- the HTML for the element, or
null - Since:
- 8.0
-
-