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 theComposedContextMenuBuilderinterface obtained by calling thegetComposedContextMenuBuilder(com.microstrategy.web.app.transforms.TransformContext)method. If the option is not enabled given the currentTransformContextprovided 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 ContextMenuItemcreateItem(TransformContext context)Creates and populates aContextMenuItembased on the information in theShortcutused as its defintion, as well as the logic included on this builder instance.ContextMenugenerateSubMenu(TransformContext context)Get the submenu that will display the different sub-menu options to the user.protected abstract ComposedContextMenuBuildergetComposedContextMenuBuilder(TransformContext context)Get an instance ofComposedContextMenuBuilderthat will help obtaining the different sub-menu options that shall be presented to the user.protected java.lang.StringgetJSCode(TransformContext context)Generate the JavaScript code the context menu item generated by this builder instance will trigger when the user selects it.protected booleanitemHasSubMenus(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:
getJSCodein classAbstractReportCellContextMenuItemBuilder- Parameters:
context-TransformContextinitialized instance with the information on where this option will be used- Returns:
- By default it will return a
nullstring 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:AbstractReportCellContextMenuItemBuilderCreates and populates aContextMenuItembased on the information in theShortcutused as its defintion, as well as the logic included on this builder instance.- Specified by:
createItemin interfaceContextMenuItemBuilder- Overrides:
createItemin classAbstractReportCellContextMenuItemBuilder- Parameters:
context-TransformContextinitialized instance with the information on where this option will be used- Returns:
- a new instance of a
ContextMenuIteminitialized 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 ofComposedContextMenuBuilderthat will help obtaining the different sub-menu options that shall be presented to the user.- Parameters:
context-TransformContextinitialized instance with the information on where this option will be used- Returns:
ComposedContextMenuBuilderinitialized instance. method provides theContextMenuwith the different attribute forms available. Returns an instance of (InvalidComposedContextMenuBuilderif not supported.
-
generateSubMenu
public ContextMenu generateSubMenu(TransformContext context)
Get the submenu that will display the different sub-menu options to the user.- Parameters:
context-TransformContextinitialized instance with the information on where this option will be used- Returns:
ContextMenuinstance initialized with all the options that can be presented to the user.
-
-