ListVOControl

Overview | Package | Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.openswing.swing.client
Class ListVOControl

    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  javax.swing.JPanel
                      org.openswing.swing.client.BaseInputControl
                          org.openswing.swing.client.ListVOControl

All Implemented Interfaces:
  javax.accessibility.Accessible, java.awt.image.ImageObserver, InputControl, org.openswing.swing.items.client.ItemsParent, java.awt.MenuContainer, SearchControl, java.io.Serializable

public class ListVOControl
extends BaseInputControl
implements InputControl, org.openswing.swing.items.client.ItemsParent, SearchControl

Title: OpenSwing Framework

Description: List input control: its items are retrieved through the items controller, that returns a list of value objects; for each value object there is a row in the list control: v.o. attributes can be mapped as columns in an item.

If this control is linked to a Form, then ListSelectionModel.SINGLE_SELECTION_MODE is allowed: other selection modes are not permitted. The list control v.o. is then mapped to Form container v.o. If this control is not linked to a Form, then it is possible to select more than one item.

Copyright: Copyright (C) 2007 Mauro Carniel

This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it

See Also:
  Serialized Form

Nested Class Summary

Nested classes inherited from class javax.swing.JComponent
`javax.swing.JComponent.AccessibleJComponent`

Field Summary

Fields inherited from class javax.swing.JComponent
`TOOL_TIP_TEXT_KEY, 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
`ListVOControl()` Contructor.

Method Summary
`void` | `addFocusListener(java.awt.event.FocusListener l)` Adds the specified focus listener to receive focus events from this component when this component gains input focus.
`void` | `addList2ParentLink(java.lang.String parentAttributeName)` Add a link from the whole list value object to an equivalent inner v.o. included in the container v.o.
`void` | `addList2ParentLink(java.lang.String comboAttributeName, java.lang.String parentAttributeName)` Add a link from an attribute of the list v.o. to an attribute of the list container v.o.
`void` | `addListSelectionListener(javax.swing.event.ListSelectionListener listener)` Adds a listener to the list that's notified each time a change to the selection occurs.
`void` | `addNotify()` Retrieve items.
`boolean` | `disableListener()`
`int` | `getAllColumnPreferredWidth()`
`javax.swing.JComponent` | `getBindingComponent()`
`javax.swing.JComponent` | `getComponent()`
`int` | `getFixedCellHeight()` Returns the fixed cell height value -- the value specified by setting the `fixedCellHeight` property, rather than that calculated from the list elements.
`int` | `getFixedCellWidth()` Returns the fixed cell width value -- the value specified by setting the `fixedCellWidth` property, rather than that calculated from the list elements.
`java.lang.String` | `getForeignKeyAttributeName()`
`int` | `getLayoutOrientation()` Returns `JList.VERTICAL` if the layout is a single column of cells, or `JList.VERTICAL_WRAP` if the layout is "newspaper style" with the content flowing vertically then horizontally or `JList.HORIZONTAL_WRAP` if the layout is "newspaper style" with the content flowing horizontally then vertically.
`org.openswing.swing.items.client.ItemsDataLocator` | `getListDataLocator()`
`int` | `getRowCount()`
`int` | `getSelectedIndex()`
`java.awt.Color` | `getSelectionBackground()` Returns the background color for selected cells.
`java.awt.Color` | `getSelectionForeground()` Returns the selection foreground color.
`int` | `getSelectionMode()` Returns whether single-item or multiple-item selections are allowed.
`java.awt.ComponentOrientation` | `getTextOrientation()`
`java.lang.Object` | `getValue()`
`java.lang.String` | `getValueAt(int index)`
`boolean` | `getValueIsAdjusting()` Returns the value of the data model's `isAdjusting` property.
`ValueObject` | `getValueObject()`
`int` | `getVisibleRowCount()` Returns the preferred number of visible rows.
`boolean` | `isAllColumnVisible()`
`boolean` | `isEnabled()`
`boolean` | `isNullAsDefaultValue()`
`boolean` | `isReadOnly()`
`void` | `reloadItems()` Reset list content, by invoking ItemsDataLocator.loadData() method again.
`void` | `removeFocusListener(java.awt.event.FocusListener l)` Removes the specified focus listener so that it no longer receives focus events from this component.
`void` | `removeListSelectionListener(javax.swing.event.ListSelectionListener listener)` Removes a listener from the list that's notified each time a change to the selection occurs.
`int` | `search(java.lang.String textToSeach)` Method invoked by SearchWindowManager when the specified "textToSeach" pattern has not matchings in the current content of binded control.
`void` | `setAllColumnPreferredWidth(int preferredWidth)` Set columns width for the whole columns of the items grid frame.
`void` | `setAllColumnVisible(boolean visible)` Set column visibility for the whole columns of the items grid frame.
`void` | `setEnabled(boolean enabled)` Set current input control abilitation.
`void` | `setFixedCellHeight(int height)` Sets the height of every cell in the list.
`void` | `setFixedCellWidth(int width)` Sets the width of every cell in the list.
`void` | `setForeignKeyAttributeName(java.lang.String foreignKeyAttributeName)` Set the attribute name in the list v.o. that identify the attribute name in the v.o. of the list container.
`void` | `setLayoutOrientation(int layoutOrientation)` Defines the way list cells are layed out.
`void` | `setListDataLocator(org.openswing.swing.items.client.ItemsDataLocator comboDataLocator)` Set list data locator.
`void` | `setListValueObjectClassName(java.lang.String comboValueObjectClassName)` Set value object class name associated to the list: this method calls initItemsVO method.
`void` | `setNullAsDefaultValue(boolean nullAsDefaultValue)` Define if in insert mode list has no item selected.
`void` | `setPreferredWidthColumn(java.lang.String itemsAttributeName, int preferredWidth)` Set column width in the items grid frame.
`void` | `setSelectedIndex(int index)` Select the list item related to the specified index.
`void` | `setSelectedIndices(int[] indices)` Select the list item related to the specified index.
`void` | `setSelectionBackground(java.awt.Color selectionBackground)` Sets the background color for selected cells.
`void` | `setSelectionForeground(java.awt.Color selectionForeground)` Sets the foreground color for selected cells.
`void` | `setSelectionMode(int selectionMode)` Determines whether single-item or multiple-item selections are allowed.
`void` | `setTextOrientation(java.awt.ComponentOrientation o)` Set the component orientation: from left to right or from right to left.
`void` | `setValue(java.lang.Object code)` Select an item from the list starting from the specified code (with ListSelectionModel.SINGLE_SELECTION) or select a list of items starting from the specified java.util.List of codes (without ListSelectionModel.SINGLE_SELECTION) or
`void` | `setValue(java.lang.String attributeName, java.lang.Object value)` Method called by ItemsController to update parent v.o.
`void` | `setValueIsAdjusting(boolean b)` Sets the data model's `isAdjusting` property to true, so that a single event will be generated when all of the selection events have finished (for example, when the mouse is being dragged over the list in selection mode).
`void` | `setVisibleColumn(java.lang.String comboAttributeName, boolean visible)` Set column visibility in the list grid frame.
`void` | `setVisibleRowCount(int visibleRowCount)` Sets the preferred number of rows in the list that can be displayed without a scrollbar, as determined by the nearest `JViewport` ancestor, if any.

Methods inherited from class org.openswing.swing.client.BaseInputControl
`addValueChangedListener, getAttributeName, getFont, getLinkLabel, getTextAlignment, getToolTipText, getValueChangeListeners, isCanCopy, isChanged, isEnabledOnEdit, isEnabledOnInsert, isRequired, removeValueChangedListener, requestFocus, setAttributeName, setCanCopy, setChanged, setEnabledOnEdit, setEnabledOnInsert, setFont, setLinkLabel, setRequired, setTextAlignment, setToolTipText`

Methods inherited from class javax.swing.JPanel
`getAccessibleContext, getUI, getUIClassID, setUI, updateUI`

Methods inherited from class javax.swing.JComponent
`addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update`

Methods inherited from class java.awt.Container
`add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate`

Methods inherited from class java.awt.Component
`action, add, addComponentListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.openswing.swing.client.InputControl
`addValueChangedListener, getAttributeName, getLinkLabel, getValueChangeListeners, isCanCopy, isChanged, isEnabledOnEdit, isEnabledOnInsert, isRequired, removeValueChangedListener, setAttributeName, setCanCopy, setChanged, setEnabledOnEdit, setEnabledOnInsert, setLinkLabel`

