Package ro.sync.ecss.extensions.dita
Class DITATextPageExternalObjectInsertionHandler
- java.lang.Object
-
- ro.sync.ecss.extensions.api.text.TextPageExternalObjectInsertionHandler
-
- ro.sync.ecss.extensions.dita.DITATextPageExternalObjectInsertionHandler
-
- All Implemented Interfaces:
Extension
,ExternalObjectInsertionSources
- Direct Known Subclasses:
DITAMapTextPageExternalObjectInsertionHandler
@API(type=INTERNAL, src=PUBLIC) public class DITATextPageExternalObjectInsertionHandler extends TextPageExternalObjectInsertionHandler
The DITA text page external object insertion handler.
-
-
Field Summary
-
Fields inherited from interface ro.sync.ecss.extensions.api.ExternalObjectInsertionSources
DND_DB_TREE, DND_DITA_COMPONENTS_TAB, DND_DITA_KEYS_VIEW, DND_DITA_MAPS_MANAGER, DND_DITA_MEDIA_TAB, DND_EXTERNAL, DND_IMAGE_PREVIEW, DND_PROJECT_TREE, PASTE
-
-
Constructor Summary
Constructors Constructor Description DITATextPageExternalObjectInsertionHandler()
Default constructorDITATextPageExternalObjectInsertionHandler(ContextKeyManagerProvider keyManagerProvider)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptsURLs(WSXMLTextEditorPage textAccess, java.util.List<java.net.URL> urls, int source)
Confirm that the list of URLs is interesting to this handler.void
insertURLs(WSXMLTextEditorPage textAccess, java.util.List<java.net.URL> urlList, int source)
A list of URLs needs to be inserted at the caret position, probably as links.-
Methods inherited from class ro.sync.ecss.extensions.api.text.TextPageExternalObjectInsertionHandler
acceptsSource, containsOnlyBinaryResources, containsOnlyImages, getDescription
-
-
-
-
Constructor Detail
-
DITATextPageExternalObjectInsertionHandler
public DITATextPageExternalObjectInsertionHandler()
Default constructor
-
DITATextPageExternalObjectInsertionHandler
public DITATextPageExternalObjectInsertionHandler(ContextKeyManagerProvider keyManagerProvider)
Constructor.- Parameters:
keyManagerProvider
- The key manager provider
-
-
Method Detail
-
acceptsURLs
public boolean acceptsURLs(WSXMLTextEditorPage textAccess, java.util.List<java.net.URL> urls, int source)
Description copied from class:TextPageExternalObjectInsertionHandler
Confirm that the list of URLs is interesting to this handler.
Thesource
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).- Overrides:
acceptsURLs
in classTextPageExternalObjectInsertionHandler
- Parameters:
textAccess
- The text page access.urls
- The list of URLs.source
- The source of the URLs, one of theExternalObjectInsertionSources
constants.- Returns:
true
if the provided URLs are interesting. Iffalse
, the default behaviors for the text page will be done (usually this means inserting the URL at the caret position).- See Also:
TextPageExternalObjectInsertionHandler.acceptsURLs(ro.sync.exml.workspace.api.editor.page.text.xml.WSXMLTextEditorPage, java.util.List, int)
-
insertURLs
public void insertURLs(WSXMLTextEditorPage textAccess, java.util.List<java.net.URL> urlList, int source) throws TextPageOperationException
Description copied from class:TextPageExternalObjectInsertionHandler
A list of URLs needs to be inserted at the caret position, probably as links.
Thesource
of the insertion can be a paste event or a drag and drop event.
This call back is received ifTextPageExternalObjectInsertionHandler.acceptsURLs(WSXMLTextEditorPage, List, int)
returnedtrue
for the samesource
andurls
list.
You can use it to link to those specific files/URLs.- Overrides:
insertURLs
in classTextPageExternalObjectInsertionHandler
- Parameters:
textAccess
- The text page accessurlList
- The list of URLs.source
- The source of the URLs, one of theExternalObjectInsertionSources
constants.- Throws:
TextPageOperationException
- See Also:
TextPageExternalObjectInsertionHandler.insertURLs(ro.sync.exml.workspace.api.editor.page.text.xml.WSXMLTextEditorPage, java.util.List, int)
-
-