semorg.gui.util
Class ConfigureListWidget

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 semorg.gui.util.ConfigureListWidget
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

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

This class is used


Nested Class Summary
(package private)  class ConfigureListWidget.TableColumnPropertyContentProvider
          This class provides the content of the columns lists, i.e. column names, their alignment and the width.
(package private)  class ConfigureListWidget.TableColumnPropertyLabelProvider
          The class provides the labels for GUI table columns.
 
Field Summary
private  TableColumnProperty[] columnProperties
          Array of table columns with unchanged order.
private  org.eclipse.swt.widgets.List deselectedColumns
          The List widget which contains the deselected columns.
private  ConfigureListWidget.TableColumnPropertyContentProvider deselectedColumnsCP
          The content provider for the deselectedColumnsViewer.
private  org.eclipse.jface.viewers.ListViewer deselectedColumnsViewer
          The list viewer which manages the list used to display the deselected columns.
private  org.eclipse.swt.widgets.List selectedColumns
          The List widget which contains the selected columns.
private  ConfigureListWidget.TableColumnPropertyContentProvider selectedColumnsCP
          The content provider for the selectedColumnsViewer.
private  org.eclipse.jface.viewers.ListViewer selectedColumnsViewer
          The list viewer which manages the list used to display the selected columns.
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
ConfigureListWidget(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.widgets.TableColumn[] currentColumns, int[] columnOrder)
          Creates a ConfigureListDlg instance with the given parameters.
 
Method Summary
 TableColumnProperty[] getColumns()
           
private  void onDeselect()
          Moves a column from the list with selected columns to the list of deselected columns.
private  void onSelect()
          Moves a column from the list with deselected columns to the list of selected columns.
private  void setListViewerInputs(TableColumnProperty[] columns, int[] columnOrder)
          Fills the both lists selectedColumns and deselectedColumns with content using the selectedColumnsViewer and the deselectedColumnsViewer.
 void updateColumnNumbers()
          Sets the columns numbers subject to the order of colmuns displayed in the lists of selected columns.
 
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, 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, getBackgroundImage, 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, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, 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
 

Field Detail

columnProperties

private TableColumnProperty[] columnProperties
Array of table columns with unchanged order.


selectedColumnsViewer

private org.eclipse.jface.viewers.ListViewer selectedColumnsViewer
The list viewer which manages the list used to display the selected columns.


deselectedColumnsViewer

private org.eclipse.jface.viewers.ListViewer deselectedColumnsViewer
The list viewer which manages the list used to display the deselected columns.


selectedColumnsCP

private ConfigureListWidget.TableColumnPropertyContentProvider selectedColumnsCP
The content provider for the selectedColumnsViewer.


deselectedColumnsCP

private ConfigureListWidget.TableColumnPropertyContentProvider deselectedColumnsCP
The content provider for the deselectedColumnsViewer.


selectedColumns

private org.eclipse.swt.widgets.List selectedColumns
The List widget which contains the selected columns.


deselectedColumns

private org.eclipse.swt.widgets.List deselectedColumns
The List widget which contains the deselected columns.

Constructor Detail

ConfigureListWidget

public ConfigureListWidget(org.eclipse.swt.widgets.Composite parent,
                           org.eclipse.swt.widgets.TableColumn[] currentColumns,
                           int[] columnOrder)
Creates a ConfigureListDlg instance with the given parameters.

Parameters:
parent - the parent composite, which contains the ConfigureListDlg.
currentColumns - array of the current columns.
columnOrder - the order of columns.
Method Detail

setListViewerInputs

private void setListViewerInputs(TableColumnProperty[] columns,
                                 int[] columnOrder)
Fills the both lists selectedColumns and deselectedColumns with content using the selectedColumnsViewer and the deselectedColumnsViewer.

Parameters:
columns - the columns to manage
columnOrder - the order of the columns

updateColumnNumbers

public void updateColumnNumbers()
Sets the columns numbers subject to the order of colmuns displayed in the lists of selected columns.


getColumns

public TableColumnProperty[] getColumns()
Returns:
An array of TableColumnProperty objects.

onSelect

private void onSelect()
Moves a column from the list with deselected columns to the list of selected columns. This method gets invoked by clicking the select button.


onDeselect

private void onDeselect()
Moves a column from the list with selected columns to the list of deselected columns. This method gets invoked by clicking the deselect button.