|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.TransferHandler
dirk_krause.tools.DkDropFile
public abstract class DkDropFile
A transfer handler accepting file names.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.TransferHandler |
---|
javax.swing.TransferHandler.DropLocation, javax.swing.TransferHandler.TransferSupport |
Field Summary | |
---|---|
protected boolean |
acceptDirectories
Accept/reject directories |
protected boolean |
acceptFiles
Accept/reject regular files |
protected boolean |
enabled
While background threads are running we want to disable drag-and-drop |
protected boolean |
finishedAfterFirst
We can finish data import after first succeeded filename. |
protected boolean |
mustAcceptAll
Is it sufficient to process one name successfully or do we need to process all names successfully? |
static java.lang.String[] |
stringClassNames
class names to check whether or not a class is the String class |
Fields inherited from class javax.swing.TransferHandler |
---|
COPY, COPY_OR_MOVE, LINK, MOVE, NONE |
Constructor Summary | |
---|---|
DkDropFile()
|
Method Summary | |
---|---|
boolean |
canImport(javax.swing.JComponent c,
java.awt.datatransfer.DataFlavor[] flavors)
Check whether or not the contents is usable. |
boolean |
getAcceptDirectories()
Check whether or not this TransferHandler accepts directory names. |
boolean |
getAcceptFiles()
Check whether or not this TransferHandler accepts file names for regular files. |
boolean |
getFinishedAfterFirst()
Get flag inidicating whether or not we can finish operation after first successful import. |
boolean |
getMustAcceptAll()
Check whether the TransferHander must accept all file names successfully for a successfull dnd operation. |
boolean |
importData(javax.swing.JComponent c,
java.awt.datatransfer.Transferable t)
Import data into component. |
boolean |
isEnabled()
Check whether or not drag-and-drop is enabled. |
protected abstract boolean |
processFilename(java.lang.String fn)
Process one filename. |
void |
setAcceptDirectories(boolean f)
Set flag for accepting directory names. |
void |
setAcceptFiles(boolean f)
Set flag for accepting regular file names. |
void |
setEnabled(boolean f)
Enable or disable drag-and-drop. |
void |
setFinishedAfterFirst(boolean b)
Set flag inidicating whether or not we can finish operation after first successful import. |
void |
setMustAcceptAll(boolean f)
Set flag, whether the TransferHandler must accept all file names successfully for a successfull dnd operation. |
Methods inherited from class javax.swing.TransferHandler |
---|
canImport, createTransferable, exportAsDrag, exportDone, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getSourceActions, getVisualRepresentation, importData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String[] stringClassNames
protected boolean enabled
protected boolean acceptFiles
protected boolean acceptDirectories
protected boolean mustAcceptAll
protected boolean finishedAfterFirst
Constructor Detail |
---|
public DkDropFile()
Method Detail |
---|
protected abstract boolean processFilename(java.lang.String fn)
fn
- The file name to process.
public boolean isEnabled()
public void setEnabled(boolean f)
f
- Enable/disable flag.public boolean getAcceptFiles()
public void setAcceptFiles(boolean f)
f
- The new flag value.public boolean getAcceptDirectories()
public void setAcceptDirectories(boolean f)
f
- The new flag value.public boolean getMustAcceptAll()
public void setMustAcceptAll(boolean f)
f
- The new flag value.public boolean getFinishedAfterFirst()
public void setFinishedAfterFirst(boolean b)
b
- The flag.public boolean canImport(javax.swing.JComponent c, java.awt.datatransfer.DataFlavor[] flavors)
canImport
in class javax.swing.TransferHandler
c
- The component.flavors
- The collection of contents flavors.public boolean importData(javax.swing.JComponent c, java.awt.datatransfer.Transferable t)
importData
in class javax.swing.TransferHandler
c
- The component receiving the data.t
- The contents to import.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |