Manage editor tab

Questions about XML that are not covered by the other forums should go here.
nhenel_sog
Posts: 13
Joined: Thu May 31, 2018 4:34 pm

Manage editor tab

Post by nhenel_sog » Thu May 31, 2018 4:48 pm

Hi all,
I'm writing a cutomizer plugin for Oxygen.
I looking for create an option to hide, and show, editors's page. Not just open to default, but really hide the tab, and the editor.
I'm talking about "Text", "Author", "Grid", etc.
Could you help me please? I need to make a option, like a checkboxMenuItem.

Thanks per advance,
Best regards,
Nhenel

Radu
Posts: 6582
Joined: Fri Jul 09, 2004 5:18 pm

Re: Manage editor tab

Post by Radu » Mon Jun 04, 2018 8:50 am

Hi,

There is a type of Oxygen plugin extension called "Components Validator" which allows you to hide various toolbar actions, views or editing modes:

https://www.oxygenxml.com/doc/versions/ ... lugin.html

The interface has a "validateEditorPage" callback which you can use to remove certain editor pages (Text/Grid) from the UI.

An implementation of the plugin based on reading an XML configuration file is available here:

https://github.com/oxygenxml/oxygen-com ... ter-plugin

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

nhenel_sog
Posts: 13
Joined: Thu May 31, 2018 4:34 pm

Re: Manage editor tab

Post by nhenel_sog » Mon Jun 04, 2018 5:53 pm

Hi,
Thanks for the answer and the help.
I test this and it's works... except when I load a document. I will explain my case with more details:
I want to always hide Grid and Text, but I want to have the option to show, or hide, Text dynamically.
It's work fine for Grid.
But I have some issue with Text. I have invalidate Text, I have this issue on opening XML file :

Code: Select all

