Package com._1c.g5.v8.dt.md.resource
Enum Class PictureManager
- All Implemented Interfaces:
Serializable
,Comparable<PictureManager>
,Constable
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Interface for listening for content changes on an picture.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(PictureManager.IPictureListener listener) Adds a listener to this manager that will be notified when this manager's state changes.void
deleteContents
(PictureDef picture) Deletes the contents of the givenpicture
.protected void
firePictureChange
(PictureDef picture) Fires a picture change event.static String
getExtension
(PictureDef picture) Returns stored picture extensionstatic boolean
isMultiImage
(Picture picture) Is this picture object contain many imagesvoid
Removes a listener from this manager.void
setContents
(PictureDef picture, InputStream input, String extension) Reads contents of the giveninputStream
and stores it insidepicture
.static PictureManager
Returns the enum constant of this class with the specified name.static PictureManager[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Field Details
-
PICTURE_EXTENSIONS
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
addListener
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 benull
.
-
removeListener
Removes a listener from this manager.- Parameters:
listener
- The listener to be removed; must not benull
.
-
firePictureChange
Fires a picture change event.- Parameters:
picture
- - a picture that changed
-
setContents
Reads contents of the giveninputStream
and stores it insidepicture
. After a successful completionPictureDef#inputStream()
will return the given contents.- Parameters:
picture
- aPictureDef
to set contents offile
- aInputStream
to get contents frominput
- contentsextension
- file extension used to identify image type- Throws:
IOException
- in case of failure
-
deleteContents
Deletes the contents of the givenpicture
. Also tries to remove the contents from the file system- Throws:
org.eclipse.core.runtime.CoreException
-
getExtension
Returns stored picture extension- Parameters:
picture
-- Returns:
-
isMultiImage
Is this picture object contain many images
- Parameters:
picture
- source picture object, cannot benull
- Returns:
true
if this picture contain many images
-