List of usage examples for com.vaadin.ui Label setWidth
@Override public void setWidth(String width)
From source file:info.magnolia.ui.mediaeditor.action.CropImageAction.java
License:Open Source License
@Override protected Component getStatusControls() { final Label l = new Label(); l.setWidth("400px"); cropField.setStatusComponent(l);//from www.j av a 2s. c o m return l; }
From source file:it.vige.greenarea.bpm.custom.ui.form.GreenareaPagedTable.java
License:Apache License
@Override public HorizontalLayout createControls() { I18nManager I18nManager = get().getI18nManager(); final PagedTableContainer container = (PagedTableContainer) getContainerDataSource(); Label itemsPerPageLabel = new Label(I18nManager.getMessage(PAGINAZIONE_PER_PAGINA)); final ComboBox itemsPerPageSelect = new ComboBox(); itemsPerPageSelect.addItem("3"); itemsPerPageSelect.addItem("10"); itemsPerPageSelect.addItem("25"); itemsPerPageSelect.addItem("50"); itemsPerPageSelect.setImmediate(true); itemsPerPageSelect.setNullSelectionAllowed(false); itemsPerPageSelect.setWidth("50px"); itemsPerPageSelect.addListener(new ValueChangeListener() { private static final long serialVersionUID = -2255853716069800092L; public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) { setPageLength(Integer.valueOf(String.valueOf(event.getProperty().getValue()))); }//from w w w. j a v a 2 s . c om }); itemsPerPageSelect.select(maxRecords + ""); Label pageLabel = new Label(I18nManager.getMessage(PAGINAZIONE_PAG) + " ", Label.CONTENT_XHTML); final TextField currentPageTextField = new TextField(); currentPageTextField.setValue(String.valueOf(getCurrentPage())); currentPageTextField.addValidator(new IntegerValidator(null)); Label separatorLabel = new Label(" / ", Label.CONTENT_XHTML); final Label totalPagesLabel = new Label(String.valueOf(getTotalAmountOfPages()), Label.CONTENT_XHTML); currentPageTextField.setStyleName(Reindeer.TEXTFIELD_SMALL); currentPageTextField.setImmediate(true); currentPageTextField.addListener(new ValueChangeListener() { private static final long serialVersionUID = -2255853716069800092L; public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) { if (currentPageTextField.isValid() && currentPageTextField.getValue() != null) { int page = Integer.valueOf(String.valueOf(currentPageTextField.getValue())); setCurrentPage(page); } } }); pageLabel.setWidth(null); currentPageTextField.setWidth("20px"); separatorLabel.setWidth(null); totalPagesLabel.setWidth(null); HorizontalLayout controlBar = new HorizontalLayout(); HorizontalLayout pageSize = new HorizontalLayout(); HorizontalLayout pageManagement = new HorizontalLayout(); final Button first = new Button("<<", new ClickListener() { private static final long serialVersionUID = -355520120491283992L; public void buttonClick(ClickEvent event) { setCurrentPage(0); if (values != null && !values.isEmpty() && values.iterator().next() instanceof Selectable) { Selectable selectable = (Selectable) values.toArray()[container.getStartIndex()]; GreenareaFormPropertiesComponent greenareaFormPropertiesComponent = (GreenareaFormPropertiesComponent) greenareaFormPropertiesForm .getComponent(1); FormProperty formProperty = greenareaFormPropertiesComponent.getFormProperties().get(0); FormPropertyRenderer formPropertyRenderer = greenareaFormPropertiesComponent .getRenderer(formProperty); greenareaFormPropertiesComponent.getForm() .getField(greenareaFormPropertiesComponent.getFormProperties().get(0).getId()) .setValue(formPropertyRenderer.getPropertyLabel(formProperty) + " " + selectable.getValue()); } } }); final Button previous = new Button("<", new ClickListener() { private static final long serialVersionUID = -355520120491283992L; public void buttonClick(ClickEvent event) { previousPage(); if (values != null && !values.isEmpty() && values.iterator().next() instanceof Selectable) { Selectable selectable = (Selectable) values.toArray()[container.getStartIndex()]; GreenareaFormPropertiesComponent greenareaFormPropertiesComponent = (GreenareaFormPropertiesComponent) greenareaFormPropertiesForm .getComponent(1); FormProperty formProperty = greenareaFormPropertiesComponent.getFormProperties().get(0); FormPropertyRenderer formPropertyRenderer = greenareaFormPropertiesComponent .getRenderer(formProperty); greenareaFormPropertiesComponent.getForm() .getField(greenareaFormPropertiesComponent.getFormProperties().get(0).getId()) .setValue(formPropertyRenderer.getPropertyLabel(formProperty) + " " + selectable.getValue()); } } }); final Button next = new Button(">", new ClickListener() { private static final long serialVersionUID = -1927138212640638452L; public void buttonClick(ClickEvent event) { nextPage(); if (values != null && !values.isEmpty() && values.iterator().next() instanceof Selectable) { Selectable selectable = (Selectable) values.toArray()[container.getStartIndex()]; GreenareaFormPropertiesComponent greenareaFormPropertiesComponent = (GreenareaFormPropertiesComponent) greenareaFormPropertiesForm .getComponent(1); FormProperty formProperty = greenareaFormPropertiesComponent.getFormProperties().get(0); FormPropertyRenderer formPropertyRenderer = greenareaFormPropertiesComponent .getRenderer(formProperty); greenareaFormPropertiesComponent.getForm() .getField(greenareaFormPropertiesComponent.getFormProperties().get(0).getId()) .setValue(formPropertyRenderer.getPropertyLabel(formProperty) + " " + selectable.getValue()); } } }); final Button last = new Button(">>", new ClickListener() { private static final long serialVersionUID = -355520120491283992L; public void buttonClick(ClickEvent event) { setCurrentPage(getTotalAmountOfPages()); if (values != null && !values.isEmpty() && values.iterator().next() instanceof Selectable) { Selectable selectable = (Selectable) values.toArray()[container.getStartIndex()]; GreenareaFormPropertiesComponent greenareaFormPropertiesComponent = (GreenareaFormPropertiesComponent) greenareaFormPropertiesForm .getComponent(1); FormProperty formProperty = greenareaFormPropertiesComponent.getFormProperties().get(0); FormPropertyRenderer formPropertyRenderer = greenareaFormPropertiesComponent .getRenderer(formProperty); greenareaFormPropertiesComponent.getForm() .getField(greenareaFormPropertiesComponent.getFormProperties().get(0).getId()) .setValue(formPropertyRenderer.getPropertyLabel(formProperty) + " " + selectable.getValue()); } } }); first.setStyleName(Reindeer.BUTTON_LINK); previous.setStyleName(Reindeer.BUTTON_LINK); next.setStyleName(Reindeer.BUTTON_LINK); last.setStyleName(Reindeer.BUTTON_LINK); itemsPerPageLabel.addStyleName("pagedtable-itemsperpagecaption"); itemsPerPageSelect.addStyleName("pagedtable-itemsperpagecombobox"); pageLabel.addStyleName("pagedtable-pagecaption"); currentPageTextField.addStyleName("pagedtable-pagefield"); separatorLabel.addStyleName("pagedtable-separator"); totalPagesLabel.addStyleName("pagedtable-total"); first.addStyleName("pagedtable-first"); previous.addStyleName("pagedtable-previous"); next.addStyleName("pagedtable-next"); last.addStyleName("pagedtable-last"); itemsPerPageLabel.addStyleName("pagedtable-label"); itemsPerPageSelect.addStyleName("pagedtable-combobox"); pageLabel.addStyleName("pagedtable-label"); currentPageTextField.addStyleName("pagedtable-label"); separatorLabel.addStyleName("pagedtable-label"); totalPagesLabel.addStyleName("pagedtable-label"); first.addStyleName("pagedtable-button"); previous.addStyleName("pagedtable-button"); next.addStyleName("pagedtable-button"); last.addStyleName("pagedtable-button"); pageSize.addComponent(itemsPerPageLabel); pageSize.addComponent(itemsPerPageSelect); pageSize.setComponentAlignment(itemsPerPageLabel, Alignment.MIDDLE_LEFT); pageSize.setComponentAlignment(itemsPerPageSelect, Alignment.MIDDLE_LEFT); pageSize.setSpacing(true); pageManagement.addComponent(first); pageManagement.addComponent(previous); pageManagement.addComponent(pageLabel); pageManagement.addComponent(currentPageTextField); pageManagement.addComponent(separatorLabel); pageManagement.addComponent(totalPagesLabel); pageManagement.addComponent(next); pageManagement.addComponent(last); pageManagement.setComponentAlignment(first, Alignment.MIDDLE_LEFT); pageManagement.setComponentAlignment(previous, Alignment.MIDDLE_LEFT); pageManagement.setComponentAlignment(pageLabel, Alignment.MIDDLE_LEFT); pageManagement.setComponentAlignment(currentPageTextField, Alignment.MIDDLE_LEFT); pageManagement.setComponentAlignment(separatorLabel, Alignment.MIDDLE_LEFT); pageManagement.setComponentAlignment(totalPagesLabel, Alignment.MIDDLE_LEFT); pageManagement.setComponentAlignment(next, Alignment.MIDDLE_LEFT); pageManagement.setComponentAlignment(last, Alignment.MIDDLE_LEFT); pageManagement.setWidth(null); pageManagement.setSpacing(true); controlBar.addComponent(pageSize); controlBar.addComponent(pageManagement); controlBar.setComponentAlignment(pageManagement, Alignment.MIDDLE_CENTER); controlBar.setWidth("100%"); controlBar.setExpandRatio(pageSize, 1); addListener(new PageChangeListener() { public void pageChanged(PagedTableChangeEvent event) { first.setEnabled(container.getStartIndex() > 0); previous.setEnabled(container.getStartIndex() > 0); next.setEnabled(container.getStartIndex() < container.getRealSize() - getPageLength()); last.setEnabled(container.getStartIndex() < container.getRealSize() - getPageLength()); currentPageTextField.setValue(String.valueOf(getCurrentPage())); totalPagesLabel.setValue(getTotalAmountOfPages()); itemsPerPageSelect.setValue(String.valueOf(getPageLength())); } }); controlBar.setStyleName("pagination"); return controlBar; }
From source file:jp.primecloud.auto.ui.LoadBalancerButtonsBottom.java
License:Open Source License
@Override public void attach() { addStyleName("loadbalancer-table-operation"); setWidth("100%"); setMargin(true);//from ww w .j a v a 2 s . co m // Add addButton = new Button(ViewProperties.getCaption("button.addLoadBalancer")); addButton.setDescription(ViewProperties.getCaption("description.addLoadBalancer")); addButton.setIcon(Icons.ADD.resource()); addButton.addStyleName("left"); addButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { addButtonClick(event); } }); addComponent(addButton); // Label spacer = new Label(" ", Label.CONTENT_XHTML); spacer.setWidth("30px"); spacer.addStyleName("left"); addComponent(spacer); // Edit editButton = new Button(ViewProperties.getCaption("button.editLoadBalancer")); editButton.setDescription(ViewProperties.getCaption("description.editLoadBalancer")); editButton.setWidth("90px"); editButton.setIcon(Icons.EDITMINI.resource()); editButton.addStyleName("left"); editButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { editButtonClick(event); } }); addComponent(editButton); // Delete deleteButton = new Button(ViewProperties.getCaption("button.deleteLoadBalancer")); deleteButton.setDescription(ViewProperties.getCaption("description.deleteLoadBalancer")); deleteButton.setWidth("90px"); deleteButton.setIcon(Icons.DELETEMINI.resource()); deleteButton.addStyleName("left"); deleteButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { deleteButtonClick(event); } }); addComponent(deleteButton); // Stop stopButton = new Button(ViewProperties.getCaption("button.stopLoadBalancer")); stopButton.setDescription(ViewProperties.getCaption("description.stopLoadBalancer")); stopButton.setWidth("90px"); stopButton.setIcon(Icons.STOPMINI.resource()); stopButton.addStyleName("right"); stopButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { stopButtonClick(event); } }); addComponent(stopButton); // Start startButton = new Button(ViewProperties.getCaption("button.startLoadBalancer")); startButton.setDescription(ViewProperties.getCaption("description.startLoadBalancer")); startButton.setWidth("90px"); startButton.setIcon(Icons.PLAYMINI.resource()); startButton.addStyleName("right"); startButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { startButtonClick(event); } }); addComponent(startButton); initialize(); }
From source file:jp.primecloud.auto.ui.MyCloudManage.java
License:Open Source License
MyCloudManage(Application ap) { apl = ap;//from w w w.ja v a2 s . c o 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.ServerButtonsBottom.java
License:Open Source License
@Override public void attach() { setWidth("100%"); setMargin(true);//ww w. j a va2 s .c o m addStyleName("server-buttons"); // Add addButton = new Button(ViewProperties.getCaption("button.addServer")); addButton.setDescription(ViewProperties.getCaption("description.addServer")); addButton.setIcon(Icons.ADD.resource()); addButton.addStyleName("left"); addButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { addButtonClick(event); } }); addComponent(addButton); // Label spacer = new Label(" ", Label.CONTENT_XHTML); spacer.setWidth("30px"); spacer.addStyleName("left"); addComponent(spacer); // Edit editButton = new Button(ViewProperties.getCaption("button.editServer")); editButton.setDescription(ViewProperties.getCaption("description.editServer")); editButton.setWidth("90px"); editButton.setIcon(Icons.EDITMINI.resource()); editButton.addStyleName("left"); editButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { editButtonClick(event); } }); addComponent(editButton); // Delete deleteButton = new Button(ViewProperties.getCaption("button.deleteServer")); deleteButton.setDescription(ViewProperties.getCaption("description.deleteServer")); deleteButton.setWidth("90px"); deleteButton.setIcon(Icons.DELETEMINI.resource()); deleteButton.addStyleName("left"); deleteButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { deleteButtonClick(event); } }); addComponent(deleteButton); // Stop stopButton = new Button(ViewProperties.getCaption("button.stopServer")); stopButton.setDescription(ViewProperties.getCaption("description.stopServer")); stopButton.setWidth("90px"); stopButton.setIcon(Icons.STOPMINI.resource()); stopButton.addStyleName("right"); stopButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { stopButtonClick(event); } }); addComponent(stopButton); // Start startButton = new Button(ViewProperties.getCaption("button.startServer")); startButton.setDescription(ViewProperties.getCaption("description.startServer")); startButton.setWidth("90px"); startButton.setIcon(Icons.PLAYMINI.resource()); startButton.addStyleName("right"); startButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { startButtonClick(event); } }); addComponent(startButton); // ?????? boolean useZabbix = BooleanUtils.toBoolean(Config.getProperty("zabbix.useZabbix")); boolean changeMonitoring = BooleanUtils.toBoolean(Config.getProperty("zabbix.changeMonitoring")); if (useZabbix && changeMonitoring) { // Stop Monitoring stopMonitoringButton = new Button(ViewProperties.getCaption("button.stopMonitoring")); stopMonitoringButton.setDescription(ViewProperties.getCaption("description.stopMonitoring")); stopMonitoringButton.setWidth("150px"); stopMonitoringButton.setIcon(Icons.STOP_MONITORING.resource()); stopMonitoringButton.addStyleName("right"); stopMonitoringButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { stopMonitoringButtonClick(event); } }); addComponent(stopMonitoringButton); // Start Monitoring startMonitoringButton = new Button(ViewProperties.getCaption("button.startMonitoring")); startMonitoringButton.setDescription(ViewProperties.getCaption("description.startMonitoring")); startMonitoringButton.setWidth("150px"); startMonitoringButton.setIcon(Icons.START_MONITORING.resource()); startMonitoringButton.addStyleName("right"); startMonitoringButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { startMonitoringButtonClick(event); } }); addComponent(startMonitoringButton); } initialize(); }
From source file:jp.primecloud.auto.ui.ServerButtonsTop.java
License:Open Source License
@Override public void attach() { setWidth("100%"); setMargin(true);/*from ww w. j a v a2 s . c o m*/ addStyleName("server-buttons"); addStyleName("server-table-label"); Label labeal = new Label(ViewProperties.getCaption("label.server"), Label.CONTENT_XHTML); labeal.setWidth("200px"); addComponent(labeal); // StopAll stopAllButton = new Button(ViewProperties.getCaption("button.stopAllServers")); stopAllButton.setDescription(ViewProperties.getCaption("description.stopAllServers")); stopAllButton.setIcon(Icons.STOPMINI.resource()); stopAllButton.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { stopAllButtonClick(event); } }); stopAllButton.addStyleName("right"); addComponent(stopAllButton); // StartAll startAllButton = new Button(ViewProperties.getCaption("button.startAllServers")); startAllButton.setDescription(ViewProperties.getCaption("description.startAllServers")); startAllButton.setIcon(Icons.PLAYMINI.resource()); startAllButton.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { startAllButtonClick(event); } }); startAllButton.addStyleName("right"); addComponent(startAllButton); initialize(); }
From source file:jp.primecloud.auto.ui.ServerDescBasic.java
License:Open Source License
public ServerDescBasic() { setHeight("100%"); addStyleName(Reindeer.PANEL_LIGHT);//from w w w . ja v a 2 s. com VerticalLayout panel = (VerticalLayout) getContent(); panel.setWidth("100%"); panel.setHeight("100%"); panel.setMargin(true); panel.setSpacing(false); panel.addStyleName("server-desc-basic"); HorizontalLayout hlPanels = new HorizontalLayout(); hlPanels.setWidth("100%"); hlPanels.setHeight("100%"); hlPanels.setMargin(true); hlPanels.setSpacing(true); hlPanels.addStyleName("server-desc-basic"); // setContent(hlPanels); left.setWidth("100%"); right.setHeight("100%"); right.setWidth("100%"); //???? Label padding = new Label(" "); padding.setWidth("7px"); padding.setHeight("99%"); padding.addStyleName("desc-padding"); Label padding2 = new Label(""); padding2.setWidth("1px"); hlPanels.addComponent(left); hlPanels.addComponent(padding); hlPanels.addComponent(padding2); hlPanels.addComponent(right); hlPanels.setExpandRatio(left, 40); hlPanels.setExpandRatio(right, 60); panel.addComponent(hlPanels); panel.setExpandRatio(hlPanels, 1.0f); }
From source file:jp.primecloud.auto.ui.ServiceButtonsBottom.java
License:Open Source License
@Override public void attach() { setWidth("100%"); setMargin(true);/* w w w. ja v a 2 s. c om*/ addStyleName("service-buttons"); // Add addButton = new Button(ViewProperties.getCaption("button.addService")); addButton.setDescription(ViewProperties.getCaption("description.addService")); addButton.setIcon(Icons.ADD.resource()); addButton.addStyleName("left"); addButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { addButtonClick(event); } }); addComponent(addButton); // Label spacer = new Label(" ", Label.CONTENT_XHTML); spacer.setWidth("30px"); spacer.addStyleName("left"); addComponent(spacer); // Edit editButton = new Button(ViewProperties.getCaption("button.editService")); editButton.setDescription(ViewProperties.getCaption("description.editService")); editButton.setWidth("90px"); editButton.setIcon(Icons.EDITMINI.resource()); editButton.addStyleName("left"); editButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { editButtonClick(event); } }); addComponent(editButton); // Delete deleteButton = new Button(ViewProperties.getCaption("button.deleteService")); deleteButton.setDescription(ViewProperties.getCaption("description.deleteService")); deleteButton.setWidth("90px"); deleteButton.setIcon(Icons.DELETEMINI.resource()); deleteButton.addStyleName("left"); deleteButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { deleteButtonClick(event); } }); addComponent(deleteButton); initialize(); }
From source file:jp.primecloud.auto.ui.ServiceButtonsTop.java
License:Open Source License
@Override public void attach() { setWidth("100%"); setMargin(false);//w ww . j av a 2 s. c o m addStyleName("service-buttons"); addStyleName("service-table-label"); Label label = new Label(ViewProperties.getCaption("label.service"), Label.CONTENT_XHTML); label.setWidth("200px"); addComponent(label); // StopAll stopAllButton = new Button(ViewProperties.getCaption("button.stopAllServices")); stopAllButton.setDescription(ViewProperties.getCaption("description.stopAllServices")); stopAllButton.setIcon(Icons.STOPMINI.resource()); stopAllButton.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { stopAllButtonClick(event); } }); stopAllButton.addStyleName("right"); addComponent(stopAllButton); // StartAll startAllButton = new Button(ViewProperties.getCaption("button.startAllServices")); startAllButton.setDescription(ViewProperties.getCaption("description.startAllServices")); startAllButton.setIcon(Icons.PLAYMINI.resource()); startAllButton.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { startAllButtonClick(event); } }); startAllButton.addStyleName("right"); addComponent(startAllButton); initialize(); }
From source file:jp.primecloud.auto.ui.ServiceDescBasic.java
License:Open Source License
public ServiceDescBasic() { addStyleName(Reindeer.PANEL_LIGHT);/*www. j av a 2 s . co m*/ setHeight("100%"); HorizontalLayout hlPanels = new HorizontalLayout(); hlPanels.setWidth("100%"); hlPanels.setHeight("100%"); hlPanels.setMargin(true); hlPanels.setSpacing(true); hlPanels.addStyleName("service-desc-basic"); setContent(hlPanels); left.setWidth("100%"); right.setWidth("100%"); //???? Label padding = new Label(" "); padding.setWidth("7px"); padding.setHeight("99%"); padding.addStyleName("desc-padding"); Label padding2 = new Label(""); padding2.setWidth("1px"); VerticalLayout layLeft = new VerticalLayout(); layLeft.setMargin(false); layLeft.setSpacing(false); layLeft.setWidth("100%"); layLeft.setHeight("100%"); layLeft.addComponent(left); layLeft.setExpandRatio(left, 1.0f); VerticalLayout layRight = new VerticalLayout(); layRight.setMargin(false); layRight.setSpacing(false); layRight.setWidth("100%"); layRight.setHeight("100%"); layRight.addComponent(right); layRight.addComponent(serverOpe); layRight.setExpandRatio(right, 1.0f); hlPanels.addComponent(layLeft); hlPanels.addComponent(padding); hlPanels.addComponent(padding2); hlPanels.addComponent(layRight); hlPanels.setExpandRatio(layLeft, 40); hlPanels.setExpandRatio(layRight, 60); }