Class AbstractSelectableRow
- java.lang.Object
-
- org.eclipse.swt.widgets.Widget
-
- org.eclipse.swt.widgets.Control
-
- org.eclipse.swt.widgets.Scrollable
-
- org.eclipse.swt.widgets.Composite
-
- org.eclipse.nebula.widgets.compositetable.AbstractSelectableRow
-
- All Implemented Interfaces:
java.util.EventListener
,IRowContentProvider
,IRowFocusListener
,org.eclipse.swt.events.FocusListener
,org.eclipse.swt.events.KeyListener
,org.eclipse.swt.events.MouseListener
,org.eclipse.swt.events.TraverseListener
,org.eclipse.swt.graphics.Drawable
,org.eclipse.swt.internal.SWTEventListener
public abstract class AbstractSelectableRow extends org.eclipse.swt.widgets.Composite implements org.eclipse.swt.events.TraverseListener, org.eclipse.swt.events.FocusListener, org.eclipse.swt.events.MouseListener, IRowFocusListener, IRowContentProvider, org.eclipse.swt.events.KeyListener
An abstract row class making it easy to implement a table where the whole row is selected at once.
-
-
Field Summary
Fields Modifier and Type Field Description private int
columnCount
private org.eclipse.swt.widgets.Display
display
private boolean
inactiveSelected
protected java.util.List
labels
private org.eclipse.swt.graphics.Color
LIST_BACKGROUND
private org.eclipse.swt.graphics.Color
LIST_FOREGROUND
private org.eclipse.swt.graphics.Color
LIST_SELECTION
private org.eclipse.swt.graphics.Color
LIST_SELECTION_NOFOCUS
private org.eclipse.swt.graphics.Color
LIST_SELECTION_TEXT
private org.eclipse.swt.graphics.Color
LIST_SELECTION_TEXT_NOFOCUS
private java.lang.Object
model
private boolean
selected
-
Constructor Summary
Constructors Constructor Description AbstractSelectableRow(org.eclipse.swt.widgets.Composite parent, int style)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
arrive(CompositeTable sender, int currentObjectOffset, org.eclipse.swt.widgets.Control newRow)
Method arrive.void
depart(CompositeTable sender, int currentObjectOffset, org.eclipse.swt.widgets.Control row)
Method depart.private void
deselectRow()
void
focusGained(org.eclipse.swt.events.FocusEvent e)
void
focusLost(org.eclipse.swt.events.FocusEvent e)
private int
getColumnCount()
java.util.List
getLabelsList()
java.lang.Object
getModel()
private void
initialize()
This method initializes thisvoid
keyPressed(org.eclipse.swt.events.KeyEvent e)
void
keyReleased(org.eclipse.swt.events.KeyEvent e)
void
keyTraversed(org.eclipse.swt.events.TraverseEvent e)
void
mouseDoubleClick(org.eclipse.swt.events.MouseEvent e)
Clients should override to implement their double-click behavior.void
mouseDown(org.eclipse.swt.events.MouseEvent e)
void
mouseUp(org.eclipse.swt.events.MouseEvent e)
void
refresh(CompositeTable sender, int currentObjectOffset, org.eclipse.swt.widgets.Control row)
Method refresh.boolean
requestRowChange(CompositeTable sender, int currentObjectOffset, org.eclipse.swt.widgets.Control row)
Method requestRowChange.void
setColumnCount(int columnCount)
Method setColumnCount.void
setMenu(org.eclipse.swt.widgets.Menu menu)
void
setModel(java.lang.Object object)
private void
setRowColor(org.eclipse.swt.graphics.Color foreground, org.eclipse.swt.graphics.Color background)
protected void
setSelection(java.lang.Object model)
-
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
-
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
-
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isAutoScalable, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
-
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
-
-
-
-
Field Detail
-
display
private org.eclipse.swt.widgets.Display display
-
LIST_BACKGROUND
private org.eclipse.swt.graphics.Color LIST_BACKGROUND
-
LIST_FOREGROUND
private org.eclipse.swt.graphics.Color LIST_FOREGROUND
-
LIST_SELECTION
private org.eclipse.swt.graphics.Color LIST_SELECTION
-
LIST_SELECTION_TEXT
private org.eclipse.swt.graphics.Color LIST_SELECTION_TEXT
-
LIST_SELECTION_NOFOCUS
private org.eclipse.swt.graphics.Color LIST_SELECTION_NOFOCUS
-
LIST_SELECTION_TEXT_NOFOCUS
private org.eclipse.swt.graphics.Color LIST_SELECTION_TEXT_NOFOCUS
-
labels
protected java.util.List labels
-
selected
private boolean selected
-
inactiveSelected
private boolean inactiveSelected
-
model
private java.lang.Object model
-
columnCount
private int columnCount
-
-
Method Detail
-
initialize
private void initialize()
This method initializes this
-
getLabelsList
public java.util.List getLabelsList()
-
setRowColor
private void setRowColor(org.eclipse.swt.graphics.Color foreground, org.eclipse.swt.graphics.Color background)
-
keyTraversed
public void keyTraversed(org.eclipse.swt.events.TraverseEvent e)
- Specified by:
keyTraversed
in interfaceorg.eclipse.swt.events.TraverseListener
-
focusGained
public void focusGained(org.eclipse.swt.events.FocusEvent e)
- Specified by:
focusGained
in interfaceorg.eclipse.swt.events.FocusListener
-
setSelection
protected void setSelection(java.lang.Object model)
-
focusLost
public void focusLost(org.eclipse.swt.events.FocusEvent e)
- Specified by:
focusLost
in interfaceorg.eclipse.swt.events.FocusListener
-
depart
public void depart(CompositeTable sender, int currentObjectOffset, org.eclipse.swt.widgets.Control row)
Description copied from interface:IRowFocusListener
Method depart. Called after requstRowChange has been called to indicate that the focus is departing the specified row.- Specified by:
depart
in interfaceIRowFocusListener
-
arrive
public void arrive(CompositeTable sender, int currentObjectOffset, org.eclipse.swt.widgets.Control newRow)
Description copied from interface:IRowFocusListener
Method arrive. Notifies receiver that the current row has just been changed.- Specified by:
arrive
in interfaceIRowFocusListener
- Parameters:
sender
- The CompositeTable sending the event.currentObjectOffset
- The 0-based offset to the row that should be populatednewRow
- The actual SWT row object that needs to be populated with data
-
refresh
public void refresh(CompositeTable sender, int currentObjectOffset, org.eclipse.swt.widgets.Control row)
Description copied from interface:IRowContentProvider
Method refresh. Requests receiver to refresh the currentRowInTable with data to edit.- Specified by:
refresh
in interfaceIRowContentProvider
- Parameters:
sender
- The CompositeTable sending the message.currentObjectOffset
- The 0-based row number that is offset in the data structure of the table's top row.row
- The row control to fill with data. This will be a copy of your prototype row object.
-
deselectRow
private void deselectRow()
-
requestRowChange
public boolean requestRowChange(CompositeTable sender, int currentObjectOffset, org.eclipse.swt.widgets.Control row)
Description copied from interface:IRowFocusListener
Method requestRowChange. Requests permission to change rows. This method is called immediately before a row change occurs. Listeners must return true to grant permission for the row change to occur or return false to veto it. If any listener returns false, the entire row change operation is aborted.- Specified by:
requestRowChange
in interfaceIRowFocusListener
- Parameters:
sender
- The CompositeTable sending the event.currentObjectOffset
- The offset of the current object in the data structure.row
- The row control that is losing focus.- Returns:
- true to permit the row change to occur; false otherwise.
-
mouseDown
public void mouseDown(org.eclipse.swt.events.MouseEvent e)
- Specified by:
mouseDown
in interfaceorg.eclipse.swt.events.MouseListener
-
mouseDoubleClick
public void mouseDoubleClick(org.eclipse.swt.events.MouseEvent e)
Clients should override to implement their double-click behavior.- Specified by:
mouseDoubleClick
in interfaceorg.eclipse.swt.events.MouseListener
-
mouseUp
public void mouseUp(org.eclipse.swt.events.MouseEvent e)
- Specified by:
mouseUp
in interfaceorg.eclipse.swt.events.MouseListener
-
setModel
public void setModel(java.lang.Object object)
-
getModel
public java.lang.Object getModel()
-
setMenu
public void setMenu(org.eclipse.swt.widgets.Menu menu)
- Overrides:
setMenu
in classorg.eclipse.swt.widgets.Control
-
keyPressed
public void keyPressed(org.eclipse.swt.events.KeyEvent e)
- Specified by:
keyPressed
in interfaceorg.eclipse.swt.events.KeyListener
-
keyReleased
public void keyReleased(org.eclipse.swt.events.KeyEvent e)
- Specified by:
keyReleased
in interfaceorg.eclipse.swt.events.KeyListener
-
setColumnCount
public void setColumnCount(int columnCount)
Method setColumnCount. Sets the number of columns in the row. This method must be called exactly once in the overridden constructor.- Parameters:
columnCount
- The number of columns in the row.
-
getColumnCount
private int getColumnCount()
-
-