simkin.examples.dialog
Class ScriptedDialog
java.lang.Object
|
+--simkin.ExecutableRoot
|
+--simkin.XMLElementObject
|
+--simkin.XMLExecutable
|
+--simkin.examples.dialog.ScriptedDialog
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.util.EventListener, Executable
- public class ScriptedDialog
- extends XMLExecutable
- implements java.awt.event.ActionListener
This class shows how you can use Simkin to show dialogs described in script
Field Summary |
java.lang.String |
FileName
the name of the XML file |
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent e)
this method catches button clicks and calls methods |
void |
close()
This method closes the dialog - because it is public it can be called from Simkin scripts |
java.lang.String |
getText(java.lang.String name)
This method returns the text in a text control - because it is public it can be called from Simkin scripts |
static void |
main(java.lang.String[] args)
pick up the name of the dialog file from the command line, and then create an instance of ScriptedDialog from the XML file name |
void |
msgBox(java.lang.String str)
This method shows a message box - because it is public it can be called from Simkin scripts |
void |
reload()
this method makes the dialog reload itself from the XML stream |
void |
run(java.lang.String command)
This method runs a command - because it is public it can be called from Simkin scripts |
void |
setFocus(java.lang.String name)
This method sets the focus to a particular control - because it is public it can be called from Simkin scripts |
Methods inherited from class simkin.XMLElementObject |
copyItemsInto, dump, enumerate, enumerate, equals, findChild, findChild, findChild, getAttribute, getData, getElement, getValue, getValueAt, method, setAttribute, setData, setValue, setValueAt, toString |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
FileName
public java.lang.String FileName
- the name of the XML file
ScriptedDialog
public ScriptedDialog(java.lang.String fileName)
throws java.io.FileNotFoundException,
org.xml.sax.SAXException,
java.io.IOException
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- this method catches button clicks and calls methods
- Specified by:
actionPerformed
in interface java.awt.event.ActionListener
run
public void run(java.lang.String command)
- This method runs a command - because it is public it can be called from Simkin scripts
msgBox
public void msgBox(java.lang.String str)
- This method shows a message box - because it is public it can be called from Simkin scripts
reload
public void reload()
- this method makes the dialog reload itself from the XML stream
close
public void close()
- This method closes the dialog - because it is public it can be called from Simkin scripts
setFocus
public void setFocus(java.lang.String name)
- This method sets the focus to a particular control - because it is public it can be called from Simkin scripts
- Parameters:
name
- the control name
getText
public java.lang.String getText(java.lang.String name)
- This method returns the text in a text control - because it is public it can be called from Simkin scripts
- Parameters:
name
- the control name- Returns:
- the text in the control (or blank if the control is not a text control)
main
public static void main(java.lang.String[] args)
- pick up the name of the dialog file from the command line, and then create an instance of ScriptedDialog from the XML file name