This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 23350 - Use TemplateWizard.Iterator cookie
Summary: Use TemplateWizard.Iterator cookie
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Group (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: issues@utilities
URL:
Keywords:
Depends on: 8858
Blocks:
  Show dependency tree
 
Reported: 2002-05-10 16:14 UTC by Jesse Glick
Modified: 2002-05-22 18:28 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Possible patch (3.15 KB, patch)
2002-05-15 18:38 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2002-05-10 16:14:40 UTC
Please remove the hacks in GroupShadow which
forcibly add a template wizard iterator to .group
files when they are templates. Replace this with
an addition of GroupTemplateIterator (a default
instance, e.g.) to the cookie set of every
GroupShadow. See issue #8858 for details of the
API change.

Also please grep through NB sources and look for
.group templates which specify the iterator as a
file attribute, and either remove this attribute
yourself or file a task in IZ to have it removed
by the module owner.

Marking this P2 because this API change was
designed with the group loader in mind as a key
example, and the current code causes undesirable
problems for the API Support when editing layers -
template iterator attributes appear unrequested in
layers and make them modified mysteriously, for
example.
Comment 1 _ lkramolis 2002-05-15 13:42:05 UTC
Could I ask you for a patches? Thanks.
Comment 2 Jesse Glick 2002-05-15 18:38:52 UTC
Created attachment 5771 [details]
Possible patch
Comment 3 Jesse Glick 2002-05-15 18:42:47 UTC
The attached patch is totally untested (did not even check
compilability) but should give you the basic idea.

You also need to depend on IDE/1 > 2.13 in your manifest.

I also tried to correct a logic bug in getCookie: if someone asks for
CompilerCookie.Foo.class (where Foo is some weird subinterface they
made themselves), you do *not* want to give them a
GroupShadowCompiler, since it will not be assignable to that cookie class.

Besides the patch to GroupShadow.java and the manifest, also recommend
removing the attr from all .group templates in the NB source base, or
filing TASKs for module owners to do so. E.g. rmi and apisupport
modules use this kind of template heavily. You don't have to include
the attr in the layer, but if you don't, things (.nbattrs) will be
written to the userdir when the template folder is first expanded,
which is ugly.
Comment 4 _ lkramolis 2002-05-16 08:22:05 UTC
Jesse, is this change functionally backward compatible -- i.e. can I
apply your patch in one step (and everything still work) and after
that module owners can change their code? Thanks.
Comment 5 Jesse Glick 2002-05-16 15:40:52 UTC
As far as I know, yes. The new behavior of TW.getIterator is to check
for the cookie first, then the file attr if the cookie is missing. So
with the proposed patch, the file attr templateWizardIterator on
*.group files would just be ignored if present.
Comment 6 _ lkramolis 2002-05-22 10:09:45 UTC
Applied your patch.

I know nothing about groups and I do not know what should I recommend
to other modules to do. For that reason I would like to ask you to
file enhancements against such modules. Thanks for understanding.
Comment 7 Jesse Glick 2002-05-22 18:28:30 UTC
OK, I will do that. I guess the code is original mryzl's. Thanks.