Java Doc for Utilities.java in  » Swing-Library » abeille-forms-designer » org » netbeans » editor » 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 » Swing Library » abeille forms designer » org.netbeans.editor 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.editor.Utilities

Utilities
public class Utilities (Code)
Various useful editor functions. Some of the methods have the same names and signatures like in javax.swing.Utilities but there is also many other useful methods. All the methods are static so there's no reason to instantiate Utilities. All the methods working with the document rely on that it is locked against modification so they don't acquire document read/write lock by themselves to guarantee the full thread safety of the execution. It's the user's task to lock the document appropriately before using methods described here. Most of the methods require org.netbeans.editor.BaseDocument instance not just the javax.swing.text.Document. The reason for that is to mark that the methods work on BaseDocument instances only, not on generic documents. To convert the Document to BaseDocument the simple conversion (BaseDocument)target.getDocument() can be done or the method getDocument(target) can be called. There are also other conversion methods like getEditorUI(), getKit() or getKitClass().
author:
   Miloslav Metelka
version:
   0.10


Field Summary
final public static  intCASE_LOWER
     Switch the case to small letters.
final public static  intCASE_SWITCH
     Switch the case to reverse.
final public static  intCASE_UPPER
     Switch the case to capital letters.


Method Summary
public static  booleanchangeCase(BaseDocument doc, int offset, int len, int type)
    
public static  voidclearStatusText(JTextComponent c)
    
public static  StringdebugDocument(Document doc)
     Display the identity of the document together with the title property and stream-description property.
public static  StringdebugPosition(BaseDocument doc, int offset)
    
public static  BaseDocumentgetDocument(JTextComponent target)
     Helper method to obtain instance of BaseDocument from JTextComponent.
public static  EditorUIgetEditorUI(JTextComponent target)
     Helper method to obtain instance of EditorUI (extended UI) from the existing JTextComponent.
public static  intgetFirstNonEmptyRow(BaseDocument doc, int offset, boolean downDir)
    
public static  intgetFirstNonWhiteBwd(BaseDocument doc, int offset)
     Get first non-white character in document in backward direction.
public static  intgetFirstNonWhiteBwd(BaseDocument doc, int offset, int limitPos)
     Get first non-white character in document in backward direction.
public static  intgetFirstNonWhiteFwd(BaseDocument doc, int offset)
    
public static  intgetFirstNonWhiteFwd(BaseDocument doc, int offset, int limitPos)
    
public static  intgetFirstNonWhiteRow(BaseDocument doc, int offset, boolean downDir)
    
public static  intgetFirstWhiteBwd(BaseDocument doc, int offset)
     Get first white character in document in backward direction.
public static  intgetFirstWhiteBwd(BaseDocument doc, int offset, int limitPos)
     Get first white character in document in backward direction.
public static  intgetFirstWhiteFwd(BaseDocument doc, int offset)
    
public static  intgetFirstWhiteFwd(BaseDocument doc, int offset, int limitPos)
    
public static  StringgetIdentifier(BaseDocument doc, int offset)
    
public static  StringgetIdentifierBefore(BaseDocument doc, int offset)
    
public static  int[]getIdentifierBlock(BaseDocument doc, int offset)
     Get the identifier around the given position or null if there's no identifier around the given position.
public static  BaseKitgetKit(JTextComponent target)
     Helper method to obtain instance of editor kit from existing JTextComponent.
public static  ClassgetKitClass(JTextComponent target)
     Helper method to obtain editor kit class from existing JTextComponent. This method is useful for example when dealing with Settings.
public static  JTextComponentgetLastActiveComponent()
    
public static  intgetLineOffset(BaseDocument doc, int offset)
    
public static  intgetNextTabColumn(BaseDocument doc, int offset)
     Get the visual column corresponding to the position after pressing the TAB key.
public static  intgetNextWord(JTextComponent c, int offset)
    
public static  intgetNextWord(BaseDocument doc, int offset)
    
public static  intgetPositionAbove(JTextComponent c, int offset, int x)
     Get the position that is one line above and visually at some x-coordinate value.
public static  intgetPositionBelow(JTextComponent c, int offset, int x)
     Get the position that is one line above and visually at some x-coordinate value.
public static  intgetPreviousWord(JTextComponent c, int offset)
    
public static  intgetPreviousWord(BaseDocument doc, int offset)
    
public static  intgetRowCount(BaseDocument doc, int startPos, int endPos)
    
public static  intgetRowCount(BaseDocument doc)
    
public static  intgetRowEnd(JTextComponent c, int offset)
     Get the end position of the row right before the new-line character.
public static  intgetRowEnd(BaseDocument doc, int offset)
    
public static  intgetRowFirstNonWhite(BaseDocument doc, int offset)
     Get the first non-white character on the line.
public static  intgetRowIndent(BaseDocument doc, int offset)
     Get indentation on the current line.
public static  intgetRowIndent(BaseDocument doc, int offset, boolean downDir)
     Get indentation on the current line.
public static  intgetRowLastNonWhite(BaseDocument doc, int offset)
     Get the last non-white character on the line.
public static  intgetRowStart(JTextComponent c, int offset)
     Get the starting position of the row.
public static  intgetRowStart(BaseDocument doc, int offset)
     Get the starting position of the row.
public static  intgetRowStart(BaseDocument doc, int offset, int lineShift)
     Get the starting position of the row while providing relative count of row how the given position should be shifted.
public static  intgetRowStartFromLineOffset(BaseDocument doc, int lineOffset)
    
public static  StringgetSelectionOrIdentifier(JTextComponent c, int offset)
     Get the selection if there's any or get the identifier around the position if there's no selection.
public static  StringgetSelectionOrIdentifier(JTextComponent c)
    
public static  int[]getSelectionOrIdentifierBlock(JTextComponent c, int offset)
     Get the selection if there's any or get the identifier around the position if there's no selection.
public static  int[]getSelectionOrIdentifierBlock(JTextComponent c)
    
public static  StringgetStatusText(JTextComponent c)
    
public static  SyntaxSupportgetSyntaxSupport(JTextComponent target)
     Get the syntax-support class that belongs to the document of the given component.
public static  StringgetTabInsertString(BaseDocument doc, int offset)
    
public static  intgetVisualColumn(BaseDocument doc, int offset)
     Return visual column (with expanded tabs) on the line.
public static  StringgetWord(JTextComponent c, int offset)
     Get the word around the given position .
public static  StringgetWord(BaseDocument doc, int offset)
     Get the word at given position.
public static  intgetWordEnd(JTextComponent c, int offset)
    
public static  intgetWordEnd(BaseDocument doc, int offset)
    
public static  intgetWordStart(JTextComponent c, int offset)
     Get start of the current word.
public static  intgetWordStart(BaseDocument doc, int offset)
    
public static  voidinsertMark(BaseDocument doc, Mark mark, int offset)
    
public static  booleanisEOL(BaseDocument doc, int offset)
    
public static  booleanisRowEmpty(BaseDocument doc, int offset)
     Tests whether the line contains no characters except the ending new-line.
public static  booleanisRowWhite(BaseDocument doc, int offset)
     Tests whether the line contains only whitespace characters.
public static  StringkeySequenceToString(KeyStroke[] seq)
     Creates nice textual description of sequence of KeyStrokes.
public static  StringkeyStrokeToString(KeyStroke stroke)
     Creates nice textual representation of KeyStroke.
public static  voidmoveMark(BaseDocument doc, Mark mark, int newOffset)
    
public static  voidperformAction(Action a, ActionEvent evt, JTextComponent target)
    
public static  intreformat(BaseDocument doc, int startOffset, int endOffset)
     Reformat a block of code.
public static  voidreformatLine(BaseDocument doc, int pos)
     Reformat the line around the given position.
public static  voidrequestFocus(JTextComponent c)
    
public static  voidreturnFocus()
    
public static  voidrunInEventDispatchThread(Runnable r)
    
public static  voidsetStatusBoldText(JTextComponent c, String text)
    
public static  voidsetStatusText(JTextComponent c, String text)
    
