Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » IPluginModelBase listener + stale information
IPluginModelBase listener + stale information [message #504261] Thu, 17 December 2009 16:59 Go to next message
James Willans is currently offline James Willans
Messages: 47
Registered: July 2009
Member
Hello,

I am adding a listener to instances of IPluginModelBase using the
following code:

private void bundleAdded(final IPluginModelBase pluginModel) {

// Create a new bundle to model the one added

pluginModel.addModelChangedListener(new IModelChangedListener() {

@Override
public void modelChanged(IModelChangedEvent event) {

System.out.println("** Change event **");
String id = pluginModel.getPluginBase().getId();
String version = pluginModel.getPluginBase().getVersion();
System.out.println("id : " + id);
System.out.println("Version: " + version);
}
});
}

When I change and save the bundle details in the manifest editor, I seem
to be getting stale information. For example, assuming that the bundle
id is "BundleA" and the version is 1.0:

1) Bundle id is changed to "BundleB" the output is correct:

** Change event **
id : BundleB
Version: 1.0.0

2) Bundle version is changed to "2.0.0" the event is fired but the
output is stale:

** Change event **
id : BundleB
Version: 1.0.0

3) Bundle version is changed to "3.0.0" the output continues to be stale:

** Change event **
id : BundleB
Version: 2.0.0

This is similarly the case when monitoring the dependencies and other
features of the model. What am I doing wrong?

Thanks,

James
Re: IPluginModelBase listener + stale information [message #505603 is a reply to message #504261] Sat, 02 January 2010 12:26 Go to previous messageGo to next message
James Willans is currently offline James Willans
Messages: 47
Registered: July 2009
Member
Bounce! I could really do with some input on this one?

Thanks,

James

James Willans wrote:
> Hello,
>
> I am adding a listener to instances of IPluginModelBase using the
> following code:
>
> private void bundleAdded(final IPluginModelBase pluginModel) {
>
> // Create a new bundle to model the one added
>
> pluginModel.addModelChangedListener(new IModelChangedListener() {
>
> @Override
> public void modelChanged(IModelChangedEvent event) {
>
> System.out.println("** Change event **");
> String id = pluginModel.getPluginBase().getId();
> String version = pluginModel.getPluginBase().getVersion();
> System.out.println("id : " + id);
> System.out.println("Version: " + version);
> }
> });
> }
>
> When I change and save the bundle details in the manifest editor, I seem
> to be getting stale information. For example, assuming that the bundle
> id is "BundleA" and the version is 1.0:
>
> 1) Bundle id is changed to "BundleB" the output is correct:
>
> ** Change event **
> id : BundleB
> Version: 1.0.0
>
> 2) Bundle version is changed to "2.0.0" the event is fired but the
> output is stale:
>
> ** Change event **
> id : BundleB
> Version: 1.0.0
>
> 3) Bundle version is changed to "3.0.0" the output continues to be stale:
>
> ** Change event **
> id : BundleB
> Version: 2.0.0
>
> This is similarly the case when monitoring the dependencies and other
> features of the model. What am I doing wrong?
>
> Thanks,
>
> James
>
Re: IPluginModelBase listener + stale information [message #603910 is a reply to message #504261] Sat, 02 January 2010 17:23 Go to previous message
James Willans is currently offline James Willans
Messages: 47
Registered: July 2009
Member
Bounce! I could really do with some input on this one?

Thanks,

James

James Willans wrote:
> Hello,
>
> I am adding a listener to instances of IPluginModelBase using the
> following code:
>
> private void bundleAdded(final IPluginModelBase pluginModel) {
>
> // Create a new bundle to model the one added
>
> pluginModel.addModelChangedListener(new IModelChangedListener() {
>
> @Override
> public void modelChanged(IModelChangedEvent event) {
>
> System.out.println("** Change event **");
> String id = pluginModel.getPluginBase().getId();
> String version = pluginModel.getPluginBase().getVersion();
> System.out.println("id : " + id);
> System.out.println("Version: " + version);
> }
> });
> }
>
> When I change and save the bundle details in the manifest editor, I seem
> to be getting stale information. For example, assuming that the bundle
> id is "BundleA" and the version is 1.0:
>
> 1) Bundle id is changed to "BundleB" the output is correct:
>
> ** Change event **
> id : BundleB
> Version: 1.0.0
>
> 2) Bundle version is changed to "2.0.0" the event is fired but the
> output is stale:
>
> ** Change event **
> id : BundleB
> Version: 1.0.0
>
> 3) Bundle version is changed to "3.0.0" the output continues to be stale:
>
> ** Change event **
> id : BundleB
> Version: 2.0.0
>
> This is similarly the case when monitoring the dependencies and other
> features of the model. What am I doing wrong?
>
> Thanks,
>
> James
>
Previous Topic:Class Loader Issue
Next Topic:One command and handler per menu entry?
Goto Forum:
  


Current Time: Tue Sep 02 15:13:12 EDT 2014

Powered by FUDForum. Page generated in 0.01698 seconds