public final class CodeTemplateManager extends Object
Modifier and Type | Method and Description |
---|---|
CodeTemplate |
createTemporary(String parametrizedText)
Create temporary code template for an ad hoc insertion.
|
static CodeTemplateManager |
get(Document doc)
Get an instance of the manager for the given document.
|
Collection<? extends CodeTemplate> |
getCodeTemplates()
Get unmodifiable collection of the code templates for this manager.
|
boolean |
isLoaded()
Check whether asynchronous loading of the code templates into this manager
was already finished.
|
void |
registerLoadedListener(ChangeListener listener)
Register change listener waiting for the state when this manager
becomes loaded with the code templates.
|
void |
waitLoaded()
Wait for this manager to become loaded with the code templates.
|
public static CodeTemplateManager get(Document doc)
doc
- document for which the instance of the manager should be obtained.public Collection<? extends CodeTemplate> getCodeTemplates()
public CodeTemplate createTemporary(String parametrizedText)
parametrizedText
- non-null parametrized text of the code template.public boolean isLoaded()
CodeTemplateManager.registerLoadedListener(ChangeListener)
public void waitLoaded()
public void registerLoadedListener(ChangeListener listener)
In case the manager is already loaded the registered listener will be fired immediately in the same thread.
There is no unregistration of the listeners because they are forgotten automatically once the manager becomes loaded.
listener
- change listener to be fired once this manager becomes loaded
by the code templates.