当前页面: 
在线文档首页 > 
NetBeans API Javadoc (Current Development Version)
CompletionQuery.AbstractResultItem (Editor Library) - NetBeans API Javadoc (Current Development Version)
org.netbeans.editor.ext
Class CompletionQuery.AbstractResultItem
java.lang.Object
  
org.netbeans.editor.ext.CompletionQuery.AbstractResultItem
- All Implemented Interfaces: 
 - CompletionQuery.ResultItem
 
- Direct Known Subclasses: 
 - CompletionQuery.DefaultResultItem
 
- Enclosing interface:
 - CompletionQuery
 
public abstract static class CompletionQuery.AbstractResultItem
- extends Object
- implements CompletionQuery.ResultItem
  
A class providing generic, nearly full implementation of ResultItem
 
 
| 
Method Summary | 
 String | 
getItemText()
 
          Says what text would this Element use if substituteText is called. | 
 boolean | 
substituteCommonText(JTextComponent c,
                     int offset,
                     int len,
                     int subLen)
 
          Generic implementation, behaves just as described in specification
 in substituteCommonText() - removes len
 characters at offset out of document and then inserts
 subLen characters from the text | 
 boolean | 
substituteText(JTextComponent c,
               int offset,
               int len,
               boolean shift)
 
          Generic implementation, behaves just as described in specification
 in substituteText() - removes len characters 
 at offset out of document and then inserts
 whole text. | 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
 
text
protected String text
CompletionQuery.AbstractResultItem
public CompletionQuery.AbstractResultItem(String text)
- Create new ResultItem for given text, should be used in subclass constructors
 
substituteCommonText
public boolean substituteCommonText(JTextComponent c,
                                    int offset,
                                    int len,
                                    int subLen)
- Generic implementation, behaves just as described in specification
 in substituteCommonText() - removes 
len
 characters at offset out of document and then inserts
 subLen characters from the text
- Specified by:
 substituteCommonText in interface CompletionQuery.ResultItem
 
- Parameters:
 c - the text component to operate on, enables implementation to
        do things like movement of caret.offset - the offset where the item should be placedlen - the length of recognized text which should be replacedsubLen - the length of common part - the length of text that should
        be inserted after removal of recognized text
- Returns:
 - whether the text was successfully updated
 
 
 
substituteText
public boolean substituteText(JTextComponent c,
                              int offset,
                              int len,
                              boolean shift)
- Generic implementation, behaves just as described in specification
 in substituteText() - removes 
len characters 
 at offset out of document and then inserts
 whole text. Ignores shift argument.
- Specified by:
 substituteText in interface CompletionQuery.ResultItem
 
- Parameters:
 c - the text component to operate on, enables implementation to
        do things like movement of caret.offset - the offset where the item should be placedlen - the length of recognized text which should be replacedshift - the flag that instructs completion to behave somehow
        differently - enables more kinds of invocation of substituteText
- Returns:
 - whether the text was successfully updated
 
 
 
getItemText
public String getItemText()
- Description copied from interface: 
CompletionQuery.ResultItem 
- Says what text would this Element use if substituteText is called.
- Specified by:
 getItemText in interface CompletionQuery.ResultItem
 
- Returns:
 - the text this item would expand to.