Tabnine Logo
ConstantsWithLookup
Code IndexAdd Tabnine to your IDE (free)

How to use
ConstantsWithLookup
in
com.google.gwt.i18n.client

Best Java code snippets using com.google.gwt.i18n.client.ConstantsWithLookup (Showing top 12 results out of 315)

origin: com.google.gwt/gwt-servlet

 public final String get(String key) {
  try {
   // Replace "." with "_" in the key to match what ConstantsImplCreator
   // does.
   return key == null ? null : messages.getString(key.replace(".", "_"));
  } catch (MissingResourceException e) {
   return null;
  }
 }
}
origin: net.wetheinter/gwt-user

 public final String get(String key) {
  try {
   // Replace "." with "_" in the key to match what ConstantsImplCreator
   // does.
   return key == null ? null : messages.getString(key.replace(".", "_"));
  } catch (MissingResourceException e) {
   return null;
  }
 }
}
origin: com.vaadin.external.gwt/gwt-user

 public final String get(String key) {
  try {
   // Replace "." with "_" in the key to match what ConstantsImplCreator
   // does.
   return key == null ? null : messages.getString(key.replace(".", "_"));
  } catch (MissingResourceException e) {
   return null;
  }
 }
}
origin: de.esoco/gewt

sValue = rStrings.getString(sKey);
origin: ManfredTremmel/gwt-bean-validators

 /**
  * get localized message for key.
  *
  * @param pkey key of message
  * @return localized text for the key
  */
 public final String get(final String pkey) {
  try {
   // Replace "." with "_" in the key to match what ConstantsImplCreator does.
   return pkey == null ? null : messages.getString(pkey.replace(".", "_"));
  } catch (final MissingResourceException e) {
   return null;
  }
 }
}
origin: fr.putnami.pwt/pwt

public String findMessage(Class<?> propertyType, String key) {
  if (key == null) {
    return null;
  }
  Class<?> typeToLookup = propertyType == null ? Object.class : propertyType;
  String label = null;
  while (typeToLookup != null && label == null) {
    try {
      ConstantsWithLookup constants = this.constantRegistry.get(typeToLookup);
      if (constants != null) {
        label = constants.getString(key);
      }
    } catch (MissingResourceException exc) {
      label = null;
    }
    typeToLookup = typeToLookup.getSuperclass();
  }
  return label;
}
origin: Putnami/putnami-web-toolkit

public String findMessage(Class<?> propertyType, String key) {
  if (key == null) {
    return null;
  }
  Class<?> typeToLookup = propertyType == null ? Object.class : propertyType;
  String label = null;
  while (typeToLookup != null && label == null) {
    try {
      ConstantsWithLookup constants = this.constantRegistry.get(typeToLookup);
      if (constants != null) {
        label = constants.getString(key);
      }
    } catch (MissingResourceException exc) {
      label = null;
    }
    typeToLookup = typeToLookup.getSuperclass();
  }
  return label;
}
origin: Putnami/putnami-web-toolkit

  private String getMessage(Throwable error, String suffix, String defaultMessage) {
    if (this.constants == null) {
      return defaultMessage;
    }
    try {
      String className = error.getClass().getSimpleName();
      if (error instanceof CommandException) {
        className = ((CommandException) error).getCauseSimpleClassName();
      }
      String methodName = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, className) + suffix;
      return this.constants.getString(methodName);
    } catch (MissingResourceException exc) {
      return defaultMessage;
    }
  }
}
origin: fr.putnami.pwt/pwt

  private String getMessage(Throwable error, String suffix, String defaultMessage) {
    if (this.constants == null) {
      return defaultMessage;
    }
    try {
      String className = error.getClass().getSimpleName();
      if (error instanceof CommandException) {
        className = ((CommandException) error).getCauseSimpleClassName();
      }
      String methodName = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, className) + suffix;
      return this.constants.getString(methodName);
    } catch (MissingResourceException exc) {
      return defaultMessage;
    }
  }
}
origin: fr.putnami.pwt/pwt

protected String getErrorMessage(StatusCodeException exception) {
  try {
    return this.constants.getString(this.constantsPrefix + exception.getStatusCode());
  } catch (MissingResourceException exc) {
    return exception.getStatusText();
  }
}
origin: Putnami/putnami-web-toolkit

protected String getErrorMessage(StatusCodeException exception) {
  try {
    return this.constants.getString(this.constantsPrefix + exception.getStatusCode());
  } catch (MissingResourceException exc) {
    return exception.getStatusText();
  }
}
origin: oVirt/ovirt-engine

  errorMsg = errorMsg.replace('.', '_');
String errorsString = errors.getString(errorMsg);
if (errorsString != null) {
  ret = errorsString.replace("\n", "<br/>"); //$NON-NLS-1$ //$NON-NLS-2$
com.google.gwt.i18n.clientConstantsWithLookup

Javadoc

Like com.google.gwt.i18n.client.Constants, a tag interface that facilitates locale-sensitive, compile-time binding of constant values supplied from properties files with the added ability to look up constants at runtime with a string key.

ConstantsWithLookup extends com.google.gwt.i18n.client.Constants and is identical in behavior, adding only a family of special-purpose lookup methods such as ConstantsWithLookup#getString(String).

It is generally preferable to extend Constants rather than ConstantsWithLookup because ConstantsWithLookup forces all constants to be retained in the compiled script, preventing the GWT compiler from pruning unused constant accessors.

Required Module

Modules that use this interface should inherit com.google.gwt.i18n.I18N. com/google/gwt/examples/i18n/InheritsExample.gwt.xml

Note

You should not directly implement this interface or interfaces derived from it since an implementation is generated automatically when message interfaces are created using com.google.gwt.core.client.GWT#create(Class).

Most used methods

  • getString
    Look up String by method name.

Popular in Java

  • Start an intent from android
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setScale (BigDecimal)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Permission (java.security)
    Legacy security code; do not use.
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JComboBox (javax.swing)
  • JPanel (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now