|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gjt.sp.util.StandardUtilities
public class StandardUtilities
Several tools that depends on JDK only.
Method Summary | |
---|---|
static java.lang.String |
createWhiteSpace(int len,
int tabSize)
Creates a string of white space with the specified length. |
static java.lang.String |
createWhiteSpace(int len,
int tabSize,
int start)
Creates a string of white space with the specified length. |
static int |
getLeadingWhiteSpace(java.lang.String str)
Returns the number of leading white space characters in the specified string. |
static int |
getLeadingWhiteSpaceWidth(java.lang.String str,
int tabSize)
Returns the width of the leading white space in the specified string. |
static int |
getOffsetOfVirtualColumn(javax.swing.text.Segment seg,
int tabSize,
int column,
int[] totalVirtualWidth)
Returns the array offset of a virtual column number (taking tabs into account) in the segment. |
static int |
getTrailingWhiteSpace(java.lang.String str)
Returns the number of trailing whitespace characters in the specified string. |
static int |
getVirtualWidth(javax.swing.text.Segment seg,
int tabSize)
Returns the virtual column number (taking tabs into account) of the specified offset in the segment. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int getLeadingWhiteSpace(java.lang.String str)
str
- The stringpublic static int getTrailingWhiteSpace(java.lang.String str)
str
- The stringpublic static int getLeadingWhiteSpaceWidth(java.lang.String str, int tabSize)
str
- The stringtabSize
- The tab sizepublic static java.lang.String createWhiteSpace(int len, int tabSize)
To get a whitespace string tuned to the current buffer's settings, call this method as follows:
myWhitespace = MiscUtilities.createWhiteSpace(myLength, (buffer.getBooleanProperty("noTabs") ? 0 : buffer.getTabSize()));
len
- The lengthtabSize
- The tab size, or 0 if tabs are not to be usedpublic static java.lang.String createWhiteSpace(int len, int tabSize, int start)
To get a whitespace string tuned to the current buffer's settings, call this method as follows:
myWhitespace = MiscUtilities.createWhiteSpace(myLength, (buffer.getBooleanProperty("noTabs") ? 0 : buffer.getTabSize()));
len
- The lengthtabSize
- The tab size, or 0 if tabs are not to be usedstart
- The start offset, for tab alignmentpublic static int getVirtualWidth(javax.swing.text.Segment seg, int tabSize)
seg
- The segmenttabSize
- The tab sizepublic static int getOffsetOfVirtualColumn(javax.swing.text.Segment seg, int tabSize, int column, int[] totalVirtualWidth)
seg
- The segmenttabSize
- The tab sizecolumn
- The virtual column numbertotalVirtualWidth
- If this array is non-null, the total
virtual width will be stored in its first location if this method
returns -1.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |