Skip Navigation

About Actions on First Runs

In the context of Sabre Red 360, an action on the first run of a plug-in is functionality that is invoked the first time a plug-in is launched. As an example, you may want to display a form that your end-users must complete the first time they launch your editor in a plug-in.

To make it easy for you to implement first run functionality, Sabre Red 360 provides the following:

  • The extension point com.sabre.edge.platform.optional.firstrun

  • The Java class com.sabre.edge.platform.optional.firstrun.worker.AbstractFirstRunWorker

To use first run functionality, incorporate this extension point and class into an existing plug-in. The plug-in may contain multiple workbench elements, such as an editor, a view, or a pop-up dialog. If you create a first run action that is not visible to end-users, such as a background process, you can add this functionality to a plug-in that is without workbench elements.

The AbstractFirstRunWorker class contains a single boolean performActions() method which you must implement. You will add your own first run action in this method.

If your first run actions interact with the UI, you are required to run the performActions() method in a UI thread because AbstractFirstRunWorker extends UiThreadInvoker . If this abstract method returns true, the actions are not invoked on start-up of the plug-in. If the method returns false, the actions are invoked on the next start of the plug-in.

After the first run of the plug-in, the functionality is not invoked unless a counter is manually incremented to artificially force startup of the plug-in.

Constraints

The following communications services cannot be used with first run actions:

  • Sabre host communications: com.sabre.edge.cf.host.Communication

  • Locking: com.sabre.edge.cf.host.Locking

  • Sabre Web Services: com.sabre.edge.cf.sws.SWS

  • SDS: com.sabre.edge.cf.host.SDS

Extension Points and Classes for First Run

Whether you are doing custom development or creating the sample first run action that the procedure in this book shows, Sabre Red 360 defines the following extension point and class that are required to add first run actions to a plug-in.

  • com.sabre.edge.platform.optional.firstrun . This Sabre Red 360 extension point defines the class that contains the first run action. It is required for all development of actions on first runs.

  • AbstractFirstRunWorker Java class. This class is required to implement the Boolean performActions() method in which you add your own action. If your first run action interacts with the UI, you must implement this method in a UI thread.