Bug 196651 - Resources plugin is not dynamic aware
Summary: Resources plugin is not dynamic aware
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Resources-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-16 10:14 EDT by Ernest Pasour CLA
Modified: 2019-09-06 16:04 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ernest Pasour CLA 2007-07-16 10:14:38 EDT
Build ID: I20070517-1700

Steps To Reproduce:
I don't have a reproducible scenario in Eclipse, so I'll just describe what I'm doing.

I am writing an update configurator for some plugins that we are using to extend the eclipse IDE.  This configurator runs as an "early startup" plugin.  One of the plugins added by the configurator defines a new nature via the  "org.eclipse.core.resources.natures" extension point.  

Once the configurator has finished running, I attempt to create a project that will use the new nature.  I get an error from the org.eclipse.core.internal.resources.NatureManager class in the validateNatureSet() method (missing nature).  It appears that the "descriptors" instance variable does not contain the new nature I have defined.  If I step through the code in the debugger and change the value of descriptors to "null" in the lazyInitialize() method, my new nature is found.  So I think the problem is that the NatureManager needs to listen for registry changes.  Something like:

        Platform.getExtensionRegistry().addRegistryChangeListener(
   new IRegistryChangeListener() {
     public void registryChanged(IRegistryChangeEvent event)
     {
        if (event.getExtensionDeltas("org.eclipse.core.resources", "natures").length > 0) { //$NON-NLS-1$ //$NON-NLS-2$
	descriptors=null;
      }
    }
  }, "org.eclipse.core.resources"); //$NON-NLS-1$

(That code was copied from IDEWorkbenchActivityHelper)



More information:
Comment 1 Ernest Pasour CLA 2007-07-19 13:36:56 EDT
I tried this patch and it mostly works, but it does not refresh existing projects that have the nature.  So if you have a previously created project with the nature, it is in a bogus state.  Loading the plugin with the nature refreshes the nature cache.  However, the patch doesn't do anything to "refresh" projects that are in a bogus state.  Closing and reopening the project seems to work.
Comment 2 John Arthorne CLA 2007-07-25 23:11:45 EDT
Only the plug-ins in the rich client platform are dynamic aware/enabled.  The resources plug-in, and other IDE plug-ins, do not support dynamic registry changes. There would be much more work other than your suggested fix to make the resources plugin dynamic enabled.
Comment 3 Ernest Pasour CLA 2007-07-26 10:39:27 EDT
Okay, thanks for your response.  Can you tell me what the motivation for dynamic aware plugins for RCP apps is?  Seems like the IDE would get much more benefit out of dynamic plugins than the typical RCP app.
Comment 4 Eclipse Webmaster CLA 2019-09-06 16:04:57 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.