public class

ReportGridCellColTitleImpl

extends AbstractReportGridCellTitle
implements ReportGridCellColTitle
java.lang.Object
   ↳ com.microstrategy.web.app.transforms.AbstractReportGridDisplayCell
     ↳ com.microstrategy.web.app.transforms.AbstractReportGridCellTitle
       ↳ com.microstrategy.web.app.transforms.ReportGridCellColTitleImpl
Known Direct Subclasses

Class Overview

The ReportGridCellColTitle is used to generate the HTML of a cell of that is a title of the column axis.

This class can handle two different types of SDK objects:

  1. WebTitle: used in view mode, this is the SDK object that represents a title of the column axis.
  2. WebSubTitle: used in view mode when attribute forms are being displayed, for each attribute form there will be a corresonding WebSubTitle.
  3. WebTemplateUnit: used in design mode, this is the SDK object used in a template for the column axis.

The ReportGridCellColTitleImpl extends the AbstractReportGridDisplayCell which controls the exeuction flow.

Users who intend to programatically modify the HTML generated for a column title should extend this class. Using this technique developers could define their own rules of the text to display based on the WebTitle content.

The following is an example of a class that extends the generateText(MarkupOutput) method of this class based on the title's template unit type:
 public class CustomColTitle extends ReportGridCellColTitleImpl {

     public void generateText(MarkupOutput mo) {
         WebTitle title = getWebTitle();

         if (title.getWebTemplateUnit() != null) {
             WebTemplateUnit unit = title.getWebTemplateUnit();

             if (unit.getUnitType() == EnumDSSXMLTemplateUnitType.DssXmlTemplateMetrics) {
                 mo.append(getDescriptor(1158));	// Descriptor: Metrics
             } else if (unit.getUnitType() == EnumDSSXMLTemplateUnitType.DssXmlTemplateDimension && title.getGridSubTitles().size() > 0) {
                 mo.append(HTMLHelper.encode(title.getGridSubTitles().get(0).getName()));
             } else {
                 mo.append(HTMLHelper.encode(unit.getAlias()));
             }
         } else if (title.getTarget() != null) {
             mo.append(HTMLHelper.encode(title.getTarget().getName()));
         } else {
             super.generateText(mo);
         }
     }
 }
 

Summary

[Expand]
Inherited Constants
From class com.microstrategy.web.app.transforms.AbstractReportGridDisplayCell
From interface com.microstrategy.web.app.transforms.ReportGridCellColTitle
From interface com.microstrategy.web.app.transforms.ReportGridDisplayCell
[Expand]
Inherited Fields
From class com.microstrategy.web.app.transforms.AbstractReportGridDisplayCell
Public Constructors
ReportGridCellColTitleImpl()
Constructor used for creating a generic display cell.
Public Methods
WebEvent getSortEvent(int type)
Get the WebEvent instance with the information for sorting the current cell values
void init(TransformContext context, WebTitle title)
This method is called to initialize the cell in view mode.
void init(WebComponent wc, WebTitle title, HashMap cachedObjects)
This method is deprecated. please use the interface that receives TransformContext instance instead.
void init(TransformContext context, WebTemplateUnit unit)
This method is called to initialize the cell in design mode.
void init(WebComponent wc, WebTemplateUnit unit, HashMap cachedObjects)
This method is deprecated. please use the interface that receives TransformContext instance instead.
boolean isDrillAvailable()
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 generatePivotButtons(MarkupOutput mo)
Calls for generatePivotButton(int) for each one of the buttons this instance normally supports
Tag generateSortButton()
Generate the sort button tag information for this object
WebEvent getSortAscendingEvent()
WebEvent getSortDescendingEvent()
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 isDrillPathAvailable(WebTitle title)
Utility method to determine if the current title has drill information available
void renderContextMenu(MarkupOutput mo)
This method is deprecated. use getContextMenuAttributes() instead
[Expand]
Inherited Methods
From class com.microstrategy.web.app.transforms.AbstractReportGridCellTitle
From class com.microstrategy.web.app.transforms.AbstractReportGridDisplayCell
From class java.lang.Object
From interface com.microstrategy.web.app.transforms.ReportGridCellColTitle
From interface com.microstrategy.web.app.transforms.ReportGridCellTitle
From interface com.microstrategy.web.app.transforms.ReportGridDisplayCell

Public Constructors

public ReportGridCellColTitleImpl ()

Constructor used for creating a generic display cell. For example, the cssPrefix is needed for the empty cells in design mode.

Public Methods

public WebEvent getSortEvent (int type)

Get the WebEvent instance with the information for sorting the current cell values

Parameters
type int value with the identifier for the sort order to generate. Values expected include SORT_TYPE_ASCENDING and SORT_TYPE_DESCENDING
Returns
  • WebEvent

public void init (TransformContext context, WebTitle title)

This method is called to initialize the cell in view mode. It receives a WebTitle instance as the underlying SDK object

Parameters
context TransformContext instance initialized with the grid's transform information.
title WebTitle instance corresponding to the cell to be displayed.

public void init (WebComponent wc, WebTitle title, HashMap cachedObjects)

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 WebTitle as the underlying SDK object.

Parameters
wc The bean being transformed.
title The WebTitle corresponding to this cell.
cachedObjects A HashMap populated by the transform and used to store information shared across multiple cells.

public void init (TransformContext context, WebTemplateUnit unit)

This method is called to initialize the cell in design mode. It receives a WebTemplateUnit instance as the underlying SDK object

Parameters
context TransformContext instance initialized with the grid's transform information.
unit WebTemplateUnit instance corresponding to the cell to display.

public void init (WebComponent wc, WebTemplateUnit unit, HashMap cachedObjects)

This method is deprecated.
please use the interface that receives TransformContext instance instead.

Initialize with the base WebComponent, the WebTemplateUnit to be rendered and a HashMap with other relevant information for this instance.

Parameters
wc WebComponent instance
unit WebTemplateUnit instance to be rendered by this class
cachedObjects HashMap with other relevant information for the initialization.

public boolean isDrillAvailable ()

public boolean isSortAscending ()

public boolean isSorted ()

public void reset ()

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.

Protected Methods

protected void appendContextMenuItems (ContextMenu rhMenu)

This method is deprecated.
Please use the new approach for generating context menus, see ReportCellRemoveFromGrid, ReportCellMove, etc

protected void generatePivotButtons (MarkupOutput mo)

Calls for generatePivotButton(int) for each one of the buttons this instance normally supports

Parameters
mo MarkupOutput instance where the HTML generated by this method will be saved.

protected Tag generateSortButton ()

Generate the sort button tag information for this object

Returns
  • Tag instance initialized if sort is supported.

protected WebEvent getSortAscendingEvent ()

protected WebEvent getSortDescendingEvent ()

protected String getSortID ()

This method return the ID to use for sorting this cell.

Returns
  • The ID to use for sorting this cell.

protected boolean hasWebObject ()

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.

Returns
  • true if the cell has underlying WebObject.

protected void initCell ()

Initialize the cell title information

protected void initDNDForDesignMode (DragAndDropItem item)

This method initializes properties used in javascript for drag and drop in design mode.

Parameters
item DragAndDropItem

protected void initDNDForExecuteMode (DragAndDropItem item)

This method initializes properties used in javascript for drag and drop in view mode.

Parameters
item DragAndDropItem

protected boolean isDrillPathAvailable (WebTitle title)

Utility method to determine if the current title has drill information available

Parameters
title WebTitle instance to analyze
Returns
  • boolean value indicating if there is drill path information available or not, for the specified title.

protected void renderContextMenu (MarkupOutput mo)

This method is deprecated.
use getContextMenuAttributes() instead

Render the context menu's trigger for this cell.

Parameters
mo the output object