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 158968 - binding issues with design time on custom beans
Summary: binding issues with design time on custom beans
Status: NEW
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
: 158967 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-02-23 10:19 UTC by paulc86
Modified: 2009-02-23 10:29 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
fix in bind() method for complex custom beans using binding (9.02 KB, text/plain)
2009-02-23 10:20 UTC, paulc86
Details

Note You need to log in before you can comment on or make changes to this bug.
Description paulc86 2009-02-23 10:19:19 UTC
when trying to use custom beans (in my case panels). with the GUI builder netbeans has problems instantiating complex
beans. most problems can be overcome by using the java.beans.Beans.isDesignTime() method. 

however I personally found that I could not overcome a call to "bindingGroup.bind();" within the initComponents() method
created by the GUI builder to get around this I had to patch the org.jdesktop.beansbinding.BindingGroup.bind() method as
I obviously could not edit the code within the initComponents() method.

Once patched the jar needs to be rebuilt and then placed in the ext folder of netbeans replacing the current library,
for good measure a restart of netbeans. This then allowed me to use my custom panels as components, dragging and
dropping them onto my forms.

My new version of the bind() method looks like..
    public void bind() {

        if (!java.beans.Beans.isDesignTime()) {

            List<Binding> toBind = new ArrayList<Binding>(unbound);

            for (Binding binding : toBind) {

                binding.bind();

            }

        }

    }

what I suggest is that netbeans should surrond the call to bindingGroup.bind(); with..
if( !java.beans.Beans.isDesignTime() ){
   bindingGroup.bind();
}

or the fix in the bind() method of beans binding should be packaged with netbeans default beansbinding jar.

This has additionally been reported to the beans binding project.

Thanks

P
Comment 1 paulc86 2009-02-23 10:20:13 UTC
Created attachment 77239 [details]
fix in bind() method for complex custom beans using binding
Comment 2 Jiri Prox 2009-02-23 10:29:13 UTC
*** Issue 158967 has been marked as a duplicate of this issue. ***