Constructor Detail

### ListVOControl

    public ListVOControl()

  Contructor.

Method Detail

### reloadItems

    public final void reloadItems()

  Reset list content, by invoking ItemsDataLocator.loadData() method again.

### addNotify

    public final void addNotify()

  Retrieve items.

### setVisibleColumn

    public final void setVisibleColumn(java.lang.String comboAttributeName,
                                       boolean visible)

  Set column visibility in the list grid frame.

  Parameters:
    `comboAttributeName` - attribute name that identifies the item column
    `visible` - column visibility state

### addList2ParentLink

    public final void addList2ParentLink(java.lang.String comboAttributeName,
                                         java.lang.String parentAttributeName)

  Add a link from an attribute of the list v.o. to an attribute of the list container v.o.

  Parameters:
    `comboAttributeName` - attribute of the list v.o.
    `parentAttributeName` - attribute of the list container v.o.

### addList2ParentLink

    public final void addList2ParentLink(java.lang.String parentAttributeName)

  Add a link from the whole list value object to an equivalent inner v.o. included in the container v.o.

  Parameters:
    `parentAttributeName` - attribute of the list container v.o., related to an inner v.o. having the same type of the list v.o.

### getListDataLocator

    public final org.openswing.swing.items.client.ItemsDataLocator getListDataLocator()

  Returns:
    list data locator

