how do I know if the user is in text mode or author ?

Oxygen general issues.
sebastienlavandier
Posts: 124
Joined: Tue May 29, 2012 5:42 pm

how do I know if the user is in text mode or author ?

Post by sebastienlavandier »

Hello,

I need to know if the user is in text mode or in the author mode.
How I can do that ?
Do you have an idea ?
Thanks in advance for your answer.
Bye
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: how do I know if the user is in text mode or author ?

Post by Radu »

Hi Sebastien,

Assuming you are using a workspace access plugin, the code would be like:

Code: Select all

    WSEditor currentEditorAccess = pluginWorkspaceAccess.getCurrentEditorAccess(StandalonePluginWorkspace.MAIN_EDITING_AREA);
if(currentEditorAccess != null) {
String currentPageID = currentEditorAccess.getCurrentPageID();
if(EditorPageConstants.PAGE_TEXT.equals(currentPageID)) {
//Editing in text
} else if(EditorPageConstants.PAGE_AUTHOR.equals(currentPageID)) {
//Editing in author
}
}
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
sebastienlavandier
Posts: 124
Joined: Tue May 29, 2012 5:42 pm

Re: how do I know if the user is in text mode or author ?

Post by sebastienlavandier »

Hi Radu,

Thanks for your answer that works well.
Bye
Post Reply