Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
languagebash
mvn clean install

...

Install the App in IGB

Start IGB and add your target directory as a new plugin repository (local App store)

  1. Re-open IGB project (double-click it in the Projects tab or use File > Open Project)
  2. Open the IGB "main" sub-project; select IGB Project > Modules > main
  3. Select Run to run IGB
  4. Within IGB, select the Plug-Ins Tab
  5. Select Launch App Manager to open the App Manager window
  6. Within the App manager, select Manage Repositories... (top right corner). This opens the App Repositories tab in the IGB Preferences window
    1. Image Added
  7. Within the App Repositories tab in the Preferences window, select Add 
  8. Enter a name for your repository, and then select the Choose local folder button
    1. Image Added
  9. 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.
    1. Image Added
  10. Close the Preferences window and return to the IGB App Manager
  11. 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.
    1. Image Added

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:

Image Added

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.

Image Added

 

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

It's not enough to create and deploy an App; you should also provide an easy-to-understand README.md file suitable for display in the IGB App Manager. See Create Markdown to display in IGB App Manager

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

...