/** * Constructs an empty VerticalLayout. */ public VerticalLayout() { super(); setSpacing(false); setMargin(false); }
public HelpContent(UiState uiState) { Objects.requireNonNull(uiState); if (!uiState.hasUi()) { throw new IllegalArgumentException("The provided uiState " + uiState + " does not have a ui."); } String content = UIHelper.loadContentFromFile(getClass(), String.format("/help/%s.html", uiState.name())); content = content.replaceAll("%title%", uiState.getDescription()); layout = new VerticalLayout(); layout.setMargin(true); layout.setWidth(400, Sizeable.Unit.PIXELS); layout.setSpacing(true); layout.addComponent(new Label(content, ContentMode.HTML)); }
@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(); Accordion accordion = new Accordion(); accordion.setSizeFull(); injectDashboardStyles(); Component severity = getComponentSeverity(16); Component uei = getComponentUei(16); VerticalLayout v1 = new VerticalLayout(severity); v1.setSizeFull(); v1.setComponentAlignment(severity, Alignment.MIDDLE_CENTER); v1.setMargin(true); accordion.addTab(v1, "by Severity"); VerticalLayout v2 = new VerticalLayout(uei); v2.setSizeFull(); v2.setComponentAlignment(uei, Alignment.MIDDLE_CENTER); v2.setMargin(true); accordion.addTab(v2, "by Uei"); m_horizontalLayout.addComponent(accordion); }
private TabContent(OutputDataKey key) { configTextArea.setSizeFull(); configTextArea.addStyleName("borderless"); descriptionLabel = new Label( UIHelper.loadContentFromFile(getClass(), key.getDescriptionFilename()), ContentMode.HTML); VerticalLayout leftLayout = new VerticalLayout(descriptionLabel); leftLayout.setMargin(true); addComponent(configTextArea); addComponent(leftLayout); setSizeFull(); setLocked(false); setSplitPosition(75, Unit.PERCENTAGE); setCaption(key.getTitle()); }
/** * Wraps the provided component in order to fit it better in the Info Panel. * E.g. a caption is added to better difference between components. * * @param component The component to wrap. * @param title the title of the component to wrap. * @param id the id of the wrapped component. * @return The wrapped component. */ private Component wrap(Component component, String title, String id) { Label label = new Label(); label.addStyleName("info-panel-item-label"); if (title != null) { label.setValue(title); } VerticalLayout layout = new VerticalLayout(); layout.addStyleName("info-panel-item"); layout.addComponent(label); layout.addComponent(component); layout.setMargin(true); if (id != null) { layout.setId(id); } return layout; }
mainLayout.setMargin(true); mainLayout.addComponent(groupTable); mainLayout.addComponent(add);
mainLayout.setMargin(true); mainLayout.addComponent(systemDefTable); mainLayout.addComponent(add);
public MBeansContentPanel(final MBeansController controller) { this.controller = controller; this.attributesTable = new AttributesTable(controller, controller); emptyLayout = new VerticalLayout(); emptyLayout.setSpacing(true); emptyLayout.setMargin(true); emptyLayout.addComponent(new Label("No MBean or Composite selected. Please select one to modify data.")); nameEditForm = new NameEditForm(controller); captionLabel = new Label(); captionLabel.setContentMode(ContentMode.HTML); VerticalLayout attributeLayout = new VerticalLayout(); attributeLayout.addComponent(captionLabel); attributeLayout.addComponent(attributesTable); attributeLayout.setSizeFull(); attributeLayout.setExpandRatio(attributesTable, 1); contentLayout = new VerticalLayout(); contentLayout.setSpacing(true); contentLayout.setMargin(true); contentLayout.addComponent(nameEditForm); contentLayout.addComponent(attributeLayout); contentLayout.setSizeFull(); contentLayout.setExpandRatio(attributeLayout, 1); // by default we do not show details addComponent(emptyLayout); addComponent(contentLayout); setSizeFull(); // we have to listen for "selection" value changed events controller.registerSelectionValueChangedListener(nameEditForm); controller.registerSelectionValueChangedListener(attributesTable); }
mainLayout.setMargin(true); mainLayout.addComponent(resourceTypeTable); mainLayout.addComponent(add);
verticalLayout.setMargin(true); verticalLayout.setSizeFull(); verticalLayout.setHeight(100, Unit.PERCENTAGE);
public InvalidConfigurationWindow(NodeMapConfiguration nodeMapConfiguration) { setModal(true); setResizable(false); setWidth(500, Unit.PIXELS); setHeight(250, Unit.PIXELS); setCaption("Configuration Error"); final Button btnClose = new Button("OK", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { close(); } }); final String errorMessage = getErrorLabel(nodeMapConfiguration); final Label label = new Label(errorMessage, ContentMode.HTML); VerticalLayout rootLayout = new VerticalLayout(); rootLayout.setSpacing(true); rootLayout.setMargin(true); rootLayout.addComponent(label); rootLayout.addComponent(btnClose); rootLayout.setExpandRatio(label, 1.0f); rootLayout.setComponentAlignment(btnClose, Alignment.BOTTOM_RIGHT); setContent(rootLayout); center(); }
public InfoDialog(String caption, String description) { setCaption(caption); setModal(true); setResizable(false); setClosable(false); setWidth(400, Unit.PIXELS); setHeight(200, Unit.PIXELS); okButton = UIHelper.createButton("ok", null, null, event -> InfoDialog.this.close()); okButton.setId("infoDialog.button.ok"); label.setValue(description); final HorizontalLayout buttonLayout = new HorizontalLayout(okButton); buttonLayout.setSpacing(true); layout.setSpacing(true); layout.setMargin(true); layout.setSizeFull(); layout.addComponent(label); layout.addComponent(buttonLayout); layout.setComponentAlignment(buttonLayout, Alignment.BOTTOM_RIGHT); setContent(layout); center(); }
layout.setComponentAlignment(cancelButton, Alignment.BOTTOM_RIGHT); layout.setSpacing(true); layout.setMargin(true);
public ConfirmationDialog(String caption, String description) { setCaption(caption); setModal(true); setResizable(false); setClosable(false); setWidth(400, Unit.PIXELS); setHeight(200, Unit.PIXELS); addCloseListener(this); okButton = UIHelper.createButton("ok", null, null, this); okButton.setId("confirmationDialog.button.ok"); cancelButton = UIHelper.createButton("cancel", "cancels the current action.", null, this); cancelButton.setId("confirmationDialog.button.cancel"); label.setDescription(description); final HorizontalLayout buttonLayout = new HorizontalLayout(okButton, cancelButton); buttonLayout.setSpacing(true); layout.setSpacing(true); layout.setMargin(true); layout.setSizeFull(); layout.addComponent(label); layout.addComponent(buttonLayout); layout.setComponentAlignment(buttonLayout, Alignment.BOTTOM_RIGHT); setContent(layout); center(); }
mainLayout.setMargin(true); mainLayout.addComponent(topToolbar); mainLayout.addComponent(eventTable);
contentLayout.setMargin(true); contentLayout.addComponent(label); contentLayout.addComponent(defaultLayout);
rootLayout.setMargin(true); rootLayout.addComponent(pingForm); rootLayout.addComponent(buttonLayout);
mainLayout.setMargin(true); mainLayout.setSizeFull(); mainLayout.addComponent(iconLayout);
mainLayout.setMargin(true); mainLayout.addComponent(toolbar); mainLayout.addComponent(groupName);
layout.addComponent(toolbar); layout.setComponentAlignment(toolbar, Alignment.BOTTOM_RIGHT); layout.setMargin(true); setContent(layout);