http://www.eteks.com

com.eteks.jeks
Class JeksTable

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JTable
                          |
                          +--com.eteks.jeks.JeksTable
All Implemented Interfaces:
javax.accessibility.Accessible, javax.swing.event.CellEditorListener, java.util.EventListener, java.awt.image.ImageObserver, javax.swing.event.ListSelectionListener, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable, javax.swing.event.TableColumnModelListener, javax.swing.event.TableModelListener

public class JeksTable
extends javax.swing.JTable

A spreadsheet table component. This table use a JeksExpressionParser parser to parse compile and evaluate computed cell. Computed cells are rendered with a JeksCellRenderer cell renderer. If it's editable it uses an instance of JeksCellEditor as editor. An instance of ReferringCellsListener is added to the table model to automaticaly update cells after changes.

Since:
Jeks 1.0
Version:
1.0
Author:
Emmanuel Puybaret
See Also:
JeksExpressionParser, JeksCellRenderer, JeksCellEditor, ReferringCellsListener, Serialized Form

Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Fields inherited from class javax.swing.JTable
AUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JeksTable()
          Creates an editable spreadsheet table with an instance of JeksExpressionParser as parser for computed cells.
JeksTable(int rowCount, int columnCount)
          Creates an editable spreadsheet table of rowCount rows and columnCount columns with an instance of JeksExpressionParser as parser for computed cells.
JeksTable(javax.swing.table.TableModel model)
          Creates an editable spreadsheet table using the model model and an instance of JeksExpressionParser as parser for computed cells.
JeksTable(javax.swing.table.TableModel model, JeksExpressionParser expressionParser, boolean editable)
          Creates a spreadsheet table.
 
Method Summary
 void addColumn(javax.swing.table.TableColumn column)
           
 void copySelectedCells()
          Copy the selected cells of this table for future paste operations.
 void cutSelectedCells()
          Cut the selected cells of this table for future paste operations.
 void deleteSelectedCells()
          Deletes the selected cells of this table.
 javax.swing.table.TableCellEditor getCellEditor(int row, int column)
          Returns a instance of JeksCellEditor if this table is editable.
 javax.swing.table.TableCellRenderer getCellRenderer(int row, int column)
          Returns the default renderer of the class of the object stored at (row,column).
 java.lang.String getColumnName(int column)
          Returns the localized column name of this table.
 JeksExpressionParser getExpressionParser()
          Returns the expression parser used by this table.
 ReferringCellsListener getReferringCellsListener()
          Return the referring cells listener added to the model of this table.
 boolean pasteCopiedCells()
          Pastes the previously cut or copied cells from the current selected cell.
 
Methods inherited from class javax.swing.JTable
addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, convertColumnIndexToModel, convertColumnIndexToView, createDefaultColumnsFromModel, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoResizeMode, getCellEditor, getCellRect, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getEditingColumn, getEditingRow, getEditorComponent, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getTableHeader, getToolTipText, getUI, getUIClassID, getValueAt, isCellEditable, isCellSelected, isColumnSelected, isEditing, isFocusTraversable, isManagingFocus, isRowSelected, moveColumn, prepareEditor, prepareRenderer, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setEditingColumn, setEditingRow, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setTableHeader, setUI, setValueAt, sizeColumnsToFit, sizeColumnsToFit, tableChanged, updateUI, valueChanged
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isLightweightComponent, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setLayout, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, contains, createImage, createImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JeksTable

public JeksTable()
Creates an editable spreadsheet table with an instance of JeksExpressionParser as parser for computed cells.

JeksTable

public JeksTable(int rowCount,
                 int columnCount)
Creates an editable spreadsheet table of rowCount rows and columnCount columns with an instance of JeksExpressionParser as parser for computed cells.

JeksTable

public JeksTable(javax.swing.table.TableModel model)
Creates an editable spreadsheet table using the model model and an instance of JeksExpressionParser as parser for computed cells.

JeksTable

public JeksTable(javax.swing.table.TableModel model,
                 JeksExpressionParser expressionParser,
                 boolean editable)
Creates a spreadsheet table.
Method Detail

getExpressionParser

public JeksExpressionParser getExpressionParser()
Returns the expression parser used by this table.

getReferringCellsListener

public ReferringCellsListener getReferringCellsListener()
Return the referring cells listener added to the model of this table.

cutSelectedCells

public void cutSelectedCells()
Cut the selected cells of this table for future paste operations. Copied cells are kept in an internal buffer.

copySelectedCells

public void copySelectedCells()
Copy the selected cells of this table for future paste operations. Copied cells are kept in an internal buffer.

deleteSelectedCells

public void deleteSelectedCells()
Deletes the selected cells of this table.

pasteCopiedCells

public boolean pasteCopiedCells()
Pastes the previously cut or copied cells from the current selected cell. Returns true if a circularity has been detected during the paste operation.

getCellRenderer

public javax.swing.table.TableCellRenderer getCellRenderer(int row,
                                                           int column)
Returns the default renderer of the class of the object stored at (row,column).
Overrides:
getCellRenderer in class javax.swing.JTable

getCellEditor

public javax.swing.table.TableCellEditor getCellEditor(int row,
                                                       int column)
Returns a instance of JeksCellEditor if this table is editable.
Overrides:
getCellEditor in class javax.swing.JTable

getColumnName

public java.lang.String getColumnName(int column)
Returns the localized column name of this table.
Overrides:
getColumnName in class javax.swing.JTable

addColumn

public void addColumn(javax.swing.table.TableColumn column)
Overrides:
addColumn in class javax.swing.JTable

&cp; 1998-2003 eTeks - All rights reserved