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
AbstractReportCellSort
is 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 int
COLSORT
protected static int
ROWSORT
protected static int
SORT_ASCENDING
protected static int
SORT_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.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.protected WebEvent
getSortEvent(TransformContext context, int type)
Utility method that generates the event for the sort manipulation.int
getSortType()
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.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.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 notvoid
setSortType(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:
isActionEnabled
in classAbstractReportCellContextMenuItemBuilder
- Parameters:
context
-TransformContext
initialized 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
-TransformContext
initialized 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
-TransformContext
initialized 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
-TransformContext
initialized 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_DESCENDING
andSORT_ASCENDING
constants- Returns:
WebEvent
initialized 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
-TransformContext
initialized instance with the information on where this option will be usedevent
-WebEvent
instance 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
-
-