public static  voidsetStatusText(JTextComponent c, String text, Coloring extraColoring)
    

Field Detail
CASE_LOWER
final public static int CASE_LOWER(Code)
Switch the case to small letters. Used in changeCase()



CASE_SWITCH
final public static int CASE_SWITCH(Code)
Switch the case to reverse. Used in changeCase()



CASE_UPPER
final public static int CASE_UPPER(Code)
Switch the case to capital letters. Used in changeCase()





Method Detail
changeCase
public static boolean changeCase(BaseDocument doc, int offset, int len, int type) throws BadLocationException(Code)
Change the case for specified part of document
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document determines the changed area begining
Parameters:
  len - number of chars to change
Parameters:
  type - either CASE_CAPITAL, CASE_SMALL or CASE_SWITCH



clearStatusText
public static void clearStatusText(JTextComponent c)(Code)



debugDocument
public static String debugDocument(Document doc)(Code)
Display the identity of the document together with the title property and stream-description property.



debugPosition
public static String debugPosition(BaseDocument doc, int offset)(Code)



getDocument
public static BaseDocument getDocument(JTextComponent target)(Code)
Helper method to obtain instance of BaseDocument from JTextComponent. If the document of the component is not an instance of the org.netbeans.editor.BaseDocument the method returns null. The method doesn't require any document locking.
Parameters:
  target - JTextComponent for which the document should be obtained BaseDocument instance or null



getEditorUI
public static EditorUI getEditorUI(JTextComponent target)(Code)
Helper method to obtain instance of EditorUI (extended UI) from the existing JTextComponent. It doesn't require any document locking.
Parameters:
  target - JTextComponent for which the extended UI should be obtained extended ui instance or null if the component.getUI() does notreturn BaseTextUI instance.



getFirstNonEmptyRow
public static int getFirstNonEmptyRow(BaseDocument doc, int offset, boolean downDir) throws BadLocationException(Code)



getFirstNonWhiteBwd
public static int getFirstNonWhiteBwd(BaseDocument doc, int offset) throws BadLocationException(Code)
Get first non-white character in document in backward direction. The character right before the character at position offset will be searched as first.
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document where to start searching position of the first non-white character or -1



getFirstNonWhiteBwd
public static int getFirstNonWhiteBwd(BaseDocument doc, int offset, int limitPos) throws BadLocationException(Code)
Get first non-white character in document in backward direction. The character right before the character at position offset will be searched as first.
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document where to start searching
Parameters:
  limitPos - position in document (lower or equal than offset) where thesearch will stop reporting unsuccessful search by returning -1 position of the first non-white character or -1



getFirstNonWhiteFwd
public static int getFirstNonWhiteFwd(BaseDocument doc, int offset) throws BadLocationException(Code)
Get first non-white character in document in forward direction
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document where to start searching position of the first non-white character or -1



getFirstNonWhiteFwd
public static int getFirstNonWhiteFwd(BaseDocument doc, int offset, int limitPos) throws BadLocationException(Code)
Get first non-white character in document in forward direction
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document where to start searching
Parameters:
  limitPos - position in document (greater or equal than offset) where thesearch will stop reporting unsuccessful search by returning -1 position of the first non-white character or -1



getFirstNonWhiteRow
public static int getFirstNonWhiteRow(BaseDocument doc, int offset, boolean downDir) throws BadLocationException(Code)



getFirstWhiteBwd
public static int getFirstWhiteBwd(BaseDocument doc, int offset) throws BadLocationException(Code)
Get first white character in document in backward direction. The character right before the character at position offset will be searched as first.
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document where to start searching position of the first white character or -1



getFirstWhiteBwd
public static int getFirstWhiteBwd(BaseDocument doc, int offset, int limitPos) throws BadLocationException(Code)
Get first white character in document in backward direction. The character right before the character at position offset will be searched as first.
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document where to start searching
Parameters:
  limitPos - position in document (lower or equal than offset) where thesearch will stop reporting unsuccessful search by returning -1 position of the first white character or -1



