Customizing Drag and Drop Support to the Editors?

Post here questions and problems related to oXygen frameworks/document types.
Kit Strong
Posts: 13
Joined: Mon Oct 07, 2013 7:19 pm

Customizing Drag and Drop Support to the Editors?

Post by Kit Strong »

Is it possible to customize the DitaMap, Author, and Text Editors to add custom DROP target support?
Radu
Posts: 9434
Joined: Fri Jul 09, 2004 5:18 pm

Re: Customizing Drag and Drop Support to the Editors?

Post by Radu »

Hi Kit,

Could you tell us more about what you want to drop?

1) For Author:

1.1) If you drop resources (files, URLs, images) into it, you could customize the external objects insertion handler ro.sync.ecss.extensions.dita.DITAExtensionsBundle.createExternalObjectInsertionHandler() which gets called in such cases.

1.2) If you drop anything else you could extend the API ro.sync.ecss.extensions.api.ExtensionsBundle.createAuthorAWTDndListener()

2) For the Text editing mode if you have a workspace access plugin implementation you could gain access to the Swing JTextArea ro.sync.exml.workspace.api.editor.page.text.WSTextEditorPage.getTextComponent() used in the text editing mode and add the DnD listener using Swing-specific means.

3) For the DITA Maps Manager, we do not have API. But if it detects dropped external resources it automatically adds topicrefs to them. Basically among other things it checks if the transferable can provide content for this flavor:

Code: Select all

 DataFlavor FLAVOR_LINUX_LIST_OF_URIs = new DataFlavor("text/uri-list;class=java.lang.String", null);
and if so, it obtains the content as a string, splits it by line breaks and tries to insert topic references to each resource.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply