issue with the custom css -- setPseudoClass
Posted: Wed Jun 19, 2024 1:44 pm
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.