站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

CompletionQuery.AbstractResultItem (Editor Library) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.lib/1 1.14.0 3

org.netbeans.editor.ext
Class CompletionQuery.AbstractResultItem

java.lang.Object
  extended by 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


Field Summary
protected  String text
           
 
Constructor Summary
CompletionQuery.AbstractResultItem(String text)
          Create new ResultItem for given text, should be used in subclass constructors
 
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
 
Methods inherited from interface org.netbeans.editor.ext.CompletionQuery.ResultItem
getPaintComponent
 

Field Detail

text

protected String text
Constructor Detail

CompletionQuery.AbstractResultItem

public CompletionQuery.AbstractResultItem(String text)
Create new ResultItem for given text, should be used in subclass constructors

Method Detail

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 placed
len - the length of recognized text which should be replaced
subLen - 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 placed
len - the length of recognized text which should be replaced
shift - 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.

org.netbeans.modules.editor.lib/1 1.14.0 3

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.