net.sourceforge.transmogrify.hook
Class HookImpl

java.lang.Object
  |
  +--net.sourceforge.transmogrify.hook.Hook
        |
        +--net.sourceforge.transmogrify.hook.HookImpl

public class HookImpl
extends Hook


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

Constructor Detail

HookImpl

public HookImpl()
Method Detail

showReferencesSourced

public void showReferencesSourced(net.sourceforge.transmogrify.symtab.IDefinition definition)
Overrides:
showReferencesSourced in class Hook

showReferencesNonsourced

public void showReferencesNonsourced(net.sourceforge.transmogrify.symtab.IDefinition defintion)
Overrides:
showReferencesNonsourced in class Hook

openFile

public void openFile(java.lang.String sourceFileName)
Description copied from class: Hook
Sets focus to specified java source file
Overrides:
openFile in class Hook
Following copied from class: net.sourceforge.transmogrify.hook.Hook
Parameters:
sourceFileName - fully qualified or relative java source file name
Throws:
java.lang.Exception - thrown on any type of error

getFiles

public java.io.File[] getFiles()
Description copied from class: Hook
Returns an array of files selected by the user
Overrides:
getFiles in class Hook
Following copied from class: net.sourceforge.transmogrify.hook.Hook
Returns:
the selected files

getCurrentFile

public java.lang.String getCurrentFile()
Description copied from class: Hook
Gets the file name of the currently focused file.
Overrides:
getCurrentFile in class Hook
Following copied from class: net.sourceforge.transmogrify.hook.Hook
Returns:
focused file name
Throws:
java.lang.Exception - thrown on any type of error

setUserInput

public void setUserInput(java.lang.String input)

getUserInput

public java.lang.String getUserInput(java.lang.String prompt,
                                     java.lang.String title)
Description copied from class: Hook
Prompts for and returns user input
Overrides:
getUserInput in class Hook
Following copied from class: net.sourceforge.transmogrify.hook.Hook
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 void displayMessage(java.lang.String title,
                           java.lang.String message)
Overrides:
displayMessage in class Hook

displayException

public void displayException(java.lang.Exception e,
                             java.lang.String description)
Overrides:
displayException in class Hook

getText

public java.lang.String getText()
Description copied from class: Hook
Returns the entire focused source file
Overrides:
getText in class Hook
Following copied from class: net.sourceforge.transmogrify.hook.Hook
Returns:
String of file
Throws:
java.lang.Exception - thrown on any type of error

getText

public java.lang.String getText(int startPos,
                                int endPos)

insertText

public void insertText(int pos,
                       java.lang.String text)

deleteText

public void deleteText(int startPos,
                       int endPos)

getNumChars

public int getNumChars()

getLine

public java.lang.String getLine(int lineNumber)
Description copied from class: Hook
Retrieves a line from the focused file.
Overrides:
getLine in class Hook
Following copied from class: net.sourceforge.transmogrify.hook.Hook
Parameters:
lineNumber - the line you wish to retrieve
Throws:
java.lang.Exception - thrown on any type of error

setLine

public void setLine(int lineNumber,
                    java.lang.String line)

insertLine

public void insertLine(int lineNumber,
                       java.lang.String line)

getNumLines

public int getNumLines()

selectText

public void selectText(int startLineNumber,
                       int startOffset,
                       int endLineNumber,
                       int endOffset)
Description copied from class: Hook
Selects a bunch of text.
Overrides:
selectText in class Hook
Following copied from class: net.sourceforge.transmogrify.hook.Hook
Throws:
java.lang.Exception - thrown on any type of error

selectText

public void selectText(int startPos,
                       int endPos)
Description copied from class: Hook
Selects a bunch of text.
Overrides:
selectText in class Hook
Following copied from class: net.sourceforge.transmogrify.hook.Hook
Throws:
java.lang.Exception - thrown on any type of error

deSelectText

public void deSelectText()
Description copied from class: Hook
Deselects text
Overrides:
deSelectText in class Hook
Following copied from class: net.sourceforge.transmogrify.hook.Hook
Throws:
java.lang.Exception - thrown on any type of error

getSelectedText

public java.lang.String getSelectedText()
Description copied from class: Hook
Returns the selected text in the form of a String
Overrides:
getSelectedText in class Hook
Following copied from class: net.sourceforge.transmogrify.hook.Hook
Returns:
String the selected text.
Throws:
java.lang.Exception - thrown on any type of error

getSelectedLines

public java.util.Enumeration getSelectedLines()
Description copied from class: Hook
Returns the selected lines in an Enumeration
Overrides:
getSelectedLines in class Hook
Following copied from class: net.sourceforge.transmogrify.hook.Hook
Returns:
Enumeration the selected lines
Throws:
java.lang.Exception - thrown on any type of error

getCaretLineNumber

public int getCaretLineNumber()
Description copied from class: Hook
Returns the 1 based line number of where the cursor is.
Overrides:
getCaretLineNumber in class Hook
Following copied from class: net.sourceforge.transmogrify.hook.Hook
Returns:
int the line number that the cursor is on.
Throws:
java.lang.Exception - thrown on any type of error

getCaretOffset

public int getCaretOffset()
Description copied from class: Hook
Returns the 1 based offset of where the cursor is.
Overrides:
getCaretOffset in class Hook
Following copied from class: net.sourceforge.transmogrify.hook.Hook
Returns:
int the offset of where on the line the cursor is.
Throws:
java.lang.Exception - thrown on any type of error

getCaretPos

public int getCaretPos()
Description copied from class: Hook
Returns the 0 based position of where the cursor is.
Overrides:
getCaretPos in class Hook
Following copied from class: net.sourceforge.transmogrify.hook.Hook
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 int getSelectionStart()
Overrides:
getSelectionStart in class Hook

getSelectionEnd

public int getSelectionEnd()
Overrides:
getSelectionEnd in class Hook

setCaretPos

public void setCaretPos(int lineNumber,
                        int offset)
Description copied from class: Hook
Sets the 0 based position of where the cursor is.
Overrides:
setCaretPos in class Hook
Following copied from class: net.sourceforge.transmogrify.hook.Hook
Throws:
java.lang.Exception - thrown on any type of error

setCaretPos

public void setCaretPos(int pos)
Description copied from class: Hook
Sets the 0 based position of where the cursor is.
Overrides:
setCaretPos in class Hook
Following copied from class: net.sourceforge.transmogrify.hook.Hook
Throws:
java.lang.Exception - thrown on any type of error