EGF Engine
Release 0.1.0

org.eclipse.egf.common.ui.viewers
Class OrderedListViewer

java.lang.Object
  extended by org.eclipse.egf.common.ui.viewers.AbstractViewerWithButtons
      extended by org.eclipse.egf.common.ui.viewers.OrderedListViewer
Direct Known Subclasses:
OrderedListViewerWithAddAndRemove

public class OrderedListViewer
extends AbstractViewerWithButtons

A concrete viewer based on an SWT List control with 2 buttons on the right side to move up (or down) elements in the list.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.egf.common.ui.viewers.AbstractViewerWithButtons
AbstractViewerWithButtons.ButtonData
 
Field Summary
 
Fields inherited from class org.eclipse.egf.common.ui.viewers.AbstractViewerWithButtons
_buttonData, _decoratedViewer
 
Constructor Summary
OrderedListViewer(Composite parent_p)
          Constructor.
 
Method Summary
protected  AbstractViewerWithButtons.ButtonData[] createButtonData()
          Create button data, that is an array of AbstractViewerWithButtons.ButtonData, descriptors for buttons to create.
protected  List<AbstractViewerWithButtons.ButtonData> createExtraButtonData()
          Create extra button data, if needed, before up and down are added.
protected  StructuredViewer createViewer(Composite composite_p)
          Default viewer is TableViewer with one column (to support labels and icons).
protected  void delegateButtonClicked(Button clickedButton_p, Object data_p)
          Delegate button clicked event, if default listener implementation ain't enough.
protected  int getElementCount()
          Return the number of element contained in the viewer.
protected  int getSelectionIndex()
          Returns the zero-relative index of the element which is currently selected in the viewer.
protected  Control getUnderlyingViewerControl()
          Return the underlying control used by the current viewer.
 
Methods inherited from class org.eclipse.egf.common.ui.viewers.AbstractViewerWithButtons
buttonSelected, createButton, createEmptySpace, getDecoratedViewer, init, isEditable, setButtonClickedListener, updateButtons
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderedListViewer

public OrderedListViewer(Composite parent_p)
Constructor.

Parameters:
parent_p -
Method Detail

delegateButtonClicked

protected void delegateButtonClicked(Button clickedButton_p,
                                     Object data_p)
Delegate button clicked event, if default listener implementation ain't enough.
This implementation does nothing. Should be implemented by subclasses.

Parameters:
clickedButton_p -
data_p -

getSelectionIndex

protected int getSelectionIndex()
Returns the zero-relative index of the element which is currently selected in the viewer.

Returns:

getElementCount

protected int getElementCount()
Return the number of element contained in the viewer.

Returns:

getUnderlyingViewerControl

protected Control getUnderlyingViewerControl()
Return the underlying control used by the current viewer. createViewer(Composite).

Returns:

createButtonData

protected AbstractViewerWithButtons.ButtonData[] createButtonData()
Description copied from class: AbstractViewerWithButtons
Create button data, that is an array of AbstractViewerWithButtons.ButtonData, descriptors for buttons to create.

Specified by:
createButtonData in class AbstractViewerWithButtons
Returns:
must not return null or an empty array.
See Also:
org.eclipse.egf.common.ui.viewers.AbstractViewerWithButtons#getButtonData()

createExtraButtonData

protected List<AbstractViewerWithButtons.ButtonData> createExtraButtonData()
Create extra button data, if needed, before up and down are added.
Subclasses must call super when overriding this method.
Default implementation provides with an empty, but not null, list of ButtonData.

Returns:

createViewer

protected StructuredViewer createViewer(Composite composite_p)
Default viewer is TableViewer with one column (to support labels and icons).

Specified by:
createViewer in class AbstractViewerWithButtons
See Also:
org.eclipse.egf.common.ui.viewers.AbstractViewerWithButtons#createViewer(org.eclipse.swt.widgets.Composite)

EGF Engine
Release 0.1.0

Copyright (c) Thales Corporate Services S.A.S, 2009.

This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.