Java Doc for AbstractDJDocument.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.util.text.SwingDocument
   edu.rice.cs.drjava.model.AbstractDJDocument

All known Subclasses:   edu.rice.cs.drjava.model.repl.InteractionsDJDocument,  edu.rice.cs.drjava.model.definitions.DefinitionsDocument,
AbstractDJDocument
abstract public class AbstractDJDocument extends SwingDocument implements DJDocument,OptionConstants(Code)
Class containing code shared between the DefinitionsDocument and the InteractionsDJDocument.

Inner Class :protected class InsertCommand implements Runnable
Inner Class :protected class RemoveCommand implements Runnable

Field Summary
final public static  intDOCSTART
     Constant for starting position of document.
final public static  intERROR_INDEX
     Constant used by helper methods to indicate an error.
protected volatile  boolean_cacheInUse
     Whether anything is stored in the cache.
protected volatile  int_currentLocation
     The absolute character offset in the document.
protected volatile  int_indent
     The default indent setting.
final protected static  HashSet<String>_keywords
     A set of Java keywords.
final protected static  HashSet<String>_normEndings
     A set of normal endings for lines.
final protected static  HashSet<String>_primTypes
     A set of Java keywords.
final public  BraceReduction_reduced
     The reduced model of the document (stored in field _reduced) handles most of the document logic and keeps track of state.

Constructor Summary
protected  AbstractDJDocument()
     Standard default constructor; required because a unary constructor is defined.
protected  AbstractDJDocument(Indenter indent)
     Constructor used to build a new document with an existing indenter.

Method Summary
protected  Object_checkCache(String key)
     Checks the helper method cache for a stored value.
public  boolean_indentLine(Indenter.IndentReason reason)
     Indents a line using the Indenter.
protected static  boolean_isReversteStartOfComment(String text, int pos)
     Helper method for findPrevNonWSCharPos.
protected static  boolean_isStartOfComment(String text, int pos)
    
protected static  HashSet<String>_makeKeywords()
     Create a set of Java/GJ keywords for special coloring.
protected static  HashSet<String>_makeNormEndings()
     Create a set of normal endings, i.e., semi-colons and braces for the purposes of indenting.
protected static  HashSet<String>_makePrimTypes()
     Create a set of Java/GJ primitive types for special coloring.
protected  void_removeIndenter()
    
protected  void_storeInCache(String key, Object result)
     Stores the given result in the helper method cache.
abstract protected  void_styleChanged()
     Fire event that styles changed from current location to the end. Right now we do this every time there is an insertion or removal. Two possible future optimizations:
  1. Only fire changed event if text other than that which was inserted or removed *actually* changed status.
abstract protected  voidaddUndoRedo(AbstractDocument.DefaultDocumentEvent chng, Runnable undoCommand, Runnable doCommand)
    
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()
    
protected  voidclearCache()
     Clears the memoizing cache for read operations on the document.
abstract protected  voidendCompoundEdit(int i)
    
abstract protected  voidendLastCompoundEdit()
    
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 forward, finds the position of the enclosing squiggly brace.
public  intfindPrevCharPos(int pos, char[] whitespace)
     Finds the position of the first non-whitespace, non-comment 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  byte[]getBytes()
     Returns the byte image (as written to a file) of this document.
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()
     Get 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  BraceReductiongetReduced()
     This method is used ONLY for testing.
public  ReducedModelStategetStateAtCurrent()
    
public  StringgetText()
    
public  intgetWhiteSpace()
     Gets the number of whitespace characters between the current location and the end 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.
protected  voidinsertUpdate(AbstractDocument.DefaultDocumentEvent chng, AttributeSet attr)
     Updates document structure as a result of text insertion.
abstract protected  IndentermakeNewIndenter(int indentLevel)
     Returns a new indenter.
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.
protected  booleanposNotInBlock(int pos)
     Returns true if the given position is not inside a paren/brace/etc phrase.
public  voidremove(int offset, int len)
     Removes a block of text from the specified location.
protected  voidremoveUpdate(AbstractDocument.DefaultDocumentEvent chng)
     Updates document structure as a result of text removal.
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 line containing pos to tab.
abstract protected  intstartCompoundEdit()
    
public  ReducedModelStatestateAtRelLocation(int dist)
    

Field Detail
DOCSTART
final public static int DOCSTART(Code)
Constant for starting position of document.



ERROR_INDEX
final public static int ERROR_INDEX(Code)
Constant used by helper methods to indicate an error.



_cacheInUse
protected volatile boolean _cacheInUse(Code)
Whether anything is stored in the cache. It is used to avoid clearing the table unnecessarily on every change to the document.



