Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 138558 - Need better way for registering editor hooks
Need better way for registering editor hooks
Status: RESOLVED WONTFIX
Product: editor
Classification: Unclassified
Component: -- Other --
6.x
All All
: P3 (vote)
: 7.0.1
Assigned To: Milutin Kristofic
issues@editor
: API
Depends on:
Blocks: 179047
  Show dependency treegraph
 
Reported: 2008-06-28 22:03 UTC by err
Modified: 2016-07-07 07:29 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description err 2008-06-28 22:03:05 UTC
<editor-preferences> is "potentially dangerous"

Notes from emails:

> > > so there could be multiple preferences, registered by different
> > > plugins, not associated with any particular mime-type. As I was poking
> > > around, it looked like there would only be one invocation to pick up a
> > > custom-action-list, even though there might be multiple of them
> > > registers. I'm wondering if this is a potential problem. Should this
> > > case be handled or detected? Of course I have no idea how/where this
> > > filesystem/editor-preference info is put together for use.
> > >     
> > Yes, your are right. This is potentially dangerous as one module could
> > override a factory supplied by someone else. I would recommend to use
> > the Editors/Actions for registration. The use of a settings factory (ie.
> > 'methodvalue' and a static method getter) is generally discouraged,
> > although still necessary in some cases.

> So the Actions are taken care of, they no longer depend on
> editor-preferences. But there is still
>
>     <editor-preferences>
>         <entry javaType="methodvalue"
>                name="kit-install-action-name-list"
>               
>     value="org.netbeans.modules.jvi.Module.getKitInstallActionNameList" />
>     </editor-preferences>
>
>
> Is there some place I can register this in layer.xml directly? Then
> jvi will no longer use this "potentially dangerous" technique.
Unfortunately, not. This still needs to be done like this. We have to
introduce some better way for registering these hooks.
Comment 1 Vitezslav Stejskal 2008-07-14 15:59:49 UTC
Thanks for filing this.
Comment 2 Miloslav Metelka 2008-11-24 14:26:50 UTC
IMHO this is a dup of issue 85442.

*** This issue has been marked as a duplicate of 85442 ***
Comment 3 err 2008-11-26 00:52:28 UTC
mmetelka, IIRC this issue was not covered by issue 85442. Issue 85442 is about registering actions, this issue is about
registering hooks under '<editor-preferences>', in this case 'name="kit-install-action-name-list"'. This particular
hook, registers a method that the infrastructure calls to get a list of actions which should be called when the kit is
installed.

The problem is that there can only be one kit-install-action-name-list in the system. The last module that registers it
would win I guess.

As Vita said
> This is potentially dangerous as one module could
> override a factory supplied by someone else
Comment 4 Max Sauer 2008-11-27 13:34:31 UTC
Lets find a solution in next..
Comment 5 Martin Balin 2016-07-07 07:29:52 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo