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 » Mon Aug 27, 2012 11:16 am

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: 6686
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 » Mon Aug 27, 2012 11:22 am

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 » Mon Aug 27, 2012 11:38 am

Hi Radu,

Thanks for your answer that works well.
Bye

Post Reply