Sunday, July 13, 2014

Add Custom Actions to the Masthead (Shortcut Buttonbar) in Notes 9 (Part1)

The Masthead (Shortcut Button bar) that was added to Notes with version 9 is only of limited use if you can not add your own actions to it, so in todays post i want to show how to extend the masthead with your own actions so that you can give your users the best usability possible.

If you do not have java and eclipse skills, you can try my tutorial Add your own Shortcuts to the Masthead without java or eclipse knowledge instead of this.

IBM Notes Domino Masthead Shortcutbuttonbar



First of all you need an eclipse installation configured for notes development. If you need help read my tutorial How to configure Eclipse 4.3 to develop plugins for Notes Part 1 and Part2.

Create a new Plug-in Project with File->New->Other

Create an new Eclipse Plugin

Choose a name for your project and select Eclipse version 3.4 as the target to run.

ShortCut Plugin for Eclipse 3.4

Go to the next page of the wizard and fill out the form.

ID: Must be a unique id of your plugin. It is recommended that you have your name or your company name in the id to avoid id collisions. For example if you choose only "Todo" as your id you will get a big problem if you install a widget in notes which uses "Todo" as the id too.
Version: It is very important that the version number is different every time you rebuild your plugin. If you change something in your plugin and deploy it to a client which already have a plugin with the same version number, that plugin will not be updated to the new version. This are very difficult to find problem. So my recommendation add ".qualifier" to the version number. Eclipse will add the date and time to the version number so that you have a new version number when you rebuild your plugin.
Activator: Tell Eclipse in which java package the Activator (controls the plugin's life cycle) should be created. It is good practice to create alle classes of a plugin in a package named similar to the id of the plugin.
Check the "This plugin will make contributions to the UI" and choose that you do not want to create a rich client application.

Create an Eclipse Activator for your Masthead plugin

Create an icon for your new custom action in the Masthead in your favorite image editor. The image should be 16x16 pixel and exported as a PNG. My recommendation is to use Gimp for this task.

Right click your package in the Package Explorer and select import to put your icon in your plugin.

Import your image to the eclipse plugin project

Choose File System as your input source.

choose file system

Select the directory in which you exported your icon from Gimp. Check the icon in the file browser and have a look whether you have chosen the correct "Into Folder".

Select directory from where image should be imported

Double click the build.properties in your plugin and select your icon in the binary build path. This is a very important step, because normally the content of the src folder will not be exported when you build your plugin. So if you do not tell eclipse about your images in the build configuration you will have only a red dot instead of your beautiful icon. Save and close the build configuration.

Change Eclipse build configuration
Now we have everything in place to write our extension which i will show you in part 2 of this tutorial.

No comments:

Post a Comment

ad