net.xoetrope.swt
Class XEditTable

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 org.eclipse.swt.widgets.Table
                      extended by net.xoetrope.swt.XTable
                          extended by net.xoetrope.swt.XEditTable
All Implemented Interfaces:
XRowSelector, XListenerHelper, XStyleComponent, XAttributedComponent, XModelHolder, org.eclipse.swt.graphics.Drawable

public class XEditTable
extends XTable

Provides a simple read-only tables/grid component.

Copyright (c) Xoetrope Ltd., 1998-2004
License: see license.txt $Revision: 2.7 $


Field Summary
protected  boolean toUpdate
           
protected  XDialogTableAddColumn xaddc
           
protected  XDialogTableAddItem xaddi
           
protected  XDialogTableSetValueColumnItem xsetvci
           
 
Fields inherited from class net.xoetrope.swt.XTable
colorSWTBg, colorSWTFg, invoker, model, updateModelSelection, usesDatabase
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
XEditTable(java.lang.Object parent)
          Create a new edittable
 
Method Summary
 void addColumn(java.lang.String title, int alignment)
          Add a column
 void addItem(java.lang.String[] args)
          Add an item
protected  void checkSubclass()
          Suppress the subclasing exception
 void setValueItem(java.lang.String[] args)
          Set a value to an attribute of an item
 java.lang.String showDialogAddColumn(java.lang.String text)
          Show the dialog to add a column
 java.lang.String showDialogAddItem(java.lang.String text)
          Show the dialog to add an item
 java.lang.String showDialogSetValueColumnItem(java.lang.String text)
          Show tha dialog to set a value to an attribute of an item
 void updateWidth(java.lang.String[] oldValues, java.lang.String[] args)
          Update the width of the columns
 void updateWidthColumn(int index, java.lang.String oldValue, java.lang.String newValue)
          Update the width a column
 
Methods inherited from class net.xoetrope.swt.XTable
addHandler, addListener, charLength, databaseRefill, getModel, getSelectedRow, getValueAt, refill, setAttribute, setBorderStyle, setDisplayAttributes, setInteractiveTable, setModel, setSelectedRow, setSelectedStyle, setSelectionMode, setStyle, setUpdateModelSelection, staticRefill, update, updateWidthColumn
 
Methods inherited from class org.eclipse.swt.widgets.Table
addSelectionListener, clear, clear, clear, clearAll, computeSize, deselect, deselect, deselect, deselectAll, getColumn, getColumnCount, getColumnOrder, getColumns, getGridLineWidth, getHeaderHeight, getHeaderVisible, getItem, getItem, getItemCount, getItemHeight, getItems, getLinesVisible, getSelection, getSelectionCount, getSelectionIndex, getSelectionIndices, getSortColumn, getSortDirection, getTopIndex, indexOf, indexOf, isSelected, remove, remove, remove, removeAll, removeSelectionListener, select, select, select, selectAll, setColumnOrder, setFont, setHeaderVisible, setItemCount, setLinesVisible, setRedraw, setSelection, setSelection, setSelection, setSelection, setSelection, setSortColumn, setSortDirection, setTopIndex, showColumn, showItem, showSelection
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, 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, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse
 
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

xaddi

protected XDialogTableAddItem xaddi

xaddc

protected XDialogTableAddColumn xaddc

xsetvci

protected XDialogTableSetValueColumnItem xsetvci

toUpdate

protected boolean toUpdate
Constructor Detail

XEditTable

public XEditTable(java.lang.Object parent)
Create a new edittable

Parameters:
parent - parent object
Method Detail

checkSubclass

protected void checkSubclass()
Suppress the subclasing exception

Overrides:
checkSubclass in class XTable

addItem

public void addItem(java.lang.String[] args)
Add an item

Parameters:
args - table of values

addColumn

public void addColumn(java.lang.String title,
                      int alignment)
Add a column

Parameters:
title - title of the column
alignment - alignment inside the column

setValueItem

public void setValueItem(java.lang.String[] args)
Set a value to an attribute of an item

Parameters:
args - table of values

updateWidth

public void updateWidth(java.lang.String[] oldValues,
                        java.lang.String[] args)
Update the width of the columns

Parameters:
oldValues - previous values
args - new values

updateWidthColumn

public void updateWidthColumn(int index,
                              java.lang.String oldValue,
                              java.lang.String newValue)
Update the width a column

Parameters:
index - index of a value
oldValue - previous value
newValue - new value

showDialogAddItem

public java.lang.String showDialogAddItem(java.lang.String text)
Show the dialog to add an item

Returns:
first value of the new item

showDialogAddColumn

public java.lang.String showDialogAddColumn(java.lang.String text)
Show the dialog to add a column

Returns:
name of the new colmn

showDialogSetValueColumnItem

public java.lang.String showDialogSetValueColumnItem(java.lang.String text)
Show tha dialog to set a value to an attribute of an item

Returns:
the new value