Package org.primefaces.util

Examples of org.primefaces.util.WidgetBuilder


    encodeScript(context, inputText);
  }

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


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

    }

    protected void encodeScript(FacesContext context, Clock clock) throws IOException {
        String clientId = clock.getClientId(context);
        String mode = clock.getMode();
        WidgetBuilder wb = getWidgetBuilder(context);

        wb.init("Clock", clock.resolveWidgetVar(), clientId);
        wb.attr("mode", mode)
            .attr("pattern", clock.getPattern(), null)
            .attr("locale", context.getViewRoot().getLocale().toString());
       
        if(mode.equals("server")) {
            wb.attr("value", System.currentTimeMillis());
           
            if(clock.isAutoSync()) {
                wb.attr("autoSync", true).attr("syncInterval", clock.getSyncInterval());
            }
        }

        wb.finish();
    }
View Full Code Here

        DefaultCommand command = (DefaultCommand) component;

        UIComponent target = SearchExpressionFacade.resolveComponent(context, command, command.getTarget());
       
        String clientId = command.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("DefaultCommand", command.resolveWidgetVar(), clientId)
                .attr("target", target.getClientId(context));
       
        String scope = command.getScope();
        if(scope != null) {
            UIComponent scopeComponent = SearchExpressionFacade.resolveComponent(context, command, scope);
            wb.attr("scope", scopeComponent.getClientId(context));
        }

        wb.finish();
    }
View Full Code Here

    @Override
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
        IdleMonitor monitor = (IdleMonitor) component;
        String clientId = monitor.getClientId();
       
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("IdleMonitor", monitor.resolveWidgetVar(), clientId, "idlemonitor")
            .attr("timeout", monitor.getTimeout())
            .callback("onidle", "function()", monitor.getOnidle())
            .callback("onactive", "function()", monitor.getOnactive());
       
        encodeClientBehaviors(context, monitor);
       
        wb.finish();
    }
View Full Code Here

    encodeScript(context, carousel);
  }
 
  private void encodeScript(FacesContext context, Carousel carousel) throws IOException{
    String clientId = carousel.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("Carousel", carousel.resolveWidgetVar(), clientId);
       
        wb.attr("firstVisible", carousel.getFirstVisible(), 0)
            .attr("circular", carousel.isCircular(), false)
            .attr("vertical", carousel.isVertical(), false)
            .attr("numVisible", carousel.getNumVisible(), 3)
            .attr("autoplayInterval", carousel.getAutoPlayInterval(), 0)
            .attr("dropDownTemplate", carousel.getDropdownTemplate(), null)
            .attr("pageLinks", carousel.getPageLinks(), 3)
            .attr("effect", carousel.getEffect(), null)
            .attr("effectDuration", carousel.getEffectDuration(), Integer.MIN_VALUE)
            .attr("easing", carousel.getEasing(), null);
   
        wb.finish();
  }
View Full Code Here

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

        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("SlideMenu", menu.resolveWidgetVar(), clientId);
       
        if(menu.isOverlay()) {
            encodeOverlayConfig(context, menu, wb);
        }

        wb.finish();
  }
View Full Code Here

        encodeScript(context, spinner);
    }

    protected void encodeScript(FacesContext context, Spinner spinner) throws IOException {
        String clientId = spinner.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("Spinner", spinner.resolveWidgetVar(), clientId)
            .attr("step", spinner.getStepFactor(), 1.0)
            .attr("min", spinner.getMin(), Double.MIN_VALUE)
            .attr("max", spinner.getMax(), Double.MAX_VALUE)
            .attr("prefix", spinner.getPrefix(), null)
            .attr("suffix", spinner.getSuffix(), null);

        wb.finish();
    }
View Full Code Here

        writer.endElement("div");
    }

    protected void encodeScript(FacesContext context, TagCloud tagCloud) throws IOException {
        String clientId = tagCloud.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("TagCloud", tagCloud.resolveWidgetVar(), clientId);
       
        encodeClientBehaviors(context, tagCloud);

        wb.finish();
    }
View Full Code Here

        writer.endElement("div");
    }
   
    protected void encodeScript(FacesContext context, SelectBooleanButton button) throws IOException {
        String clientId = button.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("SelectBooleanButton", button.resolveWidgetVar(), clientId)
            .attr("onLabel", escapeText(button.getOnLabel()))
            .attr("offLabel", escapeText(button.getOffLabel()))
            .attr("onIcon", button.getOnIcon(), null)
            .attr("offIcon", button.getOffIcon(), null);
       
        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.