ewe.database
Class DatabaseTableModel

java.lang.Object
  extended byewe.ui.TableModel
      extended byewe.data.FieldTableModel
          extended byewe.database.DatabaseTableModel
All Implemented Interfaces:
CellConstants, ControlConstants, EventListener, UIConstants

public class DatabaseTableModel
extends FieldTableModel


Nested Class Summary
 
Nested classes inherited from class ewe.ui.TableModel
TableModel.CellControl, TableModel.ControlProxy
 
Field Summary
 Database database
           
 FoundEntries entries
           
 Record record
           
protected  boolean useDataObjects
           
 EntriesView view
           
 
Fields inherited from class ewe.data.FieldTableModel
allColumns, cacheSize, displayFields, dontCacheObjects, getLock, objectClass, objectData, objects, readOnly
 
Fields inherited from class ewe.ui.TableModel
activeCellControl, allColumnsSameSize, allRowsSameSize, canHScroll, canVScroll, cellInsets, charHeight, clipData, controlProxy, cursorSize, fillToEqualHeights, fillToEqualWidths, gap, hasColumnHeaders, hasPreferredSize, hasRowHeaders, hasSpanningColumns, hasSpanningRows, horizontalScrollUnit, insets, numCols, numRows, preferredCols, preferredRows, rect, selectRowWhenEditing, shadeAlternateRows, table, tca, verticalScrollUnit
 
Fields inherited from interface ewe.ui.UIConstants
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN
 
Fields inherited from interface ewe.ui.CellConstants
BORDER, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, FIXEDSIZE, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
 
Fields inherited from interface ewe.ui.ControlConstants
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, Disabled, DisablePopupMenu, DisplayOnly, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpKeyEvents, SendUpPenEvents, ShowSIP, ShrinkToNothing, SmallControl, SpecialBackground, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
 
Constructor Summary
DatabaseTableModel(Database table)
           
DatabaseTableModel(Database table, boolean useFields)
           
DatabaseTableModel(Database table, int[] fields, boolean addNormalFieldsAfter)
           
DatabaseTableModel(Database table, String fields)
           
DatabaseTableModel(EntriesView view)
           
DatabaseTableModel(FoundEntries fe)
           
 
Method Summary
 int addNew()
           
 int addObject(Object obj)
           
protected  int calculateNumRows()
          This calculates the number of rows in the table.
 void checkUpdate()
           
protected  void dataChanged(Object obj, int row, String fieldName)
           
 void entriesChanged()
          Call this to notify the table that the entries to be displayed have been changed in some way.
protected  Object loadObjectAtRow(int row)
          Override this to use a different method of retrieving the object at a particular row.
 void onEvent(Event ev)
           
 DatabaseTableModel setEntries(FoundEntries entries)
          Call this to set the entries to be displayed in this table.
 DatabaseTableModel setView(EntriesView view)
           
 
Methods inherited from class ewe.data.FieldTableModel
cacheObject, calculateColWidth, calculateRowHeight, calculateTextCharsInColumn, countEntries, dataChanged, doColumnSelection, doHotKey, entriesChanged, getAllFields, getCachedObject, getCellAttributes, getCellControlFor, getCellText, getColumnSelector, getColumnSelectorButton, getExportTask, getField, getFieldData, getFieldValue, getMaxColWidth, getMinColWidth, getNew, getObjectAtRow, getSelectedEntry, getTableExportButton, getTableExporter, getTableForm, getTableForm, invalidateCache, invalidateCachedObject, invalidateCachedObject, made, main, modifyFields, rowChanged, selectEntry, setFields, setFields, setFields, setFields, setFields, setFields, setObjects
 
Methods inherited from class ewe.ui.TableModel
calculateTextLinesInRow, canScreenScroll, canSelect, checkControlFor, clearCellAdjustments, closeActiveControl, deferPaintTableCell, findCellsInArea, fixBorder, getCellData, getCellInsets, getCellPreferredSize, getCellRect, getColWidth, getControlFor, getLinesFor, getMaxRowHeight, getMenuFor, getMenuOutsideCells, getMinRowHeight, getPreferredSize, getRowHeight, getToolTip, hasActiveControls, inset, isActiveCellControl, notifyDataChange, onKeyEvent, paintTableCell, paintTableCell, paintTableCellData, paintTableCellText, penPressed, popupMenuEvent, remapColumns, resized, scrollTo, select, show, startedEditing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Field Detail

database

public Database database

entries

public FoundEntries entries

view

public EntriesView view

record

public Record record

useDataObjects

protected boolean useDataObjects
Constructor Detail

DatabaseTableModel

public DatabaseTableModel(Database table)

DatabaseTableModel

public DatabaseTableModel(Database table,
                          String fields)

DatabaseTableModel

public DatabaseTableModel(Database table,
                          int[] fields,
                          boolean addNormalFieldsAfter)

DatabaseTableModel

public DatabaseTableModel(Database table,
                          boolean useFields)

DatabaseTableModel

public DatabaseTableModel(FoundEntries fe)

DatabaseTableModel

public DatabaseTableModel(EntriesView view)
Method Detail

entriesChanged

public void entriesChanged()
Description copied from class: FieldTableModel
Call this to notify the table that the entries to be displayed have been changed in some way. It recalculates the number of rows and redisplays the table.

Overrides:
entriesChanged in class FieldTableModel

checkUpdate

public void checkUpdate()

setEntries

public DatabaseTableModel setEntries(FoundEntries entries)
Call this to set the entries to be displayed in this table. You can also use entriesChanged() to notify the table that the entries have been changed.

Parameters:
entries - The entries to display in this table.

setView

public DatabaseTableModel setView(EntriesView view)

calculateNumRows

protected int calculateNumRows()
This calculates the number of rows in the table. By default this will return the size of the objects Vector. If this Vector is null it will return zero. Override this if you are not using the objects Vector - in which case you must also override loadObjectAtRow().

Overrides:
calculateNumRows in class FieldTableModel

loadObjectAtRow

protected Object loadObjectAtRow(int row)
                          throws Exception
Override this to use a different method of retrieving the object at a particular row.

Overrides:
loadObjectAtRow in class FieldTableModel
Throws:
Exception

dataChanged

protected void dataChanged(Object obj,
                           int row,
                           String fieldName)
Overrides:
dataChanged in class FieldTableModel

addNew

public int addNew()
           throws IOException
Throws:
IOException

addObject

public int addObject(Object obj)
              throws IOException
Throws:
IOException

onEvent

public void onEvent(Event ev)
Specified by:
onEvent in interface EventListener
Overrides:
onEvent in class FieldTableModel