Get Current File Path When Choosing Different Doc
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 2
- Joined: Sat May 16, 2015 12:45 am
Get Current File Path When Choosing Different Doc
Hi,
I know there's a way to get path using
However, seems the authorAccess can be only passed when open a dialog, so it will keep the same even though I choose another file. That means once new a dialog, the filepath would remain the same unless close the dialog. If I click on other file while that dialog is open, I cannot get new authorAccess. (we want to prevent user from doing sth on different files)
How to new another authorAccess ? Or is there another way to get file path ?
Thanks a lot!
I know there's a way to get path using
Code: Select all
authorAccess.getEditorAccess().getEditorLocation().getPath();
How to new another authorAccess ? Or is there another way to get file path ?
Thanks a lot!
-
- Posts: 9470
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Get Current File Path When Choosing Different Doc
Hi,
I'm sorry but I do not understand. So you show a custom swing JDialog implementation? Is the dialog modal or modeless?
You can use our static API access to add a listener and when a new editor tab is selected, you can have access to its Author Access implementation:
Regards,
Radu
I'm sorry but I do not understand. So you show a custom swing JDialog implementation? Is the dialog modal or modeless?
You can use our static API access to add a listener and when a new editor tab is selected, you can have access to its Author Access implementation:
Code: Select all
PluginWorkspaceProvider.getPluginWorkspace().addEditorChangeListener(new WSEditorChangeListener(){
@Override
public void editorSelected(URL editorLocation) {
@SuppressWarnings("unused")
WSEditor editor = PluginWorkspaceProvider.getPluginWorkspace().getCurrentEditorAccess(PluginWorkspace.MAIN_EDITING_AREA);
if(editor.getCurrentPage() instanceof WSAuthorEditorPage){
AuthorAccess authorAccess = ((WSAuthorEditorPage)editor.getCurrentPage()).getAuthorAccess();
...
}
}
}, PluginWorkspace.MAIN_EDITING_AREA);
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
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