Page 1 of 1

Overriding tab behavior conditionally

Posted: Sat Mar 03, 2012 2:29 am
by chrisclarke
Is there a way to, in code, fire oxygen's default action that happens when you hit Tab in Author (or shift-tab) (moving to the next/previous node).
I need to conditionally do something at the end of a node when the user hit's tab or the default behavior.
I was thinking I would be able to create 2 new operations (tied to tab and shift tab) and then based on where the cursor was in the document, do my custom action or the default tab behavior.
I looked in AuthorCommonActions, but didn't see what I was looking for and am unable to find anything else.
I know I probably could recreate the logic myself, but I figured it was cleaner to try to use the built in functionality.

Re: Overriding tab behavior conditionally

Posted: Mon Mar 05, 2012 11:38 am
by mihaela
Hi,

The only thing you can do to override the default Tab (or Shift+Tab) behavior in oXygen is to create a custom action for your document type and set the Tab (or Shift+Tab) shortcut for it.
Here you can see our online documentation to find how to add a custom action to an existing document type:
http://www.oxygenxml.com/doc/ug-editor/ ... HowTo.html

These actions will be called every time the user hits Tab or Shift+Tab.
Unfortunately, if you implement these actions, the default behavior of Tab and Shift+Tab actions cannot be obtained (as you already said, you have to recreate the logic).

Best regards,
Mihaela