Load Layout on editorOpened
Oxygen general issues.
Load Layout on editorOpened
Hello,
I hope this is not a duplicate as I lost my browser earlier.
I'm writing an OxygenWorkspaceAccessPlugin / Oxygen 17.0
I know how to impose a layout on applicationStarted.
I want to take it a step further and switch the layout based on the document type. That is, call Load Layout passing it the name of my custom layout in the editorOpened() method in my WSEditorChangeListener.
Is this possible?
Thanks
I hope this is not a duplicate as I lost my browser earlier.
I'm writing an OxygenWorkspaceAccessPlugin / Oxygen 17.0
I know how to impose a layout on applicationStarted.
I want to take it a step further and switch the layout based on the document type. That is, call Load Layout passing it the name of my custom layout in the editorOpened() method in my WSEditorChangeListener.
Is this possible?
Thanks
Re: Load Layout on editorOpened
Hi Deanna,
I'm not sure that will work or not but you could try it.
But the end users will possibly not like very much to see the entire interface of Oxygen flicker and change, show/hide views and toolbars every time an XML document is opened.
If you want to show/hide specific views/toolbars you can also call:
Regards,
Radu
I'm not sure that will work or not but you could try it.
But the end users will possibly not like very much to see the entire interface of Oxygen flicker and change, show/hide views and toolbars every time an XML document is opened.
If you want to show/hide specific views/toolbars you can also call:
Code: Select all
StandalonePluginWorkspace.showView(String, boolean)
StandalonePluginWorkspace.hideView(String)
StandalonePluginWorkspace.showToolbar(String)
StandalonePluginWorkspace.hideToolbar(String)
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: Load Layout on editorOpened
Hi Radu,
Rather than doing it this way - one toolbar and view at a time, is there a way to invoke the "Load Layout" action? Similar to the user clicking on Window > Load Layout > Custom ... > "name of my layout"
This behaviour wouldn't be something that happens all the time - only when the user chooses to switch between different "modes". They would expect things to flicker.
Thanks
D
Rather than doing it this way - one toolbar and view at a time, is there a way to invoke the "Load Layout" action? Similar to the user clicking on Window > Load Layout > Custom ... > "name of my layout"
This behaviour wouldn't be something that happens all the time - only when the user chooses to switch between different "modes". They would expect things to flicker.
Thanks
D
Re: Load Layout on editorOpened
Hi Deanna,
Sorry, I forgot to tell you about the actual way to load a custom layout.
You could set the fixed layout in the Oxygen Global preferences using the API like:
Ideally you would call this code on a javax.swing.SwingUtilities.invokeLater(Runnable).
Regards,
Radu
Sorry, I forgot to tell you about the actual way to load a custom layout.
You could set the fixed layout in the Oxygen Global preferences using the API like:
Code: Select all
File layoutFile = new File(baseDir, "application.layout");
if (layoutFile.exists()) {
ro.sync.exml.options.PerspectivesLayoutInfo info = new PerspectivesLayoutInfo(true, false, "", layoutFile.getAbsolutePath());
pluginWorkspaceAccess.setGlobalObjectProperty("perspectives.layout.info", info);
}
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: Load Layout on editorOpened
Hi Radu,
This brings up a point I forgot to share with you.
This code works in 15.2 but when I switched to 17, it throws a JavaNullPointer at setGlobalObjectProperty the first time a layout is loaded.
Open Oxygen
Window > Load Layout > Default
Close Oxygen
Open Oxygen
>> Exception Thrown
Close Oxygen
Open Oxygen
>> No Exception going forward until you load another layout
This brings up a point I forgot to share with you.
This code works in 15.2 but when I switched to 17, it throws a JavaNullPointer at setGlobalObjectProperty the first time a layout is loaded.
Open Oxygen
Window > Load Layout > Default
Close Oxygen
Open Oxygen
>> Exception Thrown
Close Oxygen
Open Oxygen
>> No Exception going forward until you load another layout
Code: Select all
com.vasont.plugin.oxygen.workspace.OxygenWorkspaceAccessPluginExtension$layoutLoader.run(OxygenWorkspaceAccessPluginExtension.java:1908)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Re: Load Layout on editorOpened
Hi Deanna,
I managed to reproduce the NPE and we'll work to fix it, thanks for telling us about it.
I will try to add a fix for it in the next Oxygen 17.0 minor bug fix release (in a week or two).
Regards,
Radu
I managed to reproduce the NPE and we'll work to fix it, thanks for telling us about it.
I will try to add a fix for it in the next Oxygen 17.0 minor bug fix release (in a week or two).
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: Load Layout on editorOpened
Hello,
I am happy to inform you that this was already fixed in a maintenance build of oXygen XML v17.0.
Therefore, installing the latest build available on our website should avoid the exception from recurring.
According to the build-notes:
Costin
I am happy to inform you that this was already fixed in a maintenance build of oXygen XML v17.0.
Therefore, installing the latest build available on our website should avoid the exception from recurring.
According to the build-notes:
Best Regards,Oxygen SDK/API: Fixed NullPointerException error that appeared when loading a layout via API.
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
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 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