### setListDataLocator

    public final void setListDataLocator(org.openswing.swing.items.client.ItemsDataLocator comboDataLocator)

  Set list data locator.

  Parameters:
    `comboDataLocator` - list data locator

### setListValueObjectClassName

    public final void setListValueObjectClassName(java.lang.String comboValueObjectClassName)

  Set value object class name associated to the list: this method calls initItemsVO method.

### isAllColumnVisible

    public final boolean isAllColumnVisible()

  Returns:
    columns visibility

### setAllColumnVisible

    public final void setAllColumnVisible(boolean visible)

  Set column visibility for the whole columns of the items grid frame.

  Parameters:
    `visible` - columns visibility

### getAllColumnPreferredWidth

    public final int getAllColumnPreferredWidth()

  Returns:
    columns width

### setAllColumnPreferredWidth

    public final void setAllColumnPreferredWidth(int preferredWidth)

  Set columns width for the whole columns of the items grid frame.

  Parameters:
    `preferredWidth` - columns width

### setPreferredWidthColumn

    public final void setPreferredWidthColumn(java.lang.String itemsAttributeName,
                                              int preferredWidth)

  Set column width in the items grid frame.

  Parameters:
    `itemsAttributeName` - attribute name that identifies the grid column
    `preferredWidth` - column width

### setValue

    public final void setValue(java.lang.Object code)

  Select an item from the list starting from the specified code (with ListSelectionModel.SINGLE_SELECTION) or select a list of items starting from the specified java.util.List of codes (without ListSelectionModel.SINGLE_SELECTION) or

  Specified by:
    `setValue` in interface `InputControl`
  Overrides:
    `setValue` in class `BaseInputControl`
  Parameters:
    `code` - used to retrieve the corresponding item and to select that item in the list (with ListSelectionModel.SINGLE_SELECTION) or java.util.List of codes (without ListSelectionModel.SINGLE_SELECTION) when this input control is not linked to a Form or java.util.List of list's value objects (without ListSelectionModel.SINGLE_SELECTION) when this input control is linked to a Form

### getValue

    public final java.lang.Object getValue()

  Specified by:
    `getValue` in interface `InputControl`
  Overrides:
    `getValue` in class `BaseInputControl`
  Returns:
    in case of ListSelectionModel.SINGLE_SELECTION: the code related to the selected list item; it return null if no item is selected; a java.util.List of codes in case of MULTIPLE_INTERVAL_SELECTION/SINGLE_INTERVAL_SELECTION if this control is not linked to a Form a java.util.List of value objects in case of MULTIPLE_INTERVAL_SELECTION/SINGLE_INTERVAL_SELECTION if this control is linked to a Form

### getBindingComponent

    public javax.swing.JComponent getBindingComponent()

  Overrides:
    `getBindingComponent` in class `BaseInputControl`
  Returns:
    component inside this whose contains the value

### addFocusListener

    public final void addFocusListener(java.awt.event.FocusListener l)

  Adds the specified focus listener to receive focus events from this component when this component gains input focus. If listener `l` is `null`, no exception is thrown and no action is performed.

  Specified by:
    `addFocusListener` in interface `InputControl`
  Parameters:
    `l` - the focus listener
  Since:
    JDK1.1
  See Also:
    `FocusEvent`, `FocusListener`, `removeFocusListener(java.awt.event.FocusListener)`, `Component.getFocusListeners()`

