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); }
@Override public Component initContent() { VerticalLayout layout = new VerticalLayout(); layout.addComponent(table); layout.addComponent(toolbar); layout.setComponentAlignment(toolbar, Alignment.MIDDLE_RIGHT); return layout; }
/** * 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; }
/** * Constructs an empty VerticalLayout. */ public VerticalLayout() { super(); setSpacing(false); setMargin(false); }
/** * Creates the main window and adds the header, main and button panels to * it. */ private void initMainLayout() { VerticalLayout layout = new VerticalLayout(); layout.addComponent(headerPanel); layout.addComponent(contentPanel); layout.setSizeFull(); // content Panel should use most of the space layout.setExpandRatio(contentPanel, 1); setContent(layout); }
VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.addComponent(getLegend("UEI")); verticalLayout.addComponent(horizontalLayout); image.setWidth(width * 8f, Sizeable.Unit.PIXELS); VerticalLayout globalTrendLayout = new VerticalLayout(); globalTrendLayout.setSpacing(true); globalTrendLayout.addStyleName("summary"); globalTrendLayout.addStyleName("global"); globalTrendLayout.setSizeFull(); globalTrendLayout.addComponent(labelTitle); globalTrendLayout.addComponent(labelTimeslot); globalTrendLayout.addComponent(image); globalTrendLayout.setWidth(375, Sizeable.Unit.PIXELS); globalTrendLayout.setComponentAlignment(labelTitle, Alignment.MIDDLE_CENTER); globalTrendLayout.setComponentAlignment(labelTimeslot, Alignment.MIDDLE_CENTER); globalTrendLayout.setComponentAlignment(image, Alignment.MIDDLE_CENTER); globalTrendLayout.setExpandRatio(labelTitle, 1.0f); verticalLayout.addComponent(globalTrendLayout, 0);
VerticalLayout iconLayout = new VerticalLayout(); iconLayout.addStyleName("icon-selection-component"); iconLayout.setSpacing(true); iconLayout.setSizeFull(); iconLayout.addComponent(iconSelectionComponent); VerticalLayout mainLayout = new VerticalLayout(); mainLayout.setSpacing(true); mainLayout.setMargin(true); mainLayout.setSizeFull(); mainLayout.addComponent(iconLayout); mainLayout.addComponent(buttonLayout); mainLayout.setExpandRatio(iconLayout, 1); mainLayout.setComponentAlignment(buttonLayout, Alignment.BOTTOM_RIGHT);
VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.setSizeFull(); verticalLayout.setSpacing(true); verticalLayout.setMargin(true); verticalLayout.addComponent(m_nameTextField); verticalLayout.addComponent(m_reduceFunctionNativeSelect); verticalLayout.addComponent(m_thresholdTextField); verticalLayout.addComponent(m_exponentialPropagationBaseTextField); verticalLayout.addComponent(m_thresholdStatusSelect); VerticalLayout edgesButtonLayout = new VerticalLayout(); edgesButtonLayout.setWidth(110.0f, Unit.PIXELS); edgesButtonLayout.setSpacing(true); addEdgeButton.setWidth(110.0f, Unit.PIXELS); addEdgeButton.addStyleName("small"); edgesButtonLayout.addComponent(addEdgeButton); addEdgeButton.addClickListener((Button.ClickListener) event -> { final BusinessServiceEdgeEditWindow window = new BusinessServiceEdgeEditWindow(businessService, businessServiceManager, null); editEdgeButton.setWidth(110.0f, Unit.PIXELS); editEdgeButton.addStyleName("small"); edgesButtonLayout.addComponent(editEdgeButton); editEdgeButton.addClickListener((Button.ClickListener) event -> {
@Override protected Component initContent() { setImmediate(true); rootLayout.setSizeFull(); rootLayout.setSpacing(true); runButton.addStyleName("commit"); runButton.setCaption(simpleTranslator.translate("rssAggregator.manual.rss.import.all.run")); runButton.addClickListener(createButtonClickListener()); rootLayout.addComponent(runButton); rootLayout.setExpandRatio(runButton, 0); rootLayout.setComponentAlignment(runButton, Alignment.MIDDLE_CENTER); return rootLayout; }
/** * The ResourceGraphsWindow method constructs a sub-window instance which can be added to a * main window. The sub-window contains an embedded browser which displays the Resource Graphs * page of the currently selected node * @param node Selected node * @param nodeURL Node URL * @throws MalformedURLException */ public ResourceGraphsWindow(final Node node, final URL nodeURL) { rgBrowser = new Embedded("", new ExternalResource(nodeURL)); String label = node == null? "" : node.getLabel(); /*Sets up window settings*/ if (label == null || label.equals("") || label.equalsIgnoreCase(noLabel)) { label = ""; } else { label = " - " + label; } setCaption("Resource Graphs" + label); setResizable(false); /*Adds the browser component to the main layout*/ VerticalLayout layout = new VerticalLayout(); layout.addComponent(rgBrowser); setContent(layout); }
upperLayout = new VerticalLayout(); upperLayout.setId("surveillance-window"); upperLayout.setSpacing(false); upperLayout.addComponent(new Label("<div id=\"surveillanceview\"/>", ContentMode.HTML)); upperLayout.addComponent(m_surveillanceViewTableHeader); upperLayout.addComponent(m_surveillanceViewTable); rightCssLayout.setPrimaryStyleName("col-md-1"); lowerLayout = new VerticalLayout(); lowerLayout.setSpacing(true); lowerLayout.addComponent(surveillanceViewAlarmTable); lowerLayout.addComponent(surveillanceViewNotificationTable); lowerLayout.addComponent(surveillanceViewNodeRtcTable); lowerLayout.addComponent(surveillanceViewGraphComponent);
VerticalLayout layout = new VerticalLayout(); layout.addComponent(upload); layout.addComponent(label); layout.addComponent(mibsTree); layout.setComponentAlignment(upload, Alignment.TOP_RIGHT); layout.setExpandRatio(mibsTree, 1);
VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.setMargin(true); verticalLayout.setSizeFull(); verticalLayout.setHeight(100, Unit.PERCENTAGE); table.setColumnWidth("Value", -1); table.setSizeFull(); verticalLayout.addComponent(table); verticalLayout.addComponent(horizontalLayout); verticalLayout.setExpandRatio(table, 1.0f);
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)); }
/** * {@inheritDoc} */ @Override protected void init(VaadinRequest request) { /** * Force the reload of the configuration */ SurveillanceViewProvider.getInstance().load(); /** * Create the basic layout */ VerticalLayout rootLayout = new VerticalLayout(); rootLayout.setSizeFull(); rootLayout.setSpacing(true); rootLayout.addComponent(new SurveillanceViewsConfigList(m_surveillanceViewService)); setContent(rootLayout); }
private Layout createContent(final String description) { VerticalLayout content = new VerticalLayout(); content.setWidth(100, Unit.PERCENTAGE); Layout footer = createFooter(); Layout mainArea = createMainArea(description); content.addComponent(mainArea); content.addComponent(footer); content.setExpandRatio(mainArea, 1); return content; }
@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); }
public StubView(String iconId) { layout.addStyleName("app-stub-view"); layout.setSizeFull(); final Label icon = new Label(); icon.addStyleName("icon"); icon.setSizeUndefined(); icon.addStyleName(iconId); layout.addComponent(icon); layout.setComponentAlignment(icon, Alignment.MIDDLE_CENTER); }
private void createRootLayout() { m_rootLayout = new VerticalLayout(); m_rootLayout.setSizeFull(); m_rootLayout.addStyleName("root-layout"); setContent(m_rootLayout); addHeader(); addContentLayout(); }
/** * The EventsAlarmsWindow method constructs a sub-window instance which can be added to a * main window. The sub-window contains two embedded browsers which are directed at the Events * and Alarms page of the selected node * @param node Selected node * @throws MalformedURLException */ public EventsAlarmsWindow(final Node node, final URL eventsURL, final URL alarmsURL) { super("Events & Alarms" + makeLabel(node)); eventsBrowser = new Embedded("", new ExternalResource(eventsURL)); eventsBrowser.setSizeFull(); alarmsBrowser = new Embedded("", new ExternalResource(alarmsURL)); alarmsBrowser.setSizeFull(); setResizable(false); /*Adds the two browsers to separate tabs in a tabsheet layout*/ m_tabSheet = new TabSheet(); m_tabSheet.setSizeFull(); m_tabSheet.addTab(eventsBrowser, "Events"); m_tabSheet.addTab(alarmsBrowser, "Alarms"); /*Adds tabsheet component to the main layout of the sub-window*/ VerticalLayout layout = new VerticalLayout(); layout.addComponent(m_tabSheet); layout.setSizeFull(); setContent(layout); }