public void showWindow() { subwindow = new Window("Change Category Type"); subwindow.setModal(true); VerticalLayout layout = new VerticalLayout(); layout.setMargin(true); layout.setSpacing(true); final TextField txtField = new TextField("Change Category Type"); txtField.setValue(categoryType); subwindow.addComponent(txtField); Button close = new Button( "Close", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { (subwindow.getParent()).removeWindow(subwindow); } }); Button save = new Button( "Save", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { String newCatType = txtField.getValue().toString(); controller.updateComponentCategory(componentId, newCatType, itemId); (subwindow.getParent()).removeWindow(subwindow); } }); HorizontalLayout hl = new HorizontalLayout(); hl.addComponent(save); hl.addComponent(close); layout.addComponent(hl); subwindow.setWidth("350px"); subwindow.addComponent(layout); router.getMainWindow().addWindow(subwindow); }
private String buildUri(final MetadataRecord metadataRecord) { StringBuilder builder = new StringBuilder(); builder.append(router.getServiceLocation().getEscidocUri()); builder.append(metadataRecord.getXLinkHref()); return builder.toString(); }