]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.export.core/src/org/simantics/export/core/intf/ContentType.java
ImportPdfReader now implements Closeable
[simantics/platform.git] / bundles / org.simantics.export.core / src / org / simantics / export / core / intf / ContentType.java
1 package org.simantics.export.core.intf;
2
3 import java.util.Collection;
4 import java.util.Map;
5
6 import org.eclipse.jface.resource.ImageDescriptor;
7 import org.simantics.export.core.ExportContext;
8 import org.simantics.export.core.error.ExportException;
9
10 /**
11  * Content Type extension
12  *
13  * @author toni.kalajainen@semantum.fi
14  */
15 public interface ContentType extends ContentTypeAction {
16         
17         /**
18          * The identifier for the content type. 
19          * @return
20          */
21         String id();
22         
23         /**
24          * The ui label for the content type.
25          * @return
26          */
27         String label();
28         
29         /**
30          * The ui label for the content type in plural.
31          * @return
32          */
33         String plural();
34
35         /**
36          * Content-based icon for a content entity of this content type.
37          * @param content
38          * @return
39          */
40         ImageDescriptor icon(String contentUri);
41
42         /**
43          * Fixed icon for the content type
44          * @return (Optional) icon
45          */
46         ImageDescriptor icon();         
47
48         /**
49          * Returns true if the content type is a model type.
50          * @return
51          */
52         boolean isModel();
53
54         /**
55          * Read labels for a collection of contents
56          * 
57          * @param ctx 
58          * @param contents
59          * @return labels
60          * @throws ExportException if failed to get a label
61          */
62         Map<String, String> getLabels( ExportContext ctx, Collection<String> contents ) throws ExportException;
63
64 }