Code generating [message #607157] |
Sun, 17 April 2005 11:23 |
Eclipse User |
|
|
|
Hello,
I'm trying to extend VE and make a GUI builder for a framework we use on my
job. For now I made a component that can be chosen in new visual class
wizard and I made a javajet file that generates the code for a component,
that looks like that:
public class MyClass extends MyComponent{
public MyComponent()
{
buildUI();
}
private void buildUi()
{
buildComponents();
buildLayout();
}
private void buildComponents()
{
}
private void buildLayout()
{
GridBagLayoutHelper helper = new GridBagLayoutHelper(this);
}
}
But now I would like three things to hapen when i add new component to
MyComponent:
1.create new private variable of added component,
2. add line in buildComponents() that looks like this: newComponent =
MafFactory.createNewComponent();
3. add a line in buildLayout() that uses helper class and looks like that:
helper.add(newComponent);
For now as much as I understand extending VE this means it has to be done by
making a decoder and decoder helper which use AST as it was mentioned in
"Enabling support for custom widget" tutorial.
The problem is that I dont understand how can i get AST in method generate()
that is implemented in AbstractExpressionDecoder. So I wonder, is it right
for me to extend AbstractExpressionDecoder and SimpleAttributeDecoderHelper
to get the wanted result or is there some other way to achive that.
Also I would like to know when will you write a code generation tutorial?
Thank you,
Danijel
|
|
|
Powered by
FUDForum. Page generated in 0.27133 seconds