ewe.filechooser
Class FileListTableModel

java.lang.Object
  extended byewe.ui.TableModel
      extended byewe.filechooser.FileListTableModel
All Implemented Interfaces:
CellConstants, ControlConstants, EventListener, FileClipboard.FileClipboardSource, UIConstants

public class FileListTableModel
extends TableModel
implements FileClipboard.FileClipboardSource


Nested Class Summary
 
Nested classes inherited from class ewe.ui.TableModel
TableModel.CellControl, TableModel.ControlProxy
 
Field Summary
 File fileCheck
           
 Time fileTime
           
 boolean fileTips
           
 IImage folder
           
 PropertyList formatProperties
           
static int HMode
           
 boolean showDetails
           
 boolean verticalOnly
           
static int VMode
           
 
Fields inherited from class ewe.ui.TableModel
activeCellControl, allColumnsSameSize, allRowsSameSize, canHScroll, canVScroll, cellInsets, charHeight, charWidth, 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.filechooser.FileClipboard.FileClipboardSource
FILES_REJECTED, FILES_TAKEN
 
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
FileListTableModel(FileChooser chooser)
           
 
Method Summary
 int calculateColWidth(int col)
          This returns the full width of the column.
 int calculateRowHeight(int row)
          This returns the full height of the row.
 boolean canSelect(int row, int col)
          This should return whether or not a particular cell may be selected.
 Point cellOf(int index)
           
 int fileAt(int row, int col)
           
 boolean fileClipboardOperation(FileClipboard clip, int op)
           
 TableCellAttributes getCellAttributes(int row, int col, boolean isSelected, TableCellAttributes ta)
          Get the attributes for a cell.
 Insets getCellInsets(int row, int col, Insets insets)
          Get the insets of the data in the specified cell.
 int getFileIndex(int row, int col)
           
 Menu getMenuFor(int row, int col)
           
 Menu getMenuOutsideCells(Point p)
           
 String[] getSelectedFiles()
           
 Object getToolTip(int x, int y)
          Return a Tool Tip for the x,y position (in pixels) on the table.
 int indexOf(String file)
           
 void made()
          This is called after the TableControl has been made.
 void resized(int width, int height)
          This is called after the TableControl has been resized.
 void select(int row, int col, boolean selectOn)
          This is called by the table to tell the model that it wants to select a particular cell.
 void setFiles(File parent, String[] files)
           
 void setFilesToCopy(boolean isCut)
           
 void setShowDetails(boolean show)
           
 void updateDisplay()
           
 
Methods inherited from class ewe.ui.TableModel
calculateTextCharsInColumn, calculateTextLinesInRow, canScreenScroll, checkControlFor, clearCellAdjustments, closeActiveControl, deferPaintTableCell, doHotKey, findCellsInArea, fixBorder, getCellControlFor, getCellData, getCellPreferredSize, getCellRect, getCellText, getColWidth, getControlFor, getLinesFor, getMaxColWidth, getMaxRowHeight, getMinColWidth, getMinRowHeight, getPreferredSize, getRowHeight, hasActiveControls, inset, isActiveCellControl, notifyDataChange, onEvent, onKeyEvent, paintTableCell, paintTableCell, paintTableCellData, paintTableCellText, penPressed, popupMenuEvent, remapColumns, scrollTo, show, startedEditing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Field Detail

folder

public IImage folder

fileCheck

public File fileCheck

fileTime

public Time fileTime

showDetails

public boolean showDetails

verticalOnly

public boolean verticalOnly

fileTips

public boolean fileTips

HMode

public static final int HMode
See Also:
Constant Field Values

VMode

public static final int VMode
See Also:
Constant Field Values

formatProperties

public PropertyList formatProperties
Constructor Detail

FileListTableModel

public FileListTableModel(FileChooser chooser)
Method Detail

setShowDetails

public void setShowDetails(boolean show)

select

public void select(int row,
                   int col,
                   boolean selectOn)
This is called by the table to tell the model that it wants to select a particular cell. The model should then call table.addToSelection() to add it to the selection. Alternately the model can add more or different cells.

Overrides:
select in class TableModel

canSelect

public boolean canSelect(int row,
                         int col)
Description copied from class: TableModel
This should return whether or not a particular cell may be selected. Note that selecting a column or row header (row == -1 or col == -1) results in the entire row/column being selected.

Overrides:
canSelect in class TableModel

setFiles

public void setFiles(File parent,
                     String[] files)

made

public void made()
Description copied from class: TableModel
This is called after the TableControl has been made.

Overrides:
made in class TableModel

resized

public void resized(int width,
                    int height)
Description copied from class: TableModel
This is called after the TableControl has been resized.

Overrides:
resized in class TableModel

updateDisplay

public void updateDisplay()

calculateColWidth

public int calculateColWidth(int col)
Description copied from class: TableModel
This returns the full width of the column. If the requested col is -1 (header col) and there are no row headers it should return 0.

Overrides:
calculateColWidth in class TableModel

calculateRowHeight

public int calculateRowHeight(int row)
Description copied from class: TableModel
This returns the full height of the row. If the requested row is -1 (header row) and there are no column headers it should return 0.

Overrides:
calculateRowHeight in class TableModel

getFileIndex

public int getFileIndex(int row,
                        int col)

getSelectedFiles

public String[] getSelectedFiles()

fileClipboardOperation

public boolean fileClipboardOperation(FileClipboard clip,
                                      int op)
Specified by:
fileClipboardOperation in interface FileClipboard.FileClipboardSource

setFilesToCopy

public void setFilesToCopy(boolean isCut)

getCellInsets

public Insets getCellInsets(int row,
                            int col,
                            Insets insets)
Description copied from class: TableModel
Get the insets of the data in the specified cell. If "insets" is null a new one will be created. If this function returns null it is to be interpreted as zero insets. Insets are used for all data EXCEPT Controls.

Overrides:
getCellInsets in class TableModel

getCellAttributes

public TableCellAttributes getCellAttributes(int row,
                                             int col,
                                             boolean isSelected,
                                             TableCellAttributes ta)
Description copied from class: TableModel
Get the attributes for a cell. Note that even though a TableCellAttributes is passed to the method, for effeciency a completely different one may be returned. You should therefore not attempt to modify or reuse the one that is returned.

Overrides:
getCellAttributes in class TableModel

fileAt

public int fileAt(int row,
                  int col)

getToolTip

public Object getToolTip(int x,
                         int y)
Description copied from class: TableModel
Return a Tool Tip for the x,y position (in pixels) on the table. In this method you can do:
        Point cell = table.cellAtPoint(x,y,null);
        if (cell == null) return null; //Not on a cell.
        // Now cell.x will have the column and cell.y will have the row
        // of the cell the mouse is over and you can then display a tool tip for that cell.
        

Overrides:
getToolTip in class TableModel
Parameters:
x - The x co-ordinate in pixels of the mouse.
y - The y co-ordinate in pixels of the mouse.
Returns:
An acceptable ToolTip object.

indexOf

public int indexOf(String file)

cellOf

public Point cellOf(int index)

getMenuOutsideCells

public Menu getMenuOutsideCells(Point p)
Overrides:
getMenuOutsideCells in class TableModel

getMenuFor

public Menu getMenuFor(int row,
                       int col)
Overrides:
getMenuFor in class TableModel