|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.dnd.DropTargetAdapter com.levigo.jadice.appbase.FileOpener
public class FileOpener
Support file based opening operations for the viewer.
Nested Class Summary | |
---|---|
static class |
FileOpener.FileOpenerReadConfiguration
A ReadConfiguration which loads a single local File . |
protected class |
FileOpener.SimpleReadStrategy
|
Field Summary | |
---|---|
protected PageView |
view
|
Constructor Summary | |
---|---|
FileOpener(PageView forView)
FileOpener Constructor |
Method Summary | |
---|---|
protected ReadConfiguration |
createReadConfiguration(File file)
Create a ReadConfigurer for the provided File . |
void |
dragEnter(DropTargetDragEvent dtde)
|
void |
dragOver(DropTargetDragEvent dtde)
|
void |
drop(DropTargetDropEvent dtde)
This method will be called when a drag operation has terminated with a drop on a component which DropTarget is registered with a FileOpener instance as DropTargetListener. |
void |
openDocumentFromFile()
Produces a FileDialog and calls openDocumentFromFile(File) . |
void |
openDocumentFromFile(File fSelected)
Loads a file specified by the parameter supplied. |
void |
openDocumentFromFile(String fullName)
Loads a file specified by its name. |
Methods inherited from class java.awt.dnd.DropTargetAdapter |
---|
dragExit, dropActionChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected PageView view
Constructor Detail |
---|
public FileOpener(PageView forView)
forView
- the viewer into which the documents shall be loadedMethod Detail |
---|
protected ReadConfiguration createReadConfiguration(File file)
ReadConfigurer
for the provided File
. This method may be overridden to
integrate custom loading logic which may respect loading of Annotations and other things of
interest.
The FileOpener
will only use one Document
generated from the
ReadConfigurer
. If multiple documents are generated within the ReadConfigurer
all but the first will be ignored.
public void openDocumentFromFile()
FileDialog
and calls openDocumentFromFile(File)
.
public void openDocumentFromFile(File fSelected)
fSelected
- file to loadpublic void openDocumentFromFile(String fullName)
fullName
- full file namepublic void drop(DropTargetDropEvent dtde)
This method will be called when a drag operation has terminated with a drop on a component
which DropTarget
is registered with a FileOpener instance as DropTargetListener.
Within this method the transferable object will be used to load and display a dropped file into
the associated viewer.
As DataFlavor only DataFlavor.javaFileListFlavor
will be accepted.
Integrator hint: To enable file dropping from GNOME / KDE desktop, you have to implement
a Transferable
that accepts the text/uri-list
format. For further details
see Oracle Bug Database, ID 4899516.
DropTargetListener.drop(java.awt.dnd.DropTargetDropEvent)
public void dragOver(DropTargetDragEvent dtde)
dragOver
in interface DropTargetListener
dragOver
in class DropTargetAdapter
public void dragEnter(DropTargetDragEvent dtde)
dragEnter
in interface DropTargetListener
dragEnter
in class DropTargetAdapter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |