|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for the GlobalModel's handler of an open DefinitionsDocument. Provides a means to interact with the document.
Method Summary | |
void |
addBreakpoint(Breakpoint breakpoint)
Add the supplied Breakpoint to the hashtable, keyed by its BreakpointRequest |
int |
balanceBackward()
Forwarding method to find the match for the closing brace immediately to the left, assuming there is such a brace. |
int |
balanceForward()
Forwarding method to find the match for the open brace immediately to the right, assuming there is such a brace. |
boolean |
canAbandonFile()
Returns whether the GlobalModel can abandon this document, asking the listeners if isModifiedSinceSave() is true. |
boolean |
checkIfClassFileInSync()
Checks if the document is modified. |
void |
cleanUpPrintJob()
|
void |
clearBreakpoints()
Tells the document to remove all breakpoints |
FindReplaceMachine |
createFindReplaceMachine()
Create a find and replace mechanism starting at the current character offset in the definitions. |
Breakpoint |
getBreakpointAt(int lineNumber)
Returns the Breakpoint in this OpenDefinitionsDocument at the given linenumber, or null if one does not exist. |
gj.util.Vector |
getBreakpoints()
Returns a Vector |
CompilerErrorModel |
getCompilerErrorModel()
Returns the model responsible for maintaining all current errors within this OpenDefinitionsDocument's file. |
int |
getCurrentDefinitionsLocation()
Get the location of the cursor in the definitions according to the definitions document. |
DefinitionsDocument |
getDocument()
Gets the definitions document being handled. |
File |
getFile()
Returns the file for this document. |
String |
getFilename()
Returns the name of this file, or "(untitled)" if no file. |
String |
getFirstTopLevelClassName()
Returns the name of the top level class, if any. |
JUnitErrorModel |
getJUnitErrorModel()
Returns the model responsible for maintaining all current JUnit errors within this OpenDefinitionsDocument. |
Pageable |
getPageable()
|
File |
getSourceRoot()
Finds the root directory of the source files. |
int |
gotoLine(int line)
Moves the definitions document to the given line, and returns the character position in the document it's gotten to. |
void |
indentLinesInDefinitions(int selStart,
int selEnd)
A forwarding method to indent the current line or selection in the definitions. |
boolean |
isModifiedOnDisk()
Determines if this definitions document has changed since the last save. |
boolean |
isModifiedSinceSave()
Determines if this definitions document has changed since the last save. |
boolean |
isUntitled()
Returns whether this document is currently untitled (indicating whether it has a file yet or not). |
void |
preparePrintJob()
|
void |
print()
|
void |
removeBreakpoint(Breakpoint breakpoint)
Remove the given Breakpoint from the hashtable. |
void |
removeFromDebugger()
Called to indicate the document is being closed, so to remove all related state from the debug manager. |
void |
revertFile()
Revert the document to the version saved on disk. |
boolean |
revertIfModifiedOnDisk()
Asks the GlobalModel if it can revert current definitions to version on disk. |
void |
saveFile(FileSaveSelector com)
Saves the document with a FileWriter. |
void |
saveFileAs(FileSaveSelector com)
Saves the document with a FileWriter. |
void |
setCompilerErrorModel(CompilerErrorModel model)
Sets this OpenDefinitionsDocument's notion of all current errors within the corresponding file. |
void |
setDefinitionsIndent(int indent)
Set the indent tab size for this document. |
void |
setJUnitErrorModel(JUnitErrorModel model)
Sets the OpenDefinitionDocument's notion of all JUnit errors within this current document. |
void |
startCompile()
Starts compiling the source. |
void |
startJUnit()
Starts testing the source using JUnit. |
void |
syncCurrentLocationWithDefinitions(int location)
Forwarding method to sync the definitions with whatever view component is representing them. |
Method Detail |
public DefinitionsDocument getDocument()
public String getFirstTopLevelClassName() throws ClassNameNotFoundException
ClassNameNotFoundException
- if no top level class name found.public boolean isUntitled()
public File getFile() throws IllegalStateException, FileMovedException
IllegalStateException
- if document never had a fileFileMovedException
- if the document's file no longer existspublic String getFilename()
public void saveFile(FileSaveSelector com) throws IOException
com
- a selector that picks the file nameIOException
- public void revertFile() throws IOException
public void saveFileAs(FileSaveSelector com) throws IOException
com
- a selector that picks the file name.IOException
- public void startCompile() throws IOException
IOException
- if a file with errors cannot be openedpublic void startJUnit() throws ClassNotFoundException, IOException
IOException
- if a file with errors cannot be openedClassNotFoundException
- when the class is compiled to a location
not on the classpath.public CompilerErrorModel getCompilerErrorModel()
public void setCompilerErrorModel(CompilerErrorModel model)
model
- CompilerErrorModel containing all errors for this filepublic JUnitErrorModel getJUnitErrorModel()
public void setJUnitErrorModel(JUnitErrorModel model)
model
- JUnitErrorModel containing all JUnit errors for this file.public boolean isModifiedSinceSave()
public boolean isModifiedOnDisk()
public boolean revertIfModifiedOnDisk() throws IOException
public boolean canAbandonFile()
public int gotoLine(int line)
line
- Number of the line to go to. If line exceeds the number
of lines in the document, it is interpreted as the last line.public void syncCurrentLocationWithDefinitions(int location)
public int getCurrentDefinitionsLocation()
public int balanceBackward()
public int balanceForward()
public void setDefinitionsIndent(int indent)
indent
- the number of spaces to make per level of indentpublic void indentLinesInDefinitions(int selStart, int selEnd)
public FindReplaceMachine createFindReplaceMachine()
public File getSourceRoot() throws InvalidPackageException
InvalidPackageException
- If the package statement is invalid,
or if it does not match up with the
location of the source file.public void preparePrintJob() throws BadLocationException, FileMovedException
public void print() throws PrinterException, BadLocationException, FileMovedException
public Pageable getPageable() throws IllegalStateException
public void cleanUpPrintJob()
public boolean checkIfClassFileInSync()
public Breakpoint getBreakpointAt(int lineNumber)
lineNumber
- the line number of the breakpointpublic void addBreakpoint(Breakpoint breakpoint)
breakpoint
- the Breakpoint to be inserted into the hashtablepublic void removeBreakpoint(Breakpoint breakpoint)
breakpoint
- the Breakpoint to be removed.public gj.util.Vector getBreakpoints()
public void clearBreakpoints()
public void removeFromDebugger()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |