The new class wizard is creating a subclass
of BoxLayoutPane, it isn't dropping one. Since you are subclassing there
is no constructor with parameters already set. So there is no concept of
it being X or Y because it depends on what was set into the constructor
when it is used, not when it is being subclassed. When it is being subclassed,
no constructor parms are used because none are set.
Rich
"Janak Mulani"
<janak.mulani@xxxxxxxxx> Sent by: ve-dev-bounces@xxxxxxxxxxx
08/13/2005 05:37 AM
Please respond to
Discussions people developing code for the Visual Editor project
To
"ve-Dev@Eclipse. Org"
<ve-dev@xxxxxxxxxxx>
cc
Subject
[ve-dev] Creating Visual
Class using Class Wizard
Hi,
A question about Class Wizard (I am still using VE 1.0.2.x).
Scenario:
When a BoxLayoutPane is selected from the palette and put on the canavs,
the
corresponding model object (JavaObjectInstance) is created using the
prototype URI specified in the palette xmi file.
In the prototypeURI we point to xmi file which define allocation feature
for
BoxLayoutPane because BoxLayoutPane constructor takes axis argument, e.g.:
new ULCBoxLayoutPane(ULCBoxLayoutPane.X_AXIS)
We have defined two palette entries for BoxLayouPane_X and BoxLayoutPane_Y
and we have corresponding xmi files with appropriate arg for allocation.
All this works ok, SO far so good.
Now suppose I put the ULCBoxLayoutPane in the list of classes that can
be
created using the class wizard. In the plugin.xml I define extension
newStyleComponent, a category for ULC classes, and VisulaElement for
ULCBoxLayoutPane:
<visualElement type="com...ULCBoxLayoutPane">
Now when the visual class is created, it does not use the allocation feature
from the above defined xmi file to create JavaObjectInstance. So we do
not
know if the JavaObjectInstance represents BoxLayout_X or BoxLayout_Y.
Question:
1. How does the class wizard create JavaObjectInstance?
2. Can the instance creation be controlled in the manner when the widget
is
selected from the palette (e.g, using the prototypeURI and specifying
appropriate allocation feature)?