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 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