### removeFocusListener

    public final void removeFocusListener(java.awt.event.FocusListener l)

  Removes the specified focus listener so that it no longer receives focus events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If listener `l` is `null`, no exception is thrown and no action is performed.

  Specified by:
    `removeFocusListener` in interface `InputControl`
  Parameters:
    `l` - the focus listener
  Since:
    JDK1.1
  See Also:
    `FocusEvent`, `FocusListener`, `addFocusListener(java.awt.event.FocusListener)`, `Component.getFocusListeners()`

### isNullAsDefaultValue

    public final boolean isNullAsDefaultValue()

  Returns:
    define if in insert mode list has no item selected

### setNullAsDefaultValue

    public final void setNullAsDefaultValue(boolean nullAsDefaultValue)

  Define if in insert mode list has no item selected.

  Parameters:
    `nullAsDefaultValue` - define if in insert mode list has no item selected

### setValue

    public void setValue(java.lang.String attributeName,
                         java.lang.Object value)

  Method called by ItemsController to update parent v.o.

  Specified by:
    `setValue` in interface `org.openswing.swing.items.client.ItemsParent`
  Parameters:
    `attributeName` - attribute name in the parent v.o. that must be updated
    `value` - updated value

### getValueObject

    public ValueObject getValueObject()

  Specified by:
    `getValueObject` in interface `org.openswing.swing.items.client.ItemsParent`
  Returns:
    parent value object

### setSelectedIndex

    public final void setSelectedIndex(int index)

  Select the list item related to the specified index.

  Specified by:
    `setSelectedIndex` in interface `SearchControl`
  Parameters:
    `index` - index to retrieve the corresponding item and to select that item in the list

### setSelectedIndices

    public final void setSelectedIndices(int[] indices)

  Select the list item related to the specified index.

  Parameters:
    `indices` - interval of indices to retrieve the corresponding item and to select that item in the list

### getFixedCellHeight

    public final int getFixedCellHeight()

  Returns the fixed cell height value -- the value specified by setting the `fixedCellHeight` property, rather than that calculated from the list elements.

  Returns:
    the fixed cell height, in pixels
  See Also:
    `setFixedCellHeight(int)`

### setFixedCellHeight

    public final void setFixedCellHeight(int height)

  Sets the height of every cell in the list. If `height` is -1, cell heights are computed by applying `getPreferredSize` to the `cellRenderer` component for each list element.

  The default value of this property is -1.

  This is a JavaBeans bound property.

  Parameters:
    `height` - an integer giving the height, in pixels, for all cells in this list
  See Also:
    `#getPrototypeCellValue`, `setFixedCellWidth(int)`, `JComponent.addPropertyChangeListener(java.beans.PropertyChangeListener)`

### getFixedCellWidth

    public final int getFixedCellWidth()

  Returns the fixed cell width value -- the value specified by setting the `fixedCellWidth` property, rather than that calculated from the list elements.

  Returns:
    the fixed cell width
  See Also:
    `setFixedCellWidth(int)`

### setFixedCellWidth

    public final void setFixedCellWidth(int width)

  Sets the width of every cell in the list. If `width` is -1, cell widths are computed by applying `getPreferredSize` to the `cellRenderer` component for each list element.

  The default value of this property is -1.

  This is a JavaBeans bound property.

  Parameters:
    `width` - the width, in pixels, for all cells in this list
  See Also:
    `#getPrototypeCellValue`, `setFixedCellWidth(int)`, `JComponent.addPropertyChangeListener(java.beans.PropertyChangeListener)`

### getVisibleRowCount

    public final int getVisibleRowCount()

  Returns the preferred number of visible rows.

  Returns:
    an integer indicating the preferred number of rows to display without using a scroll bar
  See Also:
    `setVisibleRowCount(int)`

### setVisibleRowCount

    public final void setVisibleRowCount(int visibleRowCount)

  Sets the preferred number of rows in the list that can be displayed without a scrollbar, as determined by the nearest `JViewport` ancestor, if any. The value of this property only affects the value of the `JList`'s `preferredScrollableViewportSize`.

  The default value of this property is 8.

  This is a JavaBeans bound property.

  Parameters:
    `visibleRowCount` - an integer specifying the preferred number of visible rows
  See Also:
    `getVisibleRowCount()`, `JComponent.getVisibleRect()`, `JViewport`

### getLayoutOrientation

    public final int getLayoutOrientation()

  Returns `JList.VERTICAL` if the layout is a single column of cells, or `JList.VERTICAL_WRAP` if the layout is "newspaper style" with the content flowing vertically then horizontally or `JList.HORIZONTAL_WRAP` if the layout is "newspaper style" with the content flowing horizontally then vertically.

  Returns:
    the value of the layoutOrientation property
  Since:
    1.4
  See Also:
    `setLayoutOrientation(int)`

