issue with the custom css -- setPseudoClass
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 168
- Joined: Fri Feb 28, 2020 4:02 pm
issue with the custom css -- setPseudoClass
Post by vishwavaranasi »
Hello Team , we have a custom css style as below
/** read-only topics or maps will be displayed with gray back ground color*/
:root:read-only{
background-color:#C0C0C0;
}
and in the plugin extension file we have our code like this , when we open a read-only file it is setting the bgcolor using the code
here is the use case
1. ditamap file opened in main editing area - as read only file - and the bgcolor is showing as gray from css.
2. we have a our custom Action called check-out , which check-out(gets a lock) the file ditamap file on the right click of root node of the ditamap file. means here we are removed read-only (checkout action makes this a writable). and we are trying the below to remove bgcolor as part of check-out action.
3. problem is , the bgcolor is not going away until unless we click on the main editing area.
4. our requirement is as soon as checkout completed the bgcolor should go away (even with out clicking any where in the oxygen editor).
would you please help us to achieve the same.
/** read-only topics or maps will be displayed with gray back ground color*/
:root:read-only{
background-color:#C0C0C0;
}
and in the plugin extension file we have our code like this , when we open a read-only file it is setting the bgcolor using the code
Code: Select all
if (currentPage instanceof WSAuthorEditorPage && !currentPage.isEditable()) {
WSAuthorEditorPage authorPage = ((WSAuthorEditorPage) currentPage);
authorPage.getDocumentController().setPseudoClass("read-only", authorPage.getDocumentController().getAuthorDocumentNode().getRootElement());
}
1. ditamap file opened in main editing area - as read only file - and the bgcolor is showing as gray from css.
2. we have a our custom Action called check-out , which check-out(gets a lock) the file ditamap file on the right click of root node of the ditamap file. means here we are removed read-only (checkout action makes this a writable). and we are trying the below to remove bgcolor as part of check-out action.
Code: Select all
log.info("checkout done and next steps");
WSEditor mainEditorAccess = pluginWorkspaceAccess.getCurrentEditorAccess(StandalonePluginWorkspace.MAIN_EDITING_AREA);
WSEditorPage currentPage = mainEditorAccess.getCurrentPage();
if (currentPage instanceof WSAuthorEditorPage && currentPage.isEditable()) {
log.info("current page is writable");
WSAuthorEditorPage authorPage = ((WSAuthorEditorPage) currentPage);
log.info(authorPage.getDocumentController().getAuthorDocumentNode().getRootElement().getName());
authorPage.getDocumentController().setPseudoClassUndoable("read-only", authorPage.getDocumentController().getAuthorDocumentNode().getRootElement());
log.info("removed BG Color");
}
4. our requirement is as soon as checkout completed the bgcolor should go away (even with out clicking any where in the oxygen editor).
would you please help us to achieve the same.
Thanks,
vishwa
vishwa
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: issue with the custom css -- setPseudoClass
Hi,
I think this should have worked, I would advise you to use "authorPage.getDocumentController().setPseudoClass" instead of "authorPage.getDocumentController().setPseudoClassUndoable". On what execution thread is your code called? If you log the "Thread.currentThread()" object, what does it output in the console? If all else fails you could try to call "authorPage.refresh()".
Regards,
Radu
I think this should have worked, I would advise you to use "authorPage.getDocumentController().setPseudoClass" instead of "authorPage.getDocumentController().setPseudoClassUndoable". On what execution thread is your code called? If you log the "Thread.currentThread()" object, what does it output in the console? If all else fails you could try to call "authorPage.refresh()".
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)
- ↳ 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