org.eclipse.cdt.internal.ui.dialogs
Class SelectionList

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by org.eclipse.cdt.internal.ui.dialogs.SelectionList
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class SelectionList
extends org.eclipse.swt.widgets.Composite

A selection widget that consists of a list and a text entry field. The list of elements presented are limited to the pattern entered into the text entry field.


Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
SelectionList(org.eclipse.swt.widgets.Composite parent, int style, org.eclipse.jface.viewers.ILabelProvider renderer, boolean ignoreCase)
          Creates new instance of the widget.
 
Method Summary
 void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
          Adds a selection change listener to this widget.
 void filter(boolean forceUpdate)
          Filters the list of elements according to the pattern entered into the text entry field.
 java.lang.String getFilter()
          Returns the currently used filter text.
 java.util.List getSelection()
          Returns a list of selected elements.
 int[] getSelectionIndices()
          Returns the selection indices.
 boolean isEmptyList()
          Returns true when the list of elements is empty.
 void removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
          Removes a selection change listener to this widget.
 void selectFilterText()
          Select the pattern text.
 void setElements(java.util.List elements, boolean refilter)
          Sets the list of elements presented in the widget.
 void setEnabled(boolean enable)
           
 void setFilter(java.lang.String pattern, boolean refilter)
          Sets the filter pattern.
 boolean setFocus()
           
 void setFont(org.eclipse.swt.graphics.Font font)
           
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SelectionList

public SelectionList(org.eclipse.swt.widgets.Composite parent,
                     int style,
                     org.eclipse.jface.viewers.ILabelProvider renderer,
                     boolean ignoreCase)
Creates new instance of the widget.

Method Detail

addSelectionListener

public void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Adds a selection change listener to this widget.


filter

public void filter(boolean forceUpdate)
Filters the list of elements according to the pattern entered into the text entry field.


getFilter

public java.lang.String getFilter()
Returns the currently used filter text.


getSelectionIndices

public int[] getSelectionIndices()
Returns the selection indices.


getSelection

public java.util.List getSelection()
Returns a list of selected elements. Note that the type of the elements returned in the list are the same as the ones passed to the selection list via setElements. The list doesn't contain the rendered strings.


isEmptyList

public boolean isEmptyList()
Returns true when the list of elements is empty.


removeSelectionListener

public void removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Removes a selection change listener to this widget.


selectFilterText

public void selectFilterText()
Select the pattern text.


setElements

public void setElements(java.util.List elements,
                        boolean refilter)
Sets the list of elements presented in the widget.


setEnabled

public void setEnabled(boolean enable)
Overrides:
setEnabled in class org.eclipse.swt.widgets.Control

setFilter

public void setFilter(java.lang.String pattern,
                      boolean refilter)
Sets the filter pattern. Current only prefix filter pattern are supported.


setFocus

public boolean setFocus()
Overrides:
setFocus in class org.eclipse.swt.widgets.Composite

setFont

public void setFont(org.eclipse.swt.graphics.Font font)
Overrides:
setFont in class org.eclipse.swt.widgets.Control