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

E13403-04

oracle.javatools.editor.insight
Class ListInsightView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JList
                  extended by oracle.javatools.editor.insight.ListInsightView
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.Scrollable, InsightView

public class ListInsightView
extends javax.swing.JList
implements InsightView

The ListInsightView class is an implementation of the InsightView to support list-type data models. The data is displayed inside a JList and rendered with a custom list cell renderer if one is provided.

The default implementation of ListDataItemCellRenderer can be used, which will render the list cells with an icon (if one is provided) and display text. To take advantage of this, extend ListDataItem for your own data items in the list.

The ListInsightData extends the InsightData to define the model requirements of this ListInsightView class. Your implementation must implement the ListInsightData in order to work with this view implementation. You may wish to make use of the provided ListDataItemListModel to take care of ListModel functionality as well as sorting and searching functionality.

See Also:
InsightView, ListInsightData, ListDataItem, ListDataItemCellRenderer, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JList
javax.swing.JList.AccessibleJList, javax.swing.JList.DropLocation
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JList
HORIZONTAL_WRAP, VERTICAL, VERTICAL_WRAP
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ListInsightView()
          Constructs a new ListInsightView with no custom cell renderer.
ListInsightView(javax.swing.ListCellRenderer renderer)
          Constructs a new ListInsightView with no data, but with the specified cell renderer.
 
Method Summary
 boolean begin()
          Command to move the selection of the view to the top of the data set.
 boolean complete(Insight insight)
          Command to accept (complete) the current insight selection into the document.
 boolean down()
          Command to move the selection of the view to the next item (down) in the data set.
 boolean end()
          Command to move the selection of the view to the bottom of the data set.
 javax.swing.JComponent getComponent()
          Fetches the Swing UI component for displaying this view.
 InsightData getData()
          Fetches the InsightData that is the data model associated with this particular view.
protected  javax.swing.ListModel getListModel(ListInsightData insightData)
          Utility routine to fetch the ListModel from the given insight data instance.
 int getVisibleRowCount()
          Returns the preferred number of visible rows.
protected  boolean isAtBeginList()
          Utility routine to check if the selected index is currently at the start of the list.
protected  boolean isAtEndList()
          Utility routine to check if the selected index is currently at the end of the list.
 boolean left()
          Command to move the selection of the view to the left item in the data set.
 boolean pageDown()
          Command to move the selection of the view down by one page in the data set.
 boolean pageUp()
          Command to move the selection of the view up by one page in the data set.
 boolean partialComplete()
          Command to request partial completion using the current insight information based on the current document contents.
 boolean right()
          Command to move the selection of the view to the right item in the data set.
 void selectDefault()
          Instructs the InsightView to select the default insight data item, and to make sure that it is visible.
 void setData(InsightData newData)
          Sets the InsightData data model which should be displayed by this view.
 void setPopupWindow(PopupWindow popup)
          Sets the PopupWindow so we can set the accessible name of the selected item on the window so it will be read.
 void setSelectionInterval(int anchor, int lead)
           
 void setUI(javax.swing.plaf.ListUI ui)
          Sets the look and feel (L&F) object that renders this component.
protected  boolean supportWrapping()
          Whether to support wrapping behavior with the arrow keys at the top or bottom of the code insight list.
 boolean up()
          Command to move the selection of the view to the previous item (up) in the data set.
 
Methods inherited from class javax.swing.JList
addListSelectionListener, addSelectionInterval, clearSelection, createSelectionModel, ensureIndexIsVisible, fireSelectionValueChanged, getAccessibleContext, getAnchorSelectionIndex, getCellBounds, getCellRenderer, getDragEnabled, getDropLocation, getDropMode, getFirstVisibleIndex, getFixedCellHeight, getFixedCellWidth, getLastVisibleIndex, getLayoutOrientation, getLeadSelectionIndex, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getModel, getNextMatch, getPreferredScrollableViewportSize, getPrototypeCellValue, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedIndex, getSelectedIndices, getSelectedValue, getSelectedValues, getSelectionBackground, getSelectionForeground, getSelectionMode, getSelectionModel, getToolTipText, getUI, getUIClassID, getValueIsAdjusting, indexToLocation, isSelectedIndex, isSelectionEmpty, locationToIndex, paramString, removeListSelectionListener, removeSelectionInterval, setCellRenderer, setDragEnabled, setDropMode, setFixedCellHeight, setFixedCellWidth, setLayoutOrientation, setListData, setListData, setModel, setPrototypeCellValue, setSelectedIndex, setSelectedIndices, setSelectedValue, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setValueIsAdjusting, setVisibleRowCount, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListInsightView

public ListInsightView()
Constructs a new ListInsightView with no custom cell renderer. This will just construct an empty list with our default ListDataItemCellRenderer


ListInsightView

public ListInsightView(javax.swing.ListCellRenderer renderer)
Constructs a new ListInsightView with no data, but with the specified cell renderer. Since the data list is empty, the data to be displayed must be set with a separate call to setData() to display any data.

Parameters:
renderer - the cell renderer to use
Method Detail

setUI

public void setUI(javax.swing.plaf.ListUI ui)
Sets the look and feel (L&F) object that renders this component. Override the default so that we can also set the color look of this component to match a tooltip.

Overrides:
setUI in class javax.swing.JList
Parameters:
ui - the ListUI L&F object

getVisibleRowCount

public int getVisibleRowCount()
Returns the preferred number of visible rows. We override this so that the popup window will shrink down to match our JList size.

Overrides:
getVisibleRowCount in class javax.swing.JList
Returns:
an integer indicating the preferred number of rows to display without using a scroll bar
See Also:
JList.setVisibleRowCount(int)

setSelectionInterval

public void setSelectionInterval(int anchor,
                                 int lead)
Overrides:
setSelectionInterval in class javax.swing.JList

setPopupWindow

public void setPopupWindow(PopupWindow popup)
Sets the PopupWindow so we can set the accessible name of the selected item on the window so it will be read.

Specified by:
setPopupWindow in interface InsightView
Parameters:
popup - the popup window

setData

public void setData(InsightData newData)
Sets the InsightData data model which should be displayed by this view.

Specified by:
setData in interface InsightView
Parameters:
newData - the data model to use

getListModel

protected javax.swing.ListModel getListModel(ListInsightData insightData)
Utility routine to fetch the ListModel from the given insight data instance. This allows us to enable filtering of only matching elements if the given property is enabled.

Parameters:
insightData - the list insight data instance
Returns:
the appropriate list model to use for our view

selectDefault

public void selectDefault()
Instructs the InsightView to select the default insight data item, and to make sure that it is visible. This may be necessary as the InsightData instance may be set into the view using setData() before the actual view is even visible.

Specified by:
selectDefault in interface InsightView

getData

public InsightData getData()
Fetches the InsightData that is the data model associated with this particular view.

Specified by:
getData in interface InsightView
Returns:
the InsightData that is displayed by this view

getComponent

public javax.swing.JComponent getComponent()
Fetches the Swing UI component for displaying this view.

Specified by:
getComponent in interface InsightView
Returns:
the Swing UI component for displaying this view.

supportWrapping

protected boolean supportWrapping()
Whether to support wrapping behavior with the arrow keys at the top or bottom of the code insight list. Subclasses can override this if they wish to disable wrapping in their implementations.

Returns:
true to support wrapping, false otherwise

isAtBeginList

protected boolean isAtBeginList()
Utility routine to check if the selected index is currently at the start of the list.

Returns:
true if the list selected index is at the beginning

isAtEndList

protected boolean isAtEndList()
Utility routine to check if the selected index is currently at the end of the list.

Returns:
true if the list selected index is at the end

up

public boolean up()
Command to move the selection of the view to the previous item (up) in the data set. If the underlying view does not support the given navigation (i.e., it is a tooltip view and provides read-only information), nothing will happen. The view should return true if the view supports the up navigation, even if no action is taken. This is so that the up action can be consumed by the Insight framework instead of being passed on through the editor hierarchy.

For example, suppose the underlying Insight implements completion insight, and the view is a List. The view should return true here even if the selection is at the top of the list since the view supports navigation upwards and downwards.

Specified by:
up in interface InsightView
Returns:
true if the underlying InsightView supports the concept of navigating up in the visible data

down

public boolean down()
Command to move the selection of the view to the next item (down) in the data set.

Specified by:
down in interface InsightView
Returns:
true if the underlying InsightView supports the concept of navigating down in the visible data

right

public boolean right()
Command to move the selection of the view to the right item in the data set. The right() and left() actions are here to support views where the concept of right and left makes sense, such as a tree view.

Specified by:
right in interface InsightView
Returns:
true if the underlying InsightView supports the concept of navigating right in the visible data

left

public boolean left()
Command to move the selection of the view to the left item in the data set. The right() and left() actions are here to support views where the concept of right and left makes sense, such as a tree view.

Specified by:
left in interface InsightView
Returns:
true if the underlying InsightView supports the concept of navigating left in the visible data

pageUp

public boolean pageUp()
Command to move the selection of the view up by one page in the data set.

Specified by:
pageUp in interface InsightView
Returns:
true if the underlying InsightView supports the concept of navigating one page up

pageDown

public boolean pageDown()
Command to move the selection of the view down by one page in the data set.

Specified by:
pageDown in interface InsightView
Returns:
true if the underlying InsightView supports the concept of navigating one page down

begin

public boolean begin()
Command to move the selection of the view to the top of the data set.

Specified by:
begin in interface InsightView
Returns:
true if the underlying InsightView supports the concept of navigating to the top of the data set

end

public boolean end()
Command to move the selection of the view to the bottom of the data set.

Specified by:
end in interface InsightView
Returns:
true if the underlying InsightView supports the concept of navigating to the bottom of the data set

complete

public boolean complete(Insight insight)
Description copied from interface: InsightView
Command to accept (complete) the current insight selection into the document. This occurs when the user hits the "Enter" key while Insight information is visible. This method is responding for hiding the Insight window and retriggering the Insight auto-popup if necessary.

Specified by:
complete in interface InsightView
Parameters:
insight - the main Insight engine for the purpose of hiding or re-triggering Insight
Returns:
true if this Insight supports completion assistance

partialComplete

public boolean partialComplete()
Command to request partial completion using the current insight information based on the current document contents. This occurs when the user hits the "Tab" key while insight information is available.

Specified by:
partialComplete in interface InsightView
Returns:
true if this Insight supports partial completion assitance

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

E13403-04

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