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

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

Best Java code snippets using com.liferay.faces.util.client.BrowserSnifferFactory (Showing top 20 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

/**
 * 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}.
 *
 * @param  externalContext  The external context associated with the current faces context. It is needed in order
 *                          for the {@link FactoryExtensionFinder} to be able to find the factory.
 *
 * @since  3.1
 * @since  2.1
 * @since  1.1
 */
public static BrowserSniffer getBrowserSnifferInstance(ExternalContext externalContext) {
  BrowserSnifferFactory browserSnifferFactory = (BrowserSnifferFactory) FactoryExtensionFinder.getFactory(
      externalContext, BrowserSnifferFactory.class);
  return browserSnifferFactory.getBrowserSniffer(externalContext);
}
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.bridge.ext

  private BrowserSnifferFactory getFirstNonBridgeBrowserSnifferFactory() {

    BrowserSnifferFactory firstNonBridgeBrowserSnifferFactory = wrappedBrowserSnifferFactory;

    while (firstNonBridgeBrowserSnifferFactory.getClass().getName().startsWith("com.liferay.faces.bridge")) {
      firstNonBridgeBrowserSnifferFactory = firstNonBridgeBrowserSnifferFactory.getWrapped();
    }

    return firstNonBridgeBrowserSnifferFactory;
  }
}
origin: com.liferay.faces/liferay-faces-alloy

@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());
  InputTime inputTime = (InputTime) uiComponent;
  if (isNative(browserSniffer, inputTime)) {
    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: liferay/liferay-faces

@Override
public PartialResponseWriter getPartialResponseWriter() {
  if (partialResponseWriter == null) {
    BrowserSnifferFactory browserSnifferFactory = (BrowserSnifferFactory) FactoryExtensionFinder.getFactory(
        BrowserSnifferFactory.class);
    FacesContext facesContext = FacesContext.getCurrentInstance();
    BrowserSniffer browserSniffer = browserSnifferFactory.getBrowserSniffer(facesContext.getExternalContext());
    partialResponseWriter = new PartialResponseWriterAlloyImpl(super.getPartialResponseWriter(),
        browserSniffer);
  }
  return partialResponseWriter;
}
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/liferay-faces-alloy

@Override
public PartialResponseWriter getPartialResponseWriter() {
  if (partialResponseWriter == null) {
    BrowserSnifferFactory browserSnifferFactory = (BrowserSnifferFactory) FactoryExtensionFinder.getFactory(
        BrowserSnifferFactory.class);
    FacesContext facesContext = FacesContext.getCurrentInstance();
    BrowserSniffer browserSniffer = browserSnifferFactory.getBrowserSniffer(facesContext.getExternalContext());
    partialResponseWriter = new PartialResponseWriterAlloyImpl(super.getPartialResponseWriter(),
        browserSniffer);
  }
  return partialResponseWriter;
}
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: liferay/liferay-faces

@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 (isNative(browserSniffer, inputDate)) {
    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/liferay-faces-alloy

@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 (isNative(browserSniffer, inputDate)) {
    alloyClassName = alloyClassName.concat("Native");
  }
  return alloyClassName;
}
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/liferay-faces-alloy

protected String[] getModules(String[] defaultModules, FacesContext facesContext, UIComponent uiComponent) {
  List<String> modules = new ArrayList<String>();
  BrowserSnifferFactory browserSnifferFactory = (BrowserSnifferFactory) FactoryExtensionFinder.getFactory(
      BrowserSnifferFactory.class);
  BrowserSniffer browserSniffer = browserSnifferFactory.getBrowserSniffer(facesContext.getExternalContext());
  InputDateTime inputDateTime = (InputDateTime) uiComponent;
  if (isNative(browserSniffer, inputDateTime)) {
    String nativeAlloyModuleName = defaultModules[0].concat("-native");
    modules.add(nativeAlloyModuleName);
  }
  else {
    modules.addAll(Arrays.asList(defaultModules));
    Map<String, List<ClientBehavior>> clientBehaviorMap = inputDateTime.getClientBehaviors();
    List<ClientBehavior> valueChangeClientBehaviors = clientBehaviorMap.get(VALUE_CHANGE);
    if ((valueChangeClientBehaviors != null) && !valueChangeClientBehaviors.isEmpty()) {
      modules.add(NODE_EVENT_SIMULATE);
    }
    modules = getModules(Collections.unmodifiableList(modules), facesContext, inputDateTime);
  }
  return modules.toArray(new String[] {});
}
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: liferay/liferay-faces

@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());
  InputTime inputTime = (InputTime) uiComponent;
  if (isNative(browserSniffer, inputTime)) {
    alloyClassName = alloyClassName.concat("Native");
  }
  return alloyClassName;
}
origin: com.liferay.faces/com.liferay.faces.util

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

protected String[] getModules(String[] defaultModules, FacesContext facesContext, UIComponent uiComponent) {
  List<String> modules = new ArrayList<String>();
  BrowserSnifferFactory browserSnifferFactory = (BrowserSnifferFactory) FactoryExtensionFinder.getFactory(
      BrowserSnifferFactory.class);
  BrowserSniffer browserSniffer = browserSnifferFactory.getBrowserSniffer(facesContext.getExternalContext());
  InputDateTime inputDateTime = (InputDateTime) uiComponent;
  if (isNative(browserSniffer, inputDateTime)) {
    String nativeAlloyModuleName = defaultModules[0].concat("-native");
    modules.add(nativeAlloyModuleName);
  }
  else {
    modules.addAll(Arrays.asList(defaultModules));
    Map<String, List<ClientBehavior>> clientBehaviorMap = inputDateTime.getClientBehaviors();
    List<ClientBehavior> valueChangeClientBehaviors = clientBehaviorMap.get(VALUE_CHANGE);
    if ((valueChangeClientBehaviors != null) && !valueChangeClientBehaviors.isEmpty()) {
      modules.add(NODE_EVENT_SIMULATE);
    }
    modules = getModules(Collections.unmodifiableList(modules), facesContext, inputDateTime);
  }
  return modules.toArray(new String[] {});
}
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/liferay-faces-alloy

@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 (!isNative(browserSniffer, inputDate)) {
    encodeCalendar(facesContext, responseWriter, inputDate, first);
    first = false;
    encodeHiddenAttributesInputDateTime(facesContext, responseWriter, inputDate, first);
    first = false;
  }
}
com.liferay.faces.util.clientBrowserSnifferFactory

Most used methods

  • getBrowserSniffer
    Returns a new instance of BrowserSniffer. The returned instance is designed to be used during execut
  • getBrowserSnifferInstance
    Returns a new instance of BrowserSniffer from the BrowserSnifferFactory found by the FactoryExtensio
  • getWrapped

Popular in Java

  • Finding current android device location
  • startActivity (Activity)
  • scheduleAtFixedRate (Timer)
  • onCreateOptionsMenu (Activity)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JList (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
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