Codota Logo
BrowserSnifferFactory.getBrowserSnifferInstance
Code IndexAdd Codota to your IDE (free)

How to use
getBrowserSnifferInstance
method
in
com.liferay.faces.util.client.BrowserSnifferFactory

Best Java code snippets using com.liferay.faces.util.client.BrowserSnifferFactory.getBrowserSnifferInstance (Showing top 17 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: com.liferay.faces/com.liferay.faces.util

/**
 * @deprecated  Call {@link #getBrowserSnifferInstance(ExternalContext)} instead.
 *
 *              <p>Returns a new instance of {@link BrowserSniffer} from the {@link BrowserSnifferFactory} found by
 *              the {@link FactoryExtensionFinder}. The returned instance is designed to be used during execution of
 *              a request thread, so it is not guaranteed to be {@link java.io.Serializable}.</p>
 */
@Deprecated
public static BrowserSniffer getBrowserSnifferInstance() {
  return getBrowserSnifferInstance(FacesContext.getCurrentInstance().getExternalContext());
}
origin: com.liferay.faces/com.liferay.faces.alloy

@Override
public String getAlloyClassName(FacesContext facesContext, UIComponent uiComponent) {
  String alloyClassName = super.getAlloyClassName(facesContext, uiComponent);
  BrowserSniffer browserSniffer = BrowserSnifferFactory.getBrowserSnifferInstance(
      facesContext.getExternalContext());
  InputDate inputDate = (InputDate) uiComponent;
  if (isNative(browserSniffer, inputDate)) {
    alloyClassName = alloyClassName.concat("Native");
  }
  return alloyClassName;
}
origin: com.liferay.faces/com.liferay.faces.alloy

@Override
public String getAlloyClassName(FacesContext facesContext, UIComponent uiComponent) {
  String alloyClassName = super.getAlloyClassName(facesContext, uiComponent);
  BrowserSniffer browserSniffer = BrowserSnifferFactory.getBrowserSnifferInstance(
      facesContext.getExternalContext());
  InputTime inputTime = (InputTime) uiComponent;
  if (isNative(browserSniffer, inputTime)) {
    alloyClassName = alloyClassName.concat("Native");
  }
  return alloyClassName;
}
origin: com.liferay.faces/com.liferay.faces.alloy

@Override
protected void encodeHiddenAttributes(FacesContext facesContext, ResponseWriter responseWriter, InputTime inputTime,
  boolean first) throws IOException {
  BrowserSniffer browserSniffer = BrowserSnifferFactory.getBrowserSnifferInstance(
      facesContext.getExternalContext());
  if (!isNative(browserSniffer, inputTime)) {
    encodeAutocomplete(facesContext, responseWriter, inputTime, first);
    first = false;
    encodeHiddenAttributesInputDateTime(facesContext, responseWriter, inputTime, first);
    first = false;
  }
}
origin: com.liferay.faces/com.liferay.faces.alloy

protected String[] getModules(String defaultModule, FacesContext facesContext, UIComponent uiComponent) {
  String[] modules = new String[] { defaultModule };
  BrowserSniffer browserSniffer = BrowserSnifferFactory.getBrowserSnifferInstance(
      facesContext.getExternalContext());
  InputDateTime inputDateTime = (InputDateTime) uiComponent;
  if (isNative(browserSniffer, inputDateTime)) {
    modules[0] = defaultModule.concat("-native");
  }
  else {
    Map<String, List<ClientBehavior>> clientBehaviorMap = inputDateTime.getClientBehaviors();
    List<ClientBehavior> valueChangeClientBehaviors = clientBehaviorMap.get(VALUE_CHANGE);
    if ((valueChangeClientBehaviors != null) && !valueChangeClientBehaviors.isEmpty()) {
      modules = StringHelper.append(modules, NODE_EVENT_SIMULATE);
    }
  }
  return modules;
}
origin: com.liferay.faces/com.liferay.faces.alloy

@Override
protected void encodeHiddenAttributes(FacesContext facesContext, ResponseWriter responseWriter, InputDate inputDate,
  boolean first) throws IOException {
  BrowserSniffer browserSniffer = BrowserSnifferFactory.getBrowserSnifferInstance(
      facesContext.getExternalContext());
  if (!isNative(browserSniffer, inputDate)) {
    encodeCalendar(facesContext, responseWriter, inputDate, first);
    first = false;
    encodeHiddenAttributesInputDateTime(facesContext, responseWriter, inputDate, first);
    first = false;
  }
}
origin: com.liferay.faces/com.liferay.faces.alloy

@Override
public String getPattern() {
  String timePattern;
  FacesContext facesContext = FacesContext.getCurrentInstance();
  BrowserSniffer browserSniffer = BrowserSnifferFactory.getBrowserSnifferInstance(
      facesContext.getExternalContext());
  if (browserSniffer.isMobile() && isNativeWhenMobile()) {
    timePattern = DEFAULT_HTML5_TIME_PATTERN;
  }
  else {
    timePattern = super.getPattern();
  }
  return timePattern;
}
origin: com.liferay.faces/com.liferay.faces.util

value = BrowserSnifferFactory.getBrowserSnifferInstance(currentInstance.getExternalContext());
origin: com.liferay.faces/com.liferay.faces.alloy

@Override
public String getPattern() {
  String datePattern;
  FacesContext facesContext = FacesContext.getCurrentInstance();
  BrowserSniffer browserSniffer = BrowserSnifferFactory.getBrowserSnifferInstance(
      facesContext.getExternalContext());
  if (browserSniffer.isMobile() && isNativeWhenMobile()) {
    datePattern = DEFAULT_HTML5_DATE_PATTERN;
  }
  else {
    datePattern = super.getPattern();
    if (datePattern == null) {
      // Provide a default datePattern based on the locale.
      Object locale = getLocale();
      datePattern = getDefaultDatePattern(locale);
    }
  }
  return datePattern;
}
origin: com.liferay.faces/com.liferay.faces.alloy

BrowserSniffer browserSniffer = BrowserSnifferFactory.getBrowserSnifferInstance(
    facesContext.getExternalContext());
String alloyBeginScript = AlloyRendererUtil.getAlloyBeginScript(sortedModules, null, browserSniffer);
origin: com.liferay.faces/com.liferay.faces.alloy

@Override
public void encodeMarkupBegin(FacesContext facesContext, UIComponent uiComponent) throws IOException {
  // Start the encoding of the outermost <div> element.
  ResponseWriter responseWriter = facesContext.getResponseWriter();
  String clientId = uiComponent.getClientId(facesContext);
  responseWriter.startElement("div", uiComponent);
  // Encode the "id" attribute on the outermost <div> element.
  responseWriter.writeAttribute("id", clientId, "id");
  // 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);
  BrowserSniffer browserSniffer = BrowserSnifferFactory.getBrowserSnifferInstance(
      facesContext.getExternalContext());
  InputDateTime inputDateTime = (InputDateTime) uiComponent;
  InputDateTimeResponseWriter inputDateTimeResponseWriter = getInputDateTimeResponseWriter(responseWriter,
      inputClientId, isNative(browserSniffer, inputDateTime));
  super.encodeMarkupBegin(facesContext, uiComponent, inputDateTimeResponseWriter);
}
origin: com.liferay.faces/com.liferay.faces.alloy

@Override
public void encodeJavaScriptCustom(FacesContext facesContext, UIComponent uiComponent) throws IOException {
  BrowserSniffer browserSniffer = BrowserSnifferFactory.getBrowserSnifferInstance(
      facesContext.getExternalContext());
  InputDate inputDate = (InputDate) uiComponent;
origin: com.liferay.faces/com.liferay.faces.alloy

BrowserSniffer browserSniffer = BrowserSnifferFactory.getBrowserSnifferInstance(
    facesContext.getExternalContext());
String alloyBeginScript = AlloyRendererUtil.getAlloyBeginScript(modules, null, browserSniffer);
origin: com.liferay.faces/com.liferay.faces.alloy

BrowserSniffer browserSniffer = BrowserSnifferFactory.getBrowserSnifferInstance(
    facesContext.getExternalContext());
origin: com.liferay.faces/com.liferay.faces.alloy

String clientId = uiComponent.getClientId(facesContext);
String inputClientId = clientId.concat(INPUT_SUFFIX);
BrowserSniffer browserSniffer = BrowserSnifferFactory.getBrowserSnifferInstance(
    facesContext.getExternalContext());
InputDateTime inputDateTime = (InputDateTime) uiComponent;
origin: com.liferay.faces/com.liferay.faces.alloy

protected void encodeFlashPlayer(FacesContext facesContext, ResponseWriter responseWriter, Media media,
  String mediaResourceURL) throws IOException {
  BrowserSniffer browserSniffer = BrowserSnifferFactory.getBrowserSnifferInstance(
      facesContext.getExternalContext());
  boolean browserIE = browserSniffer.isIe();
origin: com.liferay.faces/com.liferay.faces.alloy

/* package-private */ static void encodeJavaScriptBegin(FacesContext facesContext, UIComponent uiComponent, AlloyRenderer alloyRenderer,
  String[] modules, boolean sandboxed) throws IOException {
  ResponseWriter responseWriter = facesContext.getResponseWriter();
  if (sandboxed) {
    String yuiConfig = alloyRenderer.getYUIConfig(facesContext, responseWriter, uiComponent);
    BrowserSniffer browserSniffer = BrowserSnifferFactory.getBrowserSnifferInstance(
        facesContext.getExternalContext());
    String alloyBeginScript = AlloyRendererUtil.getAlloyBeginScript(modules, yuiConfig, browserSniffer);
    responseWriter.write(alloyBeginScript);
  }
  if (facesContext.getPartialViewContext().isAjaxRequest() && (uiComponent instanceof ClientComponent)) {
    ClientComponent clientComponent = (ClientComponent) uiComponent;
    String clientVarName = alloyRenderer.getClientVarName(facesContext, clientComponent);
    String clientKey = clientComponent.getClientKey();
    if (clientKey == null) {
      clientKey = clientVarName;
    }
    encodeLiferayComponentVar(responseWriter, clientVarName, clientKey);
    responseWriter.write("if(");
    responseWriter.write(clientVarName);
    responseWriter.write("){");
    responseWriter.write(clientVarName);
    responseWriter.write(".destroy();}");
  }
}
com.liferay.faces.util.clientBrowserSnifferFactorygetBrowserSnifferInstance

Popular methods of BrowserSnifferFactory

  • getBrowserSniffer
    Returns a new instance of BrowserSniffer. The returned instance is designed to be used during execut
  • getWrapped

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • getSharedPreferences (Context)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now