Java Doc for TextUtilities.java in  » Swing-Library » jEdit » org » gjt » sp » jedit » 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 » jEdit » org.gjt.sp.jedit 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.gjt.sp.jedit.TextUtilities

TextUtilities
public class TextUtilities (Code)
Contains several text manipulation methods.
  • Bracket matching
  • Word start and end offset calculation
  • String comparison
  • Converting tabs to spaces and vice versa
  • Wrapping text
  • String case conversion

author:
   Slava Pestov
version:
   $Id: TextUtilities.java 9134 2007-03-13 05:30:18Z vanza $


Field Summary
final public static  intBRACKET_MATCH_LIMIT
    
final public static  intLOWER_CASE
    
final public static  intMIXED
    
final public static  intTITLE_CASE
    
final public static  intUPPER_CASE
    


Method Summary
public static  intfindMatchingBracket(JEditBuffer buffer, int line, int offset)
     Returns the offset of the bracket matching the one at the specified offset of the buffer, or -1 if the bracket is unmatched (or if the character is not a bracket).
public static  intfindWordEnd(String line, int pos, String noWordSep)
     Locates the end of the word at the specified position.
public static  intfindWordEnd(String line, int pos, String noWordSep, boolean joinNonWordChars)
     Locates the end of the word at the specified position.
public static  intfindWordEnd(String line, int pos, String noWordSep, boolean joinNonWordChars, boolean eatWhitespace)
     Locates the end of the word at the specified position.
public static  intfindWordEnd(String line, int pos, String noWordSep, boolean joinNonWordChars, boolean camelCasedWords, boolean eatWhitespace)
     Locates the end of the word at the specified position.
public static  intfindWordStart(String line, int pos, String noWordSep)
     Locates the start of the word at the specified position.
public static  intfindWordStart(String line, int pos, String noWordSep, boolean joinNonWordChars)
     Locates the start of the word at the specified position.
public static  intfindWordStart(String line, int pos, String noWordSep, boolean joinNonWordChars, boolean eatWhitespace)
     Locates the start of the word at the specified position.
public static  intfindWordStart(String line, int pos, String noWordSep, boolean joinNonWordChars, boolean camelCasedWords, boolean eatWhitespace)
     Locates the start of the word at the specified position.
public static  Stringformat(String text, int maxLineLength, int tabSize)
     Formats the specified text by merging and breaking lines to the specified width.
public static  chargetComplementaryBracket(char ch, boolean[] direction)
     Given an opening bracket, return the corresponding closing bracket and store true in direction[0].
public static  intgetStringCase(String str)
     Returns if the specified string is all upper case, all lower case, or title case (first letter upper case, rest lower case).
public static  TokengetTokenAtOffset(Token tokens, int offset)
     Returns the token that contains the specified offset.
public static  intignoringWhitespaceIndex(String str, int index)
     Inverse of indexIgnoringWhitespace().
public static  intindexIgnoringWhitespace(String str, int index)
     Inverse of ignoringWhitespaceIndex().
public static  voidindexIgnoringWhitespace(String text, int maxLineLength, int tabSize, StringBuffer buf)
    
public static  Stringjoin(Collection c, String delim)
     Similar to perl's join() method on lists, but works with all collections.
public static  StringspacesToTabs(String in, int tabSize)
     Converts consecutive spaces to tabs in the specified string.
public static  StringtabsToSpaces(String in, int tabSize)
     Converts tabs to consecutive spaces in the specified string.
public static  StringtoTitleCase(String str)
     Converts the specified string to title case, by capitalizing the first letter.

Field Detail
BRACKET_MATCH_LIMIT
final public static int BRACKET_MATCH_LIMIT(Code)



LOWER_CASE
final public static int LOWER_CASE(Code)



MIXED
final public static int MIXED(Code)



TITLE_CASE
final public static int TITLE_CASE(Code)



UPPER_CASE
final public static int UPPER_CASE(Code)





Method Detail
findMatchingBracket
public static int findMatchingBracket(JEditBuffer buffer, int line, int offset)(Code)
Returns the offset of the bracket matching the one at the specified offset of the buffer, or -1 if the bracket is unmatched (or if the character is not a bracket).
Parameters:
  buffer - The buffer
Parameters:
  line - The line
Parameters:
  offset - The offset within that line
since:
   jEdit 2.6pre1



findWordEnd
public static int findWordEnd(String line, int pos, String noWordSep)(Code)
Locates the end of the word at the specified position.
Parameters:
  line - The text
Parameters:
  pos - The position
Parameters:
  noWordSep - Characters that are non-alphanumeric, butshould be treated as word characters anyway



findWordEnd
public static int findWordEnd(String line, int pos, String noWordSep, boolean joinNonWordChars)(Code)
Locates the end of the word at the specified position.
Parameters:
  line - The text
Parameters:
  pos - The position
Parameters:
  noWordSep - Characters that are non-alphanumeric, butshould be treated as word characters anyway
Parameters:
  joinNonWordChars - Treat consecutive non-alphanumericcharacters as one word
since:
   jEdit 4.1pre2



findWordEnd
public static int findWordEnd(String line, int pos, String noWordSep, boolean joinNonWordChars, boolean eatWhitespace)(Code)
Locates the end of the word at the specified position.
Parameters:
  line - The text
Parameters:
  pos - The position
Parameters:
  noWordSep - Characters that are non-alphanumeric, butshould be treated as word characters anyway
Parameters:
  joinNonWordChars - Treat consecutive non-alphanumericcharacters as one word
