com.tensegrity.gui.swt.control.multiselect
Class PaintItemSelectionBox

java.lang.Object
  extended byorg.eclipse.swt.widgets.Widget
      extended byorg.eclipse.swt.widgets.Control
          extended byorg.eclipse.swt.widgets.Scrollable
              extended byorg.eclipse.swt.widgets.Composite
                  extended byorg.eclipse.swt.widgets.Canvas
                      extended bycom.tensegrity.gui.swt.control.multiselect.SelectionBox
                          extended bycom.tensegrity.gui.swt.control.multiselect.PaintItemSelectionBox
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable, java.util.EventListener, org.eclipse.swt.events.MouseListener, org.eclipse.swt.internal.SWTEventListener

public class PaintItemSelectionBox
extends SelectionBox

A selection box for displaying and choosing PaintItems. Note that this selection box is a little bit different then the others within this package, since it can be extended by loading new items.

Version:
$Id: PaintItemSelectionBox.java,v 1.3 2005/03/21 11:30:06 ArndHouben Exp $
Author:
Arnd Houben

Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
PaintItemSelectionBox(org.eclipse.swt.widgets.Composite parent, int style, int columns)
          Constructor where you can specify the amount of used columns for displaying the available PaintItem instances
 
Method Summary
protected  org.eclipse.swt.widgets.Control createControl(org.eclipse.swt.widgets.Composite parent, java.lang.Object item)
          Returns a suitable control widget to display the given item object.
 java.lang.Object getSelection()
          Returns the selected item.
protected  void setSelection(org.eclipse.swt.widgets.Control control)
          Sets the selected control object.
 
Methods inherited from class com.tensegrity.gui.swt.control.multiselect.SelectionBox
addItem, addItems, addSelectionListener, mouseDoubleClick, mouseDown, mouseUp, removeSelectionListener
 
Methods inherited from class org.eclipse.swt.widgets.Canvas
getCaret, scroll, setCaret, setFont
 
Methods inherited from class org.eclipse.swt.widgets.Composite
checkSubclass, computeSize, getChildren, getLayout, getTabList, layout, layout, setFocus, setLayout, 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, 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, setBounds, setBounds, setCapture, setCursor, setEnabled, 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

PaintItemSelectionBox

public PaintItemSelectionBox(org.eclipse.swt.widgets.Composite parent,
                             int style,
                             int columns)
Constructor where you can specify the amount of used columns for displaying the available PaintItem instances

Parameters:
parent - the parent Composite to add this PaintItemSelectionBox to
style - the style of this SelectionBox
columns - amount of columns to use for displaying PaintItems
Method Detail

createControl

protected org.eclipse.swt.widgets.Control createControl(org.eclipse.swt.widgets.Composite parent,
                                                        java.lang.Object item)
Description copied from class: SelectionBox
Returns a suitable control widget to display the given item object. This control is also the source of mouse events within this selection box.

Specified by:
createControl in class SelectionBox
Returns:
control for displaying an item

setSelection

protected void setSelection(org.eclipse.swt.widgets.Control control)
Description copied from class: SelectionBox
Sets the selected control object. Implementing classes should take care of that the corresponding item object can be received by getSelection().

Specified by:
setSelection in class SelectionBox
Parameters:
control - the selected control widget

getSelection

public java.lang.Object getSelection()
Description copied from class: SelectionBox
Returns the selected item.

Specified by:
getSelection in class SelectionBox
Returns:
selected item or null if none was selected.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.