Class AbstractFilterOperatorContextMenuItemBuilder
- java.lang.Object
-
- com.microstrategy.web.app.gui.ContextMenu.DefaultContextMenuItemBuilder
-
- com.microstrategy.web.app.transforms.contextmenus.AbstractFilterOperatorContextMenuItemBuilder
-
- All Implemented Interfaces:
ContextMenuItemBuilder
- Direct Known Subclasses:
FilterAnd,FilterAndNot,FilterOr,FilterOrNot
public abstract class AbstractFilterOperatorContextMenuItemBuilder extends ContextMenu.DefaultContextMenuItemBuilder
This class is used by Microstrategy Web as a base class for those used to populate operator's context-menus of the Filter editor.
Context-menus-builders used with operators can be created simply by extending this class and implementing the
getToggleFunction()method. This method indicates this class the type of operator associated with the context-menu. It should return values from theEnumWebToggleFunctionenumeration.The following is an example of a subclass used to populate an "AND" context-menu-item:
public class FilterAnd extends AbstractFilterOperatorContextMenuItemBuilder { public FilterAnd(Shortcut s) { super(s); } public int getToggleFunction() { return EnumWebToggleFunction.WebToggleFunctionAnd; } }- Since:
- MicroStrategy Web 8.0.1
-
-
Constructor Summary
Constructors Constructor Description AbstractFilterOperatorContextMenuItemBuilder(Shortcut definition)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ContextMenuItemcreateItem(TransformContext context)Creates and populates a ContextMenuItem based on the information in theShortcutused as defintion.protected voidgenerateUpdateManagerEventJSString(java.lang.StringBuffer buf, java.lang.String beanPath, WebEvent event, java.lang.String[] args)Helper method that serialize an event and its arguments so it can be submitted through the event manager.protected java.lang.StringgetJSCode(TransformContext context)Returns the javascript code to trigger on the on-click.protected intgetOperatorType(ExpressionGenericTransform.Context context)Checks for the function type of the corrent node.abstract intgetToggleFunction()This function identifies the type of logical operator the builder corresponds to.protected ExpressionGenericTransformgetTransform(TransformContext context)Helper methods that returns the correspondingExpressionGenericTransformbooleanisItemAvailable(TransformContext context)Returnstrueif the underlyingShortcutused as definition is available (based on the features defined on the <shortcut> xml.-
Methods inherited from class com.microstrategy.web.app.gui.ContextMenu.DefaultContextMenuItemBuilder
createItem, getDefinition, getItemKey, getScript
-
-
-
-
Constructor Detail
-
AbstractFilterOperatorContextMenuItemBuilder
public AbstractFilterOperatorContextMenuItemBuilder(Shortcut definition)
-
-
Method Detail
-
isItemAvailable
public boolean isItemAvailable(TransformContext context)
Description copied from class:ContextMenu.DefaultContextMenuItemBuilderReturns
trueif the underlyingShortcutused as definition is available (based on the features defined on the <shortcut> xml.If this method returns
falsethe context-menu-item should not be included as part of the available options in the menu.- 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.
-
getOperatorType
protected int getOperatorType(ExpressionGenericTransform.Context context)
Checks for the function type of the corrent node.
-
getToggleFunction
public abstract int getToggleFunction()
This function identifies the type of logical operator the builder corresponds to.
-
createItem
public ContextMenuItem createItem(TransformContext context)
Description copied from class:ContextMenu.DefaultContextMenuItemBuilderCreates and populates a ContextMenuItem based on the information in theShortcutused as defintion.- Specified by:
createItemin interfaceContextMenuItemBuilder- Overrides:
createItemin classContextMenu.DefaultContextMenuItemBuilder- Parameters:
context- TransformContext with context information.- Returns:
- a new instance of a
ContextMenuItem.
-
getJSCode
protected java.lang.String getJSCode(TransformContext context)
Returns the javascript code to trigger on the on-click. Notice that this javascript only works when the Expression Transform uses the update-manager to submit events. The javascript will submit three events:- RestoreStateEvent: if needed to restore the state of the bean before editing changes.
- ToggleOperatorEvent: the actual event that toggles the logical operator.
- ApplyChagnesEvents: if auto-syc is enabled in the transform: so changes are automatically applied.
-
generateUpdateManagerEventJSString
protected final void generateUpdateManagerEventJSString(java.lang.StringBuffer buf, java.lang.String beanPath, WebEvent event, java.lang.String[] args)Helper method that serialize an event and its arguments so it can be submitted through the event manager.
-
getTransform
protected ExpressionGenericTransform getTransform(TransformContext context)
Helper methods that returns the correspondingExpressionGenericTransform
-
-