|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectwave.templateMerge.gui.TemplateGuiModel
The behavior of the core TemplateGui screen. This class could easily be used as a nonvisual component integrated into any system.
TemplateGuiVIF
,
TemplateGui
Constructor Summary | |
TemplateGuiModel()
KnownTemplates is a collection of known MergeTemplates. |
|
TemplateGuiModel(KnownTemplates known)
|
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add yourself to be notified of property changes. |
protected void |
createTreeModel()
Using the KnownMergeTemplates found in 'workingTemplates', create a TreeModel. |
void |
dumpToText(java.io.BufferedWriter buff)
Write ascii code to the buffer containing the MergeTemplate definitions. |
void |
dumpToXML(java.io.BufferedWriter buff)
Write the templates into the the buffer of an XML file. |
java.lang.String |
getBufferForTemplate(java.lang.String selection,
boolean fullView)
Useful when displaying the way a template will look. |
java.lang.String |
getSelectedTemplateName()
The currently selected template. |
protected MergeTemplate |
getTemplateNamed(java.lang.String name)
Find the template object with the given name. |
javax.swing.tree.TreeModel |
getTemplateTreeModel()
Return the TreeModel. |
TokenProvider |
getTokenProvider()
The tokenProvider contains all of the information tokens that can used in the templates. |
KnownTemplates |
getWorkingTemplates()
|
void |
importFromText(java.io.BufferedReader buff)
Read ascii code from the buffer containing the MergeTemplate definitions. |
void |
importFromXML(java.io.Reader xmlFile)
Read ascii code from the buffer containing the MergeTemplate definitions. |
void |
loadModel()
Load the model from an ObjectStream. |
static void |
main(java.lang.String[] args)
Used to generate serialized files from text template definitions. |
void |
newModel()
Change the workingTemplatesInstance. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
Only called when our knownSourceTemplates have been modified. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
No longer listen for property change events. |
void |
requestNewTemplate()
Create a new template. |
void |
requestTemplateDelete()
Edit the selected template. |
void |
requestTemplateEdit()
Edit the selected template. |
void |
saveCurrentModel()
Using serialization, save the current templates. |
void |
setSelectedTemplateName(java.lang.String val)
Other operations will be selection dependent. |
void |
setTemplateGui(java.awt.Frame gui)
Sets the TemplateGui attribute of the TemplateGuiVIF object |
protected void |
setTemplateTreeModel(javax.swing.tree.TreeModel mod)
Used internally to change the model. |
void |
setTokenProvider(TokenProvider p)
A token provider is the source of the InformationToken objects. |
void |
setWorkingTemplates(KnownTemplates workingTemplates)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TemplateGuiModel()
public TemplateGuiModel(KnownTemplates known)
known
- KnownTemplates is a collection of known MergeTemplates.Method Detail |
public static void main(java.lang.String[] args)
args
- The command line argumentspublic void setSelectedTemplateName(java.lang.String val)
setSelectedTemplateName
in interface TemplateGuiVIF
val
- The new SelectedTemplateName valuerequestTemplateEdit()
public void setTemplateGui(java.awt.Frame gui)
TemplateGuiVIF
setTemplateGui
in interface TemplateGuiVIF
gui
- The new TemplateGui valuepublic void setTokenProvider(TokenProvider p)
setTokenProvider
in interface TemplateGuiVIF
p
- The new TokenProvider valuepublic void setWorkingTemplates(KnownTemplates workingTemplates)
workingTemplates
- The new WorkingTemplates valueprotected void setTemplateTreeModel(javax.swing.tree.TreeModel mod)
mod
- The new TemplateTreeModel valuepublic java.lang.String getBufferForTemplate(java.lang.String selection, boolean fullView)
getBufferForTemplate
in interface TemplateGuiVIF
selection
- The name of a known template.fullView
- Should subtemplates be expanded?
public java.lang.String getSelectedTemplateName()
getSelectedTemplateName
in interface TemplateGuiVIF
public javax.swing.tree.TreeModel getTemplateTreeModel()
getTemplateTreeModel
in interface TemplateGuiVIF
createTreeModel()
public TokenProvider getTokenProvider()
getTokenProvider
in interface TemplateGuiVIF
public KnownTemplates getWorkingTemplates()
protected MergeTemplate getTemplateNamed(java.lang.String name)
name
-
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
addPropertyChangeListener
in interface TemplateGuiVIF
l
- The feature to be added to the PropertyChangeListener attributesetTemplateTreeModel(javax.swing.tree.TreeModel)
public void dumpToText(java.io.BufferedWriter buff) throws java.io.IOException
dumpToText
in interface TemplateGuiVIF
buff
- The output buffer upon which to write the ascii version of the
templates.
java.io.IOException
- Any exceptions related to writing to the parameter.public void dumpToXML(java.io.BufferedWriter buff) throws ConfigurationException
dumpToXML
in interface TemplateGuiVIF
buff
- BufferedWriter The output buffer of an XML file
ConfigurationException
- Receive the exception from
MergeTemplateWriterpublic void importFromText(java.io.BufferedReader buff) throws java.io.IOException
importFromText
in interface TemplateGuiVIF
buff
-
java.io.IOException
dumpToText
public void importFromXML(java.io.Reader xmlFile) throws ConfigurationException
importFromXML
in interface TemplateGuiVIF
xmlFile
- FileReader The input stream of XML file
ConfigurationException
- If any error happens in the XML file
processingdumpToText
public void loadModel()
loadModel
in interface TemplateGuiVIF
public void newModel()
newModel
in interface TemplateGuiVIF
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
evt
- public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
removePropertyChangeListener
in interface TemplateGuiVIF
l
- public void requestNewTemplate()
requestNewTemplate
in interface TemplateGuiVIF
public void requestTemplateDelete()
requestTemplateDelete
in interface TemplateGuiVIF
public void requestTemplateEdit()
requestTemplateEdit
in interface TemplateGuiVIF
public void saveCurrentModel()
saveCurrentModel
in interface TemplateGuiVIF
protected void createTreeModel()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |