Class AbstractReportCellContextMenuItemBuilder
- java.lang.Object
-
- com.microstrategy.web.app.gui.ContextMenu.DefaultContextMenuItemBuilder
-
- com.microstrategy.web.app.transforms.contextmenus.AbstractReportCellContextMenuItemBuilder
-
- All Implemented Interfaces:
ContextMenuItemBuilder
- Direct Known Subclasses:
AbstractReportCellComposedContextMenuItemBuilder
,AbstractReportCellInsertMetric
,AbstractReportCellMove
,AbstractReportCellParentMenu
,AbstractReportCellSort
,AbstractReportCellThresholds
,CreateSelectorControl
,ReportCellActionControlEditor
,ReportCellAddShortcutMetric
,ReportCellAdvancedSort
,ReportCellAlert
,ReportCellAttributeFormEditor
,ReportCellClearDerivedElements
,ReportCellCustomSort
,ReportCellDefaultMenu
,ReportCellDEQuickGroup
,ReportCellDEQuickGroupOperator
,ReportCellDerivedElements
,ReportCellEditDerived
,ReportCellFilterOn
,ReportCellFilterOnSelections
,ReportCellFormat
,ReportCellHyperLink
,ReportCellKeepOnGrid
,ReportCellMetricFilterEdit
,ReportCellNewCustomSort
,ReportCellRemoveFromGrid
,ReportCellRemoveFromReport
,ReportCellRename
,ReportCellSelectorControlEditor
,SelectControlTargets
public abstract class AbstractReportCellContextMenuItemBuilder extends ContextMenu.DefaultContextMenuItemBuilder
- Since:
- MicroStrategy Web 8.0.1
-
-
Constructor Summary
Constructors Constructor Description AbstractReportCellContextMenuItemBuilder(Shortcut shortcut)
Class constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
canDefineDerivedElements(TransformContext context)
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.protected ReportGridDisplayCell
getCell(TransformContext context)
Utility method for obtaining theReportGridDisplayCell
associated with this menu builder via aTransformContext
instance.protected FormalParameter
getFormalParameter(TransformContext context, java.lang.String fpName)
Utility method for obtaining a formal parameter value from the transform associated with this instanceprotected int
getIntValue(TransformContext context, java.lang.String fpName, int defaultValue)
Utility method for obtaining the integer value of a given formal parameterprotected abstract 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 int
getPassThroughMode(TransformContext context)
protected java.lang.String
getStringValue(TransformContext context, java.lang.String fpName, java.lang.String defaultValue)
Utility method for obtaining the string value of a given formal parameterprotected Transform
getTransform(TransformContext context)
Utility method for obtaining theReportGridTransformImpl
associated with this menu builder via aTransformContext
instance.protected abstract boolean
isActionEnabled(TransformContext context)
Called byisItemAvailable(com.microstrategy.web.app.transforms.TransformContext)
, indicates the abstract class if the corresponding action of this item is available.protected boolean
isFeatureAvailable(TransformContext context, java.lang.String featureName)
Utility method for testing a given feature against the context definedprotected boolean
isIframeEnabled(TransformContext context)
Utility method for determining if the environment is enabled for IFrame requests or notboolean
isItemAvailable(TransformContext context)
Determines if the option shall be available to the user or not.protected boolean
isRW(TransformContext context)
Indicate whether it is for a rw document or a reportprotected boolean
isTrue(TransformContext context, java.lang.String fpName)
Shortcut method for obtaining the boolean value of a formal parameter as defined on the context.-
Methods inherited from class com.microstrategy.web.app.gui.ContextMenu.DefaultContextMenuItemBuilder
createItem, getDefinition, getItemKey, getScript
-
-
-
-
Method Detail
-
getTransform
protected Transform getTransform(TransformContext context)
Utility method for obtaining theReportGridTransformImpl
associated with this menu builder via aTransformContext
instance.- Parameters:
context
-TransformContext
initialized instance with the information on where this option will be used- Returns:
Transform
instance related with this menu builder instance.
-
getCell
protected ReportGridDisplayCell getCell(TransformContext context)
Utility method for obtaining theReportGridDisplayCell
associated with this menu builder via aTransformContext
instance.- Parameters:
context
-TransformContext
initialized instance with the information on where this option will be used- Returns:
ReportGridDisplayCell
instance related with this menu builder instance.
-
getFormalParameter
protected FormalParameter getFormalParameter(TransformContext context, java.lang.String fpName)
Utility method for obtaining a formal parameter value from the transform associated with this instance- Parameters:
context
-TransformContext
initialized instance with the information on where this option will be usedfpName
- String value with the name of the formal parameter to look for- Returns:
FormalParameter
instance if found on the transform defined on the context. If the transform is not compatible with this menu builder or the formal parameter does not exist, returnsnull
-
isTrue
protected boolean isTrue(TransformContext context, java.lang.String fpName)
Shortcut method for obtaining the boolean value of a formal parameter as defined on the context.- Parameters:
context
-TransformContext
initialized instance with the information on where this option will be usedfpName
- String value with the name of the formal parameter to look for- Returns:
true
if the formal parameter is found and that's its defined value If the transform is not compatible with this menu builder, or the formal parameter does not exist or its not defined with a boolean type, returnsfalse
-
isFeatureAvailable
protected boolean isFeatureAvailable(TransformContext context, java.lang.String featureName)
Utility method for testing a given feature against the context defined- Parameters:
context
-TransformContext
initialized instance with the information on where this option will be usedfeatureName
- String value with the name of the feature to test for- Returns:
- boolean value indicating if the feature is granted or not.
-
getIntValue
protected int getIntValue(TransformContext context, java.lang.String fpName, int defaultValue)
Utility method for obtaining the integer value of a given formal parameter- Parameters:
fpName
- String value with the name of the formal parameter to testdefaultValue
- value to return if the process of querying the formal parameter fails.- Returns:
- value of the formal parameter requested. If not found or the formal parameter is not of type integer, it will return the default value provided.
- Since:
- MicroStrategy Web 9.0.0
-
getStringValue
protected java.lang.String getStringValue(TransformContext context, java.lang.String fpName, java.lang.String defaultValue)
Utility method for obtaining the string value of a given formal parameter- Parameters:
fpName
- String value with the name of the formal parameter to testdefaultValue
- value to return if the process of querying the formal parameter fails.- Returns:
- value of the formal parameter requested. If not found or the formal parameter is not of type string, it will return the default value provided.
- Since:
- MicroStrategy Web 9.0.0
-
isIframeEnabled
protected boolean isIframeEnabled(TransformContext context)
Utility method for determining if the environment is enabled for IFrame requests or not- Parameters:
context
-TransformContext
initialized instance with the information on where this option will be used- Returns:
- boolean value indicating if iframe requests shall be enabled or not.
-
isActionEnabled
protected abstract boolean isActionEnabled(TransformContext context)
Called byisItemAvailable(com.microstrategy.web.app.transforms.TransformContext)
, indicates the abstract class if the corresponding action of this item is available.- 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.
-
isItemAvailable
public boolean isItemAvailable(TransformContext context)
Determines if the option shall be available to the user or not.- Specified by:
isItemAvailable
in interfaceContextMenuItemBuilder
- Overrides:
isItemAvailable
in classContextMenu.DefaultContextMenuItemBuilder
- 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.
-
createItem
public 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.- Specified by:
createItem
in interfaceContextMenuItemBuilder
- Overrides:
createItem
in classContextMenu.DefaultContextMenuItemBuilder
- 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.
-
getJSCode
protected abstract 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.- Parameters:
context
-TransformContext
initialized instance with the information on where this option will be used- Returns:
- String value with the JavaScript information to trigger when the option is selected.
-
canDefineDerivedElements
protected boolean canDefineDerivedElements(TransformContext context)
- Since:
- MicroStrategy Web 9.0.0
-
isRW
protected boolean isRW(TransformContext context)
Indicate whether it is for a rw document or a report- Parameters:
context
-- Returns:
-
getPassThroughMode
protected int getPassThroughMode(TransformContext context)
-
-