public class TokenUtils
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
static class |
TokenUtils.TokenSubList |
限定符和类型 | 方法和说明 |
---|---|
static TokenUtils.TokenSubList |
getSubTokenList(Token tokenList,
int pos,
javax.swing.text.TabExpander e,
RSyntaxTextArea textArea,
float x0)
Modifies the passed-in token list to start at the specified offset.
|
static TokenUtils.TokenSubList |
getSubTokenList(Token tokenList,
int pos,
javax.swing.text.TabExpander e,
RSyntaxTextArea textArea,
float x0,
TokenImpl tempToken)
Modifies the passed-in token list to start at the specified offset.
|
public static TokenUtils.TokenSubList getSubTokenList(Token tokenList, int pos, javax.swing.text.TabExpander e, RSyntaxTextArea textArea, float x0)
[token1] -> [token2] -> [token3] -> [token4] 20 30 31 40 41 50 51 60and you used this method to make the token list start at position 44, then the token list would be modified to be the following:
[part-of-old-token3] -> [token4] 44 50 51 60Tokens that come before the specified position are forever lost, and the token containing that position is made to begin at that position if necessary. All token types remain the same as they were originally.
This method can be useful if you are only interested in part of a token list (i.e., the line it represents), but you don't want to modify the token list yourself.
tokenList
- The list to make start at the specified position.
This parameter is modified.pos
- The position at which the new token list is to start. If
this position is not in the passed-in token list,
returned token list will either be null
or the
unpaintable token(s) at the end of the passed-in token list.e
- How to expand tabs.textArea
- The text area from which the token list came.x0
- The initial x-pixel position of the old token list.null
if pos
was not a valid offset
into the token list.getSubTokenList(Token, int, TabExpander, RSyntaxTextArea, float, TokenImpl)
public static TokenUtils.TokenSubList getSubTokenList(Token tokenList, int pos, javax.swing.text.TabExpander e, RSyntaxTextArea textArea, float x0, TokenImpl tempToken)
[token1] -> [token2] -> [token3] -> [token4] 20 30 31 40 41 50 51 60and you used this method to make the token list start at position 44, then the token list would be modified to be the following:
[part-of-old-token3] -> [token4] 44 50 51 60Tokens that come before the specified position are forever lost, and the token containing that position is made to begin at that position if necessary. All token types remain the same as they were originally.
This method can be useful if you are only interested in part of a token list (i.e., the line it represents), but you don't want to modify the token list yourself.
tokenList
- The list to make start at the specified position.
This parameter is modified.pos
- The position at which the new token list is to start. If
this position is not in the passed-in token list,
returned token list will either be null
or the
unpaintable token(s) at the end of the passed-in token list.e
- How to expand tabs.textArea
- The text area from which the token list came.x0
- The initial x-pixel position of the old token list.tempToken
- A temporary token to use when creating the token list
result. This may be null
but callers can pass in
a "buffer" token for performance if desired.null
if pos
was not a valid offset
into the token list.getSubTokenList(Token, int, TabExpander, RSyntaxTextArea, float)