Class AbstractReportCellSort
- java.lang.Object
-
- com.microstrategy.web.app.gui.ContextMenu.DefaultContextMenuItemBuilder
-
- com.microstrategy.web.app.transforms.contextmenus.AbstractReportCellContextMenuItemBuilder
-
- com.microstrategy.web.app.transforms.contextmenus.AbstractReportCellSort
-
- All Implemented Interfaces:
ContextMenuItemBuilder
- Direct Known Subclasses:
ReportCellSortAscending,ReportCellSortColAscending,ReportCellSortColDescending,ReportCellSortDescending
public abstract class AbstractReportCellSort extends AbstractReportCellContextMenuItemBuilder
AbstractReportCellSortis the base class for generating sort options for the different cells on a report grid. Children of this class are expected to define what manipulation the sort option will be generated, for example, to sort ascending or descending.- Since:
- MicroStrategy Web 8.0.1
-
-
Field Summary
Fields Modifier and Type Field Description protected static intCOLSORTprotected static intROWSORTprotected static intSORT_ASCENDINGprotected static intSORT_DESCENDING
-
Constructor Summary
Constructors Constructor Description AbstractReportCellSort(Shortcut definition)Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgetJSCode(TransformContext context, WebEvent event)Generate the JavaScript code the context menu item generated by this builder instance will trigger when the user selects it.protected WebEventgetSortEvent(TransformContext context, int type)Utility method that generates the event for the sort manipulation.intgetSortType()protected booleanisActionEnabled(TransformContext context)Called byAbstractReportCellContextMenuItemBuilder.isItemAvailable(com.microstrategy.web.app.transforms.TransformContext), indicates the abstract class if the corresponding action of this item is available.protected booleanisSortAscending(TransformContext context)Utility method that determines if the current context for which this option will be generated has its component (for example, grid cell) sorted ascending or not.protected booleanisSorted(TransformContext context)Utility method that determines if the current context for which this option will be generated has its component (for example, grid cell) already sorted or notvoidsetSortType(int sortType)-
Methods inherited from class com.microstrategy.web.app.transforms.contextmenus.AbstractReportCellContextMenuItemBuilder
canDefineDerivedElements, createItem, getCell, getFormalParameter, getIntValue, getJSCode, getPassThroughMode, getStringValue, getTransform, isFeatureAvailable, isIframeEnabled, isItemAvailable, isRW, isTrue
-
Methods inherited from class com.microstrategy.web.app.gui.ContextMenu.DefaultContextMenuItemBuilder
createItem, getDefinition, getItemKey, getScript
-
-
-
-
Field Detail
-
SORT_ASCENDING
protected static final int SORT_ASCENDING
- See Also:
- Constant Field Values
-
SORT_DESCENDING
protected static final int SORT_DESCENDING
- See Also:
- Constant Field Values
-
ROWSORT
protected static final int ROWSORT
- Since:
- MicroStrategy Web 8.0.2
- See Also:
- Constant Field Values
-
COLSORT
protected static final int COLSORT
- Since:
- MicroStrategy Web 8.0.2
- See Also:
- Constant Field Values
-
-
Method Detail
-
isActionEnabled
protected boolean isActionEnabled(TransformContext context)
Called byAbstractReportCellContextMenuItemBuilder.isItemAvailable(com.microstrategy.web.app.transforms.TransformContext), indicates the abstract class if the corresponding action of this item is available.- Specified by:
isActionEnabledin classAbstractReportCellContextMenuItemBuilder- Parameters:
context-TransformContextinitialized instance with the information on where this option will be used- Returns:
- boolean value indicating if the option should be enabled to the user or not, given the properties available on the context object.
-
isSorted
protected boolean isSorted(TransformContext context)
Utility method that determines if the current context for which this option will be generated has its component (for example, grid cell) already sorted or not- Parameters:
context-TransformContextinitialized instance with the information on where this option will be used- Returns:
- boolean value indicating if the base element is already sorted
-
isSortAscending
protected boolean isSortAscending(TransformContext context)
Utility method that determines if the current context for which this option will be generated has its component (for example, grid cell) sorted ascending or not.- Parameters:
context-TransformContextinitialized instance with the information on where this option will be used- Returns:
- boolean value indicating if the base element is already sorted ascending
-
getSortEvent
protected WebEvent getSortEvent(TransformContext context, int type)
Utility method that generates the event for the sort manipulation.- Parameters:
context-TransformContextinitialized instance with the information on where this option will be usedtype- int value indicating which sort order shall be provided. Values expected come from theSORT_DESCENDINGandSORT_ASCENDINGconstants- Returns:
WebEventinitialized instance if the sort event is available. Otherwise it will returnnull.
-
getJSCode
protected java.lang.String getJSCode(TransformContext context, WebEvent event)
Generate the JavaScript code the context menu item generated by this builder instance will trigger when the user selects it.- Parameters:
context-TransformContextinitialized instance with the information on where this option will be usedevent-WebEventinstance that will determine which sort manipulation will be performed if the option is selected.- Returns:
- String value with the JavaScript information to trigger when the option is selected.
-
getSortType
public int getSortType()
- Returns:
- Returns the sortType.
- Since:
- MicroStrategy Web 8.0.2
-
setSortType
public void setSortType(int sortType)
- Parameters:
sortType- The sortType to set.- Since:
- MicroStrategy Web 8.0.2
-
-