Class 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 the EnumWebToggleFunction enumeration.

    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 Detail

      • AbstractFilterOperatorContextMenuItemBuilder

        public AbstractFilterOperatorContextMenuItemBuilder​(Shortcut definition)
    • Method Detail

      • getToggleFunction

        public abstract int getToggleFunction()
        This function identifies the type of logical operator the builder corresponds to.
      • 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:
        1. RestoreStateEvent: if needed to restore the state of the bean before editing changes.
        2. ToggleOperatorEvent: the actual event that toggles the logical operator.
        3. 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.