dsto.dfc.swt.controls
Class ChoicePanel

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 dsto.dfc.swt.controls.ChoicePanel
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

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

Allows selection of either one or many integer-based choices in a checkbox or radio list.

Author:
mpp

Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
ChoicePanel(org.eclipse.swt.widgets.Composite parent, String title, String[] labels, int[] values, int choice, boolean exclusive)
          Create a new instance.
 
Method Summary
 org.eclipse.swt.widgets.Button getButton(int index)
          Get the button at a given index (*not* for a given choice value).
 int getChoice()
          Get the selected choice.
 void setChoice(int choice)
          Set the current choice.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getBorderWidth, getClientArea, 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, getRegion, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, 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, setRegion, 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, getListeners, 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

ChoicePanel

public ChoicePanel(org.eclipse.swt.widgets.Composite parent,
                   String title,
                   String[] labels,
                   int[] values,
                   int choice,
                   boolean exclusive)
Create a new instance.

Parameters:
parent - The parent.
title - The title of the choice group. May be null in which case the radio buttons are not put in a Group panel.
labels - The choice labels.
values - The choice values.
choice - The initially selected choice.
exclusive - True if only one value can be chosen (will use radio list rather than checkboxes).
See Also:
getChoice()
Method Detail

setChoice

public void setChoice(int choice)
Set the current choice.

See Also:
getChoice()

getChoice

public int getChoice()
Get the selected choice. If exclusive, this will be one element from the values array. If non-exclusive, this will be a bitwise OR of the selected values from the values array.


getButton

public org.eclipse.swt.widgets.Button getButton(int index)
Get the button at a given index (*not* for a given choice value).



Copyright © 2008 Commonwealth of Australia