Parameters:
  eatWhitespace - Include whitespace at end of word
since:
   jEdit 4.2pre5



findWordEnd
public static int findWordEnd(String line, int pos, String noWordSep, boolean joinNonWordChars, boolean camelCasedWords, boolean eatWhitespace)(Code)
Locates the end of the word at the specified position.
Parameters:
  line - The text
Parameters:
  pos - The position
Parameters:
  noWordSep - Characters that are non-alphanumeric, butshould be treated as word characters anyway
Parameters:
  joinNonWordChars - Treat consecutive non-alphanumericcharacters as one word
Parameters:
  camelCasedWords - Treat "camelCased" parts as words
Parameters:
  eatWhitespace - Include whitespace at end of word
since:
   jEdit 4.3pre10



findWordStart
public static int findWordStart(String line, int pos, String noWordSep)(Code)
Locates the start of the word at the specified position.
Parameters:
  line - The text
Parameters:
  pos - The position
Parameters:
  noWordSep - Characters that are non-alphanumeric, butshould be treated as word characters anyway



findWordStart
public static int findWordStart(String line, int pos, String noWordSep, boolean joinNonWordChars)(Code)
Locates the start of the word at the specified position.
Parameters:
  line - The text
Parameters:
  pos - The position
Parameters:
  noWordSep - Characters that are non-alphanumeric, butshould be treated as word characters anyway
Parameters:
  joinNonWordChars - Treat consecutive non-alphanumericcharacters as one word
since:
   jEdit 4.2pre5



findWordStart
public static int findWordStart(String line, int pos, String noWordSep, boolean joinNonWordChars, boolean eatWhitespace)(Code)
Locates the start of the word at the specified position.
Parameters:
  line - The text
Parameters:
  pos - The position
Parameters:
  noWordSep - Characters that are non-alphanumeric, butshould be treated as word characters anyway
Parameters:
  joinNonWordChars - Treat consecutive non-alphanumericcharacters as one word
Parameters:
  eatWhitespace - Include whitespace at start of word
since:
   jEdit 4.1pre2



findWordStart
public static int findWordStart(String line, int pos, String noWordSep, boolean joinNonWordChars, boolean camelCasedWords, boolean eatWhitespace)(Code)
Locates the start of the word at the specified position.
Parameters:
  line - The text
Parameters:
  pos - The position
Parameters:
  noWordSep - Characters that are non-alphanumeric, butshould be treated as word characters anyway
Parameters:
  joinNonWordChars - Treat consecutive non-alphanumericcharacters as one word
Parameters:
  camelCasedWords - Treat "camelCased" parts as words
Parameters:
  eatWhitespace - Include whitespace at start of word
since:
   jEdit 4.3pre10



format
public static String format(String text, int maxLineLength, int tabSize)(Code)
Formats the specified text by merging and breaking lines to the specified width.
Parameters:
  text - The text
Parameters:
  maxLineLength - The maximum line length
Parameters:
  tabSize - The tab size



getComplementaryBracket
public static char getComplementaryBracket(char ch, boolean[] direction)(Code)
Given an opening bracket, return the corresponding closing bracket and store true in direction[0]. Given a closing bracket, return the corresponding opening bracket and store false in direction[0]. Otherwise, return \0.
since:
   jEdit 4.3pre2



getStringCase
public static int getStringCase(String str)(Code)
Returns if the specified string is all upper case, all lower case, or title case (first letter upper case, rest lower case).
Parameters:
  str - The string
since:
   jEdit 4.0pre1



getTokenAtOffset
public static Token getTokenAtOffset(Token tokens, int offset)(Code)
Returns the token that contains the specified offset.
Parameters:
  tokens - The token list
Parameters:
  offset - The offset
since:
   jEdit 4.0pre3



ignoringWhitespaceIndex
public static int ignoringWhitespaceIndex(String str, int index)(Code)
Inverse of indexIgnoringWhitespace().
Parameters:
  str - a string (not an empty string)
Parameters:
  index - The index The index into the string where the number of non-whitespacecharacters that precede the index is count.
since:
   jEdit 4.3pre2



indexIgnoringWhitespace
public static int indexIgnoringWhitespace(String str, int index)(Code)
Inverse of ignoringWhitespaceIndex().
Parameters:
  str - a string (not an empty string)
Parameters:
  index - The index The number of non-whitespace characters that precede the index.
since:
   jEdit 4.3pre2



indexIgnoringWhitespace
public static void indexIgnoringWhitespace(String text, int maxLineLength, int tabSize, StringBuffer buf)(Code)



join
public static String join(Collection c, String delim)(Code)
Similar to perl's join() method on lists, but works with all collections.
Parameters:
  c - An iterable collection of Objects
Parameters:
  delim - a string to put between each object a joined toString() representation of the collection
since:
   jedit 4.3pre3



spacesToTabs
public static String spacesToTabs(String in, int tabSize)(Code)
Converts consecutive spaces to tabs in the specified string.
Parameters:
  in - The string
Parameters:
  tabSize - The tab size



tabsToSpaces
public static String tabsToSpaces(String in, int tabSize)(Code)
Converts tabs to consecutive spaces in the specified string.
Parameters:
  in - The string
Parameters:
  tabSize - The tab size



toTitleCase
public static String toTitleCase(String str)(Code)
Converts the specified string to title case, by capitalizing the first letter.
Parameters:
  str - The string
since:
   jEdit 4.0pre1



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.