Quick Fix Handler enabled when there are not resolutions [message #335422] |
Tue, 07 April 2009 13:12  |
Eclipse User |
|
|
|
Hi,
There is a strange behavior on the QuickFixHandler.
When I lunch my eclipse-based application, the ProblemsView is
displayed. I right-click on an Error and the QuickFix entry is enabled.I
decide to run the action... No resolutions found!. Ok it is normal I did
not implement any. I right-click again the QuickFix Handler is not
enabled any more.
I lunch again my eclipse-based application, but this time I play with
the application a little bit before right-clicking on an Error from the
Problems View. This time the Handler is not enabled.
While debuggin I found on the MarkerHelpRegistry class a method called:
hasResolution(IMarker marker, IConfigurationElement element)
which collects resolutions only if the plugin declaring the resolution
generator is active. Otherwise we assume the will be generators
procudinc resolutions for the marker.
Ok, ok, it is can be considered as a detail instead of a problem. But
here some users of my eclipse-base application don't like this behavior.
And I'm wondering why does the plugin need to be loaded to know if the
marker has resolutions?
I mean, why the plugin activation is not allowed when the
hasResolution is called?
Anyway, the plugin will be activated when we execute the QuickFixHandler.
And the big question is.... Is this a bug?
Thanks,
Jose Alfredo S.
|
|
|
|
|
|
Re: Quick Fix Handler enabled when there are not resolutions [message #335441 is a reply to message #335434] |
Wed, 08 April 2009 09:51  |
Eclipse User |
|
|
|
Hitesh a écrit :
> Jose Alfredo Serrano wrote:
>
>
>> Prakash G.R. a écrit :
>>>> And the big question is.... Is this a bug?
>>>
>>> I don't think so. Eclipse tries to lazy load the plugin as much
>>> as possible. That is one main reason, why Eclipse scales well with
>>> thousands
> of
>>> plugins without any performance issues.
>
>> I know about the lazy load. Each plugin is activated when any class of
>> it is needed.
>
>> In my opinion, the lines:
>
>> if (Platform.getBundle(element.getNamespace()).getState() ==
>> Bundle.ACTIVE) {
>> // The element's plugin is loaded so we instantiate
>> // the resolution
>
>> ...
>
>> } else {
>> // The element's plugin in not loaded so we assume
>> // the generator will produce resolutions for the marker
>> return true;
>> }
>
>> has nothing to do in the private method hasResolutions from the
>> MarkerHelperRegistry class
>
>> The question is:
>
>> Why do we have to test the activation of the plugin on the
>> hasResolutions method? I think it is better to let the plugin with the
>> ResolutionsGenerator to be activated.
>>>
>>>> Ok, ok, it is can be considered as a detail instead of a problem.
>>>> But here some users of my eclipse-base application don't like this
>>>> behavior.
>>>
>>> (If you really need to) you can programatically activate the plugin
> with
>>> the QuickFixHandler to make your clients happy
>
>> That was the solution I implemented.
>
>> Jose Alfredo
>
> To elaborate further what Prakash said and to answer your question:
>
> Imagine a number of plug-ins (or tools) contributing
> IMarkerResolutionGenerator for their marker types (and maybe others as
> well ).When you start eclipse and the problems view shows up, it will
> show the markers that have been previously created by all the plug-ins
> available in the eclipse installation, regardless of whether they have
> been activated or not.
> Now, loading up a plug-in and executing the generators code to check if
> the quickfix is to be enabled or not will certainly cause the UI to
> stall a bit. More importantly a good number of these plug-ins may not be
> used at all in a given run. Loading them and bloating up the memory just
> for this purpose seems wasteful.
>
> Regards,
> Hitesh.
>
>
It's ok for me. Thank you guys for your answers
Regards,
Jose Alfredo
|
|
|
Powered by
FUDForum. Page generated in 0.49517 seconds