Package org.richfaces.renderkit

Examples of org.richfaces.renderkit.ScriptOptions


         String evt = (String) component.getAttributes().get("event");
        if(evt == null || evt.trim().length() == 0){
          evt = "onmouseover";
        }
        function.addParameter(evt);
        ScriptOptions subMenuOptions = new ScriptOptions(component);
        subMenuOptions.addEventHandler("onopen");
        subMenuOptions.addEventHandler("onclose");
        subMenuOptions.addOption("direction");
        subMenuOptions.addOption("highlightParent", Boolean.TRUE);
        function.addParameter(subMenuOptions);
        function.appendScript(buffer);

    } else {
        buffer.append(".");
        function = new JSFunction("asDropDown");
        function.addParameter(component.getClientId(context));
        function.addParameter(component.getClientId(context) + "_span");
          String evt = (String) component.getAttributes().get("event");
        if(evt == null || evt.trim().length() == 0){
          evt = "onmouseover";
        }
        function.addParameter(evt);
        function.addParameter("onmouseout");
        ScriptOptions menuOptions = new ScriptOptions(component);

        menuOptions.addOption("direction");
        menuOptions.addOption("jointPoint");
        menuOptions.addOption("verticalOffset");


        menuOptions.addOption("horizontalOffset");
        menuOptions.addEventHandler("oncollapse");
        menuOptions.addEventHandler("onexpand");
        menuOptions.addEventHandler("onitemselect");
        menuOptions.addEventHandler("ongroupactivate");
        menuOptions.addOption("disabled");
        function.addParameter(menuOptions);
        function.appendScript(buffer);

    }
   
View Full Code Here


   * @param context faces context
   * @param column table column
   * @return all options needed for drop JavaScript object to work
   */
  public ScriptOptions buildOptions(FacesContext context, UIComponent column) {
    ScriptOptions options = new ScriptOptions(column);
    options.addOption("acceptedTypes", "COLUMN_ORDER_"+column.getParent().getClientId(context));
    return options;
  }
View Full Code Here

        return null;
    }

    public ScriptOptions buildOptions(FacesContext context,
            UIComponent component) {
        ScriptOptions scriptOptions = new ScriptOptions(component);
        scriptOptions.addOption("selectionInput", getSelectionInputName(
                context, (UIExtendedDataTable) component));
        scriptOptions.addOption("gridId", getGridId(context,
                (UIExtendedDataTable) component));
        Map<String, Object> attributes = component.getAttributes();
        Object attribut = attributes.get("selectedClass");
        if (attribut == null) {
            attribut = "";
        }
        scriptOptions.addOption("selectedClass", attribut);
        attribut = attributes.get("activeClass");
        if (attribut == null) {
            attribut = "";
        }
        scriptOptions.addOption("activeClass", attribut);

        attribut = attributes.get("selectionMode");
        if (attribut == null) {
            attribut = "";
        }
        scriptOptions.addOption("selectionMode", attribut);
        scriptOptions.addEventHandler("onselectionchange");
        return scriptOptions;
    }
View Full Code Here

      }
    }
    if (itemId != null) {
      JSFunction function = new JSFunction(".addItem");
      function.addParameter(itemId);
      ScriptOptions options = new ScriptOptions(kid);

      options.addEventHandler("onmouseout");
      options.addEventHandler("onmouseover");
     
      if (closeOnClick) {
        options.addOption("closeOnClick", Boolean.TRUE);
      }
      options.addOption("flagGroup", flagGroup);
     
      options.addOption("styleClass");
      options.addOption("style");     
      options.addOption("itemClass");
      options.addOption("itemStyle");
      options.addOption("disabledItemClass");
      options.addOption("disabledItemStyle");
      options.addOption("selectItemClass");
      options.addOption("labelClass");
      options.addOption("selectedLabelClass");
      options.addOption("disabledLabelClass");
     
      options.addOption("selectClass");
      options.addOption("selectStyle");
      options.addOption("iconClass");
     
      if (disabled) {
        options.addOption("disabled", Boolean.TRUE);
      }
     
      options.addEventHandler("onselect");
     
      function.addParameter(options);
      return function.toScript();
    }
    return "";
