@Override
protected void onFirstShowPage() {
super.onFirstShowPage();
final PTextBox name = new PTextBox();
name.setPlaceholder("Cookie name");
final PTextBox value = new PTextBox();
name.setPlaceholder("Cookie value");
final PButton add = new PButton("Add");
add.addClickHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent event) {
UIContext.get().getCookies().setCookie(name.getValue(), value.getValue());
}
});
final PTextBox name2 = new PTextBox();
name2.setPlaceholder("Cookie name");
final PButton remove = new PButton("Remove");
remove.addClickHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent event) {
UIContext.get().getCookies().removeCookie(name2.getValue());
}
});
final PHorizontalPanel addPanel = new PHorizontalPanel();
addPanel.add(name);