Exemplo n.º 1
0
  /**
   * Returns the language-dependent label with the given key. The search order is to look first in
   * the extension's <code>label</code> files and if the requested label is not found in the BlueJ
   * system <code>label</code> files. Extensions' labels are stored in a Property format and must be
   * jarred together with the extension. The path searched is equivalent to the bluej/lib/[language]
   * style used for the BlueJ system labels. E.g. to create a set of labels which can be used by
   * English, Italian and German users of an extension, the following files would need to be present
   * in the extension's Jar file:
   *
   * <pre>
   * lib/english/label
   * lib/italian/label
   * lib/german/label
   * </pre>
   *
   * The files named <code>label</code> would contain the actual label key/value pairs.
   *
   * @param key Description of the Parameter
   * @return The label value
   */
  public String getLabel(String key) {
    if (!myWrapper.isValid()) throw new ExtensionUnloadedException();

    // If there are no label for this extension I can only return the system ones.
    if (localLabels == null) return Config.getString(key, key);

    // In theory there are label for this extension let me try to get them
    String aLabel = localLabels.getProperty(key, null);

    // Found what I wanted, job done.
    if (aLabel != null) return aLabel;

    // ok, the only hope is to get it from the system
    return Config.getString(key, key);
  }
Exemplo n.º 2
0
 public static String getContinueLabel() {
   if (continueLabel == null) {
     continueLabel = Config.getString("continue");
   }
   return continueLabel;
 }
Exemplo n.º 3
0
 public static String getCancelLabel() {
   if (cancelLabel == null) {
     cancelLabel = Config.getString("cancel");
   }
   return cancelLabel;
 }
Exemplo n.º 4
0
 public static String getCloseLabel() {
   if (closeLabel == null) {
     closeLabel = Config.getString("close");
   }
   return closeLabel;
 }
Exemplo n.º 5
0
 public static String getOkLabel() {
   if (okayLabel == null) {
     okayLabel = Config.getString("okay");
   }
   return okayLabel;
 }