API for reload a editor
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 132
- Joined: Fri Feb 28, 2020 4:02 pm
API for reload a editor
Post by vishwavaranasi »
Hello Team , is there any API in oxygenxml for reload a editor?
we know manually we can use the option from File ->Reload(F5)
Thanks,
Vishwa
we know manually we can use the option from File ->Reload(F5)
Thanks,
Vishwa
Thanks,
vishwa
vishwa
-
- Site Admin
- Posts: 114
- Joined: Wed Dec 12, 2018 5:33 pm
Re: API for reload a editor
Post by Cosmin Duna »
Hi Vishwa,
We don't have an API for this, but we already have an internal issue and I added your request to it.
As a workaround you can search for the Reload action in the author common actions like this:
Best regards,
Cosmin
We don't have an API for this, but we already have an internal issue and I added your request to it.
As a workaround you can search for the Reload action in the author common actions like this:
Code: Select all
WSEditorPage page = editor.getCurrentPage();
if (page instanceof WSAuthorEditorPage) {
WSAuthorEditorPage authorPage = (WSAuthorEditorPage)page;
Map<String, Object> commonActions = authorPage.getActionsProvider().getAuthorCommonActions();
AbstractAction realoadAction = (AbstractAction) commonActions.get("File/Reload");
}
Cosmin
Cosmin Duna
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 132
- Joined: Fri Feb 28, 2020 4:02 pm
Re: API for reload a editor
Post by vishwavaranasi »
Thanks Cosmin ,
am trying something like this
/** try to reload editor*/
but this giving me an error
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: ro.sync.exml.MainFrame cannot be cast to ro.sync.exml.workspace.api.editor.page.author.actions.AuthorActionsProvider
would you please help me?
am trying something like this
/** try to reload editor*/
Code: Select all
AuthorActionsProvider actionsProvider = (AuthorActionsProvider) pluginWorkspaceAccess.getActionsProvider();
Map<String, Object> authorCommonActions = actionsProvider.getAuthorCommonActions();
Object reloadEditorAction = authorCommonActions.get("File/Reload");
actionsProvider.invokeAction(reloadEditorAction);
but this giving me an error
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: ro.sync.exml.MainFrame cannot be cast to ro.sync.exml.workspace.api.editor.page.author.actions.AuthorActionsProvider
would you please help me?
Thanks,
vishwa
vishwa
-
- Site Admin
- Posts: 114
- Joined: Wed Dec 12, 2018 5:33 pm
Re: API for reload a editor
Post by Cosmin Duna »
Hi Vishwa,
The ActionsProvider returned by this method is not an "AuthorActionsProvider", but you can get the Reload action from the global actions too. Please try this code:
Best regards,
Cosmin
The ActionsProvider returned by this method is not an "AuthorActionsProvider", but you can get the Reload action from the global actions too. Please try this code:
Code: Select all
ActionsProvider actionsProvider = pluginWorkspaceAccess.getActionsProvider();
Map<String, Object> globalActions = actionsProvider.getGlobalActions();
AbstractAction reloadAction = (AbstractAction)globalActions.get("File/Reload");
Cosmin
Cosmin Duna
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 132
- Joined: Fri Feb 28, 2020 4:02 pm
Re: API for reload a editor
Post by vishwavaranasi »
Hello Cosmin ,
I wanted to invoke this File Reload outside of method
public void applicationStarted(StandalonePluginWorkspace pluginWorkspaceAccess)
so here , how can i get the object for pluginWorkspaceAccess
to call as below
ActionsProvider actionsProvider = pluginWorkspaceAccess.getActionsProvider();
Map<String, Object> globalActions = actionsProvider.getGlobalActions();
AbstractAction reloadAction = (AbstractAction)globalActions.get("File/Reload");
I wanted to invoke this File Reload outside of method
public void applicationStarted(StandalonePluginWorkspace pluginWorkspaceAccess)
so here , how can i get the object for pluginWorkspaceAccess
to call as below
ActionsProvider actionsProvider = pluginWorkspaceAccess.getActionsProvider();
Map<String, Object> globalActions = actionsProvider.getGlobalActions();
AbstractAction reloadAction = (AbstractAction)globalActions.get("File/Reload");
Thanks,
vishwa
vishwa
Re: API for reload a editor
Hi,
You can use our static access to the plugin workspace:
or of course pass the "pluginWorkspaceAccess" received on the applicationStarted callback to all places where you need it further, for example keep it as a field in the plugin extension class...
Regards,
Radu
You can use our static access to the plugin workspace:
Code: Select all
((StandalonePluginWorkspace)PluginWorkspaceProvider.getPluginWorkspace()).getActionsProvider()
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 132
- Joined: Fri Feb 28, 2020 4:02 pm
Re: API for reload a editor
Post by vishwavaranasi »
Thanks Radu.
is this invokeAction will reload all files opened inside DITA MAPS manager ?
my use case here ,
I have a main ditamap and it has submap , and i inserted a topic ref to submap , and the guids.ditamap is referred as mapref inside the main ditamap file.
until unless i reload the main ditamap manually , the newly inserted topicref inside submap are not resolving , to avoid that i wanted to relaod all files inside DITA MAPS manager as soon as insert anything anywhere.
any help on this would be appreciated please.
Thanks,
vishwa
Code: Select all
ActionsProvider actionsProvider = ((StandalonePluginWorkspace)PluginWorkspaceProvider.getPluginWorkspace()).getActionsProvider();
Map<String, Object> globalActions = actionsProvider.getGlobalActions();
AbstractAction reloadAction = (AbstractAction)globalActions.get("File/Reload");
actionsProvider.invokeAction(reloadAction);
my use case here ,
I have a main ditamap and it has submap , and i inserted a topic ref to submap , and the guids.ditamap is referred as mapref inside the main ditamap file.
until unless i reload the main ditamap manually , the newly inserted topicref inside submap are not resolving , to avoid that i wanted to relaod all files inside DITA MAPS manager as soon as insert anything anywhere.
any help on this would be appreciated please.
Thanks,
vishwa
Thanks,
vishwa
vishwa
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ 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 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