Welcome page in Eclipse provides you a unique way to introduce your product to the new users. Its very flexible and can be extended by other plugins. You can create the entire Welcome view by yourself by extending the org.eclipse.ui.intro and provide all the contents you want. That is little tedius, and in this tutorial, we are going to explore an easier one - the CustomizableIntroPart.

 

 

We are going to explore two scenarios. The first one is to extend the Welcome pages of an existing product with your plugin's element. This is pretty simple.

All you need to do is to extend org.eclipse.ui.intro.configExtension and provide your implementation.

 

<extension point="org.eclipse.ui.intro.configExtension">
<configExtension
configId="org.eclipse.ui.intro.universalConfig"
content="intro/eclipse-tips.xml" />
</extension>

 

The contents of the xml is XHTML, so you can have all those web goodies (CSS, images, etc) you want to have. Here is the schema for the XHTML. I have added a simple link to this Eclipse Tips website in the xml:

<?xml version="1.0" encoding="utf-8" ?>
<introContent>
<extensionContent id="comeclipsetipsintro-introExtension" style="css/sample.css" name="Sample Extension" path="webresources/@">
<group style-id="content-group" id="comeclipsetipsintro-introLink-group">
<link label="Eclipse Tips" url="http://www.eclipse-tips.com" id="comeclipsetipsintro-introLink" style-id="content-link">
<text>This site provides you helpful information, tips and tricks of Eclipse plug-in development</text>
</link>
</group>
</extensionContent>
</introContent>

 

 

The path element in the extensionContent defines where your content goes into. I've added my content to Web Resources. Instead if you want to add your content to other sections like Overview/Tutorials/Samples you can specify it here. Now launch the plugin you would see this nice link in the Web Resources of the Welcome page:

 

Now let us see the second scenario. You are building an IDE/RCP application and wanted to brand the Welcome page and let others contribute to it. First create the default RCP Mail Application and a product configuration. Next add org.eclipse.ui.intro and org.eclipse.ui.intro.universal to the plugin's dependencies. Edit the product configuration and these two plugins + org.eclipse.ui.forms as dependencies.

Now you can launch the product to see the default RCP Mail in action. We haven't configured the intro yet, so you won't see it. To have intro in our RCP App, first you need to bind an intro to the product. This is done by extending org.eclipse.ui.intro:

<extension point="org.eclipse.ui.intro">
<introProductBinding
introId="org.eclipse.ui.intro.universal"
productId="com.eclipse-tips.rcp.mail.product">
</introProductBinding>
</extension>

Now if you launch the product, you will see an intro page. But it would be something like this:

Lets fix the missing pieces. First, lets do the branding. We would need our own logo and our own intro title there. This is done by adding properties in the org.eclipse.core.runtime.products extension

<extension id="product" point="org.eclipse.core.runtime.products">
<product application="com.eclipse-tips.rcp.mail.application" name="RCP Product">

... other properties here ...
		 <property name="introBrandingImage" value="product:icons/eclipse_tips.png"/>
<property name="introTitle" value="RCP Mail in Eclipse Tips"/>
</product>
</extension>

The branding image should be specified in the product:<path> format. Once you specify this, you would get these in the welcome page, yet, the page would be still odd. Its because you haven't specified the default theme to use. The theme is specificed in the plugin_customization.ini file. Create the file at the root of your plugin and add this line:

org.eclipse.ui.intro/INTRO_THEME = org.eclipse.ui.intro.universal.slate

You can choose other themes if you want. Now the initial welcome page will not have any root pages. Specify the root pages you want as a comma seperated value

org.eclipse.ui.intro.universal/INTRO_ROOT_PAGES = overview,tutorials,samples,whatsnew,webresources

Save and launch the application, now you have a nicely branded Welcome page:

Once the user closes this, there is no way for him to restore the welcome page. So lets add a menu item. This is done in the ApplicationActionBarAdvisor class. Along with other actions, create the Intro action and add it to the help menu:

 // in makeActions()
introAction = ActionFactory.INTRO.create(window);
register(introAction);

// in fillMenubar()
helpMenu.add(introAction);
helpMenu.add(aboutAction);

 

There you go:

 

Click here to download the source for both these projects.

More articles :

» Making good Eclipse RCP apps for Mac

Eclipse isn't a perfect app on Mac platform. Right from unzipping to "install" to not being packaged as a single .app file, its far from being accepted as a perfect application. But beyond these things, Eclipse does provides some support for Mac...

» How to create a new File Wizard?

Problem is simple. Implement a INewWizard for creating some file type in your application. For this problem, I have seen people start creating the WizardPage on their own. But luckily there is a reusable WizardPage which is specifically meant for...

» API Tooling Tutorial

IntroductionRecently, while fixing a bug, there was a discussion in the emails going on whether adding a new field to an interface in the API would break the binary compatibility to the existing clients. I strongly believed that only adding a method...

» Contributing Workbench Wizards thru Commands

You must have been used this JDT toolbar quite often.The New Class tool item is contributed as an Action in (id "org.eclipse.jdt.ui.actions.NewTypeDropDown"), and then the Menu on the Action is contributed via . In this tip, let us see how to do...

» Extending FilteredItemsSelectionDialog

In a previous tip, you have seen various . One thing which was not explained in it was FilteredItemsSelectionDialog, as it deserves a tip on its own. In this tip, I'll explain how to extend that class.

Subscribe To

Unless stated, all the text contents of this site is available under Eclipse Public License