Java Doc for DJDocument.java in  » IDE » DrJava » edu » rice » cs » drjava » model » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE » DrJava » edu.rice.cs.drjava.model 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


edu.rice.cs.drjava.model.DJDocument

All known Subclasses:   edu.rice.cs.drjava.model.AbstractDJDocument,
DJDocument
public interface DJDocument extends SwingDocumentInterface(Code)
Interface to be collectively shared by the Definitions Document, Open Definitions Document, and the Interactions Document. Collectively represents a DrJava Document




Method Summary
public  voidacquireReadLock()
     Swing-style acquireReadLock().
public  voidacquireWriteLock()
     Swing-style writeLock().
public  intbalanceBackward()
     Forwarding method to find the match for the closing brace immediately to the left, assuming there is such a brace.
public  intbalanceForward()
     Forwarding method to find the match for the open brace immediately to the right, assuming there is such a brace.
public  voidclear()
     Clears the entire text of the document.
public  booleanfindCharInStmtBeforePos(char findChar, int position)
     This function finds the given character in the same statement as the given position, and before the given position.
public  intfindCharOnLine(int pos, char findChar)
     Determines if the given character exists on the line where the given cursor position is.
public  intfindNextEnclosingBrace(int pos, char opening, char closing)
     Searching forwards, finds the position of the enclosing brace.
public  intfindPrevCharPos(int pos, char[] whitespace)
     Finds the position of the first non-whitespace character before pos.
public  intfindPrevDelimiter(int pos, char[] delims)
     Searching backwards, finds the position of the first character that is one of the given delimiters.
public  intfindPrevDelimiter(int pos, char[] delims, boolean skipParenPhrases)
     Searching backwards, finds the position of the first character that is one of the given delimiters.
public  intfindPrevEnclosingBrace(int pos, char opening, char closing)
     Searching backwards, finds the position of the enclosing brace.
public  intfindPrevNonWSCharPos(int pos)
    
public  intgetCurrentLocation()
     Get the current location of the cursor in the document.
public  intgetFirstNonWSCharPos(int pos)
     Finds the position of the first non-whitespace character after pos.
public  intgetFirstNonWSCharPos(int pos, boolean acceptComments)
     Similar to the single-argument version, but allows including comments.
public  intgetFirstNonWSCharPos(int pos, char[] whitespace, boolean acceptComments)
     Finds the position of the first non-whitespace character after pos.
public  Vector<HighlightStatus>getHighlightStatus(int start, int end)
     Return all highlight status info for text between start and end.
public  intgetIndent()
     Gets the indent level.
public  IndentInfogetIndentInformation()
     Returns the indent information for the current location.
public  StringgetIndentOfCurrStmt(int pos)
     Returns the indent level of the start of the statement that the cursor is on.
public  StringgetIndentOfCurrStmt(int pos, char[] delims)
     Returns the indent level of the start of the statement that the cursor is on.
public  StringgetIndentOfCurrStmt(int pos, char[] delims, char[] whitespace)
     Returns the indent level of the start of the statement that the cursor is on.
public  intgetIntelligentBeginLinePos(int currPos)
     Returns the "intelligent" beginning of line.
public  intgetLineEndPos(int pos)
     Returns the absolute position of the end of the current line.
public  intgetLineFirstCharPos(int pos)
     Returns the absolute position of the first non-whitespace character on the current line.
public  intgetLineStartPos(int pos)
     Returns the absolute position of the beginning of the current line.
public  ReducedModelStategetStateAtCurrent()
    
public  StringgetText()
     Gets the entire text of the document.
public  intgetWhiteSpace()
     Gets the number of whitespace characters between the current location and the rest of the document or the first non-whitespace character, whichever comes first.
public  voidindentLines(int selStart, int selEnd)
     Default indentation - uses OTHER flag and no progress indicator.
public  voidindentLines(int selStart, int selEnd, Indenter.IndentReason reason, ProgressMonitor pm)
     Parameterized indentation for special-case handling.
