public final class TemplateSettings extends java.lang.Object implements PersistentStateComponent<com.intellij.codeInsight.template.impl.TemplateSettings.State>
Modifier and Type | Class and Description |
---|---|
static class |
TemplateSettings.TemplateKey |
Modifier and Type | Field and Description |
---|---|
static char |
CUSTOM_CHAR |
static char |
DEFAULT_CHAR |
static char |
ENTER_CHAR |
static char |
NONE_CHAR |
static char |
SPACE_CHAR |
static char |
TAB_CHAR |
static java.lang.String |
TEMPLATE |
static java.lang.String |
USER_GROUP_NAME |
Constructor and Description |
---|
TemplateSettings() |
TemplateSettings(SchemeManagerFactory factory) |
Modifier and Type | Method and Description |
---|---|
void |
addTemplate(Template template) |
java.util.List<TemplateImpl> |
collectMatchingCandidates(java.lang.String key,
java.lang.Character shortcutChar,
boolean hasArgument) |
PluginInfo |
findPluginForPredefinedTemplate(TemplateImpl template) |
char |
getDefaultShortcutChar() |
TemplateImpl |
getDefaultTemplate(TemplateImpl t) |
java.util.List<TemplateSettings.TemplateKey> |
getDeletedTemplates() |
static TemplateSettings |
getInstance() |
java.lang.String |
getLastSelectedTemplateGroup() |
java.lang.String |
getLastSelectedTemplateKey() |
int |
getMaxKeyLength() |
char |
getShortcutChar(TemplateImpl template) |
com.intellij.codeInsight.template.impl.TemplateSettings.State |
getState() |
TemplateImpl |
getTemplate(java.lang.String key,
java.lang.String group) |
Template |
getTemplateById(java.lang.String id) |
java.util.List<TemplateGroup> |
getTemplateGroups() |
TemplateImpl[] |
getTemplates() |
java.util.Collection<TemplateImpl> |
getTemplates(java.lang.String key) |
java.util.Collection<? extends TemplateImpl> |
getTemplatesAsList() |
void |
loadState(com.intellij.codeInsight.template.impl.TemplateSettings.State state)
This method is called when new component state is loaded.
|
static TemplateImpl |
readTemplateFromElement(java.lang.String groupName,
Element element,
java.lang.ClassLoader classLoader) |
void |
removeTemplate(Template template) |
void |
reset() |
static Element |
serializeTemplate(TemplateImpl template,
TemplateImpl defaultTemplate,
<any> idToType) |
void |
setDefaultShortcutChar(char defaultShortcutChar) |
void |
setLastSelectedTemplate(java.lang.String group,
java.lang.String key) |
void |
setTemplates(java.util.List<? extends TemplateGroup> newGroups) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeComponent, noStateLoaded
public static final java.lang.String USER_GROUP_NAME
public static final java.lang.String TEMPLATE
public static final char SPACE_CHAR
public static final char TAB_CHAR
public static final char ENTER_CHAR
public static final char DEFAULT_CHAR
public static final char CUSTOM_CHAR
public static final char NONE_CHAR
public TemplateSettings()
public TemplateSettings(SchemeManagerFactory factory)
public static TemplateSettings getInstance()
public TemplateImpl getDefaultTemplate(TemplateImpl t)
public com.intellij.codeInsight.template.impl.TemplateSettings.State getState()
getState
in interface PersistentStateComponent<com.intellij.codeInsight.template.impl.TemplateSettings.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(com.intellij.codeInsight.template.impl.TemplateSettings.State state)
PersistentStateComponent
State object should be used directly, defensive copying is not required.
loadState
in interface PersistentStateComponent<com.intellij.codeInsight.template.impl.TemplateSettings.State>
state
- loaded component stateXmlSerializerUtil.copyBean(Object, Object)
public java.lang.String getLastSelectedTemplateKey()
public java.lang.String getLastSelectedTemplateGroup()
public void setLastSelectedTemplate(java.lang.String group, java.lang.String key)
public java.util.Collection<? extends TemplateImpl> getTemplatesAsList()
public TemplateImpl[] getTemplates()
public char getDefaultShortcutChar()
public void setDefaultShortcutChar(char defaultShortcutChar)
public java.util.Collection<TemplateImpl> getTemplates(java.lang.String key)
public TemplateImpl getTemplate(java.lang.String key, java.lang.String group)
public Template getTemplateById(java.lang.String id)
public int getMaxKeyLength()
public void addTemplate(Template template)
public void removeTemplate(Template template)
public PluginInfo findPluginForPredefinedTemplate(TemplateImpl template)
public static TemplateImpl readTemplateFromElement(java.lang.String groupName, Element element, java.lang.ClassLoader classLoader)
public static Element serializeTemplate(TemplateImpl template, TemplateImpl defaultTemplate, <any> idToType)
public void setTemplates(java.util.List<? extends TemplateGroup> newGroups)
public java.util.List<TemplateGroup> getTemplateGroups()
public java.util.List<TemplateImpl> collectMatchingCandidates(java.lang.String key, java.lang.Character shortcutChar, boolean hasArgument)
public char getShortcutChar(TemplateImpl template)
public java.util.List<TemplateSettings.TemplateKey> getDeletedTemplates()
public void reset()