|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.ui.dnd.FileDropTargetListener
public class FileDropTargetListener
Provides file(s) 'drop' support to components that add a DropTarget using this DropTargetListener.
A FolderPanel instance has to be specified at creation time, this instance will be
used to change the current folder, or copy/move files to the current folder.
There are 2 different modes this class can operate in. The mode to be used has to be specified when this class is instanciated.
In 'folder change mode', when a file or string representing a file path is dropped, the associated FolderPanel's current folder is changed:
In the normal mode, files (or file paths) that are dropped can also be moved or copied to the associated FolderPanel's current folder, on top of the change current folder action. The actual drop action performed (move, copy or change current folder) depends on the keyboard modifiers typed by the user when dragging the files. When the mouse cursor enters the drop-enabled component's area, it is changed to symbolize the action to be performed. The default drop action (when no modifier is down) is copy.
Drop events originating from the same FolderPanel are on purpose not accepted as spring-loaded folders are not (yet) supported which would make the drop operation ambiguous and confusing.
| Constructor Summary | |
|---|---|
FileDropTargetListener(FolderPanel folderPanel,
boolean changeFolderOnlyMode)
Creates a new FileDropTargetListener using the provided FolderPanel that will be used to either change the current folder or copy/move when files are dropped, depending on the specified operating mode and drop action. |
|
| Method Summary | |
|---|---|
void |
dragEnter(java.awt.dnd.DropTargetDragEvent event)
|
void |
dragExit(java.awt.dnd.DropTargetEvent event)
|
void |
dragOver(java.awt.dnd.DropTargetDragEvent event)
|
void |
drop(java.awt.dnd.DropTargetDropEvent event)
|
void |
dropActionChanged(java.awt.dnd.DropTargetDragEvent event)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileDropTargetListener(FolderPanel folderPanel,
boolean changeFolderOnlyMode)
folderPanel - the FolderPanel instance used to change the current folder or copy/move when files are droppedchangeFolderOnlyMode - if true, the FolderPanel's current folder can only be changed when file(s)
are dropped, files cannot be copied or moved.| Method Detail |
|---|
public void dragEnter(java.awt.dnd.DropTargetDragEvent event)
dragEnter in interface java.awt.dnd.DropTargetListenerpublic void dragOver(java.awt.dnd.DropTargetDragEvent event)
dragOver in interface java.awt.dnd.DropTargetListenerpublic void dropActionChanged(java.awt.dnd.DropTargetDragEvent event)
dropActionChanged in interface java.awt.dnd.DropTargetListenerpublic void dragExit(java.awt.dnd.DropTargetEvent event)
dragExit in interface java.awt.dnd.DropTargetListenerpublic void drop(java.awt.dnd.DropTargetDropEvent event)
drop in interface java.awt.dnd.DropTargetListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard