wjhk.jupload2.gui
Class FilePanelTableImp

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by wjhk.jupload2.gui.FilePanelTableImp
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, FilePanel

public class FilePanelTableImp
extends Panel
implements FilePanel

Implementation of the FilePanel : it creates the FilePanelJTable, and handles the necessary functionalities.

Version:
$Revision: 439 $
Author:
William JinHua Kwong
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Panel
Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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
FilePanelTableImp(JUploadPanel jup, UploadPolicy uploadPolicy)
          Creates a new instance.
 
Method Summary
 void addFiles(File[] f, File root)
          Add multiple files to this panel.
 void clearSelection()
          Clear the current selection in the JTable.
 void focusTable()
          Requests focus for the JTable.
 Component getDropComponent()
          Return the component on which drop event can occur.
 FileData getFileDataAt(Point point)
          Ask for the file contained below the specific point on the screen.
 FileData[] getFiles()
          Retrieve all currently stored files.
 int getFilesLength()
          Retrieve the number of file entries in the JTable.
 void remove(FileData fileData)
          Removes all occurences of a file from the list.
 void removeAll()
          Removes all file entries.
 void removeSelected()
          Removes all currently selected file entries.
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FilePanelTableImp

public FilePanelTableImp(JUploadPanel jup,
                         UploadPolicy uploadPolicy)
Creates a new instance.

Parameters:
jup - The upload panel (parent).
uploadPolicy - The upload policy to apply.
Method Detail

addFiles

public final void addFiles(File[] f,
                           File root)
                    throws JUploadExceptionStopAddingFiles
Description copied from interface: FilePanel
Add multiple files to this panel.

Specified by:
addFiles in interface FilePanel
Parameters:
f - An array of files to add.
root - The toplevel of a directory hierarchy to add
Throws:
JUploadExceptionStopAddingFiles
See Also:
FilePanel.addFiles(java.io.File[],java.io.File)

getFiles

public final FileData[] getFiles()
Description copied from interface: FilePanel
Retrieve all currently stored files.

Specified by:
getFiles in interface FilePanel
Returns:
an array of files, currently managed by this instance.
See Also:
FilePanel.getFiles()

getFilesLength

public final int getFilesLength()
Description copied from interface: FilePanel
Retrieve the number of file entries in the JTable.

Specified by:
getFilesLength in interface FilePanel
Returns:
the current number of files, held by this instance.
See Also:
FilePanel.getFilesLength()

removeSelected

public final void removeSelected()
Description copied from interface: FilePanel
Removes all currently selected file entries.

Specified by:
removeSelected in interface FilePanel
See Also:
FilePanel.removeSelected()

removeAll

public final void removeAll()
Description copied from interface: FilePanel
Removes all file entries.

Specified by:
removeAll in interface FilePanel
Overrides:
removeAll in class Container
See Also:
Container.removeAll()

remove

public final void remove(FileData fileData)
Removes all occurences of a file from the list. Each file should only appear once here, but nobodody knows !

Specified by:
remove in interface FilePanel
Parameters:
fileData - The file to remove

clearSelection

public final void clearSelection()
Clear the current selection in the JTable.

Specified by:
clearSelection in interface FilePanel

focusTable

public final void focusTable()
Description copied from interface: FilePanel
Requests focus for the JTable.

Specified by:
focusTable in interface FilePanel
See Also:
FilePanel.focusTable()

getFileDataAt

public FileData getFileDataAt(Point point)
Description copied from interface: FilePanel
Ask for the file contained below the specific point on the screen.

Specified by:
getFileDataAt in interface FilePanel
Parameters:
point - The point
Returns:
The return instance of File.
See Also:
FilePanel.getFileDataAt(Point)

getDropComponent

public Component getDropComponent()
Return the component on which drop event can occur. Used by JUploadPanel, when initializing the DropTarget.

Specified by:
getDropComponent in interface FilePanel
Returns:
Component on which the drop event can occur.