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.
I've just pluged in a build target iterator and when I click on finish to really create the build target I do: target = FileUtil.copy (template); ProjectMember member=PM.getProjectMember(target) member.getContext().bind ("build", "true"); and in my Environment.Provider I do: PM.getProjectMember (obj).getContext ().lookup ( "build" ) == "true" but the Env.Provider method is often called before the bind ("build", "true") and then my template is not correctly recognized as build target.
I understand. The threading model for ProjectMembers simply doesn't exist yet ;-(. Sorry.
It helped me to move the TemplateIterator.instantiate (TemplateWizard) method into specific FileSystem.AtomicAction.run method. Maybe you or Loaders API could invoke the instantiate method in atomic action by default?
Yes, this could help in this particular situation. The question is whether there shouldn't be something like Project.postAtomic(Runnable) where you could post your bt creation code? I plan to add CreateOperation handler interface and PM.createFromTemplate() method, but it won't solve your case, because handlers are provided by ProjectEnvironmentProviders. BTW, it's not really nice to base PM recognition on anything else than the MIME type of PM's original FileObject.
I've filed separate issues for problems mentioned in this report (see issue #35293 and issue #35294). As I wrote having the PEP's code depending on anything else than the MIME-type of PM's file is not good idea. I don't know what is the motivation for marking build target by some value bound in its settings context, but at the first glance it seems inappropriate. Just choose some extension for your BT's file, register the MIMEResolver (define new MIME-type) and register PEP for that MIME-type.
As described in http://www.netbeans.org/servlets/ReadMsg?msgId=619519&listName=nbdiscuss the current work on projects prototype has been stopped. Marking issue as VERIFIED --->
---> CLOSED