Page 1 of 1

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

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

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

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

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

Posted: Mon Aug 27, 2012 11:38 am
by sebastienlavandier
Hi Radu,

Thanks for your answer that works well.
Bye