net.sourceforge.transmogrify.hook
Class Hook

java.lang.Object
  |
  +--net.sourceforge.transmogrify.hook.Hook
Direct Known Subclasses:
HookImpl

public abstract class Hook
extends java.lang.Object


Constructor Summary
Hook()
           
 
Method Summary
 void clearFiles()
           
abstract  void deSelectText()
          Deselects text
abstract  void displayException(java.lang.Exception e, java.lang.String description)
           
abstract  void displayMessage(java.lang.String title, java.lang.String message)
           
abstract  int getCaretLineNumber()
          Returns the 1 based line number of where the cursor is.
abstract  int getCaretOffset()
          Returns the 1 based offset of where the cursor is.
abstract  int getCaretPos()
          Returns the 0 based position of where the cursor is.
abstract  java.lang.String getCurrentFile()
          Gets the file name of the currently focused file.
 java.util.Set getDirtyFiles()
           
abstract  java.io.File[] getFiles()
          Returns an array of files selected by the user
abstract  java.lang.String getLine(int lineNumber)
          Retrieves a line from the focused file.
 java.util.Iterator getParsedFiles()
           
abstract  java.util.Enumeration getSelectedLines()
          Returns the selected lines in an Enumeration
abstract  java.lang.String getSelectedText()
          Returns the selected text in the form of a String
abstract  int getSelectionEnd()
           
abstract  int getSelectionStart()
           
 net.sourceforge.transmogrify.symtab.SymbolTable getSymbolTable()
           
abstract  java.lang.String getText()
          Returns the entire focused source file
abstract  java.lang.String getUserInput(java.lang.String prompt, java.lang.String title)
          Prompts for and returns user input
 void killParseThread()
           
 net.sourceforge.transmogrify.symtab.Occurrence makeOccurrence()
          makes an Occurrence based on the cursor position in the current file
abstract  void openFile(java.lang.String sourceFileName)
          Sets focus to specified java source file
 void parseFiles()
           
 void parseFiles(java.io.File[] files)
           
 void reparseFiles()
           
abstract  void selectText(int startPos, int endPos)
          Selects a bunch of text.
abstract  void selectText(int startLineNumber, int startOffset, int endLineNumber, int endOffset)
          Selects a bunch of text.
abstract  void setCaretPos(int pos)
          Sets the 0 based position of where the cursor is.
abstract  void setCaretPos(int lineNumber, int offset)
          Sets the 0 based position of where the cursor is.
 void showReferences(net.sourceforge.transmogrify.symtab.IDefinition definition)
          Displays a list of references.
abstract  void showReferencesNonsourced(net.sourceforge.transmogrify.symtab.IDefinition defintion)
           
abstract  void showReferencesSourced(net.sourceforge.transmogrify.symtab.IDefinition definition)
           
 void spawnParseThread()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hook

public Hook()
Method Detail

getParsedFiles

public java.util.Iterator getParsedFiles()

makeOccurrence

public net.sourceforge.transmogrify.symtab.Occurrence makeOccurrence()
                                                              throws java.lang.Exception
makes an Occurrence based on the cursor position in the current file

showReferences

public void showReferences(net.sourceforge.transmogrify.symtab.IDefinition definition)
Displays a list of references.
Parameters:
references - The list of references to be displayed.

showReferencesSourced

public abstract void showReferencesSourced(net.sourceforge.transmogrify.symtab.IDefinition definition)

showReferencesNonsourced

public abstract void showReferencesNonsourced(net.sourceforge.transmogrify.symtab.IDefinition defintion)

openFile

public abstract void openFile(java.lang.String sourceFileName)
                       throws java.lang.Exception
Sets focus to specified java source file
Parameters:
sourceFileName - fully qualified or relative java source file name
Throws:
java.lang.Exception - thrown on any type of error

getFiles

public abstract java.io.File[] getFiles()
                                 throws java.lang.Exception
Returns an array of files selected by the user
Returns:
the selected files

getCurrentFile

public abstract java.lang.String getCurrentFile()
                                         throws java.lang.Exception
