Interface IconProvider

All Known Implementing Classes:
AbstractResourceIconProvider

@NonNullByDefault public interface IconProvider
An icon provider can provide InputStreams for icons. The source of the images can depend on the provider implementation. The byte stream represents a PNG or SVG image, depending on the format. The icon category corresponds to the list of available channel categories. In order to provide means to user interfaces to know, what kind of icon sets are available in the system (and offered by some icon provider), the provider can additionally provide a set of IconSets.
Author:
Kai Kreuzer - Initial contribution
  • Method Details

    • getIconSets

      Set<IconSet> getIconSets()
      Returns a set of icon set definitions (meta-data) which this provider defines.
      Returns:
      a set of icon sets in the default locale
    • getIconSets

      Set<IconSet> getIconSets(@Nullable Locale locale)
      Returns a set of localized icon set definitions (meta-data) which this provider defines.
      Parameters:
      locale - the locale to use for the results
      Returns:
      a set of icon sets in the requested locale
    • hasIcon

      @Nullable Integer hasIcon(String category, String iconSetId, IconSet.Format format)
      determines whether this provider can deliver an icon for a given name
      Parameters:
      category - the icon category
      iconSetId - the id of the icon set for which the icon is requested
      format - the format of the stream (usually either png or svg)
      Returns:
      a non-negative Integer value defining the priority (higher is more important) or null, if this provider cannot deliver an icon. Default for full icon sets should be 0, so that others have the chance to override icons.
    • getIcon

      @Nullable InputStream getIcon(String category, String iconSetId, @Nullable String state, IconSet.Format format)
      retrieves the InputStream of an icon
      Parameters:
      category - the icon category
      iconSetId - the id of the icon set for which the icon is requested
      state - the string representation of the state (for the case that the icon differs for different states)
      format - the format of the stream (usually either png or svg)
      Returns:
      a byte stream of the icon in the given format or null, if no icon exists