getFirstWhiteFwd
public static int getFirstWhiteFwd(BaseDocument doc, int offset) throws BadLocationException(Code)
Get first white character in document in forward direction
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document where to start searching position of the first white character or -1



getFirstWhiteFwd
public static int getFirstWhiteFwd(BaseDocument doc, int offset, int limitPos) throws BadLocationException(Code)
Get first white character in document in forward direction
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document where to start searching
Parameters:
  limitPos - position in document (greater or equal than offset) where thesearch will stop reporting unsuccessful search by returning -1 position of the first non-white character or -1



getIdentifier
public static String getIdentifier(BaseDocument doc, int offset) throws BadLocationException(Code)
Get the identifier around the given position or null if there's no identifier
See Also:    getIdentifierBlock()



getIdentifierBefore
public static String getIdentifierBefore(BaseDocument doc, int offset) throws BadLocationException(Code)
Get the identifier before the given position (ending at given offset) or null if there's no identifier



getIdentifierBlock
public static int[] getIdentifierBlock(BaseDocument doc, int offset) throws BadLocationException(Code)
Get the identifier around the given position or null if there's no identifier around the given position. The identifier must be accepted by SyntaxSupport.isIdnetifier() otherwise null is returned.
Parameters:
  doc - document to work on
Parameters:
  offset - position in document - usually the caret.getDot() the block (starting and ending position) enclosing the identifieror null if no identifier was found



getKit
public static BaseKit getKit(JTextComponent target)(Code)
Helper method to obtain instance of editor kit from existing JTextComponent. If the kit of the component is not an instance of the org.netbeans.editor.BaseKit the method returns null. The method doesn't require any document locking.
Parameters:
  target - JTextComponent for which the editor kit should be obtained BaseKit instance or null



getKitClass
public static Class getKitClass(JTextComponent target)(Code)
Helper method to obtain editor kit class from existing JTextComponent. This method is useful for example when dealing with Settings. The method doesn't require any document locking.
Parameters:
  target - JTextComponent for which the editor kit should be obtained editor kit class



getLastActiveComponent
public static JTextComponent getLastActiveComponent()(Code)



getLineOffset
public static int getLineOffset(BaseDocument doc, int offset) throws BadLocationException(Code)
Return line offset (line number - 1) for some position in the document
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document where to start searching



getNextTabColumn
public static int getNextTabColumn(BaseDocument doc, int offset) throws BadLocationException(Code)
Get the visual column corresponding to the position after pressing the TAB key.
Parameters:
  doc - document to work with
Parameters:
  offset - position at which the TAB was pressed



getNextWord
public static int getNextWord(JTextComponent c, int offset) throws BadLocationException(Code)



getNextWord
public static int getNextWord(BaseDocument doc, int offset) throws BadLocationException(Code)



getPositionAbove
public static int getPositionAbove(JTextComponent c, int offset, int x) throws BadLocationException(Code)
Get the position that is one line above and visually at some x-coordinate value.
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document from which the current line is determined
Parameters:
  x - float x-coordinate value position of the character that is at the one line above at therequired x-coordinate value



getPositionBelow
public static int getPositionBelow(JTextComponent c, int offset, int x) throws BadLocationException(Code)
Get the position that is one line above and visually at some x-coordinate value.
Parameters:
  c - text component to operate on
Parameters:
  offset - position in document from which the current line is determined
Parameters:
  x - float x-coordinate value position of the character that is at the one line above at therequired x-coordinate value



getPreviousWord
public static int getPreviousWord(JTextComponent c, int offset) throws BadLocationException(Code)



getPreviousWord
public static int getPreviousWord(BaseDocument doc, int offset) throws BadLocationException(Code)



getRowCount
public static int getRowCount(BaseDocument doc, int startPos, int endPos) throws BadLocationException(Code)
Count of rows between these two positions



getRowCount
public static int getRowCount(BaseDocument doc)(Code)
Get the total count of lines in the document



getRowEnd
public static int getRowEnd(JTextComponent c, int offset) throws BadLocationException(Code)
Get the end position of the row right before the new-line character.
Parameters:
  c - text component to operate on
Parameters:
  offset - position in document where to start searching
