tags:

views:

591

answers:

3

Is there a way to force an RCP product to show a welcome page every time it the RCP was stared? (By default, the Welcome page is only shown for the first time the RCP is stared.)

I tried org.eclipse.ui/SHOW_INTRO=true in plugin_customization.ini, but it did not do the trick...

Thanks, Frank

A: 

Remove the -showsplash

thelost
+1  A: 

In your intro xml you can have something like

<contentProvider id="awc" class="org.eclipse.ui.intro.contentproviders.AlwaysWelcomeCheckbox" pluginId="org.eclipse.ui.intro">
    <text></text>
</contentProvider>

that allows the user to chose whether the intro page is shown every time. It displays a small checkbox wherever you place it. Don't know if it is possible to have it enabled by default.

If you don't want this, you could probably have it defined somehow in your workbench.xml and explicitly load the intro screen when you restore the RCP session.

David Sauter
Thanks, David. Thing is, I'm using a HTML welcome page, which is set in the intro.xml via the introContent element. Adding your contentProvider to the XML did have no affect. Is there a way to add the provider in the HTML page?
Frank Grimm
According to the Eclipse RCP Help (http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/ua_intro_xhtml.htm) this is an explicit feature of using XHTML. So either you switch to XHTML or you have to find another way to always show the welcome screen I think.
David Sauter
Since the help content is HTML, I decided to use a workaround and show an Intro entry in the Help menu via the standard ActionFactory.INTRO action. Thanks again!
Frank Grimm
+1  A: 

Alternatively you can set this programmatically, e.g. in your WorkbenchAdvisor's initialize Method.

 PrefUtil.getAPIPreferenceStore().setValue(
            IWorkbenchPreferenceConstants.SHOW_INTRO, true);
 PrefUtil.saveAPIPrefs();

But since PrefUtil is an internal class this is only recommended if you can't set this property in your xml (e.g. you have an intro which is not based on the Standard Intro page)

PS: The problem you have is that as the intro appears, the preference property you have set via plugin.customization is set to false, and plugin_customization only sets preference store default values, as soon as as any component sets the value, the default value becomes obsolete. With this two-liner you're setting this preference key to true on every startup and the intro will appear.

toms
Thanks for your advice, it did the trick!
Frank Grimm

related questions