Package org.primefaces.util

Examples of org.primefaces.util.WidgetBuilder


  }
 
  protected void encodeScript(FacesContext context, Password password) throws IOException {
    String clientId = password.getClientId(context);
        boolean feedback = password.isFeedback();
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("Password", password.resolveWidgetVar(), clientId);
       
        if(feedback) {
            wb.attr("feedback", true)
                .attr("inline", password.isInline())
                .attr("promptLabel", escapeText(password.getPromptLabel()))
                .attr("weakLabel", escapeText(password.getWeakLabel()))
                .attr("goodLabel", escapeText(password.getGoodLabel()))
                .attr("strongLabel", escapeText(password.getStrongLabel()));
        }

        wb.finish();
  }
View Full Code Here


        writer.endElement("div");
    }
   
    public void encodeScript(FacesContext context, RangeSlider rangeSlider) throws IOException {
        String clientId = rangeSlider.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("RangeSlider", rangeSlider.resolveWidgetVar(), clientId).finish();
    }
View Full Code Here

    @Override
    protected void encodeScript(FacesContext context, TabView tabView) throws IOException {
        String clientId = tabView.getClientId(context);
        boolean dynamic = tabView.isDynamic();
       
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("TabView", tabView.resolveWidgetVar(), clientId);
       
        if(dynamic) {
            wb.attr("dynamic", true).attr("cache", tabView.isCache());
        }
       
        wb.callback("onTabChange", "function(index)", tabView.getOnTabChange())
            .callback("onTabShow", "function(index)", tabView.getOnTabShow())
            .callback("onTabClose", "function(index)", tabView.getOnTabClose());
       
        encodeClientBehaviors(context, tabView);

        wb.finish();
    }
View Full Code Here

        }
    }

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

        }
    }

    protected void encodeScript(FacesContext context, Layout layout) throws IOException {
        String clientId = layout.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("Layout", layout.resolveWidgetVar(), clientId, "layout")
            .attr("full", layout.isFullPage(), false)
            .attr("useStateCookie", layout.isStateful(), false);
       
        if(layout.isNested()) {
            wb.attr("parent", layout.getParent().getClientId(context));
        }
       
        wb.callback("onToggle", "function(e)", layout.getOnToggle())
            .callback("onClose", "function(e)", layout.getOnClose())
            .callback("onResize", "function(e)", layout.getOnResize());
       
        encodeUnits(context, layout, wb);
        encodeClientBehaviors(context, layout);
       
        wb.finish();
    }
View Full Code Here

  protected void encodeScript(FacesContext context, AccordionPanel acco) throws IOException {
    String clientId = acco.getClientId(context);
        boolean multiple = acco.isMultiple();
       
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("AccordionPanel", acco.resolveWidgetVar(), clientId);
            
        if(acco.isDynamic()) {
            wb.attr("dynamic", true).attr("cache", acco.isCache());
        }
       
        wb.attr("multiple", multiple, false)
        .callback("onTabChange", "function(panel)", acco.getOnTabChange())
        .callback("onTabShow", "function(panel)", acco.getOnTabShow());
       
        encodeClientBehaviors(context, acco);
       
        wb.finish();
  }
View Full Code Here

    writer.write("]}")
  }

  protected void encodeScript(FacesContext context, Schedule schedule) throws IOException {
    String clientId = schedule.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("Schedule", schedule.resolveWidgetVar(), clientId, "schedule")
            .attr("defaultView", schedule.getView())
            .attr("locale", schedule.calculateLocale(context).toString())
            .attr("offset", schedule.calculateTimeZone().getRawOffset())
            .attr("tooltip", schedule.isTooltip(), false);
       
        if(schedule.getInitialDate() != null) {
      Calendar c = Calendar.getInstance();
      c.setTime((Date) schedule.getInitialDate());
           
            wb.attr("year", c.get(Calendar.YEAR)).attr("month", c.get(Calendar.MONTH)).attr("date", c.get(Calendar.DATE));
    }
       
        if(schedule.isShowHeader()) {
            wb.append(",header:{left:'")
                .append(schedule.getLeftHeaderTemplate()).append("'")
                .attr("center", schedule.getCenterHeaderTemplate())
                .attr("right", schedule.getRightHeaderTemplate())
                .append("}");
    }
        else {
            wb.attr("header", false);
    }
       
        wb.attr("allDaySlot", schedule.isAllDaySlot(), true)
            .attr("slotMinutes", schedule.getSlotMinutes(), 30)
            .attr("firstHour", schedule.getFirstHour(), 6)
            .attr("minTime", schedule.getMinTime(), null)
            .attr("maxTime", schedule.getMaxTime(), null)
            .attr("aspectRatio", schedule.getAspectRatio(), Double.MIN_VALUE)
            .attr("weekends", schedule.isShowWeekends(), true)
            .attr("disableDragging", !schedule.isDraggable(), false)
            .attr("disableResizing", !schedule.isResizable(), false)
            .attr("axisFormat", schedule.getAxisFormat(), null)
            .attr("timeFormat", schedule.getTimeFormat(), null)
            .attr("ignoreTimezone", schedule.isIgnoreTimezone(), true);
               
        String columnFormat = schedule.getColumnFormat();
        if(columnFormat != null) {
            wb.nativeAttr("columnFormat", "{" + columnFormat + "}");
        }
           
        encodeClientBehaviors(context, schedule);

        wb.finish()
  }
View Full Code Here

        writer.endElement("div");
  }
   
  protected void encodeScript(FacesContext context, ConfirmDialog dialog) throws IOException {
    String clientId = dialog.getClientId();
        WidgetBuilder wb = getWidgetBuilder(context);

        wb.initWithDomReady("ConfirmDialog", dialog.resolveWidgetVar(), clientId)
            .attr("visible", dialog.isVisible(), false)
            .attr("width", dialog.getWidth(), null)
            .attr("height", dialog.getHeight(), null)
            .attr("appendTo", SearchExpressionFacade.resolveComponentForClient(context, dialog, dialog.getAppendTo()), null)
            .attr("showEffect", dialog.getShowEffect(), null)
            .attr("hideEffect", dialog.getHideEffect(), null)
            .attr("closeOnEscape", dialog.isCloseOnEscape(), false)
            .attr("global", dialog.isGlobal(), false);
 
        wb.finish();
  }
View Full Code Here

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

  }
   
    protected void encodeScript(FacesContext context, BlockUI blockUI) throws IOException {
        String clientId = blockUI.getClientId(context);
       
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("BlockUI", blockUI.resolveWidgetVar(), clientId);
       
        wb.attr("block", SearchExpressionFacade.resolveComponentsForClient(context, blockUI, blockUI.getBlock()));
        wb.attr("triggers", SearchExpressionFacade.resolveComponentsForClient(context, blockUI, blockUI.getTrigger()), null);
        wb.attr("blocked", blockUI.isBlocked(), false);
        wb.attr("animate", blockUI.isAnimate(), true);
       
        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.