Commons

org.topcased.facilities.widgets
Class SingleObjectChooser

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.topcased.facilities.widgets.SingleObjectChooser
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

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

This widget displays a combo with the available values and a button that opens a dialog with an easier selection : searchable list with pattern text field, case sensitive filter...


Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandle
 
Fields inherited from class org.eclipse.swt.widgets.Widget
handle
 
Constructor Summary
SingleObjectChooser(org.eclipse.swt.widgets.Composite parent, int style)
          Constructor
 
Method Summary
 void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
          Add a SelectionListener on both the CCombo and the Button
 void clearCombo()
          Clear the combo
protected  void createContents(org.eclipse.swt.widgets.Composite parent)
          Creates the UI
 java.lang.Object getSelection()
          Returns the selected object
protected  void hookListeners()
          Adds the listeners on the widgets
 void removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
          Remove the SelectionListener of the CCombo and the Button
 void setChoices(java.lang.Object[] objs)
          Set the objects in which the user can choose.
 void setLabelProvider(org.eclipse.jface.viewers.IBaseLabelProvider labelProvider)
          Set the provider that displays the objects
 void setSelection(java.lang.Object selection)
          Set the selection of the combo
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getClientArea, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getBorderWidth, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBounds, getCursor, getDragDetect, 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, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, 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, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SingleObjectChooser

public SingleObjectChooser(org.eclipse.swt.widgets.Composite parent,
                           int style)
Constructor

Parameters:
parent -
style -
Method Detail

createContents

protected void createContents(org.eclipse.swt.widgets.Composite parent)
Creates the UI

Parameters:
parent - this widget

hookListeners

protected void hookListeners()
Adds the listeners on the widgets


addSelectionListener

public void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Add a SelectionListener on both the CCombo and the Button

Parameters:
listener -

removeSelectionListener

public void removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Remove the SelectionListener of the CCombo and the Button

Parameters:
listener -

setChoices

public void setChoices(java.lang.Object[] objs)
Set the objects in which the user can choose.

Parameters:
objs - the list of objects

clearCombo

public void clearCombo()
Clear the combo


setLabelProvider

public void setLabelProvider(org.eclipse.jface.viewers.IBaseLabelProvider labelProvider)
Set the provider that displays the objects

Parameters:
labelProvider - the LabelProvider

getSelection

public java.lang.Object getSelection()
Returns the selected object

Returns:
the selection

setSelection

public void setSelection(java.lang.Object selection)
Set the selection of the combo

Parameters:
selection - the selected object

Commons

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.