java.lang.Object | |
↳ | com.microstrategy.web.app.utils.TabControlHelper |
This helper class takes care of displaying a tab control according to the information used for initializing it. The tab
control is constructed as a form, therefore the information that needs to be included for its proper tab switching
needs to be in the form of hidden inputs.
Each tab has a unique identifier, specified during the calls to the addTab() method. Use this same identifier
to set the current selected tab by using the setSelectedTab() method.
Once the settings for the tab have been specified, the contents of the current selected tab have to be
specified to the control by using the setContents() method.
The different parameters that can be set when defining a new tab control include:
Example
For the tab control shown on the object browser, the calls executed for initializing the tab control are as follows:
tab.addTab(String.valueOf(EnumObjectBrowserTabs.ObjectBrowserReportObjectsTab), getDescriptor(1951), target1); 'Descriptor: Report Objects
TabControlHelper tab = new TabControlHelper();
target1 = eventSwitchToReportObjectsTab.getHiddenInputs();
target2 = eventSwitchToAllObjectsTab.getHiddenInputs();
formTarget = eventSwitchToReportObjectsTab.getSource().getRoot().getName();
tab.addTab(String.valueOf(EnumObjectBrowserTabs.ObjectBrowserAllObjectsTab), getDescriptor(1952), target2); ' Descriptor: All Objects
tab.setSwitchTabsFormTarget(formTarget);
tab.setImageTab(imgArrowDown, imgArrowRight);
tab.setStyleTab("selectedTabCell", "unselectedTabCell");
tab.setStyleLastTab("selectedTabImage", "unselectedTabImage");
tab.setImageCellStyle("selectedTabImage", "unselectedTabImage");
tab.setBorderPadding(5);
tab.setBorderColor("borderStyle");
tab.setSelectedTab(String.valueOf(_currentTab));
tab.setUseDHTML(DHTML);
If the tab control to be displayed is to work on HTML mode only and no images are displayed together with the
tabs so they can serve as INPUT images to submit the form, then the user can choose not to use forms but a direct
link, for example:
TabControlHelper tab = new TabControlHelper();
target1 = eventSwitchToReportObjectsTab.getURLLink();
target2 = eventSwitchToAllObjectsTab.getURLLink();
tab.addTab(String.valueOf(EnumObjectBrowserTabs.ObjectBrowserReportObjectsTab), getDescriptor(1951), target1); 'Descriptor: Report Objects
tab.addTab(String.valueOf(EnumObjectBrowserTabs.ObjectBrowserAllObjectsTab), getDescriptor(1952), target2); ' Descriptor: All Objects
tab.setUseForm(false);
tab.setStyleTab("selectedTabCell", "unselectedTabCell");
tab.setStyleLastTab("selectedTabImage", "unselectedTabImage");
tab.setImageCellStyle("selectedTabImage", "unselectedTabImage");
tab.setBorderPadding(5);
tab.setBorderColor("borderStyle");
tab.setSelectedTab(String.valueOf(_currentTab));
tab.setUseDHTML(false); // Change its true default value
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | TAB_ALIGNMENT_JUSTIFIED | Indicates the different tabs will be justified to the 100% of the width of the control | |||||||||
int | TAB_ALIGNMENT_LEFT | Indicates the different tabs will be aligned to the left of the control | |||||||||
int | TAB_ALIGNMENT_RIGHT | Indicates the different tabs will be aligned to the right of the control |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
TabControlHelper(ContainerServices containerServices)
Class constructor
| |||||||||||
TabControlHelper(AppContext appContext)
Class constructor
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean |
addTab(String key, String tabText, String tabInfo, String tabPrefix, String tabSuffix, String imgTooltip)
Adds the requested tab to the collection.
| ||||||||||
boolean |
addTab(String key, String tabText, MarkupOutput contents)
Adds the requested tab to the collection.
| ||||||||||
boolean |
addTab(String key, String tabText, String tabInfo, String tabPrefix, String tabSuffix)
Adds the requested tab to the collection.
| ||||||||||
boolean |
addTab(String key, String tabText, MarkupOutput contents, String tabPrefix, String tabSuffix)
Adds the requested tab to the collection.
| ||||||||||
boolean |
addTab(String key, String tabText, String tabInfo)
Adds the requested tab to the collection.
| ||||||||||
void |
clear()
Clear the tab definition
| ||||||||||
MarkupOutput |
generateOutput()
Generates the HTML output for this tab instance
| ||||||||||
int |
getBorderPadding()
Gets the border width to be applied to the tab control
| ||||||||||
String |
getExtraInput()
Gets any extra form input information that should be added to the events generated by this tab control
| ||||||||||
String |
getExtraUrl()
Gets any extra URL information that should be added to the events generated by this tab control
| ||||||||||
String |
getImageSelectedTab()
Gets the image to be displayed for the selected tab
| ||||||||||
String |
getImageUnselectedTab()
Gets the image to be displayed for the not selected tabs
| ||||||||||
int |
getIndexSelectedTab()
If no tab has been assigned as current, by default returns the first one
| ||||||||||
String |
getInfoSelectedTab()
Returns the information associated with the tab currently marked as selected.
| ||||||||||
int |
getSize()
Gets the number of tabs that have been added to the control
| ||||||||||
String |
getStyleBorderColor()
Gets the color of the border to be applied to the tab control
| ||||||||||
String |
getStyleSelectedImageCell()
Gets the style of the cell to hold the image to be used for the selected tab
| ||||||||||
String |
getStyleSelectedLastTab()
Gets the style to be used for the selected tab if it's the last one to be displayed
| ||||||||||
String |
getStyleSelectedTab()
Gets the style to be used for the selected tab
| ||||||||||
String |
getStyleSelectedText()
Gets the style to be used for the text of the selected tab
| ||||||||||
String |
getStyleUnselectedImageCell()
Gets the style of the cell to hold the image to be used for the not selected tabs
| ||||||||||
String |
getStyleUnselectedLastTab()
Gets the style to be used for the not selected tab if it's the last one to be displayed
| ||||||||||
String |
getStyleUnselectedTab()
Gets the style to be used for the not selected tabs
| ||||||||||
String |
getStyleUnselectedText()
Gets the style to be used for the text of the not selected tabs
| ||||||||||
String |
getSwitchTabsFormTarget()
Gets the target to be used when displaying the tabs
| ||||||||||
int |
getTabAlignment()
Gets the tab alignment to be used when displaying the tabs on the control
| ||||||||||
String |
getTextSelectedTab()
Returns what's the text being displayed for the tab that it's currently marked as selected.
| ||||||||||
boolean |
getUseApplyAllTabs()
Returns if this tab is to use the Apply All Tabs functionality or not
| ||||||||||
boolean |
getUseDHTML()
Returns whether the tab control displays DHTML or not
| ||||||||||
boolean |
getUseForm()
Returns if this tab is to generate a Form for switching tabs, or just regular links
| ||||||||||
boolean |
getUseIFrame()
Returns whether this tab control will be using IFrame or not
| ||||||||||
void |
setBasePath(String basePath)
Defines the base path where the image files used for regular formatting can be found
| ||||||||||
void |
setBorderPadding(int value)
Sets the border padding to use when displaying the tab contents
| ||||||||||
void |
setContents(MarkupOutput out)
Defines the contents of the current tab.
| ||||||||||
void |
setEventManager(EventManager newValue)
Assigns a new
EventManager instance to be used by the tab control for generating the events to be used for
handling this instance | ||||||||||
void |
setExtraInput(String newValue)
Sets any extra form input information that should be added to the events generated by this tab control
| ||||||||||
void |
setExtraUrl(String newValue)
Sets any extra URL information that should be added to the events generated by this tab control
| ||||||||||
void |
setImageCellStyle(String selected, String unSelected)
Defines the style of the cell that will hold the image to be used for the tab
| ||||||||||
void |
setImageSelectedTab(String value)
Sets the image to display on the selected tab
| ||||||||||
void |
setImageTab(String selected, String unSelected)
Sets the image to be used when displaying the tabs
| ||||||||||
void |
setImageUnselectedTab(String value)
Sets the image to display on the not selected tabs
| ||||||||||
boolean |
setSelectedTab(String key)
Given the key sent as parameter, have the tab associated with this key
selected as current one.
| ||||||||||
void |
setStyleBorderColor(String value)
Sets the color of the border to use when displaying the tab contents
| ||||||||||
void |
setStyleLastTab(String selected, String unSelected)
Defines the style of the last tab to be used
| ||||||||||
void |
setStyleSelectedImageCell(String value)
Sets the style to be used for the cell containing the image of the selected tab
| ||||||||||
void |
setStyleSelectedLastTab(String value)
Sets the style to be used for the selected tab if it's the last one to be displayed
| ||||||||||
void |
setStyleSelectedTab(String value)
Sets the style to be used for the selected tab
| ||||||||||
void |
setStyleSelectedText(String value)
Sets the style to use for the text to be displayed for the selected tab
| ||||||||||
void |
setStyleTab(String selected, String unSelected)
Defines the style of the tabs to be displayed for this control
| ||||||||||
void |
setStyleText(String selected, String unSelected)
Defines the style of the text to be used when displaying the tabs
| ||||||||||
void |
setStyleUnselectedImageCell(String value)
Sets the style to be used for the cell containing the image of the not selected tabs
| ||||||||||
void |
setStyleUnselectedLastTab(String value)
Sets the style to be used for the unselected tab if it's the last one to be displayed
| ||||||||||
void |
setStyleUnselectedTab(String value)
Sets the style to be used for the unselected tabs
| ||||||||||
void |
setStyleUnselectedText(String value)
Sets the style to use for the text to be displayed for the not selected tabs
| ||||||||||
void |
setSwitchTabsFormTarget(String value)
Defines the target of the form that gets submitted when a switch tab is requested
| ||||||||||
void |
setTabAlignment(int value)
Defines the alignment of the tabs to be displayed on the control.
| ||||||||||
void |
setUseApplyAllTabs(boolean useApplyAllTabs)
Defines if this tab is to use the Apply All Tabs functionality.
| ||||||||||
void |
setUseDHTML(boolean useDHTML)
Defines if this tab is to generate HTML or DHTML output.
| ||||||||||
void |
setUseForm(boolean useForm)
Defines if this tab is to generate a Form for switching tabs, or just regular links (by default it uses
a form).
| ||||||||||
void |
setUseIFrame(boolean newValue)
Defines whether this tab control will be using an IFrame or not
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Indicates the different tabs will be justified to the 100% of the width of the control
Indicates the different tabs will be aligned to the left of the control
Indicates the different tabs will be aligned to the right of the control
Adds the requested tab to the collection. If the key was already defined with another element, the previous value will be overwritten with the new information.
key | String value to associate as key of the tab being added |
---|---|
tabText | String to display when rendering the tab |
tabInfo | String containing the link to be used for accessing the contents of this tab |
tabPrefix | String to display before the text of the tab. It will not be part of the
link generated for switching tabs (if not using forms), but will have the same CSS Style as the text. |
tabSuffix | String to display after the text of the tab. It will not be part of the
link generated for switching tabs (if not using forms), but will have the same CSS Style as the text. |
imgTooltip | String to be used as tooltip if there's an image to render together with this tab when it's not
selected |
Adds the requested tab to the collection. If the key was already defined with another
key | String value to associate as key of the tab being added |
---|---|
tabText | String to display when rendering the tab |
contents | a MarkupOutput instance initialized with the contents of this tab. If contents are going
to be defined for each tab, they should be inside a tag identified with the same name as the
key specified for this tab in order to have it enabled to be hidden or shown as requested by the final user.
Somewhere in the contents the required hidden inputs should be included so the event gets handled correctly. |
Adds the requested tab to the collection. If the key was already defined with another element, the previous value will be overwritten with the new information.
key | String value to associate as key of the tab being added |
---|---|
tabText | String to display when rendering the tab |
tabInfo | String containing the link to be used for accessing the contents of this tab |
tabPrefix | String to display before the text of the tab. It will not be part of the
link generated for switching tabs (if not using forms), but will have the same CSS Style as the text. |
tabSuffix | String to display after the text of the tab. It will not be part of the
link generated for switching tabs (if not using forms), but will have the same CSS Style as the text. |
Adds the requested tab to the collection. If the key was already defined with another element, the previous value will be overwritten with the new information.
key | String value to associate as key of the tab being added |
---|---|
tabText | String to display when rendering the tab |
contents | a MarkupOutput instance initialized with the contents of this tab. If contents are going
to be defined for each tab, they should be inside a tag identified with the same name as the
key specified for this tab in order to have it enabled to be hidden or shown as requested by the final user.
Somewhere in the contents the required hidden inputs should be included so the event gets handled correctly. |
tabPrefix | String to display before the text of the tab. It will not be part of the
link generated for switching tabs (if not using forms), but will have the same CSS Style as the text. |
tabSuffix | String to display after the text of the tab. It will not be part of the
link generated for switching tabs (if not using forms), but will have the same CSS Style as the text. |
Adds the requested tab to the collection. If the key was already defined with another element, the previous value will be overwritten with the new information.
key | String value to associate as key of the tab being added |
---|---|
tabText | String to display when rendering the tab |
tabInfo | String containing the link to be used for accessing the contents of this tab |
Clear the tab definition
Generates the HTML output for this tab instance
MarkupOutput
instance with the HTML to be rendered for this tab control.
Gets the border width to be applied to the tab control
Gets any extra form input information that should be added to the events generated by this tab control
String
with any extra input information to add to the forms to be displayed
by this tab control
Gets any extra URL information that should be added to the events generated by this tab control
String
with any extra URL to add to the links to be displayed
by this tab control
Gets the image to be displayed for the selected tab
Gets the image to be displayed for the not selected tabs
If no tab has been assigned as current, by default returns the first one
Returns the information associated with the tab currently marked as selected.
Gets the number of tabs that have been added to the control
Gets the color of the border to be applied to the tab control
Gets the style of the cell to hold the image to be used for the selected tab
Gets the style to be used for the selected tab if it's the last one to be displayed
Gets the style to be used for the selected tab
Gets the style to be used for the text of the selected tab
Gets the style of the cell to hold the image to be used for the not selected tabs
Gets the style to be used for the not selected tab if it's the last one to be displayed
Gets the style to be used for the not selected tabs
Gets the style to be used for the text of the not selected tabs
Gets the target to be used when displaying the tabs
Gets the tab alignment to be used when displaying the tabs on the control
Returns what's the text being displayed for the tab that it's currently marked as selected.
Returns if this tab is to use the Apply All Tabs functionality or not
Returns whether the tab control displays DHTML or not
Returns if this tab is to generate a Form for switching tabs, or just regular links
Returns whether this tab control will be using IFrame or not
boolean
value indicating if this interface will be interacting with an IFrame control
Defines the base path where the image files used for regular formatting can be found
basePath | String with the base path to access for finding the required files (for example, "..") |
---|
Sets the border padding to use when displaying the tab contents
value | an integer value with the width to be left between the edge of the tab control and its contents |
---|
Defines the contents of the current tab.
out | a MarkupOutput instance initialized with the HTML to be displayed as the
current tab contents. These contents will be ignored if when adding tabs to the helper at least
one content was defined.
|
---|
Assigns a new EventManager
instance to be used by the tab control for generating the events to be used for
handling this instance
newValue | a EventManager instance, initialized
|
---|
Sets any extra form input information that should be added to the events generated by this tab control
newValue | String with any extra input information to add to the forms to be displayed
by this tab control
|
---|
Sets any extra URL information that should be added to the events generated by this tab control
newValue | String with any extra URL to add to the links to be displayed
by this tab control
|
---|
Defines the style of the cell that will hold the image to be used for the tab
selected | css style to use for the cell that holds the image for a selected tab |
---|---|
unSelected | css style to use for the cell that holds the image for the not selected tabs |
Sets the image to display on the selected tab
value | image source to be used |
---|
Sets the image to be used when displaying the tabs
selected | image source to be used for the selected tab |
---|---|
unSelected | image source to be used for the not selected tabs. |
Sets the image to display on the not selected tabs
value | image source to be used |
---|
Given the key sent as parameter, have the tab associated with this key selected as current one. If no tab is associated with this key, returns false
key | String value that indicates the key of the selected tab |
---|
True
if the key requested corresponds to an existing tab. Returns False
otherwise.
Sets the color of the border to use when displaying the tab contents
value | hexadecimal color code to apply when displaying the border of the tab control |
---|
Defines the style of the last tab to be used
selected | the css style to use if the last tab is a selected one |
---|---|
unSelected | the css style to use if the last tab is not the selected one |
Sets the style to be used for the cell containing the image of the selected tab
value | css style to use |
---|
Sets the style to be used for the selected tab if it's the last one to be displayed
value | css style to use |
---|
Sets the style to be used for the selected tab
value | css style to use |
---|
Sets the style to use for the text to be displayed for the selected tab
value | css style to use |
---|
Defines the style of the tabs to be displayed for this control
selected | css style to use for the selected tab |
---|---|
unSelected | css style to use for the not selected tabs |
Defines the style of the text to be used when displaying the tabs
selected | css style to use for the text of the selected tab |
---|---|
unSelected | css style to use for the text of the not selected tabs. |
Sets the style to be used for the cell containing the image of the not selected tabs
value | css style to use |
---|
Sets the style to be used for the unselected tab if it's the last one to be displayed
value | css style to use |
---|
Sets the style to be used for the unselected tabs
value | css style to use |
---|
Sets the style to use for the text to be displayed for the not selected tabs
value | css style to use |
---|
Defines the target of the form that gets submitted when a switch tab is requested
value | the target where to go when switching tabs has been asked for |
---|
Defines the alignment of the tabs to be displayed on the control. Possible values include the TAB_ALIGNMENT_LEFT, TAB_ALIGNMENT_RIGHT and TAB_ALIGNMENT_JUSTIFIED constants defined on this class.
value | the alignment to use when displaying the tab control |
---|
Defines if this tab is to use the Apply All Tabs functionality. If set to True
, it
disables the use of a Form for switching tabs and it enables the use of DHTML.
useApplyAllTabs | boolean indicating if the Apply All Tabs approach should be generated or not |
---|
Defines if this tab is to generate HTML or DHTML output. It disables the Apply All Tabs functionality
if set to False
.
useDHTML | boolean indicating if DHTML should be generated or not |
---|
Defines if this tab is to generate a Form for switching tabs, or just regular links (by default it uses
a form). It disables the Apply All Tabs functionality if set to True
.
useForm | boolean indicating if a Form should be generated or not |
---|
Defines whether this tab control will be using an IFrame or not
newValue | boolean value indicating if this interface will be interacting with an IFrame control
|
---|