Parameters:
  relLine - shift offset forward/back by some amount of lines position of the end of the row or -1 for invalid position



getRowEnd
public static int getRowEnd(BaseDocument doc, int offset) throws BadLocationException(Code)



getRowFirstNonWhite
public static int getRowFirstNonWhite(BaseDocument doc, int offset) throws BadLocationException(Code)
Get the first non-white character on the line. The document.isWhitespace() is used to test whether the particular character is white space or not.
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document anywhere on the line position of the first non-white char on the line or -1 if there'sno non-white character on that line.



getRowIndent
public static int getRowIndent(BaseDocument doc, int offset) throws BadLocationException(Code)
Get indentation on the current line. If this line is white then return -1.
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document anywhere on the line indentation or -1 if the line is white



getRowIndent
public static int getRowIndent(BaseDocument doc, int offset, boolean downDir) throws BadLocationException(Code)
Get indentation on the current line. If this line is white then go either up or down an return indentation of the first non-white row. The getRowFirstNonWhite() is used to find the indentation on particular line.
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document anywhere on the line
Parameters:
  downDir - if this flag is set to true then if the row is white then theindentation of the next first non-white row is returned. Ifit's false then the indentation of the previous firstnon-white row is returned. indentation or -1 if there's no non-white line in the specifieddirection



getRowLastNonWhite
public static int getRowLastNonWhite(BaseDocument doc, int offset) throws BadLocationException(Code)
Get the last non-white character on the line. The document.isWhitespace() is used to test whether the particular character is white space or not.
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document anywhere on the line position of the last non-white char on the line or -1 if there'sno non-white character on that line.



getRowStart
public static int getRowStart(JTextComponent c, int offset) throws BadLocationException(Code)
Get the starting position of the row.
Parameters:
  c - text component to operate on
Parameters:
  offset - position in document where to start searching position of the start of the row or -1 for invalid position



getRowStart
public static int getRowStart(BaseDocument doc, int offset) throws BadLocationException(Code)
Get the starting position of the row.
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document where to start searching position of the start of the row or -1 for invalid position



getRowStart
public static int getRowStart(BaseDocument doc, int offset, int lineShift) throws BadLocationException(Code)
Get the starting position of the row while providing relative count of row how the given position should be shifted. This is the most efficient way how to move by lines in the document based on some position. There is no similair getRowEnd() method that would have shifting parameter.
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document where to start searching
Parameters:
  lineShift - shift the given offset forward/back relatively by some amountof lines position of the start of the row or -1 for invalid position



getRowStartFromLineOffset
public static int getRowStartFromLineOffset(BaseDocument doc, int lineOffset)(Code)
Return start offset of the line
Parameters:
  lineOffset - line offset starting from 0 start position of the line or -1 if lineOffset was invalid



getSelectionOrIdentifier
public static String getSelectionOrIdentifier(JTextComponent c, int offset) throws BadLocationException(Code)
Get the selection if there's any or get the identifier around the position if there's no selection.



getSelectionOrIdentifier
public static String getSelectionOrIdentifier(JTextComponent c)(Code)
Get the selection or identifier at the current caret position



getSelectionOrIdentifierBlock
public static int[] getSelectionOrIdentifierBlock(JTextComponent c, int offset) throws BadLocationException(Code)
Get the selection if there's any or get the identifier around the position if there's no selection.
Parameters:
  c - component to work with
Parameters:
  offset - position in document - usually the caret.getDot() the block (starting and ending position) enclosing the identifieror null if no identifier was found



getSelectionOrIdentifierBlock
public static int[] getSelectionOrIdentifierBlock(JTextComponent c)(Code)
Get the selection or identifier at the current caret position
See Also:    getSelectionOrIdentifierBlock(JTextComponent, int)



getStatusText
public static String getStatusText(JTextComponent c)(Code)



getSyntaxSupport
public static SyntaxSupport getSyntaxSupport(JTextComponent target)(Code)
Get the syntax-support class that belongs to the document of the given component. Besides using directly this method, the SyntaxSupport can be obtained by calling doc.getSyntaxSupport(). The method can return null in case the document is not an instance of the BaseDocument. The method doesn't require any document locking.
Parameters:
  target - JTextComponent for which the syntax-support should be obtained SyntaxSupport instance or null



getTabInsertString
public static String getTabInsertString(BaseDocument doc, int offset) throws BadLocationException(Code)

See Also:    Formatter.insertTabString()



getVisualColumn
public static int getVisualColumn(BaseDocument doc, int offset) throws BadLocationException(Code)
Return visual column (with expanded tabs) on the line.
Parameters:
  doc - document to operate on
Parameters:
  offset - position in document for which the visual column should befound visual column on the line determined by position



getWord
public static String getWord(JTextComponent c, int offset) throws BadLocationException(Code)
Get the word around the given position .
Parameters:
  c - component to work with
Parameters:
  offset - position in document - usually the caret.getDot() the word.



getWord
public static String getWord(BaseDocument doc, int offset) throws BadLocationException(Code)
Get the word at given position.



getWordEnd
public static int getWordEnd(JTextComponent c, int offset) throws BadLocationException(Code)



getWordEnd
public static int getWordEnd(BaseDocument doc, int offset) throws BadLocationException(Code)



getWordStart
public static int getWordStart(JTextComponent c, int offset) throws BadLocationException(Code)
Get start of the current word. If there are no more words till the begining of the document, this method returns -1.
Parameters:
  c - text component to operate on
Parameters:
  offset - position in document from which the current line is determined



getWordStart
public static int getWordStart(BaseDocument doc, int offset) throws BadLocationException(Code)



insertMark
public static void insertMark(BaseDocument doc, Mark mark, int offset) throws BadLocationException, InvalidMarkException(Code)



isEOL
public static boolean isEOL(BaseDocument doc, int offset) throws BadLocationException(Code)



isRowEmpty
public static boolean isRowEmpty(BaseDocument doc, int offset) throws BadLocationException(Code)
Tests whether the line contains no characters except the ending new-line.
Parameters:
  doc - document to operate on
Parameters:
  offset - position anywhere on the tested line whether the line is empty or not



isRowWhite
public static boolean isRowWhite(BaseDocument doc, int offset) throws BadLocationException(Code)
Tests whether the line contains only whitespace characters.
Parameters:
  doc - document to operate on
Parameters:
  offset - position anywhere on the tested line whether the line is empty or not



keySequenceToString
public static String keySequenceToString(KeyStroke[] seq)(Code)
Creates nice textual description of sequence of KeyStrokes. Usable for displaying MultiKeyBindings. The keyStrokes are delimited by space.
Parameters:
  Array - of KeyStrokes representing the actual sequence. String describing the KeyStroke sequence.



keyStrokeToString
public static String keyStrokeToString(KeyStroke stroke)(Code)
Creates nice textual representation of KeyStroke. Modifiers and an actual key label are concated by plus signs
Parameters:
  the - KeyStroke to get description of String describing the KeyStroke



moveMark
public static void moveMark(BaseDocument doc, Mark mark, int newOffset) throws BadLocationException, InvalidMarkException(Code)



performAction
public static void performAction(Action a, ActionEvent evt, JTextComponent target)(Code)



reformat
public static int reformat(BaseDocument doc, int startOffset, int endOffset) throws BadLocationException(Code)
Reformat a block of code.
Parameters:
  doc - document to work with
Parameters:
  startOffset - offset at which the formatting starts
Parameters:
  endOffset - offset at which the formatting ends length of the reformatted code



reformatLine
public static void reformatLine(BaseDocument doc, int pos) throws BadLocationException(Code)
Reformat the line around the given position.



requestFocus
public static void requestFocus(JTextComponent c)(Code)



returnFocus
public static void returnFocus()(Code)



runInEventDispatchThread
public static void runInEventDispatchThread(Runnable r)(Code)



setStatusBoldText
public static void setStatusBoldText(JTextComponent c, String text)(Code)



setStatusText
public static void setStatusText(JTextComponent c, String text)(Code)



setStatusText
public static void setStatusText(JTextComponent c, String text, Coloring extraColoring)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.