Package org.primefaces.util

Examples of org.primefaces.util.WidgetBuilder


        encodeScript(context, ribbon);
    }

    private void encodeScript(FacesContext context, Ribbon ribbon) throws IOException {
        String clientId = ribbon.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("Ribbon", ribbon.resolveWidgetVar(), clientId, "ribbon");
       
        wb.finish();
    }
View Full Code Here


public class DataTableRenderer extends org.primefaces.component.datatable.DataTableRenderer {
    @Override
    protected void encodeScript(FacesContext context, DataTable table) throws IOException{
    String clientId = table.getClientId(context);       
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("DataTable", table.resolveWidgetVar(), clientId);
               
        wb.attr("selectionMode", table.getSelectionMode(), null);
       
        if(table.isPaginator()) {
            PaginatorRenderer paginatorRenderer = getPaginatorRenderer(context);
            paginatorRenderer.encodeScript(context, table, wb);
        }
       
        encodeClientBehaviors(context, table);

        wb.finish();
  }
View Full Code Here

    @Override
  protected void encodeScript(FacesContext context, AbstractMenu abstractMenu) throws IOException{
        Menubar menubar = (Menubar) abstractMenu;
    String clientId = menubar.getClientId(context);
       
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("Menubar", menubar.resolveWidgetVar(), clientId)
            .attr("autoDisplay", menubar.isAutoDisplay())
            .attr("toggleEvent", menubar.getToggleEvent(), null);

        wb.finish();
  }
View Full Code Here

  protected void encodeScript(FacesContext context, AbstractMenu abstractMenu) throws IOException{
        TieredMenu menu = (TieredMenu) abstractMenu;
    String clientId = menu.getClientId(context);
       
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("TieredMenu", menu.resolveWidgetVar(), clientId)
            .attr("autoDisplay", menu.isAutoDisplay())               
            .attr("toggleEvent", menu.getToggleEvent(), null);
       
        if(menu.isOverlay()) {
            encodeOverlayConfig(context, menu, wb);
        }

        wb.finish();
  }
View Full Code Here

  protected void encodeScript(FacesContext context, InputTextarea inputTextarea) throws IOException {
    String clientId = inputTextarea.getClientId(context);
        boolean autoResize = inputTextarea.isAutoResize();
        String counter = inputTextarea.getCounter();
       
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("InputTextarea", inputTextarea.resolveWidgetVar(), clientId)
            .attr("autoResize", autoResize)
            .attr("maxlength", inputTextarea.getMaxlength(), Integer.MAX_VALUE);
       
        if(counter != null) {
            UIComponent counterComponent = SearchExpressionFacade.resolveComponent(context, inputTextarea, counter);

          wb.attr("counter", counterComponent.getClientId(context))
              .attr("counterTemplate", inputTextarea.getCounterTemplate(), null);
        }
       
        if(inputTextarea.getCompleteMethod() != null) {
            wb.attr("autoComplete", true)
                .attr("minQueryLength", inputTextarea.getMinQueryLength())
                .attr("queryDelay", inputTextarea.getQueryDelay())
                .attr("scrollHeight", inputTextarea.getScrollHeight(), Integer.MAX_VALUE);
        }

        wb.finish();
  }
View Full Code Here

        writer.endElement("div");
    }
   
    protected void encodeScript(FacesContext context, Sticky sticky) throws IOException {
        String target = sticky.getTarget();
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("Sticky", sticky.resolveWidgetVar(), sticky.getClientId(context))
            .attr("target", SearchExpressionFacade.resolveComponentsForClient(context, sticky, target))
            .attr("margin", sticky.getMargin(), 0)
            .finish();
    }
View Full Code Here

    @Override
    protected void encodeScript(FacesContext context, AbstractMenu abstractMenu) throws IOException {
        ContextMenu menu = (ContextMenu) abstractMenu;
    String clientId = menu.getClientId(context);

        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("ContextMenu", menu.resolveWidgetVar(), clientId);
       
        String _for = menu.getFor();
        if(_for != null) {
          UIComponent target = SearchExpressionFacade.resolveComponent(context, menu, _for);
         
            wb.attr("target", target.getClientId(context))
                .attr("type", target.getClass().getSimpleName());
           
            if(target instanceof Widget) {
                wb.attr("targetWidgetVar", ((Widget) target).resolveWidgetVar());
            }
        }
       
        wb.attr("nodeType", menu.getNodeType(), null)
            .attr("event", menu.getEvent(), null)
            .attr("selectionMode", menu.getSelectionMode(), "multiple")
            .callback("beforeShow", "function(event)", menu.getBeforeShow());

        wb.finish();
  }
View Full Code Here

public class PanelRenderer extends org.primefaces.component.panel.PanelRenderer {
   
    @Override
    protected void encodeScript(FacesContext context, Panel panel) throws IOException {
        String clientId = panel.getClientId();
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("Panel", panel.resolveWidgetVar(), clientId);
       
        wb.attr("toggleable", panel.isToggleable(), false);
       
        encodeClientBehaviors(context, panel);

        wb.finish();
    }
View Full Code Here

   
    @Override
    protected void encodeScript(FacesContext context, AbstractMenu abstractMenu) throws IOException {
        TabMenu menu = (TabMenu) abstractMenu;
    String clientId = menu.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("TabMenu", menu.resolveWidgetVar(), clientId);
        wb.finish();
    }
View Full Code Here

    String clientId = tree.getClientId(context);
        boolean dynamic = tree.isDynamic();
        String selectionMode = tree.getSelectionMode();
        String widget = tree.getOrientation().equals("vertical") ? "VerticalTree" : "HorizontalTree";

        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady(widget, tree.resolveWidgetVar(), clientId);

        wb.attr("dynamic", dynamic)
          .attr("highlight", tree.isHighlight(), true)
        .attr("animate", tree.isAnimate(), false)
        .attr("droppable", tree.isDroppable(), false)
        .attr("cache", tree.isCache() && dynamic)
        .attr("dragdropScope", tree.getDragdropScope(), null)
        .callback("onNodeClick", "function(node, event)", tree.getOnNodeClick());

        //selection
        if(selectionMode != null) {
          wb.attr("selectionMode", selectionMode);
          wb.attr("propagateUp", tree.isPropagateSelectionUp());
          wb.attr("propagateDown", tree.isPropagateSelectionDown());
        }

        if(tree.isDraggable()) {
          wb.attr("draggable", true)
            .attr("dragMode", tree.getDragMode())
            .attr("dropRestrict", tree.getDropRestrict());
        }

        encodeIconStates(context, tree, wb);
        encodeClientBehaviors(context, tree);

        wb.finish();
  }
View Full Code Here

TOP

Related Classes of org.primefaces.util.WidgetBuilder

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.