public  voidinsertString(int offset, String str, AttributeSet a)
     Inserts a string of text into the document.
public  voidmove(int dist)
     The actual cursor movement logic.
public  booleanposInParenPhrase(int pos)
     Returns true if the given position is inside a paren phrase.
public  booleanposInParenPhrase()
     Returns true if the reduced model's current position is inside a paren phrase.
public  voidreleaseReadLock()
     Swing-style releaseReadLock().
public  voidreleaseWriteLock()
     Swing-style writeUnlock().
public  voidremove(int offset, int len)
     Removes a block of text from the specified location.
public  voidresetReducedModelLocation()
    
public  voidsetCurrentLocation(int loc)
    
public  voidsetIndent(int indent)
     Set the indent to a particular number of spaces.
public  voidsetTab(String tab, int pos)
     Sets text between previous newline and first non-whitespace character of the line containing pos to tab.
public  ReducedModelStatestateAtRelLocation(int dist)
    



Method Detail
acquireReadLock
public void acquireReadLock()(Code)
Swing-style acquireReadLock().



acquireWriteLock
public void acquireWriteLock()(Code)
Swing-style writeLock().



balanceBackward
public int balanceBackward()(Code)
Forwarding method to find the match for the closing brace immediately to the left, assuming there is such a brace. the relative distance backwards to the offset beforethe matching brace.



balanceForward
public int balanceForward()(Code)
Forwarding method to find the match for the open brace immediately to the right, assuming there is such a brace. the relative distance forwards to the offset afterthe matching brace.



clear
public void clear()(Code)
Clears the entire text of the document. Without this operation, a client must use locking to perform this task safely.



findCharInStmtBeforePos
public boolean findCharInStmtBeforePos(char findChar, int position)(Code)
This function finds the given character in the same statement as the given position, and before the given position. It is used by QuestionExistsCharInStmt and QuestionExistsCharInPrevStmt



findCharOnLine
public int findCharOnLine(int pos, char findChar)(Code)
Determines if the given character exists on the line where the given cursor position is. Does not search in quotes or comments.

Does not work if character being searched for is a '/' or a '*'
Parameters:
  pos - Cursor position
Parameters:
  findChar - Character to search for true if this node's rule holds.




findNextEnclosingBrace
public int findNextEnclosingBrace(int pos, char opening, char closing) throws BadLocationException(Code)
Searching forwards, finds the position of the enclosing brace. NB: ignores comments.
Parameters:
  pos - Position to start from
Parameters:
  opening - opening brace character
Parameters:
  closing - closing brace character position of enclosing squiggly brace, or ERROR_INDEX if beginningof document is reached.



findPrevCharPos
public int findPrevCharPos(int pos, char[] whitespace) throws BadLocationException(Code)
Finds the position of the first non-whitespace character before pos. NB: Skips comments and all whitespace, including newlines
Parameters:
  pos - Position to start from
Parameters:
  whitespace - chars considered as white space position of first non-whitespace character before pos,or ERROR_INDEX if begining of document is reached



findPrevDelimiter
public int findPrevDelimiter(int pos, char[] delims) throws BadLocationException(Code)
Searching backwards, finds the position of the first character that is one of the given delimiters. Does not look for delimiters inside paren phrases. (eg. skips semicolons used inside for statements.) NB: ignores comments.
Parameters:
  pos - Position to start from
Parameters:
  delims - array of characters to search for position of first matching delimiter, or ERROR_INDEX if beginningof document is reached.



findPrevDelimiter
public int findPrevDelimiter(int pos, char[] delims, boolean skipParenPhrases) throws BadLocationException(Code)
Searching backwards, finds the position of the first character that is one of the given delimiters. Will not look for delimiters inside a paren phrase if skipParenPhrases is true. NB: ignores comments.
Parameters:
  pos - Position to start from
