Package org.richfaces.renderkit

Examples of org.richfaces.renderkit.ScriptOptions


    return null;
  }

  public ScriptOptions buildOptions(FacesContext context,
      UIComponent component) {
    ScriptOptions scriptOptions = new ScriptOptions(component);
    scriptOptions.addOption("selectionInput", getSelectionInputName(
        context, (UIScrollableDataTable) component));
    scriptOptions.addOption("selectedClass");
    scriptOptions.addOption("activeClass");
    return scriptOptions;
  }
View Full Code Here


    RendererContributor contributor = DropzoneRendererContributor.getInstance();
    StringBuffer buffer = new StringBuffer();
    JSFunction function = new JSFunction("new DnD.SimpleDropZone");
    function.addParameter(component.getParent().getClientId(context));
    ScriptOptions dropOptions = contributor.buildOptions(context, component);

    DnDParametersEncoder parametersEncoder = DnDParametersEncoder.getInstance();
    dropOptions.addOption("dndParams", parametersEncoder.doEncodeAsString(context, component));

    function.addParameter(dropOptions);
    function.appendScript(buffer);

    String scriptContribution = contributor.getScriptContribution(context, component);
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));
          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

         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

    if(component instanceof UIPanelBar){
      UIPanelBar panelBar = (UIPanelBar)component;
     
      List items = getScriptPanelBarItems(context, panelBar);
       
      ScriptOptions options = new ScriptOptions(component);
     
     
      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);
     
         
      StringBuffer script = new StringBuffer();
      JSFunction function = new JSFunction("new Richfaces.PanelBar");
      function.addParameter(panelBar.getClientId(context));
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.