### setLayoutOrientation

    public final void setLayoutOrientation(int layoutOrientation)

  Defines the way list cells are layed out. Consider a `JList` with four cells, this can be layed out in one of the following ways:

         0
         1
         2
         3

         0  1
         2  3

         0  2
         1  3

  These correspond to the following values:

  Value | Description
  --- | ---
  `JList.VERTICAL` | The cells should be layed out vertically in one column.
  `JList.HORIZONTAL_WRAP` | The cells should be layed out horizontally, wrapping to a new row as necessary. The number of rows to use will either be defined by `getVisibleRowCount` if > 0, otherwise the number of rows will be determined by the width of the `JList`.
  `JList.VERTICAL_WRAP` | The cells should be layed out vertically, wrapping to a new column as necessary. The number of rows to use will either be defined by `getVisibleRowCount` if > 0, otherwise the number of rows will be determined by the height of the `JList`.

  The default value of this property is `JList.VERTICAL`.

  This will throw an `IllegalArgumentException` if `layoutOrientation` is not one of `JList.HORIZONTAL_WRAP` or `JList.VERTICAL` or `JList.VERTICAL_WRAP`

  Parameters:
    `layoutOrientation` - New orientation, one of `JList.HORIZONTAL_WRAP`, `JList.VERTICAL` or `JList.VERTICAL_WRAP`.
  Since:
    1.4
  See Also:
    `getLayoutOrientation()`, `setVisibleRowCount(int)`, `#getScrollableTracksViewportHeight`

### setSelectionMode

    public final void setSelectionMode(int selectionMode)

  Determines whether single-item or multiple-item selections are allowed. The following `selectionMode` values are allowed:
  - `ListSelectionModel.SINGLE_SELECTION` Only one list index can be selected at a time. In this mode the `setSelectionInterval` and `addSelectionInterval` methods are equivalent, and only the second index argument is used.
  - `ListSelectionModel.SINGLE_INTERVAL_SELECTION` One contiguous index interval can be selected at a time. In this mode `setSelectionInterval` and `addSelectionInterval` are equivalent.
  - `ListSelectionModel.MULTIPLE_INTERVAL_SELECTION` In this mode, there's no restriction on what can be selected. This is the default.

  Parameters:
    `selectionMode` - an integer specifying the type of selections that are permissible
  See Also:
    `getSelectionMode()`

### getSelectionMode

    public final int getSelectionMode()

  Returns whether single-item or multiple-item selections are allowed.

  Returns:
    the value of the `selectionMode` property
  See Also:
    `setSelectionMode(int)`

### setValueIsAdjusting

    public final void setValueIsAdjusting(boolean b)

  Sets the data model's `isAdjusting` property to true, so that a single event will be generated when all of the selection events have finished (for example, when the mouse is being dragged over the list in selection mode).

  Parameters:
    `b` - the boolean value for the property value
  See Also:
    `ListSelectionModel.setValueIsAdjusting(boolean)`

### getValueIsAdjusting

    public final boolean getValueIsAdjusting()

  Returns the value of the data model's `isAdjusting` property. This value is true if multiple changes are being made.

  Returns:
    true if multiple selection-changes are occurring, as when the mouse is being dragged over the list
  See Also:
    `ListSelectionModel.getValueIsAdjusting()`

### getSelectionForeground

    public java.awt.Color getSelectionForeground()

  Returns the selection foreground color.

  Returns:
    the `Color` object for the foreground property
  See Also:
    `setSelectionForeground(java.awt.Color)`, `setSelectionBackground(java.awt.Color)`

### setSelectionForeground

    public final void setSelectionForeground(java.awt.Color selectionForeground)

  Sets the foreground color for selected cells. Cell renderers can use this color to render text and graphics for selected cells.

  The default value of this property is defined by the look and feel implementation.

  This is a JavaBeans bound property.

  Parameters:
    `selectionForeground` - the `Color` to use in the foreground for selected list items
  See Also:
    `getSelectionForeground()`, `setSelectionBackground(java.awt.Color)`, `JComponent.setForeground(java.awt.Color)`, `JComponent.setBackground(java.awt.Color)`, `BaseInputControl.setFont(java.awt.Font)`

### getSelectionBackground

    public final java.awt.Color getSelectionBackground()

  Returns the background color for selected cells.

  Returns:
    the `Color` used for the background of selected list items
  See Also:
    `setSelectionBackground(java.awt.Color)`, `setSelectionForeground(java.awt.Color)`

