Package resources

# Class IconProvider

java.lang.Object
resources.IconProvider

public class IconProvider extends Object
A class that knows how to provide an icon and the URL for that icon. If `getUrl()` returns a non-null value, then that is the URL used to originally load the icon in this class.

If `getUrl()` returns null, then `getOrCreateUrl()` can be used to create a value URL by writing out the image for this class's icon.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IconProvider(Icon icon, URL url)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Image`
  `getImage()`
  `URL`
  `getOrCreateUrl()`
  Returns the value of `getUrl()` if it is non-null.
  `URL`
  `getUrl()`
  `boolean`
  `isInvalid()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### IconProvider

    public IconProvider(Icon icon, URL url)

- ## Method Details

  - ### getImage

    public Image getImage()

  - ### isInvalid

    public boolean isInvalid()

  - ### getUrl

    public URL getUrl()

  - ### getOrCreateUrl

    public URL getOrCreateUrl()
    Returns the value of `getUrl()` if it is non-null. Otherwise, this class will attempt to create a temporary file containing the image of this class in order to return a URL for that temp file. If a temporary file could not be created, then the URL returned from this class will point to the `default icon`.
    Returns:
      the URL