Skip to main content


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 13:35 Go to next message
Rayleigh Missing name is currently offline Rayleigh Missing nameFriend
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 13: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 13:57 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 979
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 14:24 Go to previous messageGo to next message
Rayleigh Missing name is currently offline Rayleigh Missing nameFriend
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 15:53 Go to previous message
Rayleigh Missing name is currently offline Rayleigh Missing nameFriend
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: Thu Apr 25 00:57:23 GMT 2024

Powered by FUDForum. Page generated in 0.03127 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top