public class DataSetUrlCompletionItem extends java.lang.Object implements CompletionItem
| Modifier and Type | Method and Description |
|---|---|
CompletionTask |
createDocumentationTask()
Returns a task used to obtain a documentation associated with the item if there
is any.
|
CompletionTask |
createToolTipTask()
Returns a task used to obtain a tooltip hint associated with the item if there
is any.
|
void |
defaultAction(javax.swing.text.JTextComponent jTextComponent)
Gets invoked when user presses
VK_ENTER key
or when she double-clicks on this item with the mouse cursor. |
java.lang.CharSequence |
getInsertPrefix()
Returns a text used for finding of a longest common prefix
after the TAB gets pressed or when the completion is opened explicitly.
|
java.lang.String |
getLabel() |
int |
getPreferredWidth(java.awt.Graphics graphics,
java.awt.Font font)
Get the preferred visual width of this item.
|
int |
getSortPriority()
Returns the item's priority.
|
java.lang.CharSequence |
getSortText()
Returns a text used to sort items alphabetically.
|
boolean |
instantSubstitution(javax.swing.text.JTextComponent jTextComponent)
When enabled for the item the instant substitution should process the item
in the same way like when the item is displayed and Enter key gets pressed
by the user.
|
void |
processKeyEvent(java.awt.event.KeyEvent keyEvent)
Process the key pressed when this completion item was selected
in the completion popup window.
|
void |
render(java.awt.Graphics graphics,
java.awt.Font font,
java.awt.Color color,
java.awt.Color color0,
int i,
int i0,
boolean b)
Render this item into the given graphics.
|
java.lang.String |
toString() |
public CompletionTask createDocumentationTask()
CompletionItemcreateDocumentationTask in interface CompletionItempublic CompletionTask createToolTipTask()
CompletionItemcreateToolTipTask in interface CompletionItempublic void defaultAction(javax.swing.text.JTextComponent jTextComponent)
CompletionItemVK_ENTER key
or when she double-clicks on this item with the mouse cursor.
defaultAction in interface CompletionItemjTextComponent - non-null text component for which the completion was invoked.public java.lang.CharSequence getInsertPrefix()
CompletionItem
Generally the returned text does not need to contain all the information
that gets inserted when the item is selected.
For example in java completion the field name should be returned for fields
or a method name for methods (but not parameters)
or a non-FQN name for classes.
getInsertPrefix in interface CompletionItempublic int getPreferredWidth(java.awt.Graphics graphics,
java.awt.Font font)
CompletionItemgetPreferredWidth in interface CompletionItemgraphics - graphics that can be used for determining the preferred width
e.g. getting of the font metrics.font - default font used for rendering.public int getSortPriority()
CompletionItemgetSortPriority in interface CompletionItempublic java.lang.CharSequence getSortText()
CompletionItemgetSortText in interface CompletionItempublic boolean instantSubstitution(javax.swing.text.JTextComponent jTextComponent)
CompletionItemCompletionItem.defaultAction(JTextComponent)
if necessary.
instantSubstitution in interface CompletionItemjTextComponent - non-null text component for which the completion was invoked.true if the instant substitution was successfully done.
false means that the instant substitution should not be done
for this item and the completion item should normally be displayed.public void processKeyEvent(java.awt.event.KeyEvent keyEvent)
CompletionItemprocessKeyEvent in interface CompletionItemkeyEvent - non-null key event of the pressed key. It should be consumed
in case the item is sensitive to the given key. The source of this
event is the text component to which the corresponding action should
be performed.public void render(java.awt.Graphics graphics,
java.awt.Font font,
java.awt.Color color,
java.awt.Color color0,
int i,
int i0,
boolean b)
CompletionItemrender in interface CompletionItemgraphics - graphics to render the item into.font - default font used for rendering.color - default color used for rendering.color0 - color used for background.i - width of the area to render into.i0 - height of the are to render into.b - whether this item is visually selected in the list
into which the items are being rendered.public java.lang.String getLabel()
public java.lang.String toString()
toString in class java.lang.Object