Package org.primefaces.util

Examples of org.primefaces.util.WidgetBuilder


    }

    private void encodeScript(FacesContext context, Spotlight spotlight) throws IOException {
        String clientId = spotlight.getClientId(context);
       
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("Spotlight", spotlight.resolveWidgetVar(), clientId);
       
        wb.attr("target", SearchExpressionFacade.resolveComponentsForClient(context, spotlight, spotlight.getTarget()));
        wb.attr("animate", spotlight.isAnimate(), true);
       
        wb.finish();
    }
View Full Code Here


public class AutoCompleteRenderer extends org.primefaces.component.autocomplete.AutoCompleteRenderer {
   
    @Override
    protected void encodeScript(FacesContext context, AutoComplete ac) throws IOException {
        String clientId = ac.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("AutoComplete", ac.resolveWidgetVar(), clientId);
       
        wb.attr("minLength", ac.getMinQueryLength(), 1)
            .attr("delay", ac.getQueryDelay(), 300);
               
        String emptyMessage = ac.getEmptyMessage();
        if(emptyMessage != null) {
            wb.attr("emptyMessage", emptyMessage, null);
        }
       
        encodeClientBehaviors(context, ac);

        wb.finish();
    }
View Full Code Here

  }

  protected void encodeScript(FacesContext context, Inplace inplace) throws IOException {
    ResponseWriter writer = context.getResponseWriter();
    String clientId = inplace.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("Inplace", inplace.resolveWidgetVar(), clientId)
            .attr("effect", inplace.getEffect())
            .attr("effectSpeed", inplace.getEffectSpeed())
            .attr("event", inplace.getEvent())
            .attr("toggleable", inplace.isToggleable(), false)
            .attr("disabled", inplace.isDisabled(), false)
            .attr("editor", inplace.isEditor(), false);
       
        encodeClientBehaviors(context, inplace);
   
        wb.finish();
  }
View Full Code Here

public class SelectOneRadioRenderer extends org.primefaces.component.selectoneradio.SelectOneRadioRenderer {
   
    @Override
    protected void encodeScript(FacesContext context, SelectOneRadio radio) throws IOException {
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("SelectOneRadio", radio.resolveWidgetVar(), radio.getClientId(context)).finish();
    }
View Full Code Here

    }

    @Override
  public WidgetBuilder getWidgetBuilder() {
      if (this.widgetBuilder == null) {
        this.widgetBuilder = new WidgetBuilder(context);
      }

        return widgetBuilder;
    }
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).attr("activeIndex", menu.getActiveIndex());
        wb.finish();
    }
View Full Code Here

    @Override
    protected void encodeScript(FacesContext context, Calendar calendar, String value) throws IOException {
        String clientId = calendar.getClientId(context);
        Locale locale = calendar.calculateLocale(context);
        String pattern = calendar.calculatePattern();
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("Calendar", calendar.resolveWidgetVar(), clientId);
       
        wb.attr("popup", calendar.isPopup())
            .attr("locale", locale.toString())
            .attr("dateFormat", CalendarUtils.convertPattern(pattern));
       
        //default date
        Object pagedate = calendar.getPagedate();
        String defaultDate = null;
       
        if(calendar.isConversionFailed()) {
            defaultDate = CalendarUtils.getValueAsString(context, calendar, new Date());
        }
        else if(!isValueBlank(value)) {
            defaultDate = value;
        }
        else if(pagedate != null) {
            defaultDate = CalendarUtils.getValueAsString(context, calendar, pagedate);
        }
       
        wb.attr("defaultDate", defaultDate, null)
            .attr("numberOfMonths", calendar.getPages(), 1)
            .attr("minDate", CalendarUtils.getValueAsString(context, calendar, calendar.getMindate()), null)
            .attr("maxDate", CalendarUtils.getValueAsString(context, calendar, calendar.getMaxdate()), null)
            .attr("showButtonPanel", calendar.isShowButtonPanel(), false)
            .attr("showWeek", calendar.isShowWeek(), false)
            .attr("disabledWeekends", calendar.isDisabledWeekends(), false)
            .attr("disabled", calendar.isDisabled(), false)
            .attr("yearRange", calendar.getYearRange(), null);
       
        if(calendar.isNavigator()) {
            wb.attr("changeMonth", true).attr("changeYear", true);
        }
       
        if(calendar.getEffect() != null) {
            wb.attr("showAnim", calendar.getEffect()).attr("duration", calendar.getEffectDuration());
        }
       
        String beforeShowDay = calendar.getBeforeShowDay();
        if(beforeShowDay != null) {
            wb.nativeAttr("preShowDay", beforeShowDay);
        }
       
        String showOn = calendar.getShowOn();
        if(!showOn.equalsIgnoreCase("focus")) {
            wb.attr("showOn", showOn);
        }
       
        if(calendar.isShowOtherMonths()) {
            wb.attr("showOtherMonths", true).attr("selectOtherMonths", true);
        }
               
        encodeClientBehaviors(context, calendar);
       
        wb.finish();
    }
View Full Code Here

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

    }
   
    @Override
    protected void encodeScript(FacesContext context, DataList list) throws IOException {
        String clientId = list.getClientId();
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("DataList", list.resolveWidgetVar(), clientId);
       
        encodeClientBehaviors(context, list);

        wb.finish();
    }
View Full Code Here

  }  
   
    @Override
    protected void encodeScript(FacesContext context, Password password) throws IOException {
    String clientId = password.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("Password", password.resolveWidgetVar(), clientId);

        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.