Module org.icepdf.ri.viewer
Class AnnotationFileDropHandler
- java.lang.Object
-
- org.icepdf.ri.common.views.annotations.AnnotationFileDropHandler
-
public final class AnnotationFileDropHandler extends Object
AnnotationFileDropHandler provides a callback for processing files that are dragged on a PopupAnnotationComponent. The callback allows a users to register a FileDropHandler for each type of file they wish to support for drag and drop. When a file is dragged on the PopupAnnotationComponent it's file extension is compared against the registered FileDropHandler's and executed if a match is found.
The main use for this call back is converting file content to ASCII for insertion into the respective PopupAnnotationComponent's annotation object.
- Since:
- 6.3.1
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFileDropHandler(FileDropHandler fileDropHandler)Register a FileDropHandler implementation with the AnnotationFileDropHandler.static AnnotationFileDropHandlergetInstance()Gets an instance of the singleton AnnotationFileDropHandler object.voidhandlePopupAnnotationFileDrop(File file, PopupAnnotationComponent popupAnnotationComponent)Takes the given file and checks for the FileDropHandler that can handle the extension.
-
-
-
Method Detail
-
getInstance
public static AnnotationFileDropHandler getInstance()
Gets an instance of the singleton AnnotationFileDropHandler object.- Returns:
- singleton instance of the AnnotationFileDropHandler.
-
addFileDropHandler
public void addFileDropHandler(FileDropHandler fileDropHandler)
Register a FileDropHandler implementation with the AnnotationFileDropHandler.- Parameters:
fileDropHandler- FileDropHandler to register.
-
handlePopupAnnotationFileDrop
public void handlePopupAnnotationFileDrop(File file, PopupAnnotationComponent popupAnnotationComponent)
Takes the given file and checks for the FileDropHandler that can handle the extension. If a FileDropHandler match is found the FileDropHandler.execute() method is called to process the file and annotation.- Parameters:
file- file that was dragged on the the popup annotation component.popupAnnotationComponent- annotation component that should be processed by the FileDropHandler.
-
-