org.formaria.swt
Class EditTable

java.lang.Object
  extended by org.eclipse.swt.widgets.Table
      extended by org.formaria.swt.Table
          extended by org.formaria.swt.EditTable
All Implemented Interfaces:
RowSelector, ListenerHelper, ModelHolder, StyleComponent

public class EditTable
extends Table

Provides a simple read-only tables/grid component.

Copyright (c) Formaria Ltd.,
License: see license.txt $Revision: 2.7 $


Field Summary
protected  boolean toUpdate
           
protected  DialogTableAddColumn xaddc
           
protected  DialogTableAddItem xaddi
           
protected  DialogTableSetValueColumnItem xsetvci
           
 
Fields inherited from class org.formaria.swt.Table
colorSWTBg, colorSWTFg, invoker, model, updateModelSelection, usesDatabase
 
Constructor Summary
EditTable(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 org.formaria.swt.Table
addHandler, addListener, charLength, databaseRefill, getModel, getSelectedRow, getToolTip, getValueAt, refill, setBorderStyle, setDataModel, setDisplayAttributes, setInteractiveTable, setSelectedRow, setSelectedStyle, setSelectionMode, setStyle, setToolTip, setUpdateModelSelection, staticRefill, update, updateWidthColumn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xaddi

protected DialogTableAddItem xaddi

xaddc

protected DialogTableAddColumn xaddc

xsetvci

protected DialogTableSetValueColumnItem xsetvci

toUpdate

protected boolean toUpdate
Constructor Detail

EditTable

public EditTable(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 Table

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