|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.cdt.internal.ui.text.CWordFinder
public class CWordFinder
This is a helper class for the text editor to be able to determine, given a particular offset in a document, various candidates segments for things like context help, proposals and hovering.
Constructor Summary | |
---|---|
CWordFinder()
|
Method Summary | |
---|---|
static int |
countLFs(java.lang.String s)
Searches for line feed symbols in string. |
static org.eclipse.jface.text.IRegion |
findFunction(org.eclipse.jface.text.IDocument document,
int offset)
This method will determine the region for the name of the function within which the current offset is contained. |
static org.eclipse.jface.text.IRegion |
findWord(org.eclipse.jface.text.IDocument document,
int offset)
This method determines for a given offset into a given document what the region is which defines the current word. |
static boolean |
hasCBraces(java.lang.String s)
Checks whether the string contains any C-block delimiters ( { } ) |
static boolean |
isGlobal(org.eclipse.jface.text.IDocument document,
int offset)
This method will determine whether current offset is contained in any function's body or it's outside it. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CWordFinder()
Method Detail |
---|
public static org.eclipse.jface.text.IRegion findWord(org.eclipse.jface.text.IDocument document, int offset)
document
- The document to be examinedoffset
- The offset into the document where a word should be
idendified.
public static org.eclipse.jface.text.IRegion findFunction(org.eclipse.jface.text.IDocument document, int offset)
document
- The document to be examinedoffset
- The offset into the document where a word should be
idendified.
public static boolean isGlobal(org.eclipse.jface.text.IDocument document, int offset)
document
- The document to be examinedoffset
- The offset into the document
true
if there is no function body around offset
false
otherwisepublic static int countLFs(java.lang.String s)
s
- string to search in.
public static boolean hasCBraces(java.lang.String s)
s
- text to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |