Package com.liferay.faces.util.client

Examples of com.liferay.faces.util.client.BrowserSnifferFactory


    }
    else {

      if (attributeValue == null) {

        BrowserSnifferFactory browserSnifferFactory = (BrowserSnifferFactory) FactoryExtensionFinder.getFactory(
            BrowserSnifferFactory.class);
        BrowserSniffer browserSniffer = browserSnifferFactory.getBrowserSniffer(externalContext);
        boolean browserIE = browserSniffer.isIe();
        float browserMajorVersion = browserSniffer.getMajorVersion();
        clientScript = new ClientScriptImpl(browserIE, browserMajorVersion);
        requestMap.put(WebKeys.AUI_SCRIPT_DATA, clientScript);
      }
View Full Code Here


  public static String getAlloyBeginScript(FacesContext facesContext, String[] modules, String config) {

    boolean browserIE = false;
    float browserMajorVersion = 1;

    BrowserSnifferFactory browserSnifferFactory = (BrowserSnifferFactory) FactoryExtensionFinder.getFactory(
        BrowserSnifferFactory.class);
    BrowserSniffer browserSniffer = browserSnifferFactory.getBrowserSniffer(facesContext.getExternalContext());

    if (LIFERAY_PORTAL_DETECTED) {
      browserIE = browserSniffer.isIe();
      browserMajorVersion = browserSniffer.getMajorVersion();
    }
View Full Code Here

        value = i18n;
      }
      else if (varName.equals(BROWSER_SNIFFER)) {

        FacesContext currentInstance = FacesContext.getCurrentInstance();
        BrowserSnifferFactory browserSnifferFactory = (BrowserSnifferFactory) FactoryExtensionFinder.getFactory(
            BrowserSnifferFactory.class);
        value = browserSnifferFactory.getBrowserSniffer(currentInstance.getExternalContext());
      }
    }
    catch (Exception e) {
      throw new ELException("Failed to resolve variable [" + varName + "]", e);
    }
View Full Code Here

  @Override
  protected String getPattern() {

    FacesContext facesContext = FacesContext.getCurrentInstance();
    BrowserSnifferFactory browserSnifferFactory = (BrowserSnifferFactory) FactoryExtensionFinder.getFactory(
        BrowserSnifferFactory.class);
    BrowserSniffer browserSniffer = browserSnifferFactory.getBrowserSniffer(facesContext.getExternalContext());

    if (browserSniffer.isMobile() && isResponsive()) {
      return DEFAULT_HTML5_DATE_PATTERN;
    }
    else {
View Full Code Here

    // Encode the "class" and "style" attributes on the outermost <div> element.
    RendererUtil.encodeStyleable(responseWriter, (Styleable) uiComponent);

    // Start the encoding of the text input by delegating to the renderer from the JSF runtime.
    String inputClientId = clientId.concat(INPUT_SUFFIX);
    BrowserSnifferFactory browserSnifferFactory = (BrowserSnifferFactory) FactoryExtensionFinder.getFactory(
        BrowserSnifferFactory.class);
    BrowserSniffer browserSniffer = browserSnifferFactory.getBrowserSniffer(facesContext.getExternalContext());
    InputDateTime inputDateTime = (InputDateTime) uiComponent;
    InputDateTimeResponseWriter inputDateTimeResponseWriter = getInputDateTimeResponseWriter(responseWriter,
        inputClientId, browserSniffer.isMobile(), inputDateTime.isResponsive());
    super.encodeMarkupBegin(facesContext, uiComponent, inputDateTimeResponseWriter);
  }
View Full Code Here

  public void encodeMarkupEnd(FacesContext facesContext, UIComponent uiComponent) throws IOException {

    ResponseWriter responseWriter = facesContext.getResponseWriter();
    String clientId = uiComponent.getClientId(facesContext);
    String inputClientId = clientId.concat(INPUT_SUFFIX);
    BrowserSnifferFactory browserSnifferFactory = (BrowserSnifferFactory) FactoryExtensionFinder.getFactory(
        BrowserSnifferFactory.class);
    BrowserSniffer browserSniffer = browserSnifferFactory.getBrowserSniffer(facesContext.getExternalContext());
    InputDateTime inputDateTime = (InputDateTime) uiComponent;
    boolean mobile = browserSniffer.isMobile();
    boolean responsive = inputDateTime.isResponsive();
    InputDateTimeResponseWriter inputDateTimeResponseWriter = getInputDateTimeResponseWriter(responseWriter,
        inputClientId, mobile, responsive);
View Full Code Here

  }

  @Override
  public void encodeJavaScriptCustom(FacesContext facesContext, UIComponent uiComponent) throws IOException {

    BrowserSnifferFactory browserSnifferFactory = (BrowserSnifferFactory) FactoryExtensionFinder.getFactory(
        BrowserSnifferFactory.class);
    BrowserSniffer browserSniffer = browserSnifferFactory.getBrowserSniffer(facesContext.getExternalContext());
    InputDate inputDate = (InputDate) uiComponent;

    if (browserSniffer.isMobile() && inputDate.isResponsive()) {

      String clientVarName = ComponentUtil.getClientVarName(facesContext, inputDate);
View Full Code Here

  @Override
  protected void encodeHiddenAttributes(FacesContext facesContext, ResponseWriter responseWriter, InputDate inputDate,
    boolean first) throws IOException {

    BrowserSnifferFactory browserSnifferFactory = (BrowserSnifferFactory) FactoryExtensionFinder.getFactory(
        BrowserSnifferFactory.class);
    BrowserSniffer browserSniffer = browserSnifferFactory.getBrowserSniffer(facesContext.getExternalContext());

    if (!(browserSniffer.isMobile() && inputDate.isResponsive())) {

      encodeCalendar(facesContext, responseWriter, inputDate, first);
      first = false;
View Full Code Here

    if (LIFERAY_FACES_BRIDGE_DETECTED) {
      super.encodeEnd(facesContext, uiComponent);
    }
    else {
      BrowserSnifferFactory browserSnifferFactory = (BrowserSnifferFactory) FactoryExtensionFinder.getFactory(
          BrowserSnifferFactory.class);
      BrowserSniffer browserSniffer = browserSnifferFactory.getBrowserSniffer(facesContext.getExternalContext());
      boolean browserIE = browserSniffer.isIe();
      float browserMajorVersion = browserSniffer.getMajorVersion();
      ResponseWriter responseWriter = facesContext.getResponseWriter();
      BodyResponseWriter delegationResponseWriter = new BodyResponseWriter(responseWriter, browserIE,
          browserMajorVersion);
View Full Code Here

  @Override
  public String getAlloyClassName(FacesContext facesContext, UIComponent uiComponent) {

    String alloyClassName = super.getAlloyClassName(facesContext, uiComponent);
    BrowserSnifferFactory browserSnifferFactory = (BrowserSnifferFactory) FactoryExtensionFinder.getFactory(
        BrowserSnifferFactory.class);
    BrowserSniffer browserSniffer = browserSnifferFactory.getBrowserSniffer(facesContext.getExternalContext());
    InputDate inputDate = (InputDate) uiComponent;

    if (browserSniffer.isMobile() && inputDate.isResponsive()) {
      alloyClassName = alloyClassName.concat("Native");
    }
View Full Code Here

TOP

Related Classes of com.liferay.faces.util.client.BrowserSnifferFactory

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.