Gets the file name of the currently focused file.
Returns:
focused file name
Throws:
java.lang.Exception - thrown on any type of error

getUserInput

public abstract java.lang.String getUserInput(java.lang.String prompt,
                                              java.lang.String title)
                                       throws java.lang.Exception
Prompts for and returns user input
Parameters:
prompt - question to ask the user
title - summary of the prompt
Returns:
String entered from user
Throws:
java.lang.Exception - thrown on any type of error

displayMessage

public abstract void displayMessage(java.lang.String title,
                                    java.lang.String message)
                             throws java.lang.Exception

displayException

public abstract void displayException(java.lang.Exception e,
                                      java.lang.String description)

getText

public abstract java.lang.String getText()
                                  throws java.lang.Exception
Returns the entire focused source file
Returns:
String of file
Throws:
java.lang.Exception - thrown on any type of error

getLine

public abstract java.lang.String getLine(int lineNumber)
                                  throws java.lang.Exception
Retrieves a line from the focused file.
Parameters:
lineNumber - the line you wish to retrieve
Throws:
java.lang.Exception - thrown on any type of error

selectText

public abstract void selectText(int startLineNumber,
                                int startOffset,
                                int endLineNumber,
                                int endOffset)
                         throws java.lang.Exception
Selects a bunch of text.
Throws:
java.lang.Exception - thrown on any type of error

selectText

public abstract void selectText(int startPos,
                                int endPos)
                         throws java.lang.Exception
Selects a bunch of text.
Throws:
java.lang.Exception - thrown on any type of error

deSelectText

public abstract void deSelectText()
                           throws java.lang.Exception
Deselects text
Throws:
java.lang.Exception - thrown on any type of error

getSelectedText

public abstract java.lang.String getSelectedText()
                                          throws java.lang.Exception
Returns the selected text in the form of a String
Returns:
String the selected text.
Throws:
java.lang.Exception - thrown on any type of error

getSelectedLines

public abstract java.util.Enumeration getSelectedLines()
                                                throws java.lang.Exception
Returns the selected lines in an Enumeration
Returns:
Enumeration the selected lines
Throws:
java.lang.Exception - thrown on any type of error

getCaretLineNumber

public abstract int getCaretLineNumber()
                                throws java.lang.Exception
Returns the 1 based line number of where the cursor is.
Returns:
int the line number that the cursor is on.
Throws:
java.lang.Exception - thrown on any type of error

getCaretOffset

public abstract int getCaretOffset()
                            throws java.lang.Exception
Returns the 1 based offset of where the cursor is.
Returns:
int the offset of where on the line the cursor is.
Throws:
java.lang.Exception - thrown on any type of error

getCaretPos

public abstract int getCaretPos()
                         throws java.lang.Exception
Returns the 0 based position of where the cursor is.
Returns:
int the position of where the cursor is in terms of total characters
Throws:
java.lang.Exception - thrown on any type of error

getSelectionStart

public abstract int getSelectionStart()
                               throws java.lang.Exception

getSelectionEnd

public abstract int getSelectionEnd()
                             throws java.lang.Exception

setCaretPos

public abstract void setCaretPos(int lineNumber,
                                 int offset)
                          throws java.lang.Exception
Sets the 0 based position of where the cursor is.
Throws:
java.lang.Exception - thrown on any type of error

setCaretPos

public abstract void setCaretPos(int pos)
                          throws java.lang.Exception
Sets the 0 based position of where the cursor is.
Throws:
java.lang.Exception - thrown on any type of error

reparseFiles

public void reparseFiles()
                  throws java.lang.Exception

parseFiles

public void parseFiles()
                throws java.io.FileNotFoundException

parseFiles

public void parseFiles(java.io.File[] files)
                throws java.lang.Exception

clearFiles

public void clearFiles()

getSymbolTable

public net.sourceforge.transmogrify.symtab.SymbolTable getSymbolTable()

getDirtyFiles

public java.util.Set getDirtyFiles()

spawnParseThread

public void spawnParseThread()

killParseThread

public void killParseThread()