Parameters:
  delims - array of characters to search for
Parameters:
  skipParenPhrases - whether to look for delimiters inside paren phrases(eg. semicolons in a for statement) position of first matching delimiter, or ERROR_INDEX if beginningof document is reached.



findPrevEnclosingBrace
public int findPrevEnclosingBrace(int pos, char opening, char closing) throws BadLocationException(Code)
Searching backwards, finds the position of the enclosing brace. NB: ignores comments.
Parameters:
  pos - Position to start from
Parameters:
  opening - opening brace character
Parameters:
  closing - closing brace character position of enclosing squiggly brace, or ERROR_INDEX if beginningof document is reached.



findPrevNonWSCharPos
public int findPrevNonWSCharPos(int pos) throws BadLocationException(Code)



getCurrentLocation
public int getCurrentLocation()(Code)
Get the current location of the cursor in the document. Unlike the usual swing document model, which is stateless, because of our implementation of the underlying reduced model, we need to keep track of the current location. where the cursor is as the number of characters into the document



getFirstNonWSCharPos
public int getFirstNonWSCharPos(int pos) throws BadLocationException(Code)
Finds the position of the first non-whitespace character after pos. NB: Skips comments and all whitespace, including newlines
Parameters:
  pos - Position to start from position of first non-whitespace character after pos,or ERROR_INDEX if end of document is reached



getFirstNonWSCharPos
public int getFirstNonWSCharPos(int pos, boolean acceptComments) throws BadLocationException(Code)
Similar to the single-argument version, but allows including comments.
Parameters:
  pos - Position to start from
Parameters:
  acceptComments - if true, find non-whitespace chars in comments position of first non-whitespace character after pos,or ERROR_INDEX if end of document is reached



getFirstNonWSCharPos
public int getFirstNonWSCharPos(int pos, char[] whitespace, boolean acceptComments) throws BadLocationException(Code)
Finds the position of the first non-whitespace character after pos. NB: Skips comments and all whitespace, including newlines
Parameters:
  pos - Position to start from
Parameters:
  whitespace - array of whitespace chars to ignore
Parameters:
  acceptComments - if true, find non-whitespace chars in comments position of first non-whitespace character after pos,or ERROR_INDEX if end of document is reached



getHighlightStatus
public Vector<HighlightStatus> getHighlightStatus(int start, int end)(Code)
Return all highlight status info for text between start and end. This should collapse adjoining blocks with the same status into one.



getIndent
public int getIndent()(Code)
Gets the indent level. the indent level



getIndentInformation
public IndentInfo getIndentInformation()(Code)
Returns the indent information for the current location.



