Hi,
I am using Exclipse (Kepler) with the Vaadin plug in.
When I create a new Composite with the Plugin, the Visual Designer works fine.
When I later open the Composite again, the Visual tab at the bottom disappears, and the Icon fo the the Java file has changed from the Vaadin iocn back to the normal Java icon.
Please find find below the source code of the generated java file, which is not recorgnized as a designer file anymore.
Does anyone has some idea how to get it recorgnized as a Vaadin Composite file to be opened by the Visual Designer?
Gerald
package de.fuchsclan.vaadin.views;
import com.vaadin.annotations.AutoGenerated;
import com.vaadin.server.ThemeResource;
import com.vaadin.ui.AbsoluteLayout;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;
public class master extends CustomComponent {
/*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */
/**
*
*/
private static final long serialVersionUID = 1L;
@AutoGenerated
private AbsoluteLayout mainLayout;
@AutoGenerated
private VerticalLayout verticalLayout_1;
@AutoGenerated
private HorizontalLayout hgf1;
@AutoGenerated
private Label label_2;
@AutoGenerated
private Label label_1;
@AutoGenerated
private Embedded embedded_1;
@AutoGenerated
private Panel masterPanel;
/**
* The constructor should first build the main layout, set the composition
* root and then do any custom initialization.
*
* The constructor will not be automatically regenerated by the visual
* editor.
*/
public master() {
buildMainLayout();
setCompositionRoot(mainLayout);
// Test
// TODO add user code here
}
public int addTopButton(Button bt) {
verticalLayout_1.addComponent(bt);
return 0;
}
@AutoGenerated
private AbsoluteLayout buildMainLayout() {
// common part: create layout
mainLayout = new AbsoluteLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("100%");
mainLayout.setHeight("100%");
// top-level component properties
setWidth("100.0%");
setHeight("100.0%");
// verticalLayout_1
verticalLayout_1 = buildVerticalLayout_1();
mainLayout.addComponent(verticalLayout_1,
"top:0.0px;right:0.0px;bottom:0.0px;left:0.0px;");
return mainLayout;
}
@AutoGenerated
private VerticalLayout buildVerticalLayout_1() {
// common part: create layout
verticalLayout_1 = new VerticalLayout();
verticalLayout_1.setImmediate(false);
verticalLayout_1.setWidth("100.0%");
verticalLayout_1.setHeight("100.0%");
verticalLayout_1.setMargin(false);
// hgf1
hgf1 = buildHgf1();
verticalLayout_1.addComponent(hgf1);
verticalLayout_1.setExpandRatio(hgf1, 1.0f);
masterPanel = new Panel();
verticalLayout_1.addComponent(masterPanel);
return verticalLayout_1;
}
@AutoGenerated
private HorizontalLayout buildHgf1() {
// common part: create layout
hgf1 = new HorizontalLayout();
hgf1.setStyleName("graybackground");
hgf1.setImmediate(false);
hgf1.setWidth("100.0%");
hgf1.setHeight("-1px");
hgf1.setMargin(false);
// embedded_1
embedded_1 = new Embedded();
embedded_1.setImmediate(false);
embedded_1.setWidth("50px");
embedded_1.setHeight("50px");
embedded_1.setSource(new ThemeResource("img/Logo.jpg"));
embedded_1.setType(1);
embedded_1.setMimeType("image/png");
hgf1.addComponent(embedded_1);
// label_1
label_1 = new Label();
label_1.setImmediate(false);
label_1.setWidth("-1px");
label_1.setHeight("-1px");
label_1.setValue("Label");
hgf1.addComponent(label_1);
// label_2
label_2 = new Label();
label_2.setImmediate(false);
label_2.setWidth("-1px");
label_2.setHeight("-1px");
label_2.setValue("RECHTS");
hgf1.addComponent(label_2);
hgf1.setComponentAlignment(label_2, new Alignment(6));
return hgf1;
}
}