shortbio.setValue("Quis aute iure reprehenderit in voluptate velit esse. Cras mattis iudicium purus sit amet fermentum.");
shortbio.setWidth("100%");
shortbio.setRows(2);
form.addComponent(shortbio);
final RichTextArea bio = new RichTextArea("Bio");
bio.setWidth("100%");
bio.setValue("<div><p><span>Integer legentibus erat a ante historiarum dapibus.</span> <span>Vivamus sagittis lacus vel augue laoreet rutrum faucibus.</span> <span>A communi observantia non est recedendum.</span> <span>Morbi fringilla convallis sapien, id pulvinar odio volutpat.</span> <span>Ab illo tempore, ab est sed immemorabili.</span> <span>Quam temere in vitiis, legem sancimus haerentia.</span></p><p><span>Morbi odio eros, volutpat ut pharetra vitae, lobortis sed nibh.</span> <span>Quam diu etiam furor iste tuus nos eludet?</span> <span>Cum sociis natoque penatibus et magnis dis parturient.</span> <span>Quam diu etiam furor iste tuus nos eludet?</span> <span>Tityre, tu patulae recubans sub tegmine fagi dolor.</span></p><p><span>Curabitur blandit tempus ardua ridiculus sed magna.</span> <span>Phasellus laoreet lorem vel dolor tempus vehicula.</span> <span>Etiam habebis sem dicantur magna mollis euismod.</span> <span>Hi omnes lingua, institutis, legibus inter se differunt.</span></p></div>");
form.addComponent(bio);
form.setReadOnly(true);
bio.setReadOnly(true);
Button edit = new Button("Edit", new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
boolean readOnly = form.isReadOnly();
if (readOnly) {
bio.setReadOnly(false);
form.setReadOnly(false);
form.removeStyleName("light");
event.getButton().setCaption("Save");
event.getButton().addStyleName("primary");
} else {
bio.setReadOnly(true);
form.setReadOnly(true);
form.addStyleName("light");
event.getButton().setCaption("Edit");
event.getButton().removeStyleName("primary");
}