Working with the BBj Macro Button Eclipse Plug-in

This topic contains the following:

Overview of the BBj Macro Button Plug-in

Installing the BBj Macro Button Plug-in

Accessing the BBj Macro Button Plug-in

Using the BBj Macro Button Plug-in

Example

Overview of the BBj Macro Button Eclipse Plug-in

The BBj Macro Button Plug-in helps developers quickly start a user-defined BBj program or script using Eclipse, and passes the currently active program from Eclipse’s active editor to the program as parameter. This allows the user to specify a custom script to validate the currently active program, or push it to a remove server, etc.

Installing the BBj Macro Button Eclipse Plug-in

In order to use the BBj Macro Button plug-in, install Eclipse before installing the plug-in. Follow the steps below to configure the Eclipse plug-in environment:

  1. Install the version of Eclipse following the instructions provided at https://www.basis.cloud/eclipseplug-ins.
    Note:The BBj Macro Button plug-in is part of the BBj Utilities since BBj 17.01. Therefore, installing Eclipse for BBj 17.01 or higher is recommended.

  2. Install the BDT plug-in, then install the BBj Macro Button plug-in (in that particular order). For both installations, follow the instructions provided on https://www.basis.cloud/eclipseplug-ins (see the “BASIS PLUG-INS” section near the top of the page). Select the URL from which to install the plug-in that is provided in the table:

Identify the BASIS plug-in to install (listed in the left column of the BASIS PLUG-IN table).

Select a URL that has the same major revision number as the BBj installation. For example, if running BBj 15.00 (or 15.11, or even 15.20), then choose a URL that has “15” in it.

Or, select the URL in the “Official Release” column (usually right next to the plug-in name). This will be the most recent public release. Simply upgrade BBj on the development computer to the most recent version with the same major revision identifier (14.xx, 15.xx, etc.).

Accessing the BBj Macro Button Eclipse Plug-in

Now that Eclipse and the BBj Macro Button Plug-in are both installed, start Eclipse and follow these steps to begin using it:

  1. Open the BDT Perspective from the main menu: Window > Perspective > Open Perspective. If ‘BDT’ is available, select it; otherwise, select ‘Other’, and then choose BDT and click [OK].

  2. Make sure the BBj Macro Button’s toolbar button is visible, either in the Activated or Deactivated state.

Activated:

Deactivated:

Using the BBj Macro Button Eclipse Plug-in

Now that Eclipse is configured to display information about the BBj Macro Button Plug-in, it is ready to use. Follow these steps to Configure the BBj Macro Button :

  1. Specify the BBj program you want to start when pressing the BBj Macro Button’s toolbar button. Open the Eclipse Preferences: Window > Preferences (on Windows).

  1. Select BBj Utilities > BBj Macro Button:

  1. Specify the BBj program to start when clicking the Macro Button’s toolbar button, then click [OK] to save the changes and close the window.

Note:

Another configuration file can be specified to execute the BBj program. The file specified will then be passed using the -c switch to the BBj interpreter. For more information, see Running BBj from the Command Line.

  1. Open any BBj program in the BBj Editor, and you should see that the BBj Macro Button’s toolbar button turns into the active mode.

  1. Click the toolbar button, and the BBj program which was defined in the steps 1-3 will be executed using the currently active BBj program’s path as a parameter.

Example

  1. Create a new BBj Project named “BBjMacroButtonDemo.” See Creating Your First BBj Project for more information).

  2. Create a new BBj Program file by right-clicking on the project and selecting New > BBj Source File.

  1. Give it the name “Script.bbj” and click [Finish].

  1. Eclipse should automatically open the file. Next, add the following line of code and save these changes:

  1. Open the BBj Macro Button’s Preference Page and set the “Script.bbj” file as the program that is called when the BBj Macro Button’s toolbar Button is pressed, and then click [OK]:

  1. Create a new file called HelloWorld.bbj in the “BBjMacroButtonDemo” project by right-clicking on the project and selecting New > BBj Source File.

  2. The file should automatically be opened by the Eclipse editor:

  1. Press the BBj Macro Button’s toolbar button to see the following result:

(back to top)