Bug 2647 - [DynamicGUI] UI contributions should be removed if plugin activation fails (1GHOOIH)
Summary: [DynamicGUI] UI contributions should be removed if plugin activation fails (1...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2001-10-10 22:40 EDT by Nick Edgar CLA
Modified: 2019-09-06 16:14 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2001-10-10 22:40:38 EDT
EC post: Removing Plugin from Registry, by KC on 7/26/2001:

I want to have a plugin determine whether or not it is licensed to run
during its startup sequence. If it is not licensed to run, the plugin should
have itself removed from the Eclipse plugin registry and all extensions
(e.g., perspectives, views, editors, actions, etc.) should also be removed
(e.g., not visible in the user interface).

I have tried creating a plugin that throws CoreException during its
startup() method and the appropriate message appears in the .metadata/.log
file. However, part of the plugin still appear
to be registered. In the Perspective menu, the plugin's perspective and its
view extensions are still available. However, when one is selected, an error
message is generated as follows:

    An internal error has occurred. Attempt to load class
com.myplugin.PluginLayout
    from deactivated plug-in com.myplugin. See error log for more details.

I have looked at the PDE Guide and examined the IPluginRegistry and
IPluginDescriptor interfaces but there does not appear to be any way to
removing the plugin. Am I missing something? If the plugin cannot be loaded,
it should not appear to be available in the user interface.

TM replies:
The problem here is that the menus are built without your plugin being
activated. Your startup() method is only called when the user tries to actually
select one of the menus or open your perspective. I don't know how to achieve
what you want to do.

KC says:
I should think that failure to load a plugin should cause Eclipse to remove
all contributions from that plugin or to disable them (removing is preferrable). 
Could someone at OTI log a PR against this?

NOTES:
Comment 1 DJ Houghton CLA 2001-10-29 19:06:55 EST
PRODUCT VERSION:
0.9

Comment 2 Nick Edgar CLA 2002-01-27 14:23:18 EST
Defer
Comment 3 Randy Giffen CLA 2002-08-08 14:56:40 EDT
Reopen for investigation
Comment 4 Ed Burnette CLA 2005-05-20 10:14:55 EDT
Is this request still active?
Comment 5 Nick Edgar CLA 2005-05-20 11:05:25 EDT
Currently, if a plug-in's start method throws an exception, then no (other) code
from that plug-in will be allowed to run.  However, the declarative
contributions (actions sets, pref pages, etc) will not be removed from the UI.

If the plug-in uninstalls itself using the OSGi mechansism, the workbench will
respond and remove all declarative contributions as well.  This should work the
same regardless of the state the plug-in is in at the time.

Comment 6 Michael Van Meekeren CLA 2006-04-21 13:56:18 EDT
Moving Dougs bugs
Comment 7 Paul Webster CLA 2007-04-05 19:00:52 EDT
Assigning to component owner
PW
Comment 8 Kim Horne CLA 2007-06-20 13:06:20 EDT
*yoink*
Comment 9 Eclipse Webmaster CLA 2019-09-06 16:14:08 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.