X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.export.core%2Fsrc%2Forg%2Fsimantics%2Fexport%2Fcore%2Fintf%2FContentType.java;fp=bundles%2Forg.simantics.export.core%2Fsrc%2Forg%2Fsimantics%2Fexport%2Fcore%2Fintf%2FContentType.java;h=5aec810fe13e1de24c4ef2f8c13f12897482f3fd;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.export.core/src/org/simantics/export/core/intf/ContentType.java b/bundles/org.simantics.export.core/src/org/simantics/export/core/intf/ContentType.java new file mode 100644 index 000000000..5aec810fe --- /dev/null +++ b/bundles/org.simantics.export.core/src/org/simantics/export/core/intf/ContentType.java @@ -0,0 +1,64 @@ +package org.simantics.export.core.intf; + +import java.util.Collection; +import java.util.Map; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.simantics.export.core.ExportContext; +import org.simantics.export.core.error.ExportException; + +/** + * Content Type extension + * + * @author toni.kalajainen@semantum.fi + */ +public interface ContentType extends ContentTypeAction { + + /** + * The identifier for the content type. + * @return + */ + String id(); + + /** + * The ui label for the content type. + * @return + */ + String label(); + + /** + * The ui label for the content type in plural. + * @return + */ + String plural(); + + /** + * Content-based icon for a content entity of this content type. + * @param content + * @return + */ + ImageDescriptor icon(String contentUri); + + /** + * Fixed icon for the content type + * @return (Optional) icon + */ + ImageDescriptor icon(); + + /** + * Returns true if the content type is a model type. + * @return + */ + boolean isModel(); + + /** + * Read labels for a collection of contents + * + * @param ctx + * @param contents + * @return labels + * @throws ExportException if failed to get a label + */ + Map getLabels( ExportContext ctx, Collection contents ) throws ExportException; + +}