org.openswing.swing.client
Class ListControl

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.openswing.swing.client.BaseInputControl
                      extended byorg.openswing.swing.client.ListControl
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, InputControl, java.awt.MenuContainer, SearchControl, java.io.Serializable

public class ListControl
extends BaseInputControl
implements InputControl, SearchControl

Title: OpenSwing Framework

Description: List input control: its items are retrieved through ClientSettings.getDomain method, that uses domainId property to identify the correct domain to use. If this control is linked to a Form, then ListSelectionModel.SINGLE_SELECTION_MODE is allowed: other selection modes are not permitted. If this control is not linked to a Form, then it is possible to select more than one item.

Copyright: Copyright (C) 2006 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
ListControl()
          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 addListSelectionListener(javax.swing.event.ListSelectionListener listener)
          Adds a listener to the list that's notified each time a change to the selection occurs.
 void addMouseListener(java.awt.event.MouseListener l)
          Adds the specified mouse listener to receive mouse events from this textfield.
 void addNotify()
           
 boolean disableListener()
           
 javax.swing.JComponent getBindingComponent()
           
 javax.swing.JComponent getComponent()
           
 Domain getDomain()
           
 java.lang.String getDomainId()
           
 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.
 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.
 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.
 int getVisibleRowCount()
          Returns the preferred number of visible rows.
 boolean isEnabled()
           
 boolean isNullAsDefaultValue()
           
 boolean isReadOnly()
           
 boolean isShowCheckBoxes()
           
 boolean isTranslateItemDescriptions()
           
 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.
 void removeMouseListener(java.awt.event.MouseListener l)
          Removes the specified mouse listener so that it no longer receives mouse events from this textfield.
 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 setDomain(Domain domain)
          Set the specified domain and retrieve the list items from the domain.
 void setDomainId(java.lang.String domainId)
          Set the domain identifier, so the control can retrieve its items from the domain.
 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 setLayoutOrientation(int layoutOrientation)
          Defines the way list cells are layed out.
 void setNullAsDefaultValue(boolean nullAsDefaultValue)
          Define if in insert mode list has no item selected.
 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 setShowCheckBoxes(boolean showCheckBoxes)
          Define if a check-box must be showed for each node.
 void setTextOrientation(java.awt.ComponentOrientation o)
          Set the component orientation: from left to right or from right to left.
 void setTranslateItemDescriptions(boolean translateItemDescriptions)
          Define if description in list items must be translated; default value: true.
 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 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 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, 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, 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

ListControl

public ListControl()
Contructor.

Method Detail

addNotify

public final void addNotify()

setDomainId

public final void setDomainId(java.lang.String domainId)
Set the domain identifier, so the control can retrieve its items from the domain.

Parameters:
domainId - domain identifier

setDomain

public final void setDomain(Domain domain)
Set the specified domain and retrieve the list items from the domain.

Parameters:
domain - domain to use to retrieve the list items

getDomainId

public final java.lang.String getDomainId()
Returns:
domain identifier

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)

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:

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

getValue

public final java.lang.Object getValue()
Specified by:
getValue in interface InputControl
Overrides:
getValue in class BaseInputControl
Returns:
code or java.util.List of codes related to the selected item/items; it return null if no item is selected (with ListSelectionModel.SINGLE_SELECTION) or an empty java.util.List (without ListSelectionModel.SINGLE_SELECTION)

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

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()

addMouseListener

public final void addMouseListener(java.awt.event.MouseListener l)
Adds the specified mouse listener to receive mouse events from this textfield.

Parameters:
l - the mouse listener to be added

removeMouseListener

public final void removeMouseListener(java.awt.event.MouseListener l)
Removes the specified mouse listener so that it no longer receives mouse events from this textfield.

Parameters:
l - the mouse listener to be removed

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

getDomain

public final Domain getDomain()
Returns:
domain to use to retrieve the list items

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

isShowCheckBoxes

public final boolean isShowCheckBoxes()
Returns:
define if a check-box must be showed for each node

setShowCheckBoxes

public final void setShowCheckBoxes(boolean showCheckBoxes)
Define if a check-box must be showed for each node.

Parameters:
showCheckBoxes - define if a check-box must be showed for each node

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

isTranslateItemDescriptions

public final boolean isTranslateItemDescriptions()
Returns:
define if description in list items must be translated

setTranslateItemDescriptions

public final void setTranslateItemDescriptions(boolean translateItemDescriptions)
Define if description in list items must be translated; default value: true.

Parameters:
translateItemDescriptions - flag used to define if description in list items must be translated

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