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

E17493-01

oracle.javatools.ui.completion
Interface CompletionProvider<T>

All Known Implementing Classes:
ExpressionEditSupport, FileCompletionProvider, InsightManager, StringCompletionProvider

public interface CompletionProvider<T>

A field insight provider is responsible for providing the insight completion list for an CompletionTextField.

T is the type of object representing each cell in the insight list (e.g. String, File)


Method Summary
 void completeInsight(javax.swing.text.Document doc, int pos, T 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.
 T[] 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?
 

Method Detail

getCellRenderer

javax.swing.ListCellRenderer getCellRenderer()
Get the cell renderer used for the completion list this provider handles.

Returns:
a list cell renderer.

handlesInsight

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. 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.

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

T[] getInsightData(javax.swing.text.Document doc,
                   int pos)
Get insight data for the specified position in the specified document.

Parameters:
doc - the document to provide insight for
pos - the current caret position within the document
Returns:
an array of insight objects.

completeInsight

void completeInsight(javax.swing.text.Document doc,
                     int pos,
                     T insightObject)
Complete insight for the specified position in the specified document, using the specified insight object.

Parameters:
doc - the document to complete
pos - the position to complete at
insightObject - the insight object to complete with

isAutoPopupChar

boolean isAutoPopupChar(char c)
Should the specified character trigger an automatic popup completion list that might be handled by this insight provider?

Parameters:
c - the character before the caret position.

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

E17493-01

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