View Full Code Here

    if(component instanceof UIPanelBar){
      UIPanelBar panelBar = (UIPanelBar)component;
     
      List items = getScriptPanelBarItems(context, panelBar);
       
      ScriptOptions options = new ScriptOptions(component);
     
      AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
     
      Object changeScript = panelBar.getAttributes().get("onitemchange");
     
      if (changeScript != null && !changeScript.equals("")) {
        JSFunctionDefinition function =  new JSFunctionDefinition();
        function.addParameter("event");
        function.addToBody(changeScript);
        options.addOption("onitemchange",function);
      } else {
        options.addOption("onitemchange","");
      }
         
      options.addOption("onclick", panelBar.getAttributes().get("onclick"));
      options.addOption("mouseover", panelBar.getAttributes().get("onmouseover"));
      options.addOption("mouseout", panelBar.getAttributes().get("onmouseout"));
      options.addOption("mousemove", panelBar.getAttributes().get("onmousemove"));
      options.addOption("items", items);
      options.addOption("ajax", ajaxContext.isAjaxRequest());
     
         
      StringBuffer script = new StringBuffer();
      JSFunction function = new JSFunction("new Richfaces.PanelBar");
      function.addParameter(panelBar.getClientId(context));
View Full Code Here

         String evt = (String) component.getAttributes().get("event");
        if(evt == null || evt.trim().length() == 0){
          evt = "onmouseover";
        }
        function.addParameter(evt);
        ScriptOptions subMenuOptions = new ScriptOptions(component);
        subMenuOptions.addEventHandler("onopen");
        subMenuOptions.addEventHandler("onclose");
        subMenuOptions.addOption("direction");
        subMenuOptions.addOption("dummy", "dummy");
        function.addParameter(subMenuOptions);
        function.appendScript(buffer);

    } else {
        buffer.append(".");
        function = new JSFunction("asContextMenu");
/*        function.addParameter(component.getParent().getClientId(context));
          String evt = (String) component.getAttributes().get("event");
        if(evt == null || evt.trim().length() == 0){
          evt = "oncontextmenu";
        }
        function.addParameter(evt);
        function.addParameter("onmouseout");
*/        ScriptOptions menuOptions = new ScriptOptions(component);

        menuOptions.addOption("direction");
        menuOptions.addOption("jointPoint");
        menuOptions.addOption("verticalOffset");


        menuOptions.addOption("horizontalOffset");
        menuOptions.addEventHandler("oncollapse");
        menuOptions.addEventHandler("onexpand");
        menuOptions.addEventHandler("onitemselect");
        menuOptions.addEventHandler("ongroupactivate");
       
        menuOptions.addOption("dummy", "dummy");
        function.addParameter(menuOptions);
        function.appendScript(buffer);

    }
   
View Full Code Here

  }

  public ScriptOptions buildOptions(FacesContext context,
      UIComponent component) {
    UIScrollableDataTable table = (UIScrollableDataTable) component;
    ScriptOptions scriptOptions = new ScriptOptions(component);
    if (table.isSelectionEnabled()) {
      scriptOptions.addOption("selectionInput", getSelectionInputName(
          context, table));
      Map<String, Object> attributes = component.getAttributes();
      Object attribut = attributes.get("selectedClass");
      if (attribut == null) {
        attribut = "";
      }
      scriptOptions.addOption("selectedClass", attribut);
      attribut = attributes.get("activeClass");
      if (attribut == null) {
        attribut = "";
      }
      scriptOptions.addOption("activeClass", attribut);
      scriptOptions.addOption("selectionMode", table.getSelectionMode());
    }
    return scriptOptions;
  }
View Full Code Here

         String evt = (String) component.getAttributes().get("event");
        if(evt == null || evt.trim().length() == 0){
          evt = "onmouseover";
        }
        function.addParameter(evt);
        ScriptOptions subMenuOptions = new ScriptOptions(component);
        subMenuOptions.addEventHandler("onopen");
        subMenuOptions.addEventHandler("onclose");
        subMenuOptions.addOption("direction");
        subMenuOptions.addOption("highlightParent", Boolean.TRUE);
        function.addParameter(subMenuOptions);
        function.appendScript(buffer);

    } else {
        buffer.append(".");
        function = new JSFunction("asDropDown");
        function.addParameter(component.getClientId(context));
        function.addParameter(component.getClientId(context) + "_span");
          String evt = (String) component.getAttributes().get("event");
        if(evt == null || evt.trim().length() == 0){
          evt = "onmouseover";
        }
        function.addParameter(evt);
        function.addParameter("onmouseout");
        ScriptOptions menuOptions = new ScriptOptions(component);

        menuOptions.addOption("direction");
        menuOptions.addOption("jointPoint");
        menuOptions.addOption("verticalOffset");


        menuOptions.addOption("horizontalOffset");
        menuOptions.addEventHandler("oncollapse");
        menuOptions.addEventHandler("onexpand");
        menuOptions.addEventHandler("onitemselect");
        menuOptions.addEventHandler("ongroupactivate");
        menuOptions.addOption("disabled");
        function.addParameter(menuOptions);
        function.appendScript(buffer);

    }
   
View Full Code Here

      }
    }
    if (itemId != null) {
      JSFunction function = new JSFunction(".addItem");
      function.addParameter(itemId);
      ScriptOptions options = new ScriptOptions(kid);
      options.addEventHandler("onmouseout");
      options.addEventHandler("onmouseover");
      options.addOption("closeOnClick", new Integer(flcloseonclick));
      options.addOption("flagGroup", new Integer(flagGroup));
      options.addOption("selectClass");
      options.addOption("style");
      options.addOption("selectStyle");
      options.addOption("iconClass");
      options.addOption("disabled", Boolean.valueOf(disabled));
      function.addParameter(options);
      return function.toScript();
    }
    return "";
  }
View Full Code Here

     * @return all options needed for drag JavaScript object to work
     */
    public ScriptOptions buildOptions(FacesContext context, UIComponent column,
            String dragSourceScriptId, String indicatorId) {

        ScriptOptions options = new ScriptOptions(column);
        options.addOption("dragType", "COLUMN_ORDER_"
                + column.getParent().getClientId(context));

        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters
                .put(
                        org.richfaces.renderkit.DraggableRendererContributor.DRAG_SOURCE_ID,
                        dragSourceScriptId);
        parameters.put(dragSourceScriptId, dragSourceScriptId);
        options.addOption("parameters", parameters);

        if (indicatorId != null) {
            options.addOption("dragIndicator", indicatorId);
        }

        return options;
    }
View Full Code Here

TOP

Related Classes of org.richfaces.renderkit.ScriptOptions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.