getIndentOfCurrStmt
public String getIndentOfCurrStmt(int pos) throws BadLocationException(Code)
Returns the indent level of the start of the statement that the cursor is on. Uses a default set of delimiters. (';', '{', '}') and a default set of whitespace characters (' ', '\t', n', ',')
Parameters:
  pos - Cursor position



getIndentOfCurrStmt
public String getIndentOfCurrStmt(int pos, char[] delims) throws BadLocationException(Code)
Returns the indent level of the start of the statement that the cursor is on. Uses a default set of whitespace characters. (' ', '\t', '\n', ',')
Parameters:
  pos - Cursor position



getIndentOfCurrStmt
public String getIndentOfCurrStmt(int pos, char[] delims, char[] whitespace) throws BadLocationException(Code)
Returns the indent level of the start of the statement that the cursor is on.
Parameters:
  pos - Cursor position
Parameters:
  delims - Delimiter characters denoting end of statement
Parameters:
  whitespace - characters to skip when looking for beginning of next statement



getIntelligentBeginLinePos
public int getIntelligentBeginLinePos(int currPos) throws BadLocationException(Code)
Returns the "intelligent" beginning of line. If currPos is to the right of the first non-whitespace character, the position of the first non-whitespace character is returned. If currPos is at or to the left of the first non-whitespace character, the beginning of the line is returned.
Parameters:
  currPos - A position on the current line



getLineEndPos
public int getLineEndPos(int pos)(Code)
Returns the absolute position of the end of the current line. (At the next newline, or the end of the document.)
Parameters:
  pos - Any position on the current line position of the end of this line



getLineFirstCharPos
public int getLineFirstCharPos(int pos) throws BadLocationException(Code)
Returns the absolute position of the first non-whitespace character on the current line. NB: Doesn't ignore comments.
Parameters:
  pos - position on the line position of first non-whitespace character on this line, or the endof the line if no non-whitespace character is found.



getLineStartPos
public int getLineStartPos(int pos)(Code)
Returns the absolute position of the beginning of the current line. (Just after most recent newline, or DOCSTART) Doesn't ignore comments.
Parameters:
  pos - Any position on the current line position of the beginning of this line



getStateAtCurrent
public ReducedModelState getStateAtCurrent()(Code)



getText
public String getText()(Code)
Gets the entire text of the document. Without this operation, a client must use locking to perform this task safely.



getWhiteSpace
public int getWhiteSpace()(Code)
Gets the number of whitespace characters between the current location and the rest of the document or the first non-whitespace character, whichever comes first. the number of whitespace characters



indentLines
public void indentLines(int selStart, int selEnd)(Code)
Default indentation - uses OTHER flag and no progress indicator.
Parameters:
  selStart - the offset of the initial character of the region to indent
Parameters:
  selEnd - the offset of the last character of the region to indent



indentLines
public void indentLines(int selStart, int selEnd, Indenter.IndentReason reason, ProgressMonitor pm) throws OperationCanceledException(Code)
Parameterized indentation for special-case handling.
Parameters:
  selStart - the offset of the initial character of the region to indent
Parameters:
  selEnd - the offset of the last character of the region to indent
Parameters:
  reason - a flag from edu.rice.cs.drjava.model.definitions.indent.Indenter Indenterto indicate the reason for the indent (indent logic may vary slightly based on the trigger action)
Parameters:
  pm - used to display progress, null if no reporting is desired



insertString
public void insertString(int offset, String str, AttributeSet a) throws BadLocationException(Code)
Inserts a string of text into the document. It turns out that this is not where we should do custom processing of the insert; that is done in AbstractDJDocument.insertUpdate .



move
public void move(int dist)(Code)
The actual cursor movement logic. Helper for setCurrentLocation(int).
Parameters:
  dist - the distance from the current location to the new location.



posInParenPhrase
public boolean posInParenPhrase(int pos)(Code)
Returns true if the given position is inside a paren phrase.
Parameters:
  pos - the position we're looking at true if pos is immediately inside parentheses



posInParenPhrase
public boolean posInParenPhrase()(Code)
Returns true if the reduced model's current position is inside a paren phrase. true if pos is immediately inside parentheses



releaseReadLock
public void releaseReadLock()(Code)
Swing-style releaseReadLock().



releaseWriteLock
public void releaseWriteLock()(Code)
Swing-style writeUnlock().



remove
public void remove(int offset, int len) throws BadLocationException(Code)
Removes a block of text from the specified location. We don't update the reduced model here; that happens in AbstractDJDocument.removeUpdate .



resetReducedModelLocation
public void resetReducedModelLocation()(Code)



setCurrentLocation
public void setCurrentLocation(int loc)(Code)
Change the current location of the document
Parameters:
  loc - the new absolute location



setIndent
public void setIndent(int indent)(Code)
Set the indent to a particular number of spaces.
Parameters:
  indent - the size of indent that you want for the document



setTab
public void setTab(String tab, int pos)(Code)
Sets text between previous newline and first non-whitespace character of the line containing pos to tab.
Parameters:
  tab - String to be placed between previous newline and first non-whitespace character



stateAtRelLocation
public ReducedModelState stateAtRelLocation(int dist)(Code)



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.