_currentLocation
protected volatile int _currentLocation(Code)
The absolute character offset in the document.



_indent
protected volatile int _indent(Code)
The default indent setting.



_keywords
final protected static HashSet<String> _keywords(Code)
A set of Java keywords.



_normEndings
final protected static HashSet<String> _normEndings(Code)
A set of normal endings for lines.



_primTypes
final protected static HashSet<String> _primTypes(Code)
A set of Java keywords.



_reduced
final public BraceReduction _reduced(Code)
The reduced model of the document (stored in field _reduced) handles most of the document logic and keeps track of state. This field together with _currentLocation function as a virtual object for purposes of synchronization. All operations that access or modify this virtual object should be synchronized on _reduced.




Constructor Detail
AbstractDJDocument
protected AbstractDJDocument()(Code)
Standard default constructor; required because a unary constructor is defined.



AbstractDJDocument
protected AbstractDJDocument(Indenter indent)(Code)
Constructor used to build a new document with an existing indenter. Only used in tests.




Method Detail
_checkCache
protected Object _checkCache(String key)(Code)
Checks the helper method cache for a stored value. Returns the value if it has been cached, or null otherwise. Calling convention for keys: methodName:arg1:arg2
Parameters:
  key - Name of the method and arguments



_indentLine
public boolean _indentLine(Indenter.IndentReason reason)(Code)
Indents a line using the Indenter. Public ONLY for testing purposes. Assumes writeLock is already held.



_isReversteStartOfComment
protected static boolean _isReversteStartOfComment(String text, int pos)(Code)
Helper method for findPrevNonWSCharPos. Determines whether the current character is the start of a comment encountered from the end: '/' or '*' preceded by a '/'. true if (pos-1,pos) == '/*' or '//'



_isStartOfComment
protected static boolean _isStartOfComment(String text, int pos)(Code)
Helper method for getFirstNonWSCharPos Determines whether the current character is the start of a comment: "/*" or "//"



_makeKeywords
protected static HashSet<String> _makeKeywords()(Code)
Create a set of Java/GJ keywords for special coloring. the set of keywords



_makeNormEndings
protected static HashSet<String> _makeNormEndings()(Code)
Create a set of normal endings, i.e., semi-colons and braces for the purposes of indenting. the set of normal endings



_makePrimTypes
protected static HashSet<String> _makePrimTypes()(Code)
Create a set of Java/GJ primitive types for special coloring. the set of primitive types



_removeIndenter
protected void _removeIndenter()(Code)



_storeInCache
protected void _storeInCache(String key, Object result)(Code)
Stores the given result in the helper method cache. Calling convention for keys: methodName:arg1:arg2
Parameters:
  key - Name of method and arguments
Parameters:
  result - Result of the method call



_styleChanged
abstract protected void _styleChanged()(Code)
Fire event that styles changed from current location to the end. Right now we do this every time there is an insertion or removal. Two possible future optimizations:
  1. Only fire changed event if text other than that which was inserted or removed *actually* changed status. If we didn't changed the status of other text (by inserting or deleting unmatched pair of quote or comment chars), no change need be fired.
  2. If a change must be fired, we could figure out the exact end of what has been changed. Right now we fire the event saying that everything changed to the end of the document.
I don't think we'll need to do either one since it's still fast now. I think this is because the UI only actually paints the things on the screen anyway.



addUndoRedo
abstract protected void addUndoRedo(AbstractDocument.DefaultDocumentEvent chng, Runnable undoCommand, Runnable doCommand)(Code)



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 before the 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 after the matching brace.



clear
public void clear()(Code)



clearCache
protected void clearCache()(Code)
Clears the memoizing cache for read operations on the document. This operation must be done before the document is modified since the contents of this cache are invalidated by any modification to the document.



endCompoundEdit
abstract protected void endCompoundEdit(int i)(Code)



endLastCompoundEdit
abstract protected void endLastCompoundEdit()(Code)



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 forward, finds the position of the enclosing squiggly 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 beginning of document is reached.



findPrevCharPos
public int findPrevCharPos(int pos, char[] whitespace) throws BadLocationException(Code)
Finds the position of the first non-whitespace, non-comment character before pos. 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 no such char



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 (e.g., 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 beginning of 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 position of first matching delimiter, or ERROR_INDEX if beginning of 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)



getBytes
public byte[] getBytes()(Code)
Returns the byte image (as written to a file) of this document.



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)
Get 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



getReduced
public BraceReduction getReduced()(Code)
This method is used ONLY for testing. This method is UNSAFE in any other context! The reduced model of this document.



getStateAtCurrent
public ReducedModelState getStateAtCurrent()(Code)



getText
public String getText()(Code)



getWhiteSpace
public int getWhiteSpace()(Code)
Gets the number of whitespace characters between the current location and the end 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. If selStart == selEnd, then the line containing the _currentLocation is indented. The values of selStart and selEnd are ignored!
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 Indenter to 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. Custom processing of the insert is not done here; that is done in AbstractDJDocument.insertUpdate .



insertUpdate
protected void insertUpdate(AbstractDocument.DefaultDocumentEvent chng, AttributeSet attr)(Code)
Updates document structure as a result of text insertion. This happens after the text has actually been inserted. Here we update the reduced model (using an AbstractDJDocument.InsertCommand InsertCommand ) and store information for how to undo/redo the reduced model changes inside the javax.swing.text.AbstractDocument.DefaultDocumentEvent DefaultDocumentEvent .
See Also:   edu.rice.cs.drjava.model.AbstractDJDocument.InsertCommand
See Also:   javax.swing.text.AbstractDocument.DefaultDocumentEvent
See Also:   edu.rice.cs.drjava.model.definitions.DefinitionsDocument.CommandUndoableEdit



makeNewIndenter
abstract protected Indenter makeNewIndenter(int indentLevel)(Code)
Returns a new indenter. Assumes writeLock is held.



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



posNotInBlock
protected boolean posNotInBlock(int pos)(Code)
Returns true if the given position is not inside a paren/brace/etc phrase. Assumes that read lock is ALREADY HELD.
Parameters:
  pos - the position we're looking at true if pos is immediately inside a paren/brace/etc



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 .



removeUpdate
protected void removeUpdate(AbstractDocument.DefaultDocumentEvent chng)(Code)
Updates document structure as a result of text removal. This happens within the swing remove operation before the text has actually been removed. Here we update the reduced model (using a AbstractDJDocument.RemoveCommandRemoveCommand ) and store information for how to undo/redo the reduced model changes inside the javax.swing.text.AbstractDocument.DefaultDocumentEvent DefaultDocumentEvent .
See Also:   AbstractDJDocument.RemoveCommand
See Also:   javax.swing.text.AbstractDocument.DefaultDocumentEvent



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 line containing pos to tab.
Parameters:
  tab - String to be placed between previous newline and firstnon-whitespace character



startCompoundEdit
abstract protected int startCompoundEdit()(Code)



stateAtRelLocation
public ReducedModelState stateAtRelLocation(int dist)(Code)



Fields inherited from edu.rice.cs.util.text.SwingDocument
protected DocumentEditCondition _condition(Code)(Java Doc)
final protected Hashtable<String, AttributeSet> _styles(Code)(Java Doc)
final protected static Object _wrappedPosListLock(Code)(Java Doc)

Methods inherited from edu.rice.cs.util.text.SwingDocument
public void _forceInsertText(int offs, String str, String style)(Code)(Java Doc)
public void _insertText(int offs, String str, String style)(Code)(Java Doc)
public void _removeText(int offs, int len)(Code)(Java Doc)
public void acquireReadLock()(Code)(Java Doc)
public void acquireWriteLock()(Code)(Java Doc)
public void addColoring(int start, int end, String style)(Code)(Java Doc)
public void append(String str, AttributeSet set)(Code)(Java Doc)
public void append(String str, String style)(Code)(Java Doc)
public void clear()(Code)(Java Doc)
public Position createUnwrappedPosition(int offs) throws BadLocationException(Code)(Java Doc)
public void forceInsertText(int offs, String str, String style)(Code)(Java Doc)
public void forceRemoveText(int offs, int len)(Code)(Java Doc)
public String getDefaultStyle()(Code)(Java Doc)
public AttributeSet getDocStyle(String name)(Code)(Java Doc)
public String getDocText(int offs, int len)(Code)(Java Doc)
public DocumentEditCondition getEditCondition()(Code)(Java Doc)
public Pageable getPageable()(Code)(Java Doc)
public String getText()(Code)(Java Doc)
public void insertString(int offs, String str, AttributeSet set) throws BadLocationException(Code)(Java Doc)
public void insertText(int offs, String str, String style)(Code)(Java Doc)
public void print()(Code)(Java Doc)
public void releaseReadLock()(Code)(Java Doc)
public void releaseWriteLock()(Code)(Java Doc)
public void remove(int offs, int len) throws BadLocationException(Code)(Java Doc)
public void removeText(int offs, int len)(Code)(Java Doc)
public void setDocStyle(String name, AttributeSet s)(Code)(Java Doc)
public void setEditCondition(DocumentEditCondition condition)(Code)(Java Doc)

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