refreshMemUsage();
}
});
final Button b = new Button("Reed state from upload",
new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
readState();
}
});
final Button c = new Button("Force GC", new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
gc();
}
});
main.addComponent(b);
main.addComponent(c);
main.addComponent(beSluggish);
main.addComponent(throwExecption);
main.addComponent(interrupt);
interrupt.addListener(new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
up.interruptUpload();
}
});
uploadBufferSelector = new Select("StreamVariable type");
uploadBufferSelector.setImmediate(true);
uploadBufferSelector.addItem("memory");
uploadBufferSelector.setValue("memory");
uploadBufferSelector.addItem("tempfile");
uploadBufferSelector
.addListener(new AbstractField.ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
setBuffer();
}
});
main.addComponent(uploadBufferSelector);
main.addComponent(up);
l = new Label("Idle");
main.addComponent(l);
pi.setVisible(false);
pi.setPollingInterval(1000);
main.addComponent(pi);
pi2.setVisible(false);
pi2.setPollingInterval(1000);
main.addComponent(pi2);
memoryStatus = new Label();
main.addComponent(memoryStatus);
statusLayout.setMargin(true);
status.setVisible(false);
main.addComponent(status);
final Button restart = new Button("R");
restart.addListener(new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
LegacyWindow window = (LegacyWindow) event.getButton().getUI();
window.getApplication().close();