public abstract class

AbstractPagebyContextMenuItemBuilder

extends ContextMenu.DefaultContextMenuItemBuilder
java.lang.Object
   ↳ com.microstrategy.web.app.gui.ContextMenu.DefaultContextMenuItemBuilder
     ↳ com.microstrategy.web.app.transforms.contextmenus.AbstractPagebyContextMenuItemBuilder
Known Direct Subclasses

Class Overview

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:

  1. createItem(): The default method that creates the context-menu item.
  2. 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;
     }

 }
 

Summary

Public Constructors
AbstractPagebyContextMenuItemBuilder(Shortcut definition)
Public Methods
boolean isItemAvailable(TransformContext context)
Returns true if the bean can be edited and the corresponding action is enabled.
Protected Methods
String getBoneID(TransformContext context)
Returns the bone-id used with this context-menu
String getContextMenusScript(TransformContext context, String args)
Returns the javascript used to process the context-menus.
String getContextMenusScript(TransformContext context)
Returns the javascript used to process the context-menus.
PageByUnit getPageByUnit(TransformContext context)
Helper method to retrieve the PageByUnit from the context.
PageByTransform getTransform(TransformContext context)
Helper method to retrieve the PageByTransform from the context.
abstract boolean isActionEnabled(TransformContext context)
Indicates the abstract class if the specific action of this item is available.
[Expand]
Inherited Methods
From class com.microstrategy.web.app.gui.ContextMenu.DefaultContextMenuItemBuilder
From class java.lang.Object
From interface com.microstrategy.web.app.gui.ContextMenuItemBuilder

Public Constructors

public AbstractPagebyContextMenuItemBuilder (Shortcut definition)

Public Methods

public boolean isItemAvailable (TransformContext context)

Returns true if the bean can be edited and the corresponding action is enabled.

Parameters
context TransformContext with context information.
Returns
  • true if the context-menu-item is available and should be included.

Protected Methods

protected String getBoneID (TransformContext context)

Returns the bone-id used with this context-menu

protected String getContextMenusScript (TransformContext context, String args)

Returns the javascript used to process the context-menus.

protected String getContextMenusScript (TransformContext context)

Returns the javascript used to process the context-menus.

protected PageByUnit getPageByUnit (TransformContext context)

Helper method to retrieve the PageByUnit from the context.

protected PageByTransform getTransform (TransformContext context)

Helper method to retrieve the PageByTransform from the context.

protected abstract boolean isActionEnabled (TransformContext context)

Indicates the abstract class if the specific action of this item is available.