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

E17493-01

oracle.javatools.ui.completion
Class FileCompletionProvider

java.lang.Object
  extended by oracle.javatools.ui.completion.FileCompletionProvider
All Implemented Interfaces:
CompletionProvider<java.io.File>

public class FileCompletionProvider
extends java.lang.Object
implements CompletionProvider<java.io.File>

Provides field insight for filenames.


Constructor Summary
FileCompletionProvider()
           
FileCompletionProvider(boolean onlyDirectories)
           
 
Method Summary
 void completeInsight(javax.swing.text.Document doc, int pos, java.io.File f)
          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.io.File[] 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?
 boolean isOnlyDirectories()
           
protected  boolean isValid(java.io.File f)
          Is the specified file valid for inclusion in the list? Subclasses can override this to filter out certain files.
 void setOnlyDirectories(boolean onlyDirectories)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileCompletionProvider

public FileCompletionProvider(boolean onlyDirectories)

FileCompletionProvider

public FileCompletionProvider()
Method Detail

setOnlyDirectories

public void setOnlyDirectories(boolean onlyDirectories)

isOnlyDirectories

public boolean isOnlyDirectories()

isValid

protected boolean isValid(java.io.File f)
Is the specified file valid for inclusion in the list? Subclasses can override this to filter out certain files.


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.io.File>
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.io.File>
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.io.File[] 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.io.File>
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.io.File f)
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.io.File>
Parameters:
doc - the document to complete
pos - the position to complete at
f - 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.io.File>
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.