### setSelectionBackground

    public void setSelectionBackground(java.awt.Color selectionBackground)

  Sets the background color for selected cells. Cell renderers can use this color to the fill selected cells.

  The default value of this property is defined by the look and feel implementation.

  This is a JavaBeans bound property.

  Parameters:
    `selectionBackground` - the `Color` to use for the background of selected cells
  See Also:
    `getSelectionBackground()`, `setSelectionForeground(java.awt.Color)`, `JComponent.setForeground(java.awt.Color)`, `JComponent.setBackground(java.awt.Color)`, `BaseInputControl.setFont(java.awt.Font)`

### addListSelectionListener

    public final void addListSelectionListener(javax.swing.event.ListSelectionListener listener)

  Adds a listener to the list that's notified each time a change to the selection occurs. Listeners added directly to the `JList` will have their `ListSelectionEvent.getSource() == this JList` (instead of the `ListSelectionModel`).

  Parameters:
    `listener` - the `ListSelectionListener` to add
  See Also:
    `#getSelectionModel`, `#getListSelectionListeners`

### removeListSelectionListener

    public final void removeListSelectionListener(javax.swing.event.ListSelectionListener listener)

  Removes a listener from the list that's notified each time a change to the selection occurs.

  Parameters:
    `listener` - the `ListSelectionListener` to remove
  See Also:
    `addListSelectionListener(javax.swing.event.ListSelectionListener)`, `#getSelectionModel`

### setEnabled

    public void setEnabled(boolean enabled)

  Description copied from interface: `InputControl`
  Set current input control abilitation.

  Specified by:
    `setEnabled` in interface `InputControl`
  Overrides:
    `setEnabled` in class `BaseInputControl`

### isEnabled

    public final boolean isEnabled()

  Specified by:
    `isEnabled` in interface `InputControl`
  Overrides:
    `isEnabled` in class `BaseInputControl`
  Returns:
    current input control abilitation

### getSelectedIndex

    public final int getSelectedIndex()

  Specified by:
    `getSelectedIndex` in interface `SearchControl`
  Returns:
    the selected index in the input control

### getRowCount

    public final int getRowCount()

  Specified by:
    `getRowCount` in interface `SearchControl`
  Returns:
    total rows count in the input control

### getValueAt

    public final java.lang.String getValueAt(int index)

  Specified by:
    `getValueAt` in interface `SearchControl`
  Returns:
    the element at the specified index, converted in String format

### getComponent

    public final javax.swing.JComponent getComponent()

  Specified by:
    `getComponent` in interface `SearchControl`
  Returns:
    combo control

### isReadOnly

    public final boolean isReadOnly()

  Specified by:
    `isReadOnly` in interface `SearchControl`
  Returns:
    `true` if the input control is in read only mode (so search is enabled), `false` otherwise

### getForeignKeyAttributeName

    public final java.lang.String getForeignKeyAttributeName()

  Returns:
    attribute name in the list v.o. that identify the attribute name in the v.o. of the list container

### setForeignKeyAttributeName

    public final void setForeignKeyAttributeName(java.lang.String foreignKeyAttributeName)

  Set the attribute name in the list v.o. that identify the attribute name in the v.o. of the list container. As default value this attribute is null. Null means that "attributeName" property will be used to identify the v.o. in the list, i.e. the attribute names in the list v.o. and in the container v.o. must have the same name.

  Parameters:
    `foreignKeyAttributeName` - String

### disableListener

    public final boolean disableListener()

  Specified by:
    `disableListener` in interface `SearchControl`
  Returns:
    `true` to disable key listening on input control (for instance, in case of nested grids), `false` to listen for key events

### search

    public final int search(java.lang.String textToSeach)

  Method invoked by SearchWindowManager when the specified "textToSeach" pattern has not matchings in the current content of binded control. This callback can be used to retrieve additional data into control and to search inside new data.

  Specified by:
    `search` in interface `SearchControl`
  Parameters:
    `textToSeach` - patten of text to search
  Returns:
    -1 if no additional data is available, otherwise the row index of data just added that satify the pattern

### setTextOrientation

    public final void setTextOrientation(java.awt.ComponentOrientation o)

  Set the component orientation: from left to right or from right to left.

  Parameters:
    `o` - component orientation

### getTextOrientation

    public final java.awt.ComponentOrientation getTextOrientation()

  Returns:
    component orientation

Overview | Package | Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD