Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » How to prevent WindowBuilder from making a child components children editable?
How to prevent WindowBuilder from making a child components children editable? [message #721329] Thu, 01 September 2011 09:35 Go to next message
Rayleigh Missing name is currently offline Rayleigh Missing name
Messages: 20
Registered: July 2011
Junior Member
I've got 2 JPanels:
- MainPanel.java
- SubPanel.java

If I add a SubPanel instance to MainPanel, WindowBuilder makes the components in SubPanel editable. But only if they're made publicly available by creating the component in a public or in some cases protected or package private getter method. Using private getters or no getters at all works. How can I prevent this behaviour, even with public getters?

[Updated on: Thu, 01 September 2011 09:35]

Report message to a moderator

Re: How to prevent WindowBuilder from making a child components children editable? [message #721336 is a reply to message #721329] Thu, 01 September 2011 09:57 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric Clayberg
Messages: 856
Registered: July 2009
Location: Boston, MA
Senior Member
You can't. That behavior is quite intentional and one of WindowBuilder's most important features. If you make a component public, you are explicitly saying that the component should be accessible to any other component that uses it.

If you don't want a component to be accessible, keep it private (which is the default for any component that WB creates).

Note that you can also expose individual properties of components while keeping the component itself private.
Re: How to prevent WindowBuilder from making a child components children editable? [message #721347 is a reply to message #721336] Thu, 01 September 2011 10:24 Go to previous messageGo to next message
Rayleigh Missing name is currently offline Rayleigh Missing name
Messages: 20
Registered: July 2011
Junior Member
I see, thanks.
Re: How to prevent WindowBuilder from making a child components children editable? [message #779811 is a reply to message #721347] Mon, 16 January 2012 10:53 Go to previous message
Rayleigh Missing name is currently offline Rayleigh Missing name
Messages: 20
Registered: July 2011
Junior Member
I just ran into the same problem again and found that it's possible to make exposed children uneditable.
In case anyone is interested:

You have to add a *.wbp-component.xml as explained in the new Componentes Tutorial and add this configuration:

<parameters>
	<parameter name="noExposedChildren">true</parameter>
</parameters>
Previous Topic:Create a new plug-in that contributes to WindowBuilder
Next Topic:Custom Layout
Goto Forum:
  


Current Time: Sat Aug 23 03:34:35 EDT 2014

Powered by FUDForum. Page generated in 0.01608 seconds