Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » custom component not displayed correctly
custom component not displayed correctly [message #121044] Wed, 29 March 2006 09:26 Go to next message
Eclipse UserFriend
Originally posted by: johannes.testori.NOSPAM_shark-soft.com

hi all,

i have created a component called "STRadioButtonSet" (that inherits from
my custom STPanel that inherits from JPanel).
the STRadioButtonSet has a method "addItem(String name)" that adds radio
buttons. every time a new item is added, a new radiobutton is created
internally and added to the STRadioButtonSet, and the layout might be
changed so the radiobuttons fit inside the STRadioButtonSet.

the problem is that when i create a new JPanel and place an
STRadioButtonSet inside it and add some radiobuttons with "addItem", the
radiobuttons are not displayed in the VE.
but if i create a new JFrame or JPanel and add the other panel (with the
STRadioButtonSet inside), the radiobuttons are displayed in the frame.

kind regards,
hannes
Re: custom component not displayed correctly [message #121066 is a reply to message #121044] Wed, 29 March 2006 15:16 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

That is because when you are adding an STRadioButtonSet to the class
being edited we don't actually run the code. That is because the class
being edited has not been compiled yet, so we kind of interpret it.

Now to handle children visuals we can only handle these either through a
standard single value property setting (i.e. setAProperty(itsvalue);).
That is because we know what those are. Or we have added code into the
VE to understand what the add method is. For example we have code that
understands jpanel.add(child, layoutdata) to mean we are adding a child
to the jpanel. In your case it is just a method (addItem) and we don't
know anything about this. So we can't add your children.

Now the reason it shows when you add a JFrame that has an
STRadioButtonSet in it is because we do actually execute code of the
classes that we are not editing. So when you add that JFrame, we
actually create that JFrame using its constructor, so the true addItem
methods are called since it is compiled code.


--
Thanks,
Rich Kulp
Re: custom component not displayed correctly [message #612380 is a reply to message #121044] Wed, 29 March 2006 15:16 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

That is because when you are adding an STRadioButtonSet to the class
being edited we don't actually run the code. That is because the class
being edited has not been compiled yet, so we kind of interpret it.

Now to handle children visuals we can only handle these either through a
standard single value property setting (i.e. setAProperty(itsvalue);).
That is because we know what those are. Or we have added code into the
VE to understand what the add method is. For example we have code that
understands jpanel.add(child, layoutdata) to mean we are adding a child
to the jpanel. In your case it is just a method (addItem) and we don't
know anything about this. So we can't add your children.

Now the reason it shows when you add a JFrame that has an
STRadioButtonSet in it is because we do actually execute code of the
classes that we are not editing. So when you add that JFrame, we
actually create that JFrame using its constructor, so the true addItem
methods are called since it is compiled code.


--
Thanks,
Rich Kulp
Previous Topic:Obscure VE classpath/ Virtual machine question
Next Topic:Obscure VE classpath/ Virtual machine question
Goto Forum:
  


Current Time: Thu Mar 28 21:38:57 GMT 2024

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

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

Back to the top