|
Re: Problems with classes that extends from JFrame in VE. [message #17792 is a reply to message #17786] |
Tue, 03 February 2004 14:26 |
Eclipse User |
|
|
|
Originally posted by: mendelgili.netscape.net
David Díaz wrote:
> Hi!
>
> I've a class named TFrame that extends from JFrame.
>
> In VE, when I drag a JFrame class into the editor, VE creates two objects:
> a JFrame and a JPanel inside.
>
> When I drag the TFrame class VE only creates this class.
>
> ¿can I do that VE creates a JPanel class inside TFrame class too?
>
> Note: I've observed that right click over TFrame class in the javabeans
> tree permits me add a ContentPane but I need that VE adds automatically
> the JPanel as JFrame case.
>
> Many thanks.
>
>
The idea is that if you drop a JFrame, we will create a contentPane for
you, as we do not support implicits at this time. It is a temporary
bandage and given that for a JFrame the content pane is a JPanel all is
well.
If you have a customed JFrame, the assumption is that you it already has
a content pane. Hence we do not want to set a new contentPane and
"clear" the old contentPane that was most likely customed by the
customed JFrame class.
In any case, it works as following:
The JFrame (xmi) override file has the following in it
<keyedValues xsi:type="ecore:EStringToStringMapEntry"
key="org.eclipse.ve.internal.cde.core.creationtool.policy"
value=" org.eclipse.ve.jfc/org.eclipse.ve.internal.jfc.core.RootPane CreationPolicy "/>
This is saying that we will drive the RootPaneCreationPolicy to when a
JFrame is created (see EMFCreationTool.getCommand())
RootPaneCreationPolicy.getCommand() will only create a content pane for
a Swing component (only): if (((JavaPackage)
javaClass.getEPackage()).getPackageName().equals("javax.swing "))
If you want to override this... create an override to the TFrame class,
and create your own Creation polity.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04716 seconds