Class TemplateManager
- java.lang.Object
- 
- com.inductiveautomation.factorypmi.application.model.TemplateManager
 
- 
 public class TemplateManager extends java.lang.Object
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classTemplateManager.InstanceCache
 - 
Field SummaryFields Modifier and Type Field Description static java.lang.StringGLOBAL_TEMPLATE_PREFIXstatic ResourceTypeRESOURCE_TYPE
 - 
Constructor SummaryConstructors Constructor Description TemplateManager(ClientContext context)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTemplateListener(ResourcePath templateId, TemplateListener listener)voidapply(java.util.List<? extends ChangeOperation> changes)Modifies the stored instances of the templates based on a supplied change set.static java.lang.StringconvertLegacyPath(java.lang.String templatePath)Detects whether the given path starts with [shared] or not.com.google.common.collect.Multimap<DataTypeEx,java.lang.String>getDropTargetTemplates()Calculates a map of all templates that have a drop target property defined, organized by drop target typeResourcePathgetId(java.lang.String templatePath)Returns a ResourcePath using the given templatePath.TemplateInfogetTemplateInfo(java.lang.String path)VisionTemplategetTemplateInstance(java.lang.String templatePath)java.awt.image.BufferedImagegetTemplateThumbnail(java.lang.String templatePath)static voidinitDeserializedTemplate(ResourcePath path, TemplateInfo info, VisionTemplate template)booleanisTemplateValid(VisionTemplate template)Whether or not this template's info is mapped, possibly removed due to an updatevoidpopCache()voidpushCache(TemplateManager.InstanceCache cache)voidremoveTemplateListener(ResourcePath templateId, TemplateListener listener)voidshutdown()Performs any necessary shutdown tasks for the TemplateManager.
 
- 
- 
- 
Field Detail- 
RESOURCE_TYPEpublic static final ResourceType RESOURCE_TYPE 
 - 
GLOBAL_TEMPLATE_PREFIXpublic static final java.lang.String GLOBAL_TEMPLATE_PREFIX - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
TemplateManagerpublic TemplateManager(ClientContext context) 
 
- 
 - 
Method Detail- 
pushCachepublic void pushCache(TemplateManager.InstanceCache cache) 
 - 
popCachepublic void popCache() 
 - 
addTemplateListenerpublic void addTemplateListener(ResourcePath templateId, TemplateListener listener) 
 - 
removeTemplateListenerpublic void removeTemplateListener(ResourcePath templateId, TemplateListener listener) 
 - 
convertLegacyPathpublic static java.lang.String convertLegacyPath(java.lang.String templatePath) Detects whether the given path starts with [shared] or not.- Returns:
- a modified path pointing to a parent "shared" folder
 
 - 
initDeserializedTemplatepublic static void initDeserializedTemplate(ResourcePath path, TemplateInfo info, VisionTemplate template) 
 - 
getIdpublic ResourcePath getId(java.lang.String templatePath) Returns a ResourcePath using the given templatePath. Corrects for legacy [global] paths. Will return null if the path specified doesn't exist in the project.
 - 
applypublic void apply(java.util.List<? extends ChangeOperation> changes) Modifies the stored instances of the templates based on a supplied change set.
 - 
getTemplateInstancepublic VisionTemplate getTemplateInstance(java.lang.String templatePath) throws TemplateNotFoundException, SerializationException 
 - 
isTemplateValidpublic boolean isTemplateValid(VisionTemplate template) Whether or not this template's info is mapped, possibly removed due to an update
 - 
getTemplateThumbnailpublic java.awt.image.BufferedImage getTemplateThumbnail(java.lang.String templatePath) 
 - 
getDropTargetTemplatespublic com.google.common.collect.Multimap<DataTypeEx,java.lang.String> getDropTargetTemplates() Calculates a map of all templates that have a drop target property defined, organized by drop target type
 - 
shutdownpublic void shutdown() Performs any necessary shutdown tasks for the TemplateManager.
 - 
getTemplateInfopublic TemplateInfo getTemplateInfo(java.lang.String path) throws TemplateNotFoundException, SerializationException 
 
- 
 
-