Exemple #1
0
  /**
   * Sets one of this object's properties using the associated key. If the value has changed, a
   * <code>PropertyChangeEvent</code> is sent to listeners.
   *
   * @param key a <code>String</code> containing the key.
   * @param value an <code>Object</code> value.
   */
  public void putValue(String key, Object value) {
    if (iconName != null && Action.SMALL_ICON.equals(key)) {
      iconName = null;
    }

    super.putValue(key, value);
  }
Exemple #2
0
  /**
   * Gets one of this object's properties using the associated key.
   *
   * @param key the name of the property.
   * @return the value of the property.
   * @see #putValue(String, Object)
   */
  public Object getValue(String key) {
    if (iconName != null && Action.SMALL_ICON.equals(key)) {
      Icon icon = ResourceLoaderWrapper.lookupIcon(iconName);

      if (icon != null) {
        putValue(Action.SMALL_ICON, icon);
      } else {
        LOG.warn(
            "Requested icon for: "
                + getClass()
                + ". \nIcon not found: "
                + iconName
                + "\nLocalization:"
                + Translator.localize(iconName));
      }
      iconName = null;
    }
    return super.getValue(key);
  }