Enum Class PictureManager

java.lang.Object
java.lang.Enum<PictureManager>
com._1c.g5.v8.dt.md.resource.PictureManager
All Implemented Interfaces:
Serializable, Comparable<PictureManager>, Constable

public enum PictureManager extends Enum<PictureManager>
This is a common place for business logics related to CommonPicture or MdPicture as an IBmObject. It contains methods that control life cycle of the issue: loading, saving, setting new contents, and erasing current contents.
  • Enum Constant Details

  • Field Details

    • PICTURE_EXTENSIONS

      public static final String[] PICTURE_EXTENSIONS
  • Method Details

    • values

      public static PictureManager[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PictureManager valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • addListener

      public void addListener(PictureManager.IPictureListener listener)
      Adds a listener to this manager that will be notified when this manager's state changes.
      Parameters:
      listener - The listener to be added; must not be null.
    • removeListener

      public void removeListener(PictureManager.IPictureListener listener)
      Removes a listener from this manager.
      Parameters:
      listener - The listener to be removed; must not be null.
    • firePictureChange

      protected void firePictureChange(PictureDef picture)
      Fires a picture change event.
      Parameters:
      picture - - a picture that changed
    • setContents

      public void setContents(PictureDef picture, InputStream input, String extension) throws IOException
      Reads contents of the given inputStream and stores it inside picture. After a successful completion PictureDef#inputStream() will return the given contents.
      Parameters:
      picture - a PictureDef to set contents of
      file - a InputStream to get contents from
      input - contents
      extension - file extension used to identify image type
      Throws:
      IOException - in case of failure
    • deleteContents

      public void deleteContents(PictureDef picture) throws org.eclipse.core.runtime.CoreException
      Deletes the contents of the given picture. Also tries to remove the contents from the file system
      Throws:
      org.eclipse.core.runtime.CoreException
    • getExtension

      public static String getExtension(PictureDef picture)
      Returns stored picture extension
      Parameters:
      picture -
      Returns:
    • isMultiImage

      public static boolean isMultiImage(Picture picture)

      Is this picture object contain many images

      Parameters:
      picture - source picture object, cannot be null
      Returns:
      true if this picture contain many images