POGO Java Program


pogo.appli
Class EditPogoCode

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--pogo.appli.EditPogoCode

public class EditPogoCode
extends java.lang.Thread
implements PogoDefs

This class start an external editor to view/edit Pogo file source code.


Field Summary
private  java.lang.String editor
           
private  int lineNum
           
private  PogoClass pogo
          Pogo Class to be used for generation.
private  java.lang.String srcCode
           
private  java.lang.String srcFilename
           
 
Fields inherited from class java.lang.Thread
contextClassLoader, daemon, eetop, group, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadQ, values
 
Fields inherited from interface pogo.gene.PogoDefs
ALREADY_OVERRIDING, ATTR_IMAGE, ATTR_READ, ATTR_READ_WITH_WRITE, ATTR_READ_WRITE, ATTR_SCALAR, ATTR_SPECTRUM, ATTR_WRITE, AttrDataArray, AttrRWtypeArray, AttrTypeArray, authorRes, classDescRes, cppAddAttrib, cppAddCommands, cppExtention, cppFile, cppLang, dataCommands, dataExtention, dataFile, dataStartCmd, dataStartStates, endGeneTag, errDetected, javaAddAttrib, javaAddCommands, javaExtention, javaFile, javaLang, languageRes, NEW_STR, NOT_OVERRIDE, outputFiles, OVERRIDE, pageTitleRes, pogoLang, projectTitleRes, readAttrProto1, readAttrProto2, readAttrProto3, readFile, revisionRes, startGeneTag, STATE, statesDescRes, STATUS, Tango_ALARM, Tango_CLOSE, Tango_CONST_DEV_STRING, Tango_DISABLE, Tango_EXTRACT, Tango_FAULT, Tango_INSERT, Tango_MOVING, Tango_OFF, Tango_ON, Tango_OPEN, Tango_RUNNING, Tango_STANDBY, Tango_TYPE_UNKNOWN, Tango_UNKNOWN, Tango_WARMUP, TangoStatesArray, templateBlock, templateClass, templateClassCmd, templateCmd, templateExecuteCmd, templateFile, writeAttrProto, writeFile
 
Constructor Summary
EditPogoCode(PogoClass pogo)
          Constructors for EditPogoCode use.
 
Method Summary
 void run()
          Fork the editor an go to the line where target has been found.
private  int searchLineNumber(java.lang.String target)
          Serch the target string into source code and count the neumeber of lines.
 void setAttributeTarget()
          Search the attributes management method and start an editor.
 void setCommandTarget(java.lang.String cmdName)
          Search the execute command method and start an editor.
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pogo

private PogoClass pogo
Pogo Class to be used for generation.

srcFilename

private java.lang.String srcFilename

editor

private java.lang.String editor

srcCode

private java.lang.String srcCode

lineNum

private int lineNum
Constructor Detail

EditPogoCode

public EditPogoCode(PogoClass pogo)
             throws java.io.FileNotFoundException,
                    java.io.IOException,
                    PogoException
Constructors for EditPogoCode use.
Parameters:
pogo - Pogo Class definition used for editing.
Method Detail

searchLineNumber

private int searchLineNumber(java.lang.String target)
                      throws PogoException
Serch the target string into source code and count the neumeber of lines.
Parameters:
target - the string to search.
Returns:
the line nuber where target has been found.

setCommandTarget

public void setCommandTarget(java.lang.String cmdName)
                      throws java.io.FileNotFoundException,
                             java.io.IOException,
                             PogoException
Search the execute command method and start an editor.
Parameters:
cmdName - the command eecute method to be edited.
Throws:
java.io.FileNotFoundException - Source file not found.
PogoException - Method not found.
java.lang.InterruptedException - Forking editor failed.

setAttributeTarget

public void setAttributeTarget()
                        throws PogoException
Search the attributes management method and start an editor.
Throws:
java.io.FileNotFoundException - Source file not found.
PogoException - Method not found.
java.lang.InterruptedException - Forking editor failed.

run

public void run()
Fork the editor an go to the line where target has been found.
Overrides:
run in class java.lang.Thread

POGO Java Program