16:12:59,124 210846 ERROR [ AWT-EventQueue-0 ] ro.sync.exml.editor.vc - Could not change from Unknown to: Text because: java.lang.NullPointerException
java.lang.NullPointerException
at ro.sync.exml.editor.vc.changePage(Unknown Source)
at ro.sync.exml.editor.vc.changePage(Unknown Source)
at ro.sync.exml.editor.validate.q.changePage(Unknown Source)
at ro.sync.exml.editor.vc.initFrame(Unknown Source)
at ro.sync.exml.editor.validate.q.initFrame(Unknown Source)
at ro.sync.exml.editor.xmleditor.sb.initFrame(Unknown Source)
at ro.sync.exml.editor.zd$28.run(Unknown Source)
at ro.sync.ui.je$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
16:12:59,124 210846 FATAL [ AWT-EventQueue-0 ] ro.sync.ui.je - java.lang.NullPointerException
java.lang.NullPointerException
at ro.sync.exml.editor.vc.changePage(Unknown Source)
at ro.sync.exml.editor.vc.changePage(Unknown Source)
at ro.sync.exml.editor.validate.q.changePage(Unknown Source)
at ro.sync.exml.editor.vc.initFrame(Unknown Source)
at ro.sync.exml.editor.validate.q.initFrame(Unknown Source)
at ro.sync.exml.editor.xmleditor.sb.initFrame(Unknown Source)
at ro.sync.exml.editor.zd$28.run(Unknown Source)
at ro.sync.ui.je$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
at ro.sync.ui.je.m(Unknown Source)
at ro.sync.ui.je.h(Unknown Source)
at ro.sync.exml.editor.zd.hvk(Unknown Source)
at ro.sync.exml.editor.zd.wxk(Unknown Source)
at ro.sync.exml.editor.ub.wxk(Unknown Source)
at ro.sync.exml.editor.zd.hxk(Unknown Source)
at ro.sync.exml.editor.zd.open(Unknown Source)
at ro.sync.exml.k.u.c(Unknown Source)
at ro.sync.exml.k.u.d(Unknown Source)
at ro.sync.exml.k.u.e(Unknown Source)
at ro.sync.exml.k.d.stl(Unknown Source)
at ro.sync.exml.k.d$5.pfe(Unknown Source)
at ro.sync.ui.application.nb.run(Unknown Source)
16:12:59,124 210846 ERROR [ Open local file ] ro.sync.exml.editor.vc - Could not change from Unknown to: Text because: java.lang.NullPointerException
java.lang.NullPointerException
at ro.sync.exml.editor.vc.changePage(Unknown Source)
at ro.sync.exml.editor.vc.changePage(Unknown Source)
at ro.sync.exml.editor.validate.q.changePage(Unknown Source)
at ro.sync.exml.editor.vc.wkk(Unknown Source)
at ro.sync.exml.editor.vc.perspectiveChanged(Unknown Source)
at ro.sync.exml.editor.xmleditor.sb.perspectiveChanged(Unknown Source)
at ro.sync.exml.editor.zd.hvk(Unknown Source)
at ro.sync.exml.editor.zd.wxk(Unknown Source)
at ro.sync.exml.editor.ub.wxk(Unknown Source)
at ro.sync.exml.editor.zd.hxk(Unknown Source)
at ro.sync.exml.editor.zd.open(Unknown Source)
at ro.sync.exml.k.u.c(Unknown Source)
at ro.sync.exml.k.u.d(Unknown Source)
at ro.sync.exml.k.u.e(Unknown Source)
at ro.sync.exml.k.d.stl(Unknown Source)
at ro.sync.exml.k.d$5.pfe(Unknown Source)
at ro.sync.ui.application.nb.run(Unknown Source)
16:12:59,125 210847 ERROR [ Open local file ] ro.sync.exml.editor.zd - java.lang.NullPointerException
java.lang.NullPointerException
at ro.sync.exml.editor.vc.changePage(Unknown Source)
at ro.sync.exml.editor.vc.changePage(Unknown Source)
at ro.sync.exml.editor.validate.q.changePage(Unknown Source)
at ro.sync.exml.editor.vc.wkk(Unknown Source)
at ro.sync.exml.editor.vc.perspectiveChanged(Unknown Source)
at ro.sync.exml.editor.xmleditor.sb.perspectiveChanged(Unknown Source)
at ro.sync.exml.editor.zd.hvk(Unknown Source)
at ro.sync.exml.editor.zd.wxk(Unknown Source)
at ro.sync.exml.editor.ub.wxk(Unknown Source)
at ro.sync.exml.editor.zd.hxk(Unknown Source)
at ro.sync.exml.editor.zd.open(Unknown Source)
at ro.sync.exml.k.u.c(Unknown Source)
at ro.sync.exml.k.u.d(Unknown Source)
at ro.sync.exml.k.u.e(Unknown Source)
at ro.sync.exml.k.d.stl(Unknown Source)
at ro.sync.exml.k.d$5.pfe(Unknown Source)
at ro.sync.ui.application.nb.run(Unknown Source)
16:13:00,467 212189 FATAL [ Open local file ] ro.sync.ui.application.nb - java.lang.NullPointerException
java.lang.NullPointerException
at ro.sync.exml.editor.vc.getAdditionalURLsToCheckForCha
I think I have an issue during default opening action. I search to open my file at Author by default, like describe here topic6214.html and apply all hints in without remove the exception.

Could you help me again, please?
Thank you per advance,
Nhenel

Radu
Posts: 6582
Joined: Fri Jul 09, 2004 5:18 pm

Re: Manage editor tab

Post by Radu » Tue Jun 05, 2018 3:45 pm

Hi Nhenel,

Unfortunately for now the "Text" editing mode cannot be completely removed or hidden. So I do not have a workaround for you.

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

nhenel_sog
Posts: 13
Joined: Thu May 31, 2018 4:34 pm

Re: Manage editor tab

Post by nhenel_sog » Tue Jun 12, 2018 12:31 pm

Too bad :/
Thanks for the help.

Radu
Posts: 6582
Joined: Fri Jul 09, 2004 5:18 pm

Re: Manage editor tab

Post by Radu » Wed Jun 13, 2018 2:00 pm

Hi,

Sorry for the inconvenience. I will add an issue on our side, maybe we can find a workaround for making this work in a future version.

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

Post Reply