...
Info |
---|
By adding a menu item to an IGB menu, as seen above, a developer can create an entry point that their IGB App can hook into. |
Getting started: set up your development environment
...
Note that the first time you build IGB, maven will download all third-party libraries (called "dependencies") required by the IGB project to a local cache on your computer. This means that first time you compile IGB, you must be connected to the internet.
Build the App
To build your App, select Run > Build in NetBeans.
Alternatively, you can build it from the command line by entering:
Code Block | ||
---|---|---|
| ||
mvn clean install |
...
Install the App in IGB
Start IGB and add your target directory as a new plugin repository (local App store)
- Re-open IGB project (double-click it in the Projects tab or use File > Open Project)
- Open the IGB "main" sub-project; select IGB Project > Modules > main
- Select Run to run IGB
- Within IGB, select the Plug-Ins Tab
- Select Launch App Manager to open the App Manager window
- Within the App manager, select Manage Repositories... (top right corner). This opens the App Repositories tab in the IGB Preferences window
- Within the App Repositories tab in the Preferences window, select Add
- Enter a name for your repository, and then select the Choose local folder button
- Select the target directory of your maven project and click submit. The target directory is the actual target directory created by maven when you built your App.
- Close the Preferences window and return to the IGB App Manager
- Note that your App should now appear in the left pane of the IGB App Manager. Select it and click the Install button. This will cause the OSGi run-time to instantiate your new menu item and add it to IGB.
Run your new App
To run your app:
- Open the IGB console by selecting Help > Show Console.
- Open the Tools menu in IGB. Observe your Hello IGB Toolbar menu item is an option.
- Select Tools > Hello IGB Toolbar to run your App; observe the message printed to the console:
Note that your new menu item is an option under the Tools menu in IGB. If you return to the App Manager and uninstall your App, this menu item will disappear from IGB.
Next step: Modify your code
Re-open your IGB App project. Edit the message your IGB App prints and re-build your App. Then, return to the IGB App Manager, un-install and then re-install your App. When you select the the menu item again, the new message will print instead of the old one.
Note that you can rapidly repeat this edit-build-uninstall-install cycle. You don't have to re-build IGB or even restart it, which makes development much faster than if you had to modify the IGB code directly.
Next step: Make README.md for your App
Completed Project Reference
git clone https://bitbucket.org/lorainelab/igb-app-hello-world.git
...
Directory Structure
The Maven build system assumes that every Java project conforms to an expected directory structure. Here, the maven project includes
...