ClassInstanceCreation fieldCreation =
((ConstructorCreationSupport) child.getCreationSupport()).getCreation();
sliderExpression = DomGenerics.arguments(fieldCreation).get(0);
}
// create new Slider
SliderInfo slider =
(SliderInfo) JavaInfoUtils.createJavaInfo(
getEditor(),
"com.extjs.gxt.ui.client.widget.Slider",
new ConstructorCreationSupport());
// prepare "new Slider()" source
String sliderSource;
{
StatementTarget statementTarget =
new StatementTarget(AstNodeUtils.getEnclosingStatement(sliderExpression), true);
NodeTarget nodeTarget = new NodeTarget(statementTarget);
sliderSource = slider.getCreationSupport().add_getSource(nodeTarget);
}
// replace "null" with "new Slider()"
sliderExpression = getEditor().replaceExpression(sliderExpression, sliderSource);
slider.setVariableSupport(new EmptyVariableSupport(slider, sliderExpression));
slider.getCreationSupport().add_setSourceExpression(sliderExpression);
// add Slider as child
slider.setAssociation(new ConstructorChildAssociation());
addChild(slider);
}
});
}