java.lang.Object | |||
↳ | com.microstrategy.web.app.transforms.AbstractReportGridDisplayCell | ||
↳ | com.microstrategy.web.app.transforms.AbstractReportGridCellHeader | ||
↳ | com.microstrategy.web.app.transforms.ReportGridCellColHeaderImpl |
![]() |
The ReportGridCellColHeaderImpl
is used to generate the HTML
of a cell of that is a value of the column axis.
SDK
objects:
WebHeader
: used in view mode, this is the SDK object that represents a value
of the column axis.
WebTemplateMetric
: used in design mode when the metrics
are located in the column axis, each metric is represented as a column header.
The ReportGridCellColHeaderImpl
extends the AbstractReportGridDisplayCell
which controls the exeuction flow.
Users who intend to programatically modify the HTML generated for a column header should
extend this class. Using this technique developers could define their own rules of the text to
display based on the WebHeader
content.
generateText(MarkupOutput)
method
of this class based on the header's semantics:
public class CustomColHeader extends ReportGridCellColHeaderImpl { public void generateText(MarkupOutput mo) { WebHeader header = getWebHeader(); if (header != null) { switch (header.getSemantics()) { case EnumDSSXMLBaseFormType.DssXmlBaseFormPicture: mo.append("<IMG SRC=\""); mo.append(getText()); mo.append("\" ALT=\"\" BORDER=0 />"); break; case EnumDSSXMLBaseFormType.DssXmlBaseFormUrl: case EnumDSSXMLBaseFormType.DssXmlBaseFormEmail: mo.append("<A HREF=\""); if (header.getSemantics() == EnumDSSXMLBaseFormType.DssXmlBaseFormEmail) mo.append("mailto:"); mo.append(getText()); mo.append("\">"); mo.append(getText()); mo.append("</A>"); break; case EnumDSSXMLBaseFormType.DssXmlBaseFormHTMLTag: mo.append(HTMLHelper.decode(getText())); break; default: super.generateText(mo); break; } } else { super.generateText(mo); } } }
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | ReportGridCellColHeaderImpl.ColHeaderPivotButtonInfo | Helper class for storing pivot button information - such as JavaScript id, descriptor (tooltip) and image name - based on the action that can be performed given the current selected target. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ReportGridCellColHeaderImpl()
Constructor used for creating a generic display cell.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean |
canInsertShortcutMetric()
Utility methood for determining if the cell object is enabled for displaying the user
the option to insert shortcut metrics based on it
| ||||||||||
boolean |
canPivot(int type)
Utility methood for determining if the cell object is enabled for displaying the user
the option to pivot it according to the type specified
| ||||||||||
boolean |
canPivot()
Utility methood for determining if the cell object is enabled for displaying the user
the option to pivot it
| ||||||||||
boolean |
canSort()
Utility methood for determining if the cell object is enabled for displaying the user
the option to sort it
| ||||||||||
WebEvent |
getSortEvent(int type)
Get the
WebEvent instance with the information for sorting the current cell values | ||||||||||
void |
init(TransformContext context, WebHeader header)
This method is called to initialize the cell in view mode.
| ||||||||||
void |
init(WebComponent wc, WebHeader header, HashMap cachedObjects)
This method is deprecated.
please use the interface that receives
TransformContext instance instead. | ||||||||||
void |
init(WebComponent wc, WebTemplateMetric metric, HashMap cachedObjects)
This method is deprecated.
please use the interface that receives
TransformContext instance instead. | ||||||||||
void |
init(FormalParameters formalParas)
This method is deprecated.
This method is not used by the Transform anymore. To initialize empty cells
it now uses init(TransformContext, WebTemplateUnit).
| ||||||||||
void |
init(TransformContext context, WebTemplateMetric metric)
This method is called to initialize the cell in design mode.
| ||||||||||
void |
init(WebComponent wc, FormalParameters formalParas)
This method is deprecated.
This method is not used by the Transform anymore. To initialize empty cells
it now uses init(TransformContext, WebTemplateUnit).
| ||||||||||
boolean |
isMetricDrillable(WebHeader header, WebDrillPath drillPath)
return whether the header has a drillable metric
| ||||||||||
boolean | isSortAscending() | ||||||||||
boolean | isSorted() | ||||||||||
void |
reset()
Reset all of the instance variables.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
appendContextMenuItems(ContextMenu rhMenu)
This method is deprecated.
Please use the new approach for generating context menus, see
ReportCellRemoveFromGrid , ReportCellMove , etc | ||||||||||
void |
generateDrillCheckBox(MarkupOutput mo)
Obtains the check box tag information for Drill and
renders it out.
| ||||||||||
void |
generateFilterOnSelectionCheckBox(MarkupOutput mo)
Obtains the check box tag information for Filter On Selection and
renders it out.
| ||||||||||
Tag |
generatePivotButton(int type)
Generate the pivot button tag, according to the type of manipulation that should perform
| ||||||||||
void |
generatePivotButtons(MarkupOutput mo)
Calls for
generatePivotButton(int) for each one of the buttons this instance
normally supports | ||||||||||
void |
generatePreContent(MarkupOutput mo)
Generates the preContent of the cell. | ||||||||||
Tag |
generateSortButton()
Generate the sort button tag information for this object
| ||||||||||
void |
generateSortButton(MarkupOutput mo)
This method is deprecated.
use
generateSortButton() instead.
| ||||||||||
WebMetric |
getColHeaderWebMetric(WebHeader header)
This method is deprecated.
please refer to the
getWebMetric method on the
ReportGridCellColHeaderImpl class.
| ||||||||||
WebTemplate |
getGridTemplate()
Returns an instance of
WebTemplate from the View Bean. | ||||||||||
WebEvent |
getPivotEvent(int type)
Generate the pivot event, according to the type of manipulation that should perform
| ||||||||||
WebEvent |
getRemoveEvent()
Get the remove event for the current object.
| ||||||||||
WebEvent | getSortEventByAxis(int axis) | ||||||||||
String |
getSortID()
This method return the ID to use for sorting this cell.
| ||||||||||
boolean |
hasWebObject()
This method allows the abstract class to identify whether the cell
has been initialized with a valid WebObject.
| ||||||||||
void |
initCell()
Initialize the cell title information
| ||||||||||
void |
initDNDForDesignMode(DragAndDropItem item)
This method initializes properties used in javascript for drag and drop
in design mode.
| ||||||||||
void |
initDNDForExecuteMode(DragAndDropItem item)
This method initializes properties used in javascript for drag and drop in view mode.
| ||||||||||
boolean | isDrillAvailable() | ||||||||||
boolean |
isDrillPathAvailable(WebHeader header)
Utility method to determine if the current header has drill information available
| ||||||||||
boolean |
isHeaderMVJsonMovable()
Fix Issue 418196 for sort in column, if the head cell can be used in sort, it don't use Jsonmap
for optimization.
| ||||||||||
boolean | isTotal() | ||||||||||
void |
renderContextMenu(MarkupOutput mo)
This method is deprecated.
use
getContextMenuAttributes() instead | ||||||||||
boolean |
showRemoveFromReport(int metricSize, int wkSetSize)
Determine if we should show the 'Remove from Report' option depending
on the number of metrics and the working set size
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Constructor used for creating a generic display cell.
Utility methood for determining if the cell object is enabled for displaying the user the option to insert shortcut metrics based on it
Utility methood for determining if the cell object is enabled for displaying the user the option to pivot it according to the type specified
type | value indicating which type of pivot manipulation is being tested.
Values come from the PIVOT_INCREASE_POSITION , PIVOT_DECREASE_POSITION ,
PIVOT_SWITCH_AXIS , PIVOT_TO_PAGE_BY and PIVOT_REMOVE constants. |
---|
Utility methood for determining if the cell object is enabled for displaying the user the option to pivot it
Utility methood for determining if the cell object is enabled for displaying the user the option to sort it
Get the WebEvent
instance with the information for sorting the current cell values
type | int value with the identifier for the sort order to generate. Values expected
include SORT_TYPE_ASCENDING and SORT_TYPE_DESCENDING |
---|
This method is called to initialize the cell in view mode. It receives a
WebHeader
instance as the underlying SDK object
context | TransformContext instance initialized with the grid's
transform information. |
---|---|
header | WebHeader instance coresponding to the cell to be displayed.
|
This method is deprecated.
please use the interface that receives TransformContext
instance instead.
This method is called to initialize the cell in view mode. It receives a
WebHeader
as the underlying SDK object.
wc | The bean being transformed. |
---|---|
header | The WebHeader corresponding to this cell. |
cachedObjects | A HashMap populated by the transform and
used to store information shared across multiple cells. |
This method is deprecated.
please use the interface that receives TransformContext
instance instead.
Initialize this class with the cell information to consider for HTML generation
wc | WebComponent base instance |
---|---|
metric | WebTemplateMetric instance related with the cell to be
rendered |
cachedObjects | HashMap instance with information relevant to this instance for HTML generation. |
This method is deprecated.
This method is not used by the Transform anymore. To initialize empty cells
it now uses init(TransformContext, WebTemplateUnit).
Initializes an ReportGridDisplayCell
. This is used to initialize
empty cells that have no underlying WebObject
.
formalParas | all the formal parameters from the report transform. Used to control some output generation. |
---|
This method is called to initialize the cell in design mode. It receives
a WebTemplateMetric
as the underlying SDK object.
context | TransformContext instance initialized with the grid's
transform information. |
---|---|
metric | WebTemplateMetric instance corresponding to the cell
to be displayed.
|
This method is deprecated.
This method is not used by the Transform anymore. To initialize empty cells
it now uses init(TransformContext, WebTemplateUnit).
Initializes an ReportGridDisplayCell
. This is used to initialize
empty cells that have no underlying WebObject
.
wc | associated web component |
---|---|
formalParas | all the formal parameters from the report transform. Used to control some output generation. |
return whether the header has a drillable metric
header | the header object |
---|---|
drillPath | the drill path |
Reset all of the instance variables. This method is very important when improve the memory performance: we create only one instance for a particular cell type and reuse it instead of creating a new instance for each concrete grid cell. Therefore, it saves a lot of memory. For implementation of this method, please follow the workflow of how all the instance variables are initialized in the class hierarchy when a new instance is created: superclass instance variables are initialized first, subclass instance variables are initialized second. Note: for the purpose of cell reuse.
This method is deprecated.
Please use the new approach for generating context menus, see
ReportCellRemoveFromGrid
, ReportCellMove
, etc
Obtains the check box tag information for Drill and renders it out. If a check box is rendered, an empty line is also added to the final HTML output.
mo | MarkupOutput instance where the HTML content generated by this method
will be saved
|
---|
Obtains the check box tag information for Filter On Selection and renders it out. If a check box is rendered, an empty line is also added to the final HTML output.
mo | MarkupOutput instance where the HTML content generated by this method
will be saved
|
---|
Generate the pivot button tag, according to the type of manipulation that should perform
type | integer value that indicates which type of pivot action it should execute.
Values come from the PIVOT_INCREASE_POSITION , PIVOT_DECREASE_POSITION and
PIVOT_REMOVE constants. |
---|
Tag
initialized instance with the information for the pivot
manipulation. It will return null
if not supported. It might return
a simple IMG tag in case the manipulation shall be processed in JavaScript, or an INPUT of type
IMAGE if it will be processed as part of a FORM, or an A anchor tag with an IMG inside if
it's to be a button link.Calls for generatePivotButton(int)
for each one of the buttons this instance
normally supports
mo | MarkupOutput instance where the HTML generated by this method will be saved.
|
---|
Generates the preContent of the cell. The pre-Content means the html content before the
core content of the cell. An example would be a checkbox before the text.
By default, this method generates images for grids in outline mode, drilling checkboxes
and filter on selection checkboxes.
Developers can either use the setPreContent(String)
method to set any text they want
to display before the contents of the cell or override this method
to inherit its functionality and build on top of it.
AbstractReportGridDisplayCell
:public void generatePreContent(MarkupOutput mo) { super.generatePreContent(mo); mo.append("<LI>"); }
mo | the output object |
---|
Generate the sort button tag information for this object
Tag
instance initialized if sort is supported.
This method is deprecated.
use generateSortButton()
instead.
Generate the HTML for the sort button
mo | MarkupOutput instnace where the HTML generated will be saved |
---|
This method is deprecated.
please refer to the getWebMetric
method on the
ReportGridCellColHeaderImpl
class.
get the metric object for the column header
header | the column header |
---|
WebMetric
objectReturns an instance of WebTemplate
from the View Bean.
WebTemplate
The Grid Template.WebBeanException | |
WebObjectsException | |
WebBeanException |
Generate the pivot event, according to the type of manipulation that should perform
type | integer value that indicates which type of pivot action it should execute.
Values come from the PIVOT_INCREASE_POSITION , PIVOT_DECREASE_POSITION
PIVOT_SWITCH_AXIS and PIVOT_TO_PAGE_BY constants. |
---|
WebEvent
initialized instance with the information for the pivot
manipulation. It will return null
if not supported.Get the remove event for the current object. This only supports objects that are metrics.
WebEvent
initialized instance if manipulation is supported, otherwise
returns null
.axis | specifies the axis EnumViewBeanEvents on which the sort is defined |
---|
This method return the ID to use for sorting this cell.
This method allows the abstract class to identify whether the cell has been initialized with a valid WebObject. Some cells are created empty (with no underlying web object), they usually represent empty cells (like the ones used in design mode for metric values or row headers); in these cases some functionality needs to be disabled (liek context-menus or dnd), this method allow us to identify these cells.
WebObject
.Initialize the cell title information
This method initializes properties used in javascript for drag and drop in design mode.
item | DragAndDropItem |
---|
This method initializes properties used in javascript for drag and drop in view mode.
item | DragAndDropItem |
---|
Utility method to determine if the current header has drill information available
header | WebHeader instance to analyze |
---|
Fix Issue 418196 for sort in column, if the head cell can be used in sort, it don't use Jsonmap for optimization.
This method is deprecated.
use getContextMenuAttributes()
instead
Render the context menu's trigger for this cell.
mo | the output object |
---|
Determine if we should show the 'Remove from Report' option depending on the number of metrics and the working set size
metricSize | number of metrics |
---|---|
wkSetSize | working set size |
true
if working set is not empty or if the working set size is greater than
the metrics size.