Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.ide.db.util
Class ExpressionEditSupport

java.lang.Object
  extended by oracle.ide.db.util.ExpressionEditSupport
All Implemented Interfaces:
java.awt.event.FocusListener, java.util.EventListener, FieldInsightProvider

public class ExpressionEditSupport
extends java.lang.Object
implements java.awt.event.FocusListener, FieldInsightProvider

Convinience support class for expression editors. Covers undo, adding of expression templates and caret focus issues.


Constructor Summary
ExpressionEditSupport(javax.swing.text.JTextComponent comp)
           
 
Method Summary
 void addToExpressionField(java.lang.String text)
          Adds the given text to the registered expression text component.
 void clearUndo()
           
 void completeInsight(javax.swing.text.Document doc, int i, java.lang.Object insert)
          Complete insight for the specified position in the specified document, using the specified insight object.
static java.util.Map createInsightMap(FromObject[] froms)
           
protected  java.lang.Object[] filter(java.lang.Object[] objs, java.lang.String filter)
           
 void focusGained(java.awt.event.FocusEvent e)
           
 void focusLost(java.awt.event.FocusEvent e)
           
 javax.swing.ListCellRenderer getCellRenderer()
          Get the cell renderer used for the completion list this provider handles.
static java.util.Collection getColumns(FromObject from)
           
 java.lang.Object[] getInsightData(javax.swing.text.Document doc, int i)
          Get insight data for the specified position in the specified document.
 boolean handlesInsight(javax.swing.text.Document doc, int i)
          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?
 void setInsightMap(java.util.Map relsToCols)
          Map of usable relation aliases to Column[].
 void setInsightObjects(java.util.Set objs)
          List of objects to insightfully show the names for.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionEditSupport

public ExpressionEditSupport(javax.swing.text.JTextComponent comp)
Method Detail

addToExpressionField

public void addToExpressionField(java.lang.String text)
Adds the given text to the registered expression text component.


clearUndo

public void clearUndo()

setInsightMap

public void setInsightMap(java.util.Map relsToCols)
Map of usable relation aliases to Column[].


setInsightObjects

public void setInsightObjects(java.util.Set objs)
List of objects to insightfully show the names for.


filter

protected java.lang.Object[] filter(java.lang.Object[] objs,
                                    java.lang.String filter)

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Specified by:
focusLost in interface java.awt.event.FocusListener

getCellRenderer

public javax.swing.ListCellRenderer getCellRenderer()
Description copied from interface: FieldInsightProvider
Get the cell renderer used for the completion list this provider handles.

Specified by:
getCellRenderer in interface FieldInsightProvider
Returns:
a list cell renderer.

handlesInsight

public boolean handlesInsight(javax.swing.text.Document doc,
                              int i)
Description copied from interface: FieldInsightProvider
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 FieldInsightProvider
Parameters:
doc - the document of the component to provide insight for
i - 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.Object[] getInsightData(javax.swing.text.Document doc,
                                         int i)
Description copied from interface: FieldInsightProvider
Get insight data for the specified position in the specified document.

Specified by:
getInsightData in interface FieldInsightProvider
Parameters:
doc - the document to provide insight for
i - the current caret position within the document
Returns:
an array of insight objects.

completeInsight

public void completeInsight(javax.swing.text.Document doc,
                            int i,
                            java.lang.Object insert)
Description copied from interface: FieldInsightProvider
Complete insight for the specified position in the specified document, using the specified insight object.

Specified by:
completeInsight in interface FieldInsightProvider
Parameters:
doc - the document to complete
i - the position to complete at
insert - the insight object to complete with

isAutoPopupChar

public boolean isAutoPopupChar(char c)
Description copied from interface: FieldInsightProvider
Should the specified character trigger an automatic popup completion list that might be handled by this insight provider?

Specified by:
isAutoPopupChar in interface FieldInsightProvider
Parameters:
c - the character before the caret position.

createInsightMap

public static java.util.Map createInsightMap(FromObject[] froms)

getColumns

public static java.util.Collection getColumns(FromObject from)

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

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