|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPanel
|
+--ftp.ui.FileTreeViewer
This class is a container of a FileTree.
| Inner Class Summary | |
protected class |
FileTreeViewer.MenuAction
Inner class: Deals with menu action. |
| Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Field Summary | |
protected FileTreeCellEditor |
cellEditor
tree cell editor |
protected FileTree |
fileTree
FileTree which the receiver contains |
protected long |
focusTime
the last focus gained time |
protected javax.swing.JTextField |
pathView
component showing selected path |
protected javax.swing.JPopupMenu |
popup
pop up menu |
protected javax.swing.JLabel |
status
status label |
| Fields inherited from class javax.swing.JComponent |
accessibleContext,
listenerList,
TOOL_TIP_TEXT_KEY,
ui,
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 |
| Constructor Summary | |
|
FileTreeViewer()
Constructs a FileTreeViewer object. |
protected |
FileTreeViewer(boolean local)
This is a formal constructor. |
| Method Summary | |
protected void |
addCellEditorListener()
Adds CellEditorListener. |
protected void |
addCollapsePopup()
Adds pop up menu for collapse use. |
protected void |
addDeletePopup()
Adds pop up menu for delete use. |
protected void |
addDragDropListener()
Adds listener to detect drag-drop action. |
protected void |
addFocusListener()
Adds FocusListener. |
protected void |
addKeyListener()
Adds KeyListener. |
protected void |
addListeners()
Adds all event listeners. |
protected void |
addLoadPopup()
Adds pop up menu for upload use. |
protected void |
addMkdirPopup()
Adds pop up menu for mkdir use. |
protected void |
addMouseListener()
Adds MouseListener. |
protected void |
addPopups()
Adds all pop up menus. |
protected void |
addRefreshPopup()
Adds pop up menu for refresh use. |
protected void |
addRenamePopup()
Adds pop up menu for rename use. |
protected void |
addTreeExpansionListener()
Adds TreeExpansionListener. |
protected void |
addTreeSelectionListener()
Adds TreeSelectionListener. |
protected void |
addTreeWillExpandListener()
Adds TreeWillExpandListener. |
void |
collapse()
Collapses the selected path. |
void |
collapse(javax.swing.tree.TreePath path)
Collapses the path. |
void |
delete()
Deletes selected treeNodes with confirmation. |
void |
expandToLocalHome()
Expands to local home. |
void |
expandToPath(java.lang.String path)
Expands file tree to a given path. |
FileTree |
getFileTree()
Returns FileTree the receiver contains. |
long |
getFocusTime()
Returns the last focus gained time. |
javax.swing.JPopupMenu |
getPopupMenu()
Returns pop up menu the receiver contains. |
FileTreeNode |
getSelectedTreeNode()
Returns the selected tree node. |
FileTreeNode[] |
getSelectedTreeNodes()
Returns all the selected tree nodes excluding those nodes whose ancestors are already selected. |
FileTreeNode[] |
getSelectionTreeNodes()
Returns all the selected tree nodes. |
protected void |
initialize()
Initalizes by setting layout, adding pop up menus. |
protected void |
insertPreholder(FileTreeNode parent,
FileTreeNode newNode)
Inserts a temporary node into tree. |
void |
mkdir()
Makes a directory beneath current selected path. |
void |
mkdir(javax.swing.tree.TreePath path)
Makes a directory beneath path. |
void |
refresh()
Refreshes the selected path. |
void |
refresh(javax.swing.tree.TreePath path)
Refreshes the path. |
void |
rename()
Renames or moves the selected file. |
void |
rename(javax.swing.tree.TreePath path)
Renames or moves the file at the path. |
void |
setStatus(java.lang.String info)
Sets the status info. |
void |
update(java.util.Observable o,
java.lang.Object arg)
Implements the Observer's method. |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext,
getUIClassID,
paramString,
updateUI |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paint,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
print,
printAll,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
unregisterKeyboardAction,
update |
| Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
| Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
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,
processComponentEvent,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
protected FileTree fileTree
FileTree which the receiver containsprotected javax.swing.JPopupMenu popup
protected FileTreeCellEditor cellEditor
protected long focusTime
protected javax.swing.JTextField pathView
protected javax.swing.JLabel status
| Constructor Detail |
public FileTreeViewer()
FileTreeViewer object.protected FileTreeViewer(boolean local)
local - formal argument.| Method Detail |
protected void initialize()
public FileTree getFileTree()
FileTree the receiver contains.FileTree the receiver contains.public javax.swing.JPopupMenu getPopupMenu()
public long getFocusTime()
public FileTreeNode getSelectedTreeNode()
public FileTreeNode[] getSelectionTreeNodes()
public FileTreeNode[] getSelectedTreeNodes()
FileTree.getSelectedTreeNodes(boolean)public void setStatus(java.lang.String info)
info - the status infoprotected void addPopups()
protected void addLoadPopup()
protected void addRenamePopup()
protected void addDeletePopup()
protected void addMkdirPopup()
protected void addRefreshPopup()
protected void addCollapsePopup()
protected void addListeners()
protected void addKeyListener()
KeyListener.protected void addTreeWillExpandListener()
TreeWillExpandListener.protected void addTreeExpansionListener()
TreeExpansionListener.protected void addTreeSelectionListener()
TreeSelectionListener.protected void addMouseListener()
MouseListener.protected void addCellEditorListener()
CellEditorListener.
Especially used for rename a file or create a new directory.protected void addDragDropListener()
protected void addFocusListener()
FocusListener.public void delete()
public void mkdir()
public void mkdir(javax.swing.tree.TreePath path)
path. Prepares cell editor for user
to edit new directory's name.path - the parent path of new directorypath is nullpublic void rename()
public void rename(javax.swing.tree.TreePath path)
path.path - where the file ispublic void refresh()
public void refresh(javax.swing.tree.TreePath path)
path.path - the path to be reloadedpublic void collapse()
public void collapse(javax.swing.tree.TreePath path)
path.path - the path to be collapsedpublic void expandToLocalHome()
public void expandToPath(java.lang.String path)
path - the path to be expanded
protected void insertPreholder(FileTreeNode parent,
FileTreeNode newNode)
parent - parent tree nodenewNode - temporary node
public void update(java.util.Observable o,
java.lang.Object arg)
Observer's method.
Updates GUI when tree structure was changed by command line
instead of graphical action. It will take no effect if arg
is not instance of DownloadEvent.Observer.update(java.util.Observable, java.lang.Object)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||