Package org.primefaces.util

Examples of org.primefaces.util.WidgetBuilder


    writer.endElement("div");
  }

  private void encodeScript(FacesContext context, NotificationBar bar) throws IOException {
    String clientId = bar.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("NotificationBar", bar.resolveWidgetVar(), clientId)
            .attr("position", bar.getPosition())
            .attr("effect", bar.getEffect())
            .attr("effectSpeed", bar.getEffectSpeed())
            .attr("autoDisplay", bar.isAutoDisplay(), false);
    wb.finish();
  }
View Full Code Here


     
    writer.endElement("button");
    }

    public void encodeScript(FacesContext context, Button button) throws IOException {
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("Button", button.resolveWidgetVar(), button.getClientId(context));
        wb.finish();
    }
View Full Code Here

        if(lb.getFacet("inline") != null)
            mode = "inline";
        else if(lb.isIframe())
            mode = "iframe";
       
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("LightBox", lb.resolveWidgetVar(), clientId)
            .attr("mode", mode)
            .attr("width", lb.getWidth(), null)
            .attr("height", lb.getHeight(), null)
            .attr("visible", lb.isVisible(), false)
            .attr("iframeTitle", lb.getIframeTitle(), null)
            .callback("onShow", "function()", lb.getOnShow())
            .callback("onHide", "function()", lb.getOnHide());
       
        wb.finish();
    }
View Full Code Here

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

    String widgetVar = cropper.resolveWidgetVar();
    String clientId = cropper.getClientId(context);
        String image = clientId + "_image";
        String select = null;
       
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithComponentLoad("ImageCropper", widgetVar, clientId, clientId + "_image", "imagecropper")
            .attr("image", image);
       
        if(cropper.getMinSize() != null)
            wb.append(",minSize:[").append(cropper.getMinSize()).append("]");
       
        if(cropper.getMaxSize() != null)
            wb.append(",maxSize:[").append(cropper.getMaxSize()).append("]");
       
        wb.attr("bgColor", cropper.getBackgroundColor(), null)
            .attr("bgOpacity", cropper.getBackgroundOpacity(), 0.6)
            .attr("aspectRatio", cropper.getAspectRatio(), Double.MIN_VALUE);
       
    if(cropper.getValue() != null) {
            CroppedImage croppedImage = (CroppedImage) cropper.getValue();
           
            int x = croppedImage.getLeft();
            int y = croppedImage.getTop();
            int x2 = x + croppedImage.getWidth();
            int y2 = y + croppedImage.getHeight();

            select = "[" + x +  "," + y + "," + x2 + "," + y2 + "]";
    }
        else if(cropper.getInitialCoords() != null) {
            select = "[" + cropper.getInitialCoords() + "]";
        }
       
        wb.append(",setSelect:").append(select);

        wb.finish();
  }
View Full Code Here

        encodeScript(facesContext, panel);
    }

    protected void encodeScript(FacesContext context, Panel panel) throws IOException {
        String clientId = panel.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("Panel", panel.resolveWidgetVar(), clientId);
       
        if(panel.isToggleable()) {
            wb.attr("toggleable", true)
                .attr("toggleSpeed", panel.getToggleSpeed())
                .attr("collapsed", panel.isCollapsed())
                .attr("toggleOrientation", panel.getToggleOrientation());
        }
       
        if(panel.isClosable()) {
            wb.attr("closable", true)
                .attr("closeSpeed", panel.getCloseSpeed());
        }
       
        if(panel.getOptionsMenu() != null) {
            wb.attr("hasMenu", true);
        }
       
        encodeClientBehaviors(context, panel);

        wb.finish();
    }
View Full Code Here

  }
 
  protected void encodeScript(FacesContext context, TreeTable tt) throws IOException {
    String clientId = tt.getClientId(context);
        String selectionMode = tt.getSelectionMode();
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("TreeTable", tt.resolveWidgetVar(), clientId)
            .attr("selectionMode", selectionMode, null)
            .attr("resizableColumns", tt.isResizableColumns(), false)
            .attr("liveResize", tt.isLiveResize(), false)
            .attr("scrollable", tt.isScrollable(), false)
            .attr("scrollHeight", tt.getScrollHeight(), null)
            .attr("scrollWidth", tt.getScrollWidth(), null)
            .attr("nativeElements", tt.isNativeElements(), false);
       
        encodeClientBehaviors(context, tt);

        wb.finish();
  }
View Full Code Here

                .onsuccess(poll.getOnsuccess())
                .oncomplete(poll.getOncomplete())
                .params(poll)
                .build();
       
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("Poll", poll.resolveWidgetVar(), clientId)
            .attr("frequency", poll.getInterval())
            .attr("autoStart", poll.isAutoStart())
            .callback("fn", "function()", request);

        wb.finish();
    }
View Full Code Here

        writer.endElement("div");
    }

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

    encodeScript(context, status);
  }

  protected void encodeScript(FacesContext context, AjaxStatus status) throws IOException {
    String clientId = status.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("AjaxStatus", status.resolveWidgetVar(), clientId);

        wb.callback(AjaxStatus.START, AjaxStatus.CALLBACK_SIGNATURE, status.getOnstart())
            .callback(AjaxStatus.ERROR, AjaxStatus.CALLBACK_SIGNATURE, status.getOnerror())
            .callback(AjaxStatus.SUCCESS, AjaxStatus.CALLBACK_SIGNATURE, status.getOnsuccess())
            .callback(AjaxStatus.COMPLETE, AjaxStatus.CALLBACK_SIGNATURE, status.getOncomplete());
       
        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.