Class AbstractPagebyContextMenuItemBuilder
- java.lang.Object
-
- com.microstrategy.web.app.gui.ContextMenu.DefaultContextMenuItemBuilder
-
- com.microstrategy.web.app.transforms.contextmenus.AbstractPagebyContextMenuItemBuilder
-
- All Implemented Interfaces:
ContextMenuItemBuilder
- Direct Known Subclasses:
PageByAttrForms,PageByDelete,PageByHyperLinkEdit,PageByHyperLinkNavigation,PageByPivot,PageByProperties,PageByRemove,PageByRename,PageBySort,ReportPageByCellDrill
public abstract class AbstractPagebyContextMenuItemBuilder extends ContextMenu.DefaultContextMenuItemBuilder
This class is used by Microstrategy Web as a base class for those used to populate context-menus used with the PageBy transform. It provides convenience methods and common functionality shared by these classes.
New context-menus-builders can be created simply by extending this class and implementing/overriding these methods:
- createItem(): The default method that creates the context-menu item.
- isActionEnabled(): To indicate this class if the specific action associated with this item is available.
The following would be an example of a subclass used to populate an "Remove" context-menu-item:
public class PageByRemove extends AbstractPagebyContextMenuItemBuilder { public PageByRemove(Shortcut definition) { super(definition); } public boolean isActionEnabled(TransformContext context) { PageByUnit unit = getPageByUnit(context); if (unit == null) return false; return unit.isRemoveAvailable(); } public ContextMenuItem createItem(TransformContext context) { ContextMenuItem __result = super.createItem(context); __result.setJSCode(getContextMenusScript(context, "'rmv'")); __result.setImageType(EnumMenuImages.MenuImageRemove); return __result; } }- Since:
- MicroStrategy Web 8.0.1
-
-
Constructor Summary
Constructors Constructor Description AbstractPagebyContextMenuItemBuilder(Shortcut definition)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgetBoneID(TransformContext context)Returns the bone-id used with this context-menuprotected java.lang.StringgetContextMenusScript(TransformContext context)Returns the javascript used to process the context-menus.protected java.lang.StringgetContextMenusScript(TransformContext context, java.lang.String args)Returns the javascript used to process the context-menus.protected PageByUnitgetPageByUnit(TransformContext context)Helper method to retrieve the PageByUnit from the context.protected PageByTransformgetTransform(TransformContext context)Helper method to retrieve the PageByTransform from the context.protected abstract booleanisActionEnabled(TransformContext context)Indicates the abstract class if the specific action of this item is available.booleanisItemAvailable(TransformContext context)Returns true if the bean can be edited and the corresponding action is enabled.-
Methods inherited from class com.microstrategy.web.app.gui.ContextMenu.DefaultContextMenuItemBuilder
createItem, createItem, getDefinition, getItemKey, getScript
-
-
-
-
Constructor Detail
-
AbstractPagebyContextMenuItemBuilder
public AbstractPagebyContextMenuItemBuilder(Shortcut definition)
-
-
Method Detail
-
isItemAvailable
public boolean isItemAvailable(TransformContext context)
Returns true if the bean can be edited and the corresponding action is enabled.- Specified by:
isItemAvailablein interfaceContextMenuItemBuilder- Overrides:
isItemAvailablein classContextMenu.DefaultContextMenuItemBuilder- Parameters:
context- TransformContext with context information.- Returns:
trueif the context-menu-item is available and should be included.
-
getPageByUnit
protected PageByUnit getPageByUnit(TransformContext context)
Helper method to retrieve the PageByUnit from the context.
-
getTransform
protected PageByTransform getTransform(TransformContext context)
Helper method to retrieve the PageByTransform from the context.
-
getBoneID
protected java.lang.String getBoneID(TransformContext context)
Returns the bone-id used with this context-menu
-
getContextMenusScript
protected java.lang.String getContextMenusScript(TransformContext context)
Returns the javascript used to process the context-menus.
-
getContextMenusScript
protected java.lang.String getContextMenusScript(TransformContext context, java.lang.String args)
Returns the javascript used to process the context-menus.
-
isActionEnabled
protected abstract boolean isActionEnabled(TransformContext context)
Indicates the abstract class if the specific action of this item is available.
-
-