|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttemplates.library.TemplateLibrary
public class TemplateLibrary
Library of Templates.
| Constructor Summary | |
|---|---|
TemplateLibrary(java.io.File dir)
Create a new template library using the files in the given directory. |
|
| Method Summary | |
|---|---|
void |
addListener(TemplateLibraryListener listener)
Subscribe the given listener to receive notifications from this template library. |
void |
addTemplate(TemplateDescriptor td,
ides.api.model.fsa.FSAModel model)
Add a new template to the library, with the given properties and underlying model. |
protected void |
fireCollectionChanged()
Announce a change in the content of the template library to all subscribed listeners. |
Template |
getTemplate(java.lang.String name)
Retrieve the template with the given "ID". |
TemplateLibraryListener[] |
getTemplateLibraryListeners()
Returns all current subscribers to this template library. |
java.util.Collection<Template> |
getTemplates()
Retrieve the set of templates in the library. |
protected ides.api.model.fsa.FSAModel |
loadTemplateModel(java.io.File file)
Load the model of a template from the given file. |
void |
reloadTemplate(java.lang.String name)
Reload the given template from the file where the template is saved. |
void |
removeListener(TemplateLibraryListener listener)
Cancel the subscription the given listener to receive notifications from this template library. |
void |
removeTemplate(java.lang.String name)
Remove a template from the library and remove the file with the template from the directory of templates. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TemplateLibrary(java.io.File dir)
NoticeManager.
dir - the directory which contains the files where the models of the
templates in the library are saved| Method Detail |
|---|
public java.util.Collection<Template> getTemplates()
public Template getTemplate(java.lang.String name)
name - the "ID" of the template
null otherwiseTemplate.getName()
public void addTemplate(TemplateDescriptor td,
ides.api.model.fsa.FSAModel model)
throws java.io.IOException
td - the properties of the new templatemodel - the underlying model for the new template
java.io.IOException - when there is an IO problem while saving the new template
into a file
public void removeTemplate(java.lang.String name)
throws java.io.IOException
name - the "ID" of the template to be removed
java.io.IOException - when there is an IO problem while removing the file of the
template
public void reloadTemplate(java.lang.String name)
throws java.io.IOException
name - the "ID" of the template to be reloaded
java.io.IOException - when there is an IO problem while loading the template from
the file
protected ides.api.model.fsa.FSAModel loadTemplateModel(java.io.File file)
throws ides.api.plugin.io.FileLoadException
file - the file containing the template model
ides.api.plugin.io.FileLoadException - when the loading of the template model failed; the exception
may contain the partially-loaded modelTemplateDescriptorprotected void fireCollectionChanged()
public void addListener(TemplateLibraryListener listener)
listener - the listener to be subscribedpublic void removeListener(TemplateLibraryListener listener)
listener - the listener whose subscription is to be cancelledpublic TemplateLibraryListener[] getTemplateLibraryListeners()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||