Class AbstractReportCellComposedContextMenuItemBuilder
- java.lang.Object
-
- com.microstrategy.web.app.gui.ContextMenu.DefaultContextMenuItemBuilder
-
- com.microstrategy.web.app.transforms.contextmenus.AbstractReportCellContextMenuItemBuilder
-
- com.microstrategy.web.app.transforms.contextmenus.AbstractReportCellComposedContextMenuItemBuilder
-
- All Implemented Interfaces:
ContextMenuItemBuilder
- Direct Known Subclasses:
ReportCellAttributeForms
,ReportCellDrill
,ReportCellHyperLinkNavigation
,ReportCellPercentForEachMetric
,ReportCellRankMetric
,ReportCellTransformationMetric
public abstract class AbstractReportCellComposedContextMenuItemBuilder extends AbstractReportCellContextMenuItemBuilder
This is a base class for those context menu item builders for report cells that generate menu options with sub-menus associated to them. The sub-menu structure is generated by an instance of theComposedContextMenuBuilder
interface obtained by calling thegetComposedContextMenuBuilder(com.microstrategy.web.app.transforms.TransformContext)
method. If the option is not enabled given the currentTransformContext
provided when calling for this builder, theAbstractReportCellContextMenuItemBuilder.isActionEnabled(com.microstrategy.web.app.transforms.TransformContext)
will return false so the context menu option should not be created. This can happen given lack of privileges, the current context contains objects that are not supported by this builder or for those objects there are no options that can be displayed to the user.- Since:
- MicroStrategy Web 8.0.1
-
-
Constructor Summary
Constructors Constructor Description AbstractReportCellComposedContextMenuItemBuilder(Shortcut shortcut)
Class constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ContextMenuItem
createItem(TransformContext context)
Creates and populates aContextMenuItem
based on the information in theShortcut
used as its defintion, as well as the logic included on this builder instance.ContextMenu
generateSubMenu(TransformContext context)
Get the submenu that will display the different sub-menu options to the user.protected abstract ComposedContextMenuBuilder
getComposedContextMenuBuilder(TransformContext context)
Get an instance ofComposedContextMenuBuilder
that will help obtaining the different sub-menu options that shall be presented to the user.protected java.lang.String
getJSCode(TransformContext context)
Generate the JavaScript code the context menu item generated by this builder instance will trigger when the user selects it.protected boolean
itemHasSubMenus(ContextMenuItem item, TransformContext context)
-
Methods inherited from class com.microstrategy.web.app.transforms.contextmenus.AbstractReportCellContextMenuItemBuilder
canDefineDerivedElements, getCell, getFormalParameter, getIntValue, getPassThroughMode, getStringValue, getTransform, isActionEnabled, isFeatureAvailable, isIframeEnabled, isItemAvailable, isRW, isTrue
-
Methods inherited from class com.microstrategy.web.app.gui.ContextMenu.DefaultContextMenuItemBuilder
createItem, getDefinition, getItemKey, getScript
-
-
-
-
Method Detail
-
getJSCode
protected java.lang.String getJSCode(TransformContext context)
Generate the JavaScript code the context menu item generated by this builder instance will trigger when the user selects it.- Specified by:
getJSCode
in classAbstractReportCellContextMenuItemBuilder
- Parameters:
context
-TransformContext
initialized instance with the information on where this option will be used- Returns:
- By default it will return a
null
string since this option will have a context menu attached to it, and JavaScript code already takes care of these cases.
-
createItem
public ContextMenuItem createItem(TransformContext context)
Description copied from class:AbstractReportCellContextMenuItemBuilder
Creates and populates aContextMenuItem
based on the information in theShortcut
used as its defintion, as well as the logic included on this builder instance.- Specified by:
createItem
in interfaceContextMenuItemBuilder
- Overrides:
createItem
in classAbstractReportCellContextMenuItemBuilder
- Parameters:
context
-TransformContext
initialized instance with the information on where this option will be used- Returns:
- a new instance of a
ContextMenuItem
initialized with the option information to present to the user.
-
itemHasSubMenus
protected boolean itemHasSubMenus(ContextMenuItem item, TransformContext context)
- Since:
- MicroStrategy Web 9.0.0
-
getComposedContextMenuBuilder
protected abstract ComposedContextMenuBuilder getComposedContextMenuBuilder(TransformContext context)
Get an instance ofComposedContextMenuBuilder
that will help obtaining the different sub-menu options that shall be presented to the user.- Parameters:
context
-TransformContext
initialized instance with the information on where this option will be used- Returns:
ComposedContextMenuBuilder
initialized instance. method provides theContextMenu
with the different attribute forms available. Returns an instance of (InvalidComposedContextMenuBuilder
if not supported.
-
generateSubMenu
public ContextMenu generateSubMenu(TransformContext context)
Get the submenu that will display the different sub-menu options to the user.- Parameters:
context
-TransformContext
initialized instance with the information on where this option will be used- Returns:
ContextMenu
instance initialized with all the options that can be presented to the user.
-
-