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.controls.nicelist
Class NiceList

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.controls.nicelist.NiceList

All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.Scrollable

public class NiceList
extends javax.swing.JList

A custom JList implementation. This is designed to be used in conjunction with NiceListRenderer, which provides several facilities for a specialized checkbox list with inline descriptions.

You will generally want to associate this list with an instance of NiceListRenderer by calling JList.setCellRenderer( ListCellRenderer ). If the renderer is anything other than a NiceListRenderer, this implementation will never fire any NiceListActionEvents.

This implementation is mainly concerned with adapting various mouse and key events on the list to NiceListActionEvents.

Since:
11.0
See Also:
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
NiceList()
           

 

Method Summary
 void addDoubleClickActionListener(java.awt.event.ActionListener listener)
          Adds an action listener.
 void addListActionListener(NiceListActionListener listener)
          Adds a listener to the list.
protected  void fireCheckBoxAction(int row)
          Fires an event of type NiceListActionEvent.Type.CHECKBOX to all registered listeners.
protected  void fireHyperLinkAction(int row)
          Fires an event of type NiceListActionEvent.Type.HYPERLINK to all registered listeners.
protected  void fireSecondaryHyperLinkAction(int row)
          Fires an event of type NiceListActionEvent.Type.HYPERLINK to all registered listeners.
 java.awt.Dimension getPreferredScrollableViewportSize()
          Override to return the correct size of visible row count.
 boolean isFireCheckboxActionOnDoubleClick()
          Returns whether double click on a list item will fire a checkbox event.
 boolean isFireCheckboxActionOnSelectionChanged()
          Returns true if this list is configured to fire checkbox action events when an item in the list is selected.
 void removeDoubleClickActionListener(java.awt.event.ActionListener listener)
          Removes a double click action listener previously registered with removeDoubleClickActionListener(ActionListener).
 void removeListActionListener(NiceListActionListener listener)
          Removes a listener from the list.
 void setFireCheckboxActionOnDoubleClick(boolean toggleOnDoubleClick)
          Sets whether a double click on an item in the list should automatically fire a checkbox event to registered niceListActionListeners.
 void setFireCheckboxActionOnSelectionChanged(boolean fire)
          Sets whether this list will fire NiceListActionEvent.Type.CHECKBOX events when an item in the list is selected.

 

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, getPrototypeCellValue, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedIndex, getSelectedIndices, getSelectedValue, getSelectedValues, getSelectionBackground, getSelectionForeground, getSelectionMode, getSelectionModel, getToolTipText, getUI, getUIClassID, getValueIsAdjusting, getVisibleRowCount, indexToLocation, isSelectedIndex, isSelectionEmpty, locationToIndex, paramString, removeListSelectionListener, removeSelectionInterval, setCellRenderer, setDragEnabled, setDropMode, setFixedCellHeight, setFixedCellWidth, setLayoutOrientation, setListData, setListData, setModel, setPrototypeCellValue, setSelectedIndex, setSelectedIndices, setSelectedValue, setSelectionBackground, setSelectionForeground, setSelectionInterval, setSelectionMode, setSelectionModel, setUI, 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

NiceList

public NiceList()

Method Detail

setFireCheckboxActionOnDoubleClick

public void setFireCheckboxActionOnDoubleClick(boolean toggleOnDoubleClick)
Sets whether a double click on an item in the list should automatically fire a checkbox event to registered niceListActionListeners.

By default, this property is false.

Note that setting this property does not prevent double click events from being fired to registered actionListeners.

Parameters:
toggleOnDoubleClick - if true fire checkbox events when a double click event occurs.

isFireCheckboxActionOnDoubleClick

public boolean isFireCheckboxActionOnDoubleClick()
Returns whether double click on a list item will fire a checkbox event.
Returns:
true if checkboxes will be toggled on double click.

setFireCheckboxActionOnSelectionChanged

public void setFireCheckboxActionOnSelectionChanged(boolean fire)
Sets whether this list will fire NiceListActionEvent.Type.CHECKBOX events when an item in the list is selected. The default is to only fire the event when the checkbox is checked (i.e. the click falls within the area of the checkbox). It's not advisable to use this option with lists that contain hyperlinks.
Parameters:
fire - if true, selection change events will trigger checkbox action events.

isFireCheckboxActionOnSelectionChanged

public boolean isFireCheckboxActionOnSelectionChanged()
Returns true if this list is configured to fire checkbox action events when an item in the list is selected.
Returns:
true if selection change events trigger checkbox action events.

addDoubleClickActionListener

public final void addDoubleClickActionListener(java.awt.event.ActionListener listener)
Adds an action listener. The listener will be notified when the user double clicks on an item in the list.
Parameters:
listener - a listener to register. Must not be null.
Since:
11.0

removeDoubleClickActionListener

public final void removeDoubleClickActionListener(java.awt.event.ActionListener listener)
Removes a double click action listener previously registered with removeDoubleClickActionListener(ActionListener).
Parameters:
listener - the listener to remove.

addListActionListener

public final void addListActionListener(NiceListActionListener listener)
Adds a listener to the list.
Parameters:
listener - a listener. Must not be null.

removeListActionListener

public final void removeListActionListener(NiceListActionListener listener)
Removes a listener from the list.
Parameters:
listener - a listener.

fireCheckBoxAction

protected final void fireCheckBoxAction(int row)
Fires an event of type NiceListActionEvent.Type.CHECKBOX to all registered listeners.
Parameters:
row - the row to fire the event on.

fireHyperLinkAction

protected final void fireHyperLinkAction(int row)
Fires an event of type NiceListActionEvent.Type.HYPERLINK to all registered listeners.
Parameters:
row - the row to fire the event on.

fireSecondaryHyperLinkAction

protected final void fireSecondaryHyperLinkAction(int row)
Fires an event of type NiceListActionEvent.Type.HYPERLINK to all registered listeners.
Parameters:
row - the row to fire the event on.

getPreferredScrollableViewportSize

public java.awt.Dimension getPreferredScrollableViewportSize()
Override to return the correct size of visible row count. Rather than multiplying the visibleRowCount by the height of the first cell, return the actual bounds of the visibleRowCount as NiceList supports rendering rows with variable heights.
Specified by:
getPreferredScrollableViewportSize in interface javax.swing.Scrollable
Overrides:
getPreferredScrollableViewportSize in class javax.swing.JList

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.