List of usage examples for com.vaadin.ui Alignment BOTTOM_RIGHT
Alignment BOTTOM_RIGHT
To view the source code for com.vaadin.ui Alignment BOTTOM_RIGHT.
Click Source Link
From source file:info.magnolia.ui.form.field.MultiField.java
License:Open Source License
/** * Create a single element.<br>// w w w .ja v a2 s . c om * This single element is composed of:<br> * - a configured field <br> * - a remove Button<br> */ private Component createEntryComponent(Object propertyId, Property<?> property) { final HorizontalLayout layout = new HorizontalLayout(); layout.setWidth(100, Unit.PERCENTAGE); layout.setHeight(-1, Unit.PIXELS); final Field<?> field = createLocalField(fieldDefinition, property, true); // creates property datasource if given property is null layout.addComponent(field); // bind the field's property to the item if (property == null) { property = field.getPropertyDataSource(); ((PropertysetItem) getPropertyDataSource().getValue()).addItemProperty(propertyId, property); } final Property<?> propertyReference = property; // set layout to full width layout.setWidth(100, Unit.PERCENTAGE); // distribute space in favour of field over delete button layout.setExpandRatio(field, 1); if (definition.isReadOnly()) { return layout; } // move up Button Button moveUpButton = new Button(); moveUpButton.setHtmlContentAllowed(true); moveUpButton.setCaption("<span class=\"" + "icon-arrow2_n" + "\"></span>"); moveUpButton.addStyleName("inline"); moveUpButton.setDescription(buttonCaptionMoveUp); moveUpButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { onMove(layout, propertyReference, true); } }); // move down Button Button moveDownButton = new Button(); moveDownButton.setHtmlContentAllowed(true); moveDownButton.setCaption("<span class=\"" + "icon-arrow2_s" + "\"></span>"); moveDownButton.addStyleName("inline"); moveDownButton.setDescription(buttonCaptionMoveDown); moveDownButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { onMove(layout, propertyReference, false); } }); // Delete Button Button deleteButton = new Button(); deleteButton.setHtmlContentAllowed(true); deleteButton.setCaption("<span class=\"" + "icon-trash" + "\"></span>"); deleteButton.addStyleName("inline"); deleteButton.setDescription(buttonCaptionRemove); deleteButton.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { onDelete(layout, propertyReference); } }); layout.addComponents(moveUpButton, moveDownButton, deleteButton); // make sure button stays aligned with the field and not with the optional field label when used layout.setComponentAlignment(deleteButton, Alignment.BOTTOM_RIGHT); layout.setComponentAlignment(moveUpButton, Alignment.BOTTOM_RIGHT); layout.setComponentAlignment(moveDownButton, Alignment.BOTTOM_RIGHT); return layout; }
From source file:io.subutai.plugin.accumulo.ui.wizard.WelcomeStep.java
public WelcomeStep(final Wizard wizard) { setSizeFull();//from w w w .j a va 2 s . c o m GridLayout grid = new GridLayout(10, 6); grid.setSpacing(true); grid.setMargin(true); grid.setSizeFull(); Label welcomeMsg = new Label("<center><h2>Welcome to Accumulo Installation Wizard!</h2>"); welcomeMsg.setContentMode(ContentMode.HTML); grid.addComponent(welcomeMsg, 3, 1, 6, 2); Label logoImg = new Label(); // Image as a file resource logoImg.setIcon(new FileResource(FileUtil.getFile(AccumuloPortalModule.MODULE_IMAGE, this))); logoImg.setContentMode(ContentMode.HTML); logoImg.setHeight(56, Unit.PIXELS); logoImg.setWidth(220, Unit.PIXELS); grid.addComponent(logoImg, 1, 3, 2, 5); Button startOverHadoopNZK = new Button("Start over Hadoop & ZK installation"); startOverHadoopNZK.setId("startOverHadoopNZK"); startOverHadoopNZK.addStyleName("default"); grid.addComponent(startOverHadoopNZK, 4, 4, 4, 4); grid.setComponentAlignment(startOverHadoopNZK, Alignment.BOTTOM_RIGHT); startOverHadoopNZK.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { wizard.init(); wizard.getConfig().setSetupType(SetupType.OVER_HADOOP_N_ZK); wizard.next(); } }); setContent(grid); }
From source file:jp.primecloud.auto.ui.MyCloudAdd.java
License:Open Source License
MyCloudAdd(Application ap) { apl = ap;/*from w w w . ja v a2 s.co m*/ // setIcon(Icons.ADD.resource()); setCaption(ViewProperties.getCaption("window.myCloudAdd")); setModal(true); setWidth("550px"); VerticalLayout layout = (VerticalLayout) getContent(); layout.setMargin(false, true, false, true); layout.setSpacing(true); // layout.addComponent(new BasicTab()); // ?? HorizontalLayout okbar = new HorizontalLayout(); okbar.setSpacing(true); okbar.setMargin(false, false, true, false); //okbar.setWidth("100%"); layout.addComponent(okbar); layout.setComponentAlignment(okbar, Alignment.BOTTOM_RIGHT); // Add Button addButton = new Button(ViewProperties.getCaption("button.add")); addButton.setDescription(ViewProperties.getCaption("description.mycloud.add")); addButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { MyCloudAdd.this.addButtonClick(event); } }); okbar.addComponent(addButton); // Cancel Button cancelButton = new Button(ViewProperties.getCaption("button.cancel")); cancelButton.setDescription(ViewProperties.getCaption("description.cansel")); cancelButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { MyCloudAdd.this.close(); } }); okbar.addComponent(cancelButton); // ?? initValidation(); // ??? initData(); // showTemplates(); }
From source file:jp.primecloud.auto.ui.MyCloudEdit.java
License:Open Source License
MyCloudEdit(Application apl, Long farmNo) { this.apl = apl; this.farmNo = farmNo; ////from www .j av a2s . c o m setIcon(Icons.ADD.resource()); setCaption(ViewProperties.getCaption("window.myCloudEdit")); setModal(true); setWidth("450px"); VerticalLayout layout = (VerticalLayout) getContent(); layout.setMargin(false, true, false, true); layout.setSpacing(true); // layout.addComponent(new BasicTab()); // ?? HorizontalLayout okbar = new HorizontalLayout(); okbar.setSpacing(true); okbar.setMargin(false, false, true, false); //okbar.setWidth("100%"); layout.addComponent(okbar); layout.setComponentAlignment(okbar, Alignment.BOTTOM_RIGHT); // OK Button okButton = new Button(ViewProperties.getCaption("button.ok")); okButton.setDescription(ViewProperties.getCaption("description.editCloud.ok")); okButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { MyCloudEdit.this.editButtonClick(event); } }); okbar.addComponent(okButton); // Cancel Button cancelButton = new Button(ViewProperties.getCaption("button.cancel")); cancelButton.setDescription(ViewProperties.getCaption("description.cancel")); cancelButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { MyCloudEdit.this.close(); } }); okbar.addComponent(cancelButton); //??? initData(); // ?? initValidation(); }
From source file:jp.primecloud.auto.ui.MyCloudManage.java
License:Open Source License
MyCloudManage(Application ap) { apl = ap;//from www .j a va2s. co m // setIcon(Icons.EDITMINI.resource()); setCaption(ViewProperties.getCaption("window.myCloudManage")); setModal(true); setWidth("550px"); VerticalLayout layout = (VerticalLayout) getContent(); layout.setMargin(true); // ? HorizontalLayout tbar = new HorizontalLayout(); tbar.setWidth("100%"); tbar.setSpacing(true); // ? Label tcaption = new Label(ViewProperties.getCaption("table.cloud")); tcaption.setWidth("300px"); tbar.addComponent(tcaption); tbar.setComponentAlignment(tcaption, Alignment.MIDDLE_LEFT); // Edit Button editButton = new Button(ViewProperties.getCaption("button.editCloud")); editButton.setDescription(ViewProperties.getCaption("description.editCloud")); editButton.setIcon(Icons.EDITMINI.resource()); editButton.setWidth("85px"); editButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { MyCloudManage.this.editButtonClick(event); } }); tbar.addComponent(editButton); tbar.setComponentAlignment(editButton, Alignment.BOTTOM_RIGHT); // Delete Button deleteButton = new Button(ViewProperties.getCaption("button.delete")); deleteButton.setDescription(ViewProperties.getCaption("description.delete")); deleteButton.setWidth("85px"); deleteButton.setIcon(Icons.DELETEMINI.resource()); deleteButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { MyCloudManage.this.deleteButtonClick(event); } }); tbar.addComponent(deleteButton); tbar.setComponentAlignment(deleteButton, Alignment.BOTTOM_RIGHT); tbar.setExpandRatio(tcaption, 10); layout.addComponent(tbar); // ? Label spacer1 = new Label(""); spacer1.setHeight("5px"); layout.addComponent(spacer1); // cloudTable = new CloudTable(); layout.addComponent(cloudTable); // ? Label spacer2 = new Label(""); spacer2.setHeight("7px"); layout.addComponent(spacer2); // ?? HorizontalLayout bbar = new HorizontalLayout(); bbar.setWidth("100%"); HorizontalLayout rlay = new HorizontalLayout(); rlay.setSpacing(true); // New Button addButton = new Button(ViewProperties.getCaption("button.newCloud")); addButton.setDescription(ViewProperties.getCaption("description.newCloud")); addButton.setIcon(Icons.ADD.resource()); addButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { MyCloudManage.this.addButtonClick(event); } }); bbar.addComponent(addButton); bbar.setComponentAlignment(addButton, Alignment.MIDDLE_LEFT); // Switch Button switchButton = new Button(ViewProperties.getCaption("button.switch")); switchButton.setDescription(ViewProperties.getCaption("description.mycloud.switch")); switchButton.setWidth("85px"); switchButton.setIcon(Icons.SELECTMINI.resource()); switchButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { MyCloudManage.this.switchButtonClick(event); } }); // [Enter]?switchButton switchButton.setClickShortcut(KeyCode.ENTER); switchButton.focus(); rlay.addComponent(switchButton); // Cancel Button cancelButton = new Button(ViewProperties.getCaption("button.cancel")); cancelButton.setDescription(ViewProperties.getCaption("description.cancel")); cancelButton.setWidth("85px"); cancelButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { MyCloudManage.this.close(); } }); rlay.addComponent(cancelButton); bbar.addComponent(rlay); bbar.setComponentAlignment(rlay, Alignment.MIDDLE_RIGHT); layout.addComponent(bbar); // ??? initData(); //???/? if (ViewContext.getPowerUser()) { addButton.setEnabled(true); deleteButton.setEnabled(true); editButton.setEnabled(true); //?????????????? if (ViewContext.getPowerUser() && !ViewContext.getPowerDefaultMaster().equals(ViewContext.getLoginUser())) { addButton.setEnabled(false); } } else if (ViewContext.getUserNo().equals(ViewContext.getLoginUser())) { addButton.setEnabled(true); deleteButton.setEnabled(true); editButton.setEnabled(true); } else { addButton.setEnabled(false); deleteButton.setEnabled(false); editButton.setEnabled(false); } // showClouds(); }
From source file:jp.primecloud.auto.ui.WinPassword.java
License:Open Source License
public WinPassword(InstanceDto instanceDto, final Long instanceNo) { setCaption(ViewProperties.getCaption("description.getPassword")); setModal(true);//from w w w. j a v a 2 s . c om setWidth("580px"); setIcon(Icons.EDITMINI.resource()); VerticalLayout layout = (VerticalLayout) getContent(); layout.setMargin(true); layout.setSpacing(true); layout.setStyleName("win-password"); // PlatformDto platformDto = instanceDto.getPlatform(); String keyName = ""; // TODO CLOUD BRANCHING if (PCCConstant.PLATFORM_TYPE_AWS.equals(platformDto.getPlatform().getPlatformType())) { keyName = instanceDto.getAwsInstance().getKeyName(); } else if (PCCConstant.PLATFORM_TYPE_CLOUDSTACK.equals(platformDto.getPlatform().getPlatformType())) { keyName = instanceDto.getCloudstackInstance().getKeyName(); } Label privateKeyLabel = new Label(ViewMessages.getMessage("IUI-000099", keyName)); layout.addComponent(privateKeyLabel); privateKeyField = new TextField(); privateKeyField.setSizeFull(); privateKeyField.setRows(10); privateKeyField.setStyleName("privatekey"); layout.addComponent(privateKeyField); passwordField = new TextField(""); passwordField.setColumns(20); passwordField.setCaption(ViewProperties.getCaption("label.password")); passwordField.setStyleName("password"); layout.addComponent(passwordField); HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setMargin(true); horizontalLayout.setSpacing(true); passwordButton = new Button(ViewProperties.getCaption("button.getPassword")); passwordButton.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { getPassword(instanceNo); } }); horizontalLayout.addComponent(passwordButton); closeButton = new Button(ViewProperties.getCaption("button.close")); closeButton.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { close(); } }); horizontalLayout.addComponent(closeButton); layout.addComponent(horizontalLayout); layout.setComponentAlignment(horizontalLayout, Alignment.BOTTOM_RIGHT); layout.setComponentAlignment(passwordField, Alignment.MIDDLE_CENTER); initValidation(); }
From source file:jp.primecloud.auto.ui.WinServerAdd.java
License:Open Source License
WinServerAdd(Application ap) { apl = ap;/*from www . j av a 2s. com*/ // setIcon(Icons.ADD.resource()); setCaption(ViewProperties.getCaption("window.winServerAdd")); setModal(true); setWidth("620px"); //setHeight("600px"); VerticalLayout layout = (VerticalLayout) getContent(); layout.setMargin(true, true, false, true); layout.setSpacing(false); // layout.addComponent(new BasicForm()); // ?? HorizontalLayout okbar = new HorizontalLayout(); okbar.setSpacing(true); okbar.setMargin(false, false, true, false); layout.addComponent(okbar); layout.setComponentAlignment(okbar, Alignment.BOTTOM_RIGHT); // Add Button addButton = new Button(ViewProperties.getCaption("button.add")); addButton.setDescription(ViewProperties.getCaption("description.addServer")); addButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { addButtonClick(event); } }); // [Enter]?addButton addButton.setClickShortcut(KeyCode.ENTER); addButton.focus(); okbar.addComponent(addButton); // Cancel Button cancelButton = new Button(ViewProperties.getCaption("button.cancel")); cancelButton.setDescription(ViewProperties.getCaption("description.cancel")); cancelButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { close(); } }); okbar.addComponent(cancelButton); // ?? initValidation(); // ??? initData(); // ? showClouds(); }
From source file:jp.primecloud.auto.ui.WinServerAddSimple.java
License:Open Source License
WinServerAddSimple(Application ap, Long componentTypeNo) { apl = ap;//from w w w . java 2 s .c om this.componentTypeNo = componentTypeNo; // setIcon(Icons.ADD.resource()); setCaption(ViewProperties.getCaption("window.winServerAddSimple")); setModal(true); setWidth("450px"); setResizable(false); VerticalLayout layout = (VerticalLayout) getContent(); layout.setMargin(true, true, false, true); layout.setSpacing(false); // layout.addComponent(new ServerAddForm()); // ?? HorizontalLayout okbar = new HorizontalLayout(); okbar.setSpacing(true); okbar.setMargin(false, false, true, false); layout.addComponent(okbar); layout.setComponentAlignment(okbar, Alignment.BOTTOM_RIGHT); // Add Button addButton = new Button(ViewProperties.getCaption("button.add")); addButton.setDescription(ViewProperties.getCaption("description.add")); addButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { final List<String> serverNames = getServerNames(); DialogConfirm dialog = null; String message = ""; if (serverNames == null) { return; } else if (serverNames.size() > 1) { message = ViewMessages.getMessage("IUI-000043", serverNames.get(0), serverNames.get(serverNames.size() - 1), serverNames.size()); } else { message = ViewMessages.getMessage("IUI-000042", serverNames.get(0), serverNames.size()); } dialog = new DialogConfirm(ViewProperties.getCaption("dialog.confirm"), message, Buttons.OKCancel); dialog.setCallback(new DialogConfirm.Callback() { @Override public void onDialogResult(Result result) { if (result != Result.OK) { return; } else { addButtonClick(serverNames); } } }); getApplication().getMainWindow().addWindow(dialog); } }); okbar.addComponent(addButton); // Cancel Button cancelButton = new Button(ViewProperties.getCaption("button.cancel")); cancelButton.setDescription(ViewProperties.getCaption("description.cancel")); cancelButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { close(); } }); okbar.addComponent(cancelButton); // ?? initValidation(); // ??? initData(); // ? showClouds(); }
From source file:jp.primecloud.auto.ui.WinServerDataDiskConfig.java
License:Open Source License
WinServerDataDiskConfig(Application ap, Long instanceNo, DataDiskDto dataDiskDto) { this.ap = ap; this.instanceNo = instanceNo; this.dataDiskDto = dataDiskDto; // Window//from w w w .j a v a 2s . c o m isAddMode = (this.dataDiskDto == null) ? true : false; if (isAddMode) { //? setIcon(Icons.ADD.resource()); setCaption(ViewProperties.getCaption("window.WinServerAddDataDisk")); } else { //? setIcon(Icons.EDIT.resource()); setCaption(ViewProperties.getCaption("window.WinServerEditDataDisk")); } setModal(true); setWidth("400px"); setResizable(false); // Layout VerticalLayout layout = (VerticalLayout) getContent(); layout.setMargin(true); layout.setSpacing(true); // Form Form form = new Form(); txtDiskSize = new TextField(ViewProperties.getCaption("field.diskSize")); txtDiskSize.setWidth("90%"); form.getLayout().addComponent(txtDiskSize); layout.addComponent(form); // ?? HorizontalLayout buttonBar = new HorizontalLayout(); buttonBar.setSpacing(true); buttonBar.setMargin(false, true, true, false); layout.addComponent(buttonBar); layout.setComponentAlignment(buttonBar, Alignment.BOTTOM_RIGHT); // OK Button Button btnOk = new Button(ViewProperties.getCaption("button.ok")); btnOk.setDescription(ViewProperties.getCaption("description.ok")); btnOk.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { okButtonClick(event); } }); buttonBar.addComponent(btnOk); // [Enter]?OK btnOk.setClickShortcut(KeyCode.ENTER); //Cancel Button Button btnCancel = new Button(ViewProperties.getCaption("button.cancel")); btnCancel.setDescription(ViewProperties.getCaption("description.cancel")); btnCancel.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { close(); } }); buttonBar.addComponent(btnCancel); // showData(); // ?? initValidation(); }
From source file:jp.primecloud.auto.ui.WinServerEdit.java
License:Open Source License
WinServerEdit(Application ap, Long instanceNo) { apl = ap;//from w w w . ja va2 s. c o m this.instanceNo = instanceNo; // ??? initData(); // setCaption(ViewProperties.getCaption("window.winServerEdit")); setModal(true); setWidth("600px"); setIcon(Icons.EDITMINI.resource()); VerticalLayout layout = (VerticalLayout) getContent(); layout.setMargin(false, true, false, true); layout.setSpacing(true); //Tab? basicTab = new BasicTab(); tab.addTab(basicTab, ViewProperties.getCaption("tab.basic"), Icons.BASIC.resource()); layout.addComponent(tab); // ?? basicTab.initValidation(); // ? basicTab.showData(); //Tab? String platformType = platformDto.getPlatform().getPlatformType(); // TODO CLOUD BRANCHING if (PCCConstant.PLATFORM_TYPE_AWS.equals(platformType)) { awsDetailTab = new AWSDetailTab(); tab.addTab(awsDetailTab, ViewProperties.getCaption("tab.detail"), Icons.DETAIL.resource()); layout.addComponent(tab); // ?? awsDetailTab.initValidation(); // ? awsDetailTab.showData(); } else if (PCCConstant.PLATFORM_TYPE_VMWARE.equals(platformType)) { vmwareDetailTab = new VMWareDetailTab(); tab.addTab(vmwareDetailTab, ViewProperties.getCaption("tab.detail"), Icons.DETAIL.resource()); // ?? vmwareDetailTab.initValidation(); // ? vmwareDetailTab.showData(); boolean enableVmwareStaticIp = BooleanUtils.toBoolean(Config.getProperty("ui.enableVmwareEditIp")); if (BooleanUtils.isTrue(enableVmwareStaticIp)) { this.vmwareEditIpTab = new VmwareEditIpTab(); tab.addTab(vmwareEditIpTab, ViewProperties.getCaption("tab.editIp"), Icons.DETAIL.resource()); this.vmwareEditIpTab.showData(); this.vmwareEditIpTab.initValidation(); } layout.addComponent(tab); } else if (PCCConstant.PLATFORM_TYPE_NIFTY.equals(platformType)) { niftyDetailTab = new NiftyDetailTab(); tab.addTab(niftyDetailTab, ViewProperties.getCaption("tab.detail"), Icons.DETAIL.resource()); layout.addComponent(tab); // ?? niftyDetailTab.initValidation(); // ? niftyDetailTab.showData(); } else if (PCCConstant.PLATFORM_TYPE_CLOUDSTACK.equals(platformType)) { cloudStackDetailTab = new CloudStackDetailTab(); tab.addTab(cloudStackDetailTab, ViewProperties.getCaption("tab.detail"), Icons.DETAIL.resource()); layout.addComponent(tab); // ?? cloudStackDetailTab.initValidation(); // ? cloudStackDetailTab.showData(); } else if (PCCConstant.PLATFORM_TYPE_VCLOUD.equals(platformType)) { // vcloudDetailTab = new VcloudDetailTab(); tab.addTab(vcloudDetailTab, ViewProperties.getCaption("tab.detail"), Icons.DETAIL.resource()); // ?? vcloudDetailTab.initValidation(); // ? vcloudDetailTab.showData(); //? vcloudNetworkTab = new VcloudNetworkTab(); tab.addTab(vcloudNetworkTab, ViewProperties.getCaption("tab.network"), Icons.DETAIL.resource()); vcloudNetworkTab.showData(); layout.addComponent(tab); } else if (PCCConstant.PLATFORM_TYPE_AZURE.equals(platformType)) { azureDetailTab = new AzureDetailTab(); tab.addTab(azureDetailTab, ViewProperties.getCaption("tab.detail"), Icons.DETAIL.resource()); layout.addComponent(tab); // ?? azureDetailTab.initValidation(); // ? azureDetailTab.showData(); } else if (PCCConstant.PLATFORM_TYPE_OPENSTACK.equals(platformType)) { openStackDetailTab = new OpenStackDetailTab(); tab.addTab(openStackDetailTab, ViewProperties.getCaption("tab.detail"), Icons.DETAIL.resource()); layout.addComponent(tab); // ?? openStackDetailTab.initValidation(); // ? openStackDetailTab.showData(); } // tab.addTab(new UserTab(), "", new ThemeResource("icons/user.png")); // layout.addComponent(tab); // ?? HorizontalLayout okbar = new HorizontalLayout(); okbar.setSpacing(true); okbar.setMargin(false, false, true, false); layout.addComponent(okbar); layout.setComponentAlignment(okbar, Alignment.BOTTOM_RIGHT); // OK Button okButton = new Button(ViewProperties.getCaption("button.ok")); okButton.setDescription(ViewProperties.getCaption("description.editServer.ok")); okButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { okButtonClick(event); } }); okbar.addComponent(okButton); // [Enter]?okButton okButton.setClickShortcut(KeyCode.ENTER); okButton.focus(); Button cancelButton = new Button(ViewProperties.getCaption("button.cancel")); cancelButton.setDescription(ViewProperties.getCaption("description.cancel")); cancelButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { close(); } }); okbar.addComponent(cancelButton); }