Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » RCP - Trouble getting feature information
RCP - Trouble getting feature information [message #192187] Tue, 10 February 2004 15:23 Go to next message
Eclipse UserFriend
Originally posted by: IanPLang.yahoo.com

I have a simple app (based on the RCP articles originally posted at
http://www.eclipsepowered.org/rcp.html) which I am slowly building up. I
am working on the about box at the moment. What I want to do is something
similar to the way the Eclipse IDE does it (but less involved). I want to
get information about the installed features and use their branding
information to display a dialog box. After reading the code used in
Eclipse's about box I started with the code below.

My problem is I have two plug-ins and two features at the moment but only
the primary one shows up in the collection from
IPlatformConfiguration.getConfiguredFeatureEntries – see code below. In
fact I get different results depending on how I run it. If I run from the
command line in my install directory I get this (outside dev environment):
AboutAction run found primary feature ID: com.lesliesoftware.lphoto
Feature ID: com.lesliesoftware.lphoto
Version ID: null
Plug-in ID: com.lesliesoftware.lphoto

If I run from inside Eclipse with the target platform pointing to the
install image I get this:
AboutAction run found primary feature ID: com.lesliesoftware.lphoto
Feature ID: com.lesliesoftware.lphoto
Version ID: 0.1.0
Plug-in ID: com.lesliesoftware.lphoto

So I have two questions: Why is only one of my features showing up? And
why is the version ID missing when I run outside the debugger?

IL

---8<---
IPlatformConfiguration conf =
BootLoader.getCurrentPlatformConfiguration();

// Primary feature
String featureId = conf.getPrimaryFeatureIdentifier();

ILog log = Platform.getPlugin(PlatformUI.PLUGIN_ID).getLog();
log.log (new Status (IStatus.INFO, PlatformUI.PLUGIN_ID, 0,
"AboutAction run found primary feature ID: " + featureId, null));
//$NON-NLS-1$
System.out.println ("AboutAction run found primary feature ID: " +
featureId); //$NON-NLS-1$

// All features
IPlatformConfiguration.IFeatureEntry[] entries =
conf.getConfiguredFeatureEntries();
for (int i = 0; i < entries.length; i++) {
featureId = entries[i].getFeatureIdentifier();
String versionId = entries[i].getFeatureVersion();
String pluginId = entries[i].getFeaturePluginIdentifier();
log.log (new Status (IStatus.INFO, PlatformUI.PLUGIN_ID, 0, "
Feature ID: " + featureId, null)); //$NON-NLS-1$
System.out.println (" Feature ID: " + featureId); //$NON-NLS-1$
log.log (new Status (IStatus.INFO, PlatformUI.PLUGIN_ID, 0, "
Version ID: " + versionId, null)); //$NON-NLS-1$
System.out.println (" Version ID: " + versionId); //$NON-NLS-1$
log.log (new Status (IStatus.INFO, PlatformUI.PLUGIN_ID, 0, "
Plug-in ID: " + pluginId, null)); //$NON-NLS-1$
System.out.println (" Plug-in ID: " + pluginId); //$NON-NLS-1$
}
---8<---
Re: RCP - Trouble getting feature information [message #192206 is a reply to message #192187] Tue, 10 February 2004 16:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: manahan.NOSPAM.ca.ibm.com

This is working as far as I can tell in an rcp app.

private void loadFeatureData() {
try {
ILocalSite ls = SiteManager.getLocalSite();
IConfiguredSite[] cs = ls.getCurrentConfiguration()
.getConfiguredSites();
for (int i = 0; i < cs.length; i++) {
IConfiguredSite site = cs[i];
IFeatureReference[] fr = site.getConfiguredFeatures();
for (int j = 0; j < fr.length; j++) {
IFeatureReference ref = fr[j];
IFeature f = ref.getFeature(null);
System.out.println(
f.getVersionedIdentifier().getIdentifier() +
" " +
f.getVersionedIdentifier().getVersion().toString());

}
}

Peter

Ian Lang wrote:
> I have a simple app (based on the RCP articles originally posted at
> http://www.eclipsepowered.org/rcp.html) which I am slowly building up. I
> am working on the about box at the moment. What I want to do is something
> similar to the way the Eclipse IDE does it (but less involved). I want to
> get information about the installed features and use their branding
> information to display a dialog box. After reading the code used in
> Eclipse's about box I started with the code below.
>
> My problem is I have two plug-ins and two features at the moment but only
> the primary one shows up in the collection from
> IPlatformConfiguration.getConfiguredFeatureEntries ? see code below. In
> fact I get different results depending on how I run it. If I run from the
> command line in my install directory I get this (outside dev environment):
> AboutAction run found primary feature ID: com.lesliesoftware.lphoto
> Feature ID: com.lesliesoftware.lphoto
> Version ID: null
> Plug-in ID: com.lesliesoftware.lphoto
>
> If I run from inside Eclipse with the target platform pointing to the
> install image I get this:
> AboutAction run found primary feature ID: com.lesliesoftware.lphoto
> Feature ID: com.lesliesoftware.lphoto
> Version ID: 0.1.0
> Plug-in ID: com.lesliesoftware.lphoto
>
> So I have two questions: Why is only one of my features showing up? And
> why is the version ID missing when I run outside the debugger?
>
> IL
>
> ---8<---
> IPlatformConfiguration conf =
> BootLoader.getCurrentPlatformConfiguration();
>
> // Primary feature
> String featureId = conf.getPrimaryFeatureIdentifier();
>
> ILog log = Platform.getPlugin(PlatformUI.PLUGIN_ID).getLog();
> log.log (new Status (IStatus.INFO, PlatformUI.PLUGIN_ID, 0,
> "AboutAction run found primary feature ID: " + featureId, null));
> //$NON-NLS-1$
> System.out.println ("AboutAction run found primary feature ID: " +
> featureId); //$NON-NLS-1$
>
> // All features
> IPlatformConfiguration.IFeatureEntry[] entries =
> conf.getConfiguredFeatureEntries();
> for (int i = 0; i < entries.length; i++) {
> featureId = entries[i].getFeatureIdentifier();
> String versionId = entries[i].getFeatureVersion();
> String pluginId = entries[i].getFeaturePluginIdentifier();
> log.log (new Status (IStatus.INFO, PlatformUI.PLUGIN_ID, 0, "
> Feature ID: " + featureId, null)); //$NON-NLS-1$
> System.out.println (" Feature ID: " + featureId); //$NON-NLS-1$
> log.log (new Status (IStatus.INFO, PlatformUI.PLUGIN_ID, 0, "
> Version ID: " + versionId, null)); //$NON-NLS-1$
> System.out.println (" Version ID: " + versionId); //$NON-NLS-1$
> log.log (new Status (IStatus.INFO, PlatformUI.PLUGIN_ID, 0, "
> Plug-in ID: " + pluginId, null)); //$NON-NLS-1$
> System.out.println (" Plug-in ID: " + pluginId); //$NON-NLS-1$
> }
> ---8<---
>
Re: RCP - Trouble getting feature information [message #192312 is a reply to message #192206] Tue, 10 February 2004 22:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jeff_mcaffer_REMOVE.ca.ibm.com

Just so you know, there is work going on in this area to remove the direct
dependency on features. I believe this is scheduled for M8. See IProduct,
IBundleGroup, IBundleGroupProvider and associated methods on Platform to get
an idea of what is coming. The About dialog will be reimplemented in terms
of these classes.

Jeff

"Peter Manahan" <manahan@NOSPAM.ca.ibm.com> wrote in message
news:c0bh2m$dql$1@eclipse.org...
> This is working as far as I can tell in an rcp app.
>
> private void loadFeatureData() {
> try {
> ILocalSite ls = SiteManager.getLocalSite();
> IConfiguredSite[] cs = ls.getCurrentConfiguration()
> .getConfiguredSites();
> for (int i = 0; i < cs.length; i++) {
> IConfiguredSite site = cs[i];
> IFeatureReference[] fr = site.getConfiguredFeatures();
> for (int j = 0; j < fr.length; j++) {
> IFeatureReference ref = fr[j];
> IFeature f = ref.getFeature(null);
> System.out.println(
> f.getVersionedIdentifier().getIdentifier() +
> " " +
> f.getVersionedIdentifier().getVersion().toString());
>
> }
> }
>
> Peter
>
> Ian Lang wrote:
> > I have a simple app (based on the RCP articles originally posted at
> > http://www.eclipsepowered.org/rcp.html) which I am slowly building up.
I
> > am working on the about box at the moment. What I want to do is
something
> > similar to the way the Eclipse IDE does it (but less involved). I want
to
> > get information about the installed features and use their branding
> > information to display a dialog box. After reading the code used in
> > Eclipse's about box I started with the code below.
> >
> > My problem is I have two plug-ins and two features at the moment but
only
> > the primary one shows up in the collection from
> > IPlatformConfiguration.getConfiguredFeatureEntries ? see code below. In
> > fact I get different results depending on how I run it. If I run from
the
> > command line in my install directory I get this (outside dev
environment):
> > AboutAction run found primary feature ID: com.lesliesoftware.lphoto
> > Feature ID: com.lesliesoftware.lphoto
> > Version ID: null
> > Plug-in ID: com.lesliesoftware.lphoto
> >
> > If I run from inside Eclipse with the target platform pointing to the
> > install image I get this:
> > AboutAction run found primary feature ID: com.lesliesoftware.lphoto
> > Feature ID: com.lesliesoftware.lphoto
> > Version ID: 0.1.0
> > Plug-in ID: com.lesliesoftware.lphoto
> >
> > So I have two questions: Why is only one of my features showing up?
And
> > why is the version ID missing when I run outside the debugger?
> >
> > IL
> >
> > ---8<---
> > IPlatformConfiguration conf =
> > BootLoader.getCurrentPlatformConfiguration();
> >
> > // Primary feature
> > String featureId = conf.getPrimaryFeatureIdentifier();
> >
> > ILog log = Platform.getPlugin(PlatformUI.PLUGIN_ID).getLog();
> > log.log (new Status (IStatus.INFO, PlatformUI.PLUGIN_ID, 0,
> > "AboutAction run found primary feature ID: " + featureId, null));
> > //$NON-NLS-1$
> > System.out.println ("AboutAction run found primary feature ID: " +
> > featureId); //$NON-NLS-1$
> >
> > // All features
> > IPlatformConfiguration.IFeatureEntry[] entries =
> > conf.getConfiguredFeatureEntries();
> > for (int i = 0; i < entries.length; i++) {
> > featureId = entries[i].getFeatureIdentifier();
> > String versionId = entries[i].getFeatureVersion();
> > String pluginId = entries[i].getFeaturePluginIdentifier();
> > log.log (new Status (IStatus.INFO, PlatformUI.PLUGIN_ID, 0, "
> > Feature ID: " + featureId, null)); //$NON-NLS-1$
> > System.out.println (" Feature ID: " + featureId); //$NON-NLS-1$
> > log.log (new Status (IStatus.INFO, PlatformUI.PLUGIN_ID, 0, "
> > Version ID: " + versionId, null)); //$NON-NLS-1$
> > System.out.println (" Version ID: " + versionId); //$NON-NLS-1$
> > log.log (new Status (IStatus.INFO, PlatformUI.PLUGIN_ID, 0, "
> > Plug-in ID: " + pluginId, null)); //$NON-NLS-1$
> > System.out.println (" Plug-in ID: " + pluginId); //$NON-NLS-1$
> > }
> > ---8<---
> >
>
Re: RCP - Trouble getting feature information [message #192582 is a reply to message #192187] Wed, 11 February 2004 09:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: IanPLang.yahoo.com

I solved my own problem with a little help from Jeff's answer to my splash
screen problem
< http://www.eclipse.org/newsportal/article.php?id=13981&g roup=eclipse.platform>.
After some experimentation trying to solve the splash screen I noticed a
log entry that indicated eclipse could not find
org.eclipse.update.core.<class I forget>. So I added two more plug-ins
org.eclipse.update.core_3.0.0 and org.eclipse.update.core.win32_3.0.0.

Now I get both my features when I run outside the debug environment - I
still only get the primary feature when running under the debugger. Any
ideas why that would be?

Ian
Re: RCP - Trouble getting feature information [message #192590 is a reply to message #192187] Wed, 11 February 2004 09:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: IanPLang.yahoo.com

I solved my own problem with a little help from Jeff's answer to my splash
screen problem
< http://www.eclipse.org/newsportal/article.php?id=13981&g roup=eclipse.platform>.
After some experimentation trying to solve the splash screen I noticed a
log entry that indicated eclipse could not find
org.eclipse.update.core.<class I forget>. So I added two more plug-ins
org.eclipse.update.core_3.0.0 and org.eclipse.update.core.win32_3.0.0.

Now I get both my features when I run outside the debug environment - I
still only get the primary feature when running under the debugger. Any
ideas why that would be?

Ian
Re: RCP - Trouble getting feature information [message #192697 is a reply to message #192312] Wed, 11 February 2004 12:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: IanPLang.yahoo.com

Are you saying that in M8 RCP apps will be able to use the normal about
box directly?

IL

Jeff McAffer wrote:

> Just so you know, there is work going on in this area to remove the direct
> dependency on features. I believe this is scheduled for M8. See IProduct,
> IBundleGroup, IBundleGroupProvider and associated methods on Platform to get
> an idea of what is coming. The About dialog will be reimplemented in terms
> of these classes.

<snip>
Re: RCP - Trouble getting feature information [message #192967 is a reply to message #192697] Wed, 11 February 2004 21:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jeff_mcaffer_REMOVE.ca.ibm.com

I actually don't know if the About dialog is in the RCP layer or part of the
IDE layer. Good question for the UI team.

Jeff

"Ian Lang" <IanPLang@yahoo.com> wrote in message
news:c0dpba$23d$1@eclipse.org...
> Are you saying that in M8 RCP apps will be able to use the normal about
> box directly?
>
> IL
>
> Jeff McAffer wrote:
>
> > Just so you know, there is work going on in this area to remove the
direct
> > dependency on features. I believe this is scheduled for M8. See
IProduct,
> > IBundleGroup, IBundleGroupProvider and associated methods on Platform to
get
> > an idea of what is coming. The About dialog will be reimplemented in
terms
> > of these classes.
>
> <snip>
>
Re: RCP - Trouble getting feature information [message #193022 is a reply to message #192967] Wed, 11 February 2004 23:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: IanPLang.yahoo.com

I can say that in M6 it is definitely in the IDE layer. I took a shot at
using it in my RCP app and did not have to read much code to realize that
was not going to happen. Where can I find out about plans for about box
changes?

IL


Jeff McAffer wrote:

> I actually don't know if the About dialog is in the RCP layer or part of the
> IDE layer. Good question for the UI team.

> Jeff

> "Ian Lang" <IanPLang@yahoo.com> wrote in message
> news:c0dpba$23d$1@eclipse.org...
> > Are you saying that in M8 RCP apps will be able to use the normal about
> > box directly?
> >
> > IL
Re: RCP - Trouble getting feature information [message #193297 is a reply to message #192206] Thu, 12 February 2004 09:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: IanPLang.yahoo.com

I am unable to get your code to work. Both IConfiguredSite and ILocalSite
cannot be found. I cannot find them in the 30 platform API documentation.
And when I search through the 30 source I find they referenced in
AboutFeaturesDialog and SystemSummaryDialog. Where are those two?

IL

Peter Manahan wrote:

> This is working as far as I can tell in an rcp app.

> private void loadFeatureData() {
> try {
> ILocalSite ls = SiteManager.getLocalSite();
> IConfiguredSite[] cs = ls.getCurrentConfiguration()
> .getConfiguredSites();
> for (int i = 0; i < cs.length; i++) {
> IConfiguredSite site = cs[i];
> IFeatureReference[] fr = site.getConfiguredFeatures();
> for (int j = 0; j < fr.length; j++) {
> IFeatureReference ref = fr[j];
> IFeature f = ref.getFeature(null);
> System.out.println(
> f.getVersionedIdentifier().getIdentifier() +
> " " +
> f.getVersionedIdentifier().getVersion().toString());

> }
> }

> Peter
Problem solved [message #193313 is a reply to message #192590] Thu, 12 February 2004 09:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: IanPLang.yahoo.com

I have tried recreating the runtime workspace to no avail. I also noticed
that the .config directory is not under the workspace for 30 any more. So
when running from the commandline there is a .config and a workspace
directory and all is well. When running from the debugger there is only a
workspace - even if I set things up so they both use the same workspace it
does not work.

So I looked at the command line argument documentation and found
-configuration which let me point to the working .config directory and now
I see the right set of festures under the debugger. In fact previously
the primary feature was only being found because I was using the -feature
option.

IL

Ian Lang wrote:

> I solved my own problem with a little help from Jeff's answer to my splash
> screen problem
>
< http://www.eclipse.org/newsportal/article.php?id=13981&g roup=eclipse.platform>.
> After some experimentation trying to solve the splash screen I noticed a
> log entry that indicated eclipse could not find
> org.eclipse.update.core.<class I forget>. So I added two more plug-ins
> org.eclipse.update.core_3.0.0 and org.eclipse.update.core.win32_3.0.0.

> Now I get both my features when I run outside the debug environment - I
> still only get the primary feature when running under the debugger. Any
> ideas why that would be?

> Ian
Re: RCP - Trouble getting feature information [message #193460 is a reply to message #193297] Thu, 12 February 2004 13:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: manahan.NOSPAM.ca.ibm.com

They are in org.eclipse.update.core. If you are using features and want
to update them via the update manager function you'll need that. If you
don't care and just want the branding, then the work Jeff mentioned
about the IProduct etc in Platform is probably the correct direction to
head. RCP applications may not be using features so there needs to be
another way to brand which is feature neutral.

Peter

Ian Lang wrote:
> I am unable to get your code to work. Both IConfiguredSite and ILocalSite
> cannot be found. I cannot find them in the 30 platform API documentation.
> And when I search through the 30 source I find they referenced in
> AboutFeaturesDialog and SystemSummaryDialog. Where are those two?
>
> IL
>
> Peter Manahan wrote:
>
>
>>This is working as far as I can tell in an rcp app.
>
>
>>private void loadFeatureData() {
>> try {
>> ILocalSite ls = SiteManager.getLocalSite();
>> IConfiguredSite[] cs = ls.getCurrentConfiguration()
>> .getConfiguredSites();
>> for (int i = 0; i < cs.length; i++) {
>> IConfiguredSite site = cs[i];
>> IFeatureReference[] fr = site.getConfiguredFeatures();
>> for (int j = 0; j < fr.length; j++) {
>> IFeatureReference ref = fr[j];
>> IFeature f = ref.getFeature(null);
>> System.out.println(
>> f.getVersionedIdentifier().getIdentifier() +
>> " " +
>> f.getVersionedIdentifier().getVersion().toString());
>
>
>> }
>> }
>
>
>>Peter
>
>
>
Re: RCP - Trouble getting feature information [message #193934 is a reply to message #193460] Fri, 13 February 2004 08:59 Go to previous message
Eclipse UserFriend
Originally posted by: IanPLang.yahoo.com

Thanks, Peter.

Funny I still do not see them in the API docs but I added a dependency and
every thing is good.

IL

Peter Manahan wrote:

> They are in org.eclipse.update.core. If you are using features and want
> to update them via the update manager function you'll need that. If you
> don't care and just want the branding, then the work Jeff mentioned
> about the IProduct etc in Platform is probably the correct direction to
> head. RCP applications may not be using features so there needs to be
> another way to brand which is feature neutral.

> Peter
Previous Topic:Bringing the Menubar down the Shell
Next Topic:multiple editor partitioning in 3.0
Goto Forum:
  


Current Time: Sun May 11 04:38:08 EDT 2025

Powered by FUDForum. Page generated in 0.03835 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top