Package org.apache.juneau.console.views
Class DetailTab
java.lang.Object
org.apache.juneau.console.views.DetailTab
One tab of a tabbed
RowDetail: a fields grid, a nested table, a chart or a client-rendered pane.
The tab is loaded lazily: its content is fetched the first time the user opens it. A tab id is the slug of its
title unless id(String) is given.
Example:
RowDetail.
- Since:
- 10.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumHow a row detail caches the content of its tabs.static enumThe tab kinds. -
Method Summary
Modifier and TypeMethodDescriptionstatic DetailTabStarts a chart tab.static DetailTabStarts a client-rendered tab.columns(int n) Sets the grid column count of a fields tab.Sets a server-side counter shown in the tab label.Shows the nested table's row count in the tab label once the tab has loaded.Sets the text shown when the tab has nothing to show.Sets the per-tab GET endpoint.static DetailTabStarts a fields-grid tab.Groups some of a fields tab's fields under a heading.Sets the tab icon.Sets the tab id (default: the slug of the title).Returns the element's model block.refreshOnPoll(boolean value) Sets whether the tab reloads when the table polls.scopeParam(String value) Sets the query parameter carrying the parent row id to a nested table.self()Returns this builder.static DetailTabStarts a nested-table tab.toMap()Serializes this tab to its wire shape.visibleWhen(VisibilityRule... rules) Hides the tab unless every rule matches.
-
Method Details
-
modelBlock
Description copied from interface:HandledReturns the element's model block.- Specified by:
modelBlockin interfaceHandled<DetailTab>- Returns:
- The block; never
null .
-
self
Description copied from interface:HandledReturns this builder. -
fields
Starts a fields-grid tab.- Parameters:
title- The tab title. Must not be blank.fields- The row field names shown, in order. Unique within the tab.- Returns:
- A new tab.
-
table
Starts a nested-table tab.- Parameters:
title- The tab title. Must not be blank.view- The nested table; it must declare a rows data URL.- Returns:
- A new tab.
-
chart
Starts a chart tab.- Parameters:
title- The tab title. Must not be blank.region- The chart region.- Returns:
- A new tab.
-
client
Starts a client-rendered tab.- Parameters:
title- The tab title. Must not be blank.renderer- The name of a renderer registered in the browser; letters, digits,. _ -, at most 64.- Returns:
- A new tab.
-
id
Sets the tab id (default: the slug of the title).- Parameters:
value- The id; lower-case letter first, then lower-case letters, digits and-, at most 32.- Returns:
- This object.
-
icon
Sets the tab icon.- Parameters:
value- An icon name.- Returns:
- This object.
-
endpoint
Sets the per-tab GET endpoint.- Parameters:
value- A same-origin path template;{id}is replaced by the row id.- Returns:
- This object.
-
emptyText
Sets the text shown when the tab has nothing to show.- Parameters:
value- The text.- Returns:
- This object.
-
columns
Sets the grid column count of a fields tab.- Parameters:
n- The count, 1 to 4; 0 inherits the detail's count.- Returns:
- This object.
-
group
Groups some of a fields tab's fields under a heading. Fields in no group follow, under no heading.- Parameters:
groupTitle- The heading.groupFields- The fields; each must be in the tab's field list and in no other group.- Returns:
- This object.
-
scopeParam
Sets the query parameter carrying the parent row id to a nested table.- Parameters:
value- The parameter name (defaultparentId).- Returns:
- This object.
-
countFromRows
Shows the nested table's row count in the tab label once the tab has loaded. Table tabs only.- Returns:
- This object.
-
count
Sets a server-side counter shown in the tab label. The value travels in the detail'scounts.- Parameters:
f- Maps a row id to a count.- Returns:
- This object.
-
refreshOnPoll
Sets whether the tab reloads when the table polls.- Parameters:
value- The flag (defaultfalse ).- Returns:
- This object.
-
visibleWhen
Hides the tab unless every rule matches. Presentation only; it never authorises.- Parameters:
rules- The rules.- Returns:
- This object.
-
toMap
Serializes this tab to its wire shape.- Returns:
- The tab map.
- Throws:
IllegalArgumentException- If the tab is invalid.
-