public final class FileTemplateManagerImpl extends FileTemplateManager implements PersistentStateComponent<FileTemplateManagerImpl.State>
Modifier and Type | Class and Description |
---|---|
static class |
FileTemplateManagerImpl.State |
CODE_TEMPLATES_CATEGORY, DEFAULT_TEMPLATE_PROPERTIES, DEFAULT_TEMPLATES_CATEGORY, FILE_HEADER_TEMPLATE_NAME, INCLUDES_TEMPLATES_CATEGORY, INTERNAL_HTML_TEMPLATE_NAME, INTERNAL_HTML5_TEMPLATE_NAME, INTERNAL_TEMPLATES_CATEGORY, INTERNAL_XHTML_TEMPLATE_NAME, J2EE_TEMPLATES_CATEGORY, PROJECT_NAME_VARIABLE, RECENT_TEMPLATES_SIZE
Modifier and Type | Method and Description |
---|---|
void |
addRecentName(java.lang.String name) |
FileTemplate |
addTemplate(java.lang.String name,
java.lang.String extension)
Creates a new template with specified name, and adds it to the list of default templates.
|
protected FileTemplateManager |
checkInitialized() |
FileTemplate |
findInternalTemplate(java.lang.String templateName) |
FileTemplate [] |
getAllCodeTemplates() |
FileTemplate [] |
getAllJ2eeTemplates() |
FileTemplate [] |
getAllPatterns() |
FileTemplate [] |
getAllTemplates()
Returns all templates from "Default" category.
|
FileTemplate |
getCodeTemplate(java.lang.String templateName) |
FileTemplatesScheme |
getCurrentScheme() |
java.util.Properties |
getDefaultProperties() |
FileTemplate |
getDefaultTemplate(java.lang.String name)
Returns template with default (bundled) text.
|
java.net.URL |
getDefaultTemplateDescription() |
static FileTemplateManagerImpl |
getInstanceImpl(Project project) |
FileTemplate |
getInternalTemplate(java.lang.String templateName) |
FileTemplate [] |
getInternalTemplates() |
FileTemplate |
getJ2eeTemplate(java.lang.String templateName) |
FileTemplate |
getPattern(java.lang.String name) |
FileTemplatesScheme |
getProjectScheme() |
java.util.Collection<java.lang.String> |
getRecentNames() |
FileTemplateManagerImpl.State |
getState() |
FileTemplate |
getTemplate(java.lang.String templateName) |
FileTemplate [] |
getTemplates(java.lang.String category) |
java.lang.String |
internalTemplateToSubject(java.lang.String templateName) |
void |
loadState(FileTemplateManagerImpl.State state)
This method is called when new component state is loaded.
|
void |
removeTemplate(FileTemplate template) |
void |
saveAllTemplates() |
void |
setCurrentScheme(FileTemplatesScheme scheme) |
void |
setDefaultFileIncludeTemplateTextTemporarilyForTest(java.lang.String simpleName,
java.lang.String text,
Disposable parentDisposable) |
void |
setTemplates(java.lang.String templatesCategory,
java.util.Collection<? extends FileTemplate> templates) |
void |
setTestDate(java.util.Date testDate) |
getDefaultInstance, getDefaultProperties, getInstance, getInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeComponent, noStateLoaded
public static FileTemplateManagerImpl getInstanceImpl(Project project)
public FileTemplatesScheme getCurrentScheme()
getCurrentScheme
in class FileTemplateManager
public void setCurrentScheme(FileTemplatesScheme scheme)
setCurrentScheme
in class FileTemplateManager
protected FileTemplateManager checkInitialized()
checkInitialized
in class FileTemplateManager
public FileTemplatesScheme getProjectScheme()
getProjectScheme
in class FileTemplateManager
public FileTemplate [] getTemplates(java.lang.String category)
getTemplates
in class FileTemplateManager
public FileTemplate [] getAllTemplates()
FileTemplateManager
getAllTemplates
in class FileTemplateManager
public FileTemplate getTemplate(java.lang.String templateName)
getTemplate
in class FileTemplateManager
public FileTemplate addTemplate(java.lang.String name, java.lang.String extension)
FileTemplateManager
addTemplate
in class FileTemplateManager
public void removeTemplate(FileTemplate template)
removeTemplate
in class FileTemplateManager
public java.util.Properties getDefaultProperties()
getDefaultProperties
in class FileTemplateManager
public java.util.Collection<java.lang.String> getRecentNames()
getRecentNames
in class FileTemplateManager
public void addRecentName(java.lang.String name)
addRecentName
in class FileTemplateManager
public FileTemplate [] getInternalTemplates()
getInternalTemplates
in class FileTemplateManager
public FileTemplate getInternalTemplate(java.lang.String templateName)
getInternalTemplate
in class FileTemplateManager
public FileTemplate findInternalTemplate(java.lang.String templateName)
findInternalTemplate
in class FileTemplateManager
public java.lang.String internalTemplateToSubject(java.lang.String templateName)
internalTemplateToSubject
in class FileTemplateManager
public FileTemplate getCodeTemplate(java.lang.String templateName)
getCodeTemplate
in class FileTemplateManager
templateName
- template namepublic FileTemplate getJ2eeTemplate(java.lang.String templateName)
getJ2eeTemplate
in class FileTemplateManager
templateName
- template namepublic FileTemplate getDefaultTemplate(java.lang.String name)
FileTemplateManager
getDefaultTemplate
in class FileTemplateManager
public FileTemplate [] getAllPatterns()
getAllPatterns
in class FileTemplateManager
public FileTemplate getPattern(java.lang.String name)
getPattern
in class FileTemplateManager
public FileTemplate [] getAllCodeTemplates()
getAllCodeTemplates
in class FileTemplateManager
public FileTemplate [] getAllJ2eeTemplates()
getAllJ2eeTemplates
in class FileTemplateManager
public void setTemplates(java.lang.String templatesCategory, java.util.Collection<? extends FileTemplate> templates)
setTemplates
in class FileTemplateManager
public void saveAllTemplates()
saveAllTemplates
in class FileTemplateManager
public java.net.URL getDefaultTemplateDescription()
public void setTestDate(java.util.Date testDate)
public FileTemplateManagerImpl.State getState()
getState
in interface PersistentStateComponent<FileTemplateManagerImpl.State>
null
value indicates
that the returned state won't be stored, as a result previously stored state will be used.XmlSerializer
public void loadState(FileTemplateManagerImpl.State state)
PersistentStateComponent
State object should be used directly, defensive copying is not required.
loadState
in interface PersistentStateComponent<FileTemplateManagerImpl.State>
state
- loaded component stateXmlSerializerUtil.copyBean(Object, Object)
public void setDefaultFileIncludeTemplateTextTemporarilyForTest(java.lang.String simpleName, java.lang.String text, Disposable parentDisposable)