Class TextPageExternalObjectInsertionHandler

    • Constructor Detail

      • TextPageExternalObjectInsertionHandler

        public TextPageExternalObjectInsertionHandler()
    • Method Detail

      • acceptsURLs

        public boolean acceptsURLs​(WSXMLTextEditorPage textAccess,
                                   java.util.List<java.net.URL> urls,
                                   int source)
        Confirm that the list of URLs is interesting to this handler.
        The source of the insertion can be a paste event or a drag and drop event. If the source is of drag and drop type and it is accepted, the caret will be moved to the drop position.
        By default all pasted URLs are accepted. Also all dropped images are accepted. For all other cases we accept by default URLs dropped from inside Oxygen (from views like Project and DITA Maps Manager).
        Parameters:
        textAccess - The text page access.
        urls - The list of URLs.
        source - The source of the URLs, one of the ExternalObjectInsertionSources constants.
        Returns:
        true if the provided URLs are interesting. If false, the default behaviors for the text page will be done (usually this means inserting the URL at the caret position).
      • acceptsSource

        public boolean acceptsSource​(WSXMLTextEditorPage textAccess,
                                     int source)
        Confirm that the source of URLs is interesting to this handler.
        The source of the insertion can be a paste event or a drag and drop event. If the source is of drag and drop type and it is accepted, the caret will be moved to the drag position.
        By default accepts paste sources and drags from the Oxygen Project and DITA Maps Manager.
        Parameters:
        textAccess - The text page access.
        source - The source of the URLs, one of the ExternalObjectInsertionSources constants (that represents a paste or a drag and drop event)
        Returns:
        true if the insert URLs are interesting.
      • containsOnlyImages

        protected static boolean containsOnlyImages​(WSXMLTextEditorPage textPage,
                                                    java.util.List<java.net.URL> urlList)
        Verify if the provided URLs locate only images.
        Parameters:
        textPage - The text page access.
        urlList - The list of URLs.
        Returns:
        true if the URLs locate only images.
      • containsOnlyBinaryResources

        protected static boolean containsOnlyBinaryResources​(WSXMLTextEditorPage textPage,
                                                             java.util.List<java.net.URL> urlList)
        Verify if the provided URLs locate only binary resources.
        Parameters:
        textPage - The text page access.
        urlList - The list of URLs.
        Returns:
        true if the URLs locate only binary resources.