Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Show intro on new version first launch
Show intro on new version first launch [message #754296] Tue, 01 November 2011 17:16 Go to next message
Eclipse User
I was pretty sure, that when I launch new version of Eclipse, Welcome
page is shown. I considered this as default behavior of RCP App.

But this doesn't work for my app.

I've got app version 1.0 (set in plug-in and product config) and app
1.1. When I clean user data, intros show at first launch any of them.
But nothing appears when after using 1.0, I launch 1.1.

--
Tomek
Re: Show intro on new version first launch [message #754794 is a reply to message #754296] Fri, 04 November 2011 07:59 Go to previous message
Eclipse User
W dniu 2011-11-01 22:16, Tomasz Kańka pisze:
> I was pretty sure, that when I launch new version of Eclipse, Welcome
> page is shown. I considered this as default behavior of RCP App.
>
> But this doesn't work for my app.
>
> I've got app version 1.0 (set in plug-in and product config) and app
> 1.1. When I clean user data, intros show at first launch any of them.
> But nothing appears when after using 1.0, I launch 1.1.
>

I did it manually, but I don't like it

public void preWindowOpen()
{

// Take version number
Dictionary<String, String> headers =
Activator.getDefault().getBundle().getHeaders();
String version = headers.get("Bundle-Version");
if (version == null)
version = "0.0";

//Take first 2 digits
Pattern p = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)\\.([\\d\\w]+)");
Matcher m = p.matcher(version);
if (m.matches())
{
version = m.group(1)+"."+m.group(2);
}

String introCount =
PlatformUI.getPreferenceStore().getString(INTRO_COUNTER + version);
if ((introCount == null) || !introCount.matches("\\d+"))
introCount = INTRO_COUNTER_MAX;

Long c = Long.valueOf(introCount);
if (c > 0)
{
c = c - 1;
PlatformUI.getPreferenceStore().putValue(INTRO_COUNTER + version,
Long.valueOf(c).toString());
PlatformUI.getPreferenceStore().putValue(IWorkbenchPreferenceConstants.SHOW_INTRO, "true");

....

}
Previous Topic:Application crashing due to packed plugin, can I unpack?
Next Topic:Run as ... (from product fails, from plugin don't)
Goto Forum:
  


Current Time: Wed Aug 20 06:52:42 EDT 2014

Powered by FUDForum. Page generated in 0.05402 seconds