@Override public void refresh() { m_timeslot = 3600; try { m_timeslot = Math.max(1, Integer.parseInt(getDashletSpec().getParameters().get("timeslot"))); } catch (NumberFormatException numberFormatException) { /** * Just ignore */ } m_horizontalLayout.removeAllComponents(); injectWallboardStyles(); Component severity = getComponentSeverity(32); Component uei = getComponentUei(32); m_horizontalLayout.addComponent(severity); m_horizontalLayout.addComponent(uei); m_horizontalLayout.setSizeFull(); m_horizontalLayout.setComponentAlignment(severity, Alignment.TOP_CENTER); m_horizontalLayout.setComponentAlignment(uei, Alignment.TOP_CENTER); }
private Layout createFooter() { HorizontalLayout footer = new HorizontalLayout(); footer.setSpacing(true); footer.setMargin(true); footer.setWidth(100, Unit.PERCENTAGE); footer.addComponent(okayButton); footer.setComponentAlignment(okayButton, Alignment.BOTTOM_RIGHT); return footer; }
optionEntry.addComponent(label); optionEntry.setSpacing(true); optionEntry.setComponentAlignment(disableSelection, Alignment.MIDDLE_RIGHT); optionEntry.setComponentAlignment(label, Alignment.MIDDLE_RIGHT); optionEntry.addComponent(automaticUpdatePeriodControl); optionEntry.setSpacing(true); optionEntry.setComponentAlignment(periodSelection, Alignment.MIDDLE_RIGHT); optionEntry.setComponentAlignment(automaticUpdatePeriodControl, Alignment.MIDDLE_RIGHT); root.addComponent(optionEntry);
private Component getLegend(String entity) { HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSpacing(true); horizontalLayout.addStyleName("summary"); horizontalLayout.addStyleName("global"); Label labelx = new Label(entity); labelx.addStyleName("summary-font-legend"); Image ackdImage = new Image(null, new ThemeResource("img/acknowledged.png")); ackdImage.setWidth(16, Sizeable.Unit.PIXELS); Image unackdImage = new Image(null, new ThemeResource("img/unacknowledged.png")); unackdImage.setWidth(16, Sizeable.Unit.PIXELS); Label dummyLabel = new Label(); dummyLabel.setWidth(32, Sizeable.Unit.PIXELS); horizontalLayout.addComponent(labelx); horizontalLayout.addComponent(ackdImage); horizontalLayout.addComponent(unackdImage); horizontalLayout.addComponent(dummyLabel); horizontalLayout.setComponentAlignment(ackdImage, Alignment.TOP_RIGHT); horizontalLayout.setComponentAlignment(unackdImage, Alignment.TOP_RIGHT); horizontalLayout.setExpandRatio(labelx, 4.0f); horizontalLayout.setExpandRatio(ackdImage, 1.0f); horizontalLayout.setExpandRatio(unackdImage, 1.0f); horizontalLayout.setExpandRatio(dummyLabel, 1.0f); horizontalLayout.setWidth(375, Sizeable.Unit.PIXELS); return horizontalLayout; }
horizontalLayout.addComponent(cancel); horizontalLayout.setExpandRatio(cancel, 1); horizontalLayout.setComponentAlignment(cancel, Alignment.TOP_RIGHT);
public HeaderPanel() { label = new Label(); label.setContentMode(ContentMode.HTML); helpPopupView = new PopupView(new HelpContent(UiState.ServiceConfigurationView)); helpPopupView.setVisible(false); helpPopupView.setPopupVisible(false); Button popupButton = UIHelper.createButton("", "help", Config.Icons.HELP, new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { helpPopupView.setPopupVisible(true); helpPopupView.setVisible(true); } }); HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); layout.setMargin(true); layout.addComponent(popupButton); layout.addComponent(helpPopupView); layout.addComponent(label); layout.setComponentAlignment(label, Alignment.MIDDLE_LEFT); setContent(layout); }
toolbar.setComponentAlignment(comboLabel, Alignment.MIDDLE_LEFT);
horizontalLayout.setExpandRatio(image, 1.0f); horizontalLayout.setComponentAlignment(image, Alignment.TOP_CENTER);
@Override public Object generateCell(Table source, Object itemId, Object columnId) { final HorizontalLayout layout = new HorizontalLayout(); final BusinessServiceStateMachine stateMachine = businessServiceManager.getStateMachine(); final BusinessService businessService = getItem(itemId).getBean().getBusinessService(); final Status status = stateMachine.getOperationalStatus(businessService); if (status != null) { final String topologyLink = new TopologyLinkBuilder() .focus(businessService.getId().toString()) .szl(1) .layout(Layout.HIERARCHY) .provider(TopologyProvider.BUSINESS_SERVICE) .getLink(); // Generate the link final Link link = new Link("View in Topology UI", new ExternalResource(topologyLink)); link.setIcon(FontAwesome.EXTERNAL_LINK_SQUARE); // This app is typically access in an iframe, so we open the URL in a new window/tab link.setTargetName("_blank"); layout.addComponent(link); layout.setComponentAlignment(link, Alignment.MIDDLE_CENTER); } else { Label label = new Label("N/A"); label.setDescription("Try reloading the daemon and refreshing the table."); label.setWidth(null); layout.addComponent(label); } return layout; } });
extraControls.setComponentAlignment(component, Alignment.MIDDLE_RIGHT);
toolbar.setComponentAlignment(comboLabel, Alignment.MIDDLE_LEFT);
horizontalLayout.setExpandRatio(image, 1.0f); horizontalLayout.setComponentAlignment(image, Alignment.TOP_CENTER);
upperLayout.addComponent(leftButtonGroup); upperLayout.addComponent(rightButtonGroup); upperLayout.setComponentAlignment(leftButtonGroup, Alignment.TOP_LEFT); upperLayout.setComponentAlignment(rightButtonGroup, Alignment.TOP_RIGHT); upperLayout.setWidth(100, Unit.PERCENTAGE); addComponent(upperLayout);
/** * Override of CompletedLayout section.<br> * Used the configuration in order to define the action to perform and Thumbnail component to display. */ @Override protected Layout createCompletedActionLayout() { if (isReadOnly()) { return new HorizontalLayout(); } // Action Button (Upload new or delete). Default is always Upload HorizontalLayout actionLayout = new HorizontalLayout(); actionLayout.setSizeUndefined(); actionLayout.addStyleName("buttons"); actionLayout.setSpacing(true); // Add an Edit Button if the MediaFile has configured it. if (getValue() != null && !getValue().isEmpty() && getValue().getEditAssetAppConfiguration().hasEditConfig()) { Button edit = createEditButton(); actionLayout.addComponent(edit); } // Add Upload Button getUpload().setButtonCaption(getCaption(selectAnotherCaption, null)); actionLayout.addComponent(getUpload()); // Add a Remove Button if a file is present. if (getValue() != null && !getValue().isEmpty()) { Button delete = createDeleteButton(); actionLayout.addComponent(delete); actionLayout.setComponentAlignment(delete, Alignment.MIDDLE_LEFT); } return actionLayout; }
extraControls.setComponentAlignment(component, Alignment.MIDDLE_RIGHT);
horizontalLayout.setComponentAlignment(m_cancelButton, Alignment.TOP_RIGHT);
horizontalLayout.setComponentAlignment(label, Alignment.MIDDLE_LEFT);
buttonLayout.setWidth("100%"); buttonLayout.addComponent(close); buttonLayout.setComponentAlignment(close, Alignment.BOTTOM_RIGHT);
horizontalLayout.addComponent(cancel); horizontalLayout.setExpandRatio(cancel, 1); horizontalLayout.setComponentAlignment(cancel, Alignment.TOP_RIGHT);
horizontalLayout.setComponentAlignment(m_cancelButton, Alignment.TOP_RIGHT);