Class 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 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.