Specifying application for open image
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 72
- Joined: Thu Mar 26, 2015 4:57 pm
Specifying application for open image
Post by steve.cuzner »
In a docbook document, if I have an imagedata element with a fileref attribute that points to an image file, I can double click or use the context menu->Open image to launch the image in an external image editor that is the default editor for the file extension. Is it possible to configure Oxygen to launch different editors based on criteria such as an attribute? For example, if the imagedata also has a role attribute set to "editor1" it would launch draw but if the role is set to "editor2" it would use a snagit.
-
- Posts: 9470
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Specifying application for open image
Hi Steve,
We have API which allows you to add a mouse listener on the Author visual editing page, something like:
The same API could be used from a Javascript-based Workspace Access Plugin Extension.
We also have API WSAuthorEditorPage.addPopUpMenuCustomizer(AuthorPopupMenuCustomizer) to customize the contextual menu in the Author visual editing mode.
Regards,
Radu
We have API which allows you to add a mouse listener on the Author visual editing page, something like:
Code: Select all
PluginWorkspaceProvider.getPluginWorkspace().addEditorChangeListener(new WSEditorChangeListener(){
/**
* @see ro.sync.exml.workspace.api.listeners.WSEditorChangeListener#editorOpened(java.net.URL)
*/
@Override
public void editorOpened(URL editorLocation) {
WSEditor editor = PluginWorkspaceProvider.getPluginWorkspace().getEditorAccess(editorLocation, PluginWorkspace.MAIN_EDITING_AREA);
WSEditorPage currentPage = editor.getCurrentPage();
if(currentPage instanceof WSAuthorEditorPage){
final WSAuthorEditorPage authorPage = (WSAuthorEditorPage)currentPage;
authorPage.addAuthorMouseListener(new AuthorMouseAdapter(){
/**
* @see ro.sync.ecss.extensions.api.AuthorMouseAdapter#mouseClicked(ro.sync.ecss.extensions.api.AuthorMouseEvent)
*/
@Override
public void mouseClicked(AuthorMouseEvent e) {
if(e.clickCount == 2 && ! e.isPopupTrigger()){
//Double click...
AuthorViewToModelInfo vtm = authorPage.viewToModel(e.X, e.Y);
if("image".equals(vtm.getAuthorNode().getName())){
System.err.println("CUSTOM OPEN " + ((AuthorElement)vtm.getAuthorNode()).getAttribute("href"));
// Runtime.getRuntime().exec(".....");
//Consume event...
e.consume();
}
}
}
});
}
}
}, PluginWorkspace.MAIN_EDITING_AREA);
We also have API WSAuthorEditorPage.addPopUpMenuCustomizer(AuthorPopupMenuCustomizer) to customize the contextual menu in the Author visual editing mode.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service