Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


oracle.javatools.ui.completion
Class StringCompletionProvider

java.lang.Object
  extended by oracle.javatools.ui.completion.StringCompletionProvider

All Implemented Interfaces:
CompletionProvider<java.lang.String>

public final class StringCompletionProvider
extends java.lang.Object
implements CompletionProvider<java.lang.String>

A completion provider for a simple collection of Strings.


Field Summary
 javax.swing.DefaultListCellRenderer renderer
           

 

Constructor Summary
StringCompletionProvider(java.util.Collection<java.lang.String> strings)
          Create a provider with the collection of strings to offer to the user in the popup for this completion field.

 

Method Summary
 void completeInsight(javax.swing.text.Document doc, int pos, java.lang.String insightObject)
          Complete insight for the specified position in the specified document, using the specified insight object.
 javax.swing.ListCellRenderer getCellRenderer()
          Get the cell renderer used for the completion list this provider handles.
 java.lang.String[] getInsightData(javax.swing.text.Document doc, int pos)
          Get insight data for the specified position in the specified document.
 boolean handlesInsight(javax.swing.text.Document doc, int pos)
          Does this provider handle insight for the specified document? This method is normally called when an insight trigger of some kind happens (e.g.
 boolean isAutoPopupChar(char c)
          Should the specified character trigger an automatic popup completion list that might be handled by this insight provider?

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

renderer

public final javax.swing.DefaultListCellRenderer renderer

Constructor Detail

StringCompletionProvider

public StringCompletionProvider(java.util.Collection<java.lang.String> strings)
Create a provider with the collection of strings to offer to the user in the popup for this completion field.
Parameters:
strings -

Method Detail

getCellRenderer

public javax.swing.ListCellRenderer getCellRenderer()
Description copied from interface: CompletionProvider
Get the cell renderer used for the completion list this provider handles.
Specified by:
getCellRenderer in interface CompletionProvider<java.lang.String>
Returns:
a list cell renderer.

handlesInsight

public boolean handlesInsight(javax.swing.text.Document doc,
                              int pos)
Description copied from interface: CompletionProvider
Does this provider handle insight for the specified document? This method is normally called when an insight trigger of some kind happens (e.g. a delay timer for popup insight has expired, or the user explicitly requested insight). The implementation should examine the text in the document, based on the specified caret position, and decide whether it will handle insight for this location. If so, it should return true.
Specified by:
handlesInsight in interface CompletionProvider<java.lang.String>
Parameters:
doc - the document of the component to provide insight for
pos - the current caret position within the document
Returns:
true if this provider can provide an insight list for the specified location in the document.

getInsightData

public java.lang.String[] getInsightData(javax.swing.text.Document doc,
                                         int pos)
Description copied from interface: CompletionProvider
Get insight data for the specified position in the specified document.
Specified by:
getInsightData in interface CompletionProvider<java.lang.String>
Parameters:
doc - the document to provide insight for
pos - the current caret position within the document
Returns:
an array of insight objects.

completeInsight

public void completeInsight(javax.swing.text.Document doc,
                            int pos,
                            java.lang.String insightObject)
Description copied from interface: CompletionProvider
Complete insight for the specified position in the specified document, using the specified insight object.
Specified by:
completeInsight in interface CompletionProvider<java.lang.String>
Parameters:
doc - the document to complete
pos - the position to complete at
insightObject - the insight object to complete with

isAutoPopupChar

public boolean isAutoPopupChar(char c)
Description copied from interface: CompletionProvider
Should the specified character trigger an automatic popup completion list that might be handled by this insight provider?
Specified by:
isAutoPopupChar in interface CompletionProvider<java.lang.String>
Parameters:
c - the character before the caret position.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


Copyright © 1997, 2012, Oracle. All rights reserved.