Click or drag to resize
Creating actions

SDL Trados Studio Integration API provides support for the third party developers to implement actions inside the Studio desktop applications.

An action is a piece of code which can have a UI representation and is usually executed over a UI controller. Most of the time is used to allow user to execute an application specific functionality.

About actions

There are two kind of actions that can be created inside Studio applications:

  • Actions which have a global purpose beeing executed in the application context (see: StudioContext ).
  • Actions which are executed over a view or viewpart controller (see: Creating views, Creating viewparts ).

For a sample on how to create a global context actions integrated into a custom ribbon group: Integrating actions

Creating an action

In order to create an action a third party developer will require the following steps:

For a sample on how to create actions see: Integrating actions

Creating a keyboard shortcut for an action

The SDL Trados Studio Integration API provide support for third party developers to add keyboard shortcuts to the actions they implement.

In order to create a shortcut action a third party developer will require to decorate the action class with the ShortcutAttribute and specify the combination of keyboard keys on which the action should be triggered and executed.

You can see in the sample bellow how ALT+F8 is added as a shortcut key for the action.

C#
[Action("MyMainIconAction", Icon = "MyAction_Icon")]
[ActionLayout(typeof(MySampleRibbonGroup), 10, DisplayType.Large)]
[Shortcut(Keys.Alt | Keys.F8)]
public class MyMainIconAction : AbstractAction
{
    protected override void Execute()
    {
        MessageBox.Show("My icon and shortcut key action sample.");
    }
}

Note Note

The shortcut keys that are in conflict with SDL shorcuts will have a lower priority and will be ignored.

See Also

Reference

StudioContext
Community
Edit

Be the first to Edit the community content of this topic.
Comments