public final class CompletionResultSet extends Object
Modifier and Type | Field and Description |
---|---|
static int |
PRIORITY_SORT_TYPE
Sort type returned from
CompletionResultSet.getSortType()
that prefers priority of the item (CompletionItem.getSortPriority() )
over the text of the item (CompletionItem.getSortText() ). |
static int |
TEXT_SORT_TYPE
Sort type returned from
CompletionResultSet.getSortType()
that prefers text of the item (CompletionItem.getSortText() ). |
Modifier and Type | Method and Description |
---|---|
boolean |
addAllItems(Collection<? extends CompletionItem> items)
Add the collection of the completion items to this result set.
|
boolean |
addItem(CompletionItem item)
Add the completion item to this result set.
|
void |
estimateItems(int estimatedItemCount,
int estimatedItemWidth)
Indicate that adding of the items to this result set
will likely need a long time so the resulting number of items
and their visual size should be estimated so that
the completion infrastructure can estimate the size
of the popup window and display the items added subsequently
without changing its bound extensively.
|
void |
finish()
Mark that this result set is finished and there will be no more
modifications done to it.
|
int |
getSortType()
Get the sort type currently used by the code completion.
|
boolean |
isFinished()
Check whether this result set is finished.
|
void |
setAnchorOffset(int anchorOffset)
Set the document offset to which the returned completion items
or documentation or tooltip should be anchored.
|
void |
setDocumentation(CompletionDocumentation documentation)
Set the documentation to this result set.
|
void |
setHasAdditionalItems(boolean value)
Indicate that additional items could be added to this result set.
|
void |
setHasAdditionalItemsText(String text)
Set the text to be displayed in a completion popup whenever a
CompletionProvider
indicates that additional items could be added to this result set by passing
true to CompletionResultSet.setHasAdditionalItems(boolean) . |
void |
setTitle(String title)
Deprecated.
|
void |
setToolTip(JToolTip toolTip)
Set the tooltip to this result set.
|
void |
setWaitText(String waitText)
Set the explicit value displayed in a label when the completion results
do not get computed during a certain timeout (e.g.
|
public static final int PRIORITY_SORT_TYPE
CompletionResultSet.getSortType()
that prefers priority of the item (CompletionItem.getSortPriority()
)
over the text of the item (CompletionItem.getSortText()
).public static final int TEXT_SORT_TYPE
CompletionResultSet.getSortType()
that prefers text of the item (CompletionItem.getSortText()
).
over the priority of the item (CompletionItem.getSortPriority()
)@Deprecated public void setTitle(String title)
CompletionProvider.COMPLETION_QUERY_TYPE
.
public void setAnchorOffset(int anchorOffset)
public boolean addItem(CompletionItem item)
item
- non-null completion item.public boolean addAllItems(Collection<? extends CompletionItem> items)
items
- collection of items to be added.public void estimateItems(int estimatedItemCount, int estimatedItemWidth)
CompletionResultSet.finish()
gets called on this result set
before displaying any of the items added to this result set.
By calling of this method the task also confirms
that the items added by CompletionResultSet.addItem(CompletionItem)
subsequently
are already in the order corresponding to the CompletionResultSet.getSortType()
.
estimatedItemCount
- estimated number of the items that will
be added to this result set by CompletionResultSet.addItem(CompletionItem)
.
If the estimate is significantly lower than the reality then
the vertical scrollbar granularity may be decreased or the vertical
scrollbar can be removed completely once the result set is finished.
If the estimate is significantly higher than the reality then
the vertical scrollbar granularity may be increased
once the result set is finished.estimatedItemWidth
- estimated maximum visual width of a completion item.public void setHasAdditionalItems(boolean value)
CompletionProvider.COMPLETION_ALL_QUERY_TYPE
.
CompletionProvider.createTask(int, javax.swing.text.JTextComponent)
with CompletionProvider.COMPLETION_QUERY_TYPE
.public void setHasAdditionalItemsText(String text)
CompletionProvider
indicates that additional items could be added to this result set by passing
true
to CompletionResultSet.setHasAdditionalItems(boolean)
.text
- the text that will be directly prepend to the "Press 'Ctrl-Space' Again for All Items"
message in the completion popup. The text should end with a separator (e.g. space, semicolon and space, etc.)
that will separate it from the rest of the displayed message. null
can be passed
to revert any previous setting of the text.public void setDocumentation(CompletionDocumentation documentation)
CompletionProvider.createTask(int, javax.swing.text.JTextComponent)
with CompletionProvider.DOCUMENTATION_QUERY_TYPE
or for CompletionItem.createDocumentationTask()
.public void setToolTip(JToolTip toolTip)
CompletionProvider.createTask(int, javax.swing.text.JTextComponent)
with CompletionProvider.TOOLTIP_QUERY_TYPE
or for CompletionItem.createToolTipTask()
.public void finish()
public boolean isFinished()
CompletionResultSet.finish()
.public int getSortType()
CompletionResultSet.PRIORITY_SORT_TYPE
or CompletionResultSet.TEXT_SORT_TYPE
.public void setWaitText(String waitText)
waitText
- description of what the query computation
is currently (doing or waiting for).
null
can be passed
to restore using of the default text.