Vaadin IDE and components with constructor argument


I’m trying to create a page using the Vaadin IDE. All works well until I try to add an invient chart.
The invient chart shows up in the component list on the design tab of the eclipse IDE, dragging it onto the page results in a new InvientCharts() being created.

	private VerticalLayout buildContent() {
		// common part: create layout
		content = new VerticalLayout();
		// invientCharts_1
invientCharts_1 = new InvientCharts();
		return content;

But the InvientChart expects a InvientChartsConfig as contructor parameter.

	public StatisticsChart(InvientChartsConfig chartConfig) { 

I’m using the invientChart as an example but there are probably more cases like this.

I can create the InvientChartsConfig in the application constructor, but I’m not able to add this because creation of the Chart is happening in a method that has @AutoGenerated annotation. meaning my changes will be erased.

I’m guessing I made a design mistake, can somebody give me an idea how this could be made to work?


update: added some code to make it more clear.

Currently, the visual editor does not support custom components or widgets that do not have a default constructor, and I would not expect that to change in the near future.

If it would be possible to set the configuration after the constructor call (before or in the attach() method), you could subclass the chart component, provide such a setter and call the setter from the constructor of your CustomComponent after the main layout is constructed. You might also be able to wrap the chart in a class that has a no-args constructor and creates the chart with the correct constructor parameters.