Class UIFormPaneWithTabs.Tab
- java.lang.Object
-
- com.orchestranetworks.ui.form.UIFormPaneWithTabs.Tab
-
- Enclosing class:
- UIFormPaneWithTabs
public static final class UIFormPaneWithTabs.Tab extends Object
This class offers a tab to have aUIFormLabelSpecfor the title and thus can have aUIFormLabelSpec.DocumentationPane.It is designed to be added to a
UIFormPaneWithTabsby using the methodUIFormPaneWithTabs.addTab(Tab).The
idcan be set, and be used tohideorshowa tab via JavaScript. The initial hiding statecan be set.Example of implementation:
UIFormPaneWithTabs aPaneWithTabs = new UIFormPaneWithTabs(); aPaneWithTabs.addTab("Tab before example tab", new UITabBeforeExampleTabFormPane()); String exampleTabId = "exampleTabId"; Tab exampleTab = new Tab(new UIFormLabelSpec(new DocumentationPane( "Example tab documentation pane"), "Example tab title"), new UIExampleTabFormPane()); exampleTab.setId(exampleTabId); exampleTab.setInitiallyHidden(); aPaneWithTabs.addTab(exampleTab); String showExampleTabJSfnName = "displayExampleTab"; String hideExampleTabJSfnName = "hideExampleTab"; UIButtonSpecJSActionToggle toggleExampleTabDisplay = new UIButtonSpecJSActionToggle( UserMessage.createInfo("Display example tab"), showExampleTabJSfnName + "()", hideExampleTabJSfnName + "()"); aWriter.addButtonJavaScriptToggle(toggleExampleTabDisplay); aWriter.addJS("function ").addJS(showExampleTabJSfnName).addJS("(){"); aWriter.addJS_showTab(exampleTabId); aWriter.addJS("}"); aWriter.addJS("function ").addJS(hideExampleTabJSfnName).addJS("(){"); aWriter.addJS_hideTab(exampleTabId); aWriter.addJS("}"); aWriter.includePane(aPaneWithTabs);- Since:
- 5.7.0
- See Also:
UIFormPaneWithTabs.addTab(Tab),UIFormWriter.addJS_hideTab(String),UIFormWriter.addJS_showTab(String)
-
-
Constructor Summary
Constructors Constructor Description Tab(UIFormPane aPane)Constructs a tab without title.Tab(UIFormLabelSpec aTitle, UIFormPane aPane)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetId()UIFormPanegetPane()UIFormLabelSpecgetTitle()booleanisInitiallyHidden()voidsetId(String id)Sets an id for the tab.voidsetInitiallyHidden()Sets this tab to initially hidden on the browser screen.voidsetTitle(UIFormLabelSpec aTitle)Changes the tab title.
-
-
-
Constructor Detail
-
Tab
public Tab(UIFormPane aPane)
Constructs a tab without title.This constructor is interesting for the first tab, a default title ("Main") will therefore be assigned.
-
Tab
public Tab(UIFormLabelSpec aTitle, UIFormPane aPane)
-
-
Method Detail
-
setId
public void setId(String id)
Sets an id for the tab.The id attribute must respect the W3C Recommendation (in particular, by being unique in the page). See https://www.w3.org/TR/REC-html40/struct/global.html#adef-id for more information.
If no id is specified, an id will be generated.
If the list of tabs is dynamic to the record state (or an extra info), please set a fixed id. Otherwise, this tab won't be reselected after page reloading, record saving, etc.
- Parameters:
id- the id to set for the tab.- Since:
- 5.8.0
-
getId
public String getId()
- Returns:
- the id previously defined, or
null. - See Also:
setId(String)
-
getTitle
public UIFormLabelSpec getTitle()
- Returns:
- the title previously defined, or
null.
-
setTitle
public void setTitle(UIFormLabelSpec aTitle)
Changes the tab title.- Parameters:
aTitle- the new title- Since:
- 5.8.0
-
getPane
public UIFormPane getPane()
- Returns:
- the pane defined in the constructor
-
setInitiallyHidden
public void setInitiallyHidden()
Sets this tab to initially hidden on the browser screen.The tab can be shown or hidden by a JavaScript function and the tab id.
-
isInitiallyHidden
public boolean isInitiallyHidden()
- Returns:
trueif this tab will be initially hidden on the browser screen,falseif this tab will be initially displayed- See Also:
setInitiallyHidden()
-
-