Working with the BBj Macro Button
This topic contains the following:
Overview of the BBj Macro Button
Installing the BBj Macro Button
Accessing the BBj Macro Button
Overview of the BBj Macro Button
The BBj Macro Button helps developers quickly start a user-defined BBj program or script using the BDT Studio, and passes the currently active program from BDT Studio’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
For BBj 26.00 and higher, access the BBj Macro Button by installing the BDT Studio, a standalone application that supersedes using the Eclipse IDE. Then, you can proceed to the next section, Accessing the BBj Macro Button.
For versions prior to BBj 26.00, you must first install Eclipse and then the plug-in. Follow the steps below to get your Eclipse plug-in environment configured:
-
Install the version of Eclipse following the instructions provided at https://www.basis.cloud/eclipseplug-ins.
Note:
The BBj Macro Button is part of the BBj Utilities since BBj 17.01. Therefore, installing Eclipse for BBj 17.01 or higher is recommended.
-
Install the BDT plug-in, then install the BBj Macro Button (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
Now that BBj Macro Button is installed, start BDT Studio (or Eclipse for versions prior to BBj 26.00) and follow these steps to begin using it:
-
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].
-
Make sure the BBj Macro Button’s toolbar button is visible, either in the Activated or Deactivated state.
Activated:
Deactivated:
Using the BBj Macro
Now that your IDE is configured to display information about the BBj Macro Button, it is ready to use. Follow these steps to Configure the BBj Macro Button.
- Specify the BBj program you want to start when pressing the BBj Macro Button’s toolbar button. Open the preferences: Window > Preferences (on Windows).
-
Select BBj Utilities > BBj Macro Button:
-
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.
-
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.
-
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
-
Create a new BBj Project named “BBjMacroButtonDemo.” See Creating Your First BBj Project for more information).
-
Create a new BBj Program file by right-clicking on the project and selecting New > BBj Source File.
- Give it the name “Script.bbj” and click [Finish].
- The IDE should automatically open the file. Next, add the following line of code and save these changes:
- 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]:
-
Create a new file called HelloWorld.bbj in the “BBjMacroButtonDemo” project by right-clicking on the project and selecting New > BBj Source File.
-
The file should automatically be opened by the editor:
-
Press the BBj Macro Button’s toolbar button to see the following result: