]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.export.core/src/org/simantics/export/core/intf/Format.java
ImportPdfReader now implements Closeable
[simantics/platform.git] / bundles / org.simantics.export.core / src / org / simantics / export / core / intf / Format.java
1 package org.simantics.export.core.intf;
2
3 import org.eclipse.jface.resource.ImageDescriptor;
4 import org.simantics.export.core.error.ExportException;
5
6 /**
7  * Description of a file format.
8  *
9  * @author toni.kalajainen@semantum.fi
10  */
11 public interface Format extends FormatClass {
12         
13         /**
14          * Format identifier
15          * @return format identifier
16          */
17         String id();
18         
19         /**
20          * File extension of this format
21          * @return
22          */
23         String fileext();
24         
25         /**
26          * Defines the writer class that the exporter extension will use for writing the content of this format.
27          * @return
28          * @throws ClassNotFoundException 
29          */
30         Class<?> writerClass() throws ClassNotFoundException;
31         
32         /**
33          * The class the importer will use for reading the associated content type.
34          * @return
35          * @throws ClassNotFoundException 
36          */
37         Class<?> readerClass() throws ClassNotFoundException;
38         
39         /**
40          * Create action factory for the file format.
41          * 
42          * @return action factory
43          * @throws ExportException 
44          */
45         FormatClass formatActions() throws ExportException;
46         
47         /**
48          * The label
49          * @return
50          */
51         String label();
52         
53         /**
54          * The label in plural form
55          * @return
56          */
57         String plural();
58         
59         /**
60          * Image descriptor
61          * @return
62          */
63         ImageDescriptor icon();
64         
65         /**
66          * Set to true, if the format supports merging of multiple items of content of one type.
67          * @return true if this is group format
68          */
69         boolean isGroupFormat();
70         
71         /**
72          * Set to true, if the format can contain multiple content items of any types.
73          * @return true if this is container format
74          */
75         boolean isContainerFormat();
76         
77         /**
78          * This attribute determines if the format is attachable to another format of group type.
79          * 
80          * @return true if this is attachable format.
81          */
82         boolean isAttachable();
83         
84         /**
85          * This property determines - if true - that the content must always be published and cannot be hidden inside container file.
86          * 
87          * @return if, true that the content must always be published and cannot be hidden inside container file.
88          */
89         boolean isAlwaysPublished();
90         
91         /**
92          * If true, this format is can contain links to other files.
93          * @return true, this format is can contain links to other files.
94          */
95         boolean isLinkContainer();
96         
97         /**
98          * The default selection for merge the group.
99          * @return
100          */
101         boolean mergeGroupFormatDefault();
102                 
103 }