Package org.apache.juneau.console.views
Class TerminalViewDef
java.lang.Object
org.apache.juneau.console.views.TerminalViewDef
The author-facing declaration of a terminal-view region, compiled to a
RegionDef.
toRegion() produces a region with populate("terminal-view"), opts that populator in with
allowPopulators("terminal-view"), and carries every setting as a flat params scalar. It never sets
dataUrl or refreshMs on the region: the terminal view owns its own polling loop.
Example:
RegionDef
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanCompact mode.static final longThe default poll interval in milliseconds.Events endpoint path template; required unlesspollisfalse .final StringRegion id.The param keys, in emission order.static final longThe refresh floor in milliseconds.static final StringThe path prefix used byforMixin(String, String, String); equalsTerminalViewMixin.RUN_VIEW_PREFIX.booleanWhether the region pollseventsUrl;false makes a region that only takes appended events.static final StringThe populator name.Raw-console link template with one{offset}placeholder.longPoll interval in milliseconds.Accessible name and heading.Region type; defaults toRegionDef.TYPE_CARD_BODY. -
Method Summary
Modifier and TypeMethodDescriptioncompact(boolean value) static TerminalViewDefCreates a declaration.static TerminalViewDefCreates a declaration whose events URL points at aTerminalViewMixinmounted atmountPath.static TerminalViewDefCreates a declaration from a parsed map (the console-ui card body).poll(boolean value) refreshMs(long value) toMap()Returns the set params inKEYSorder, withrefreshMsclamped.toRegion()Validates and compiles this declaration.validate()Validates this declaration (fail-closed).
-
Field Details
-
POPULATOR
The populator name.- See Also:
-
MIN_REFRESH_MS
The refresh floor in milliseconds.- See Also:
-
DEFAULT_REFRESH_MS
The default poll interval in milliseconds.- See Also:
-
MIXIN_PREFIX
The path prefix used byforMixin(String, String, String); equalsTerminalViewMixin.RUN_VIEW_PREFIX.- See Also:
-
KEYS
The param keys, in emission order. -
id
Region id. -
type
Region type; defaults toRegionDef.TYPE_CARD_BODY. -
eventsUrl
Events endpoint path template; required unlesspollisfalse . -
refreshMs
Poll interval in milliseconds. -
poll
Whether the region pollseventsUrl;false makes a region that only takes appended events. -
compact
Compact mode. -
title
Accessible name and heading. -
rawHref
Raw-console link template with one{offset}placeholder.
-
-
Method Details
-
create
Creates a declaration.- Parameters:
id- The region id.- Returns:
- A new declaration.
-
forMixin
Creates a declaration whose events URL points at aTerminalViewMixinmounted atmountPath.- Parameters:
id- The region id.mountPath- The resource mount path, for example"/petstore".runIdTemplate-"{id}"(the client row-id placeholder) or a literal run id.- Returns:
- A new declaration.
-
fromMap
Creates a declaration from a parsed map (the console-ui card body).- Parameters:
id- The card id.map- TheterminalViewobject; keys must be a subset ofKEYS.- Returns:
- A new declaration (not yet validated).
-
type
- Parameters:
value- The region type. @return This object.
-
eventsUrl
- Parameters:
value- The events endpoint path template. @return This object.
-
refreshMs
- Parameters:
value- The poll interval; clamped toMIN_REFRESH_MS. @return This object.
-
poll
- Parameters:
value- Whether to poll. @return This object.
-
compact
- Parameters:
value- Compact mode. @return This object.
-
title
- Parameters:
value- The accessible name and heading. @return This object.
-
rawHref
- Parameters:
value- The raw-console link template, with one{offset}. @return This object.
-
validate
Validates this declaration (fail-closed).- Returns:
- This object.
- Throws:
IllegalArgumentException- If a rule is broken.
-
toMap
Returns the set params inKEYSorder, withrefreshMsclamped.- Returns:
- A new ordered map.
-
toRegion
Validates and compiles this declaration.- Returns:
- A validated region.
-