@Override public Component initContent() { HorizontalLayout layout = new HorizontalLayout(); layout.addComponent(selectField); return layout; }
@Override public Component initContent() { HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); layout.setWidth("100%"); layout.addComponent(oidType); layout.addComponent(oidValue); layout.setExpandRatio(oidValue, 1); return layout; }
/** * Returns the image severity layout for the given content. * * @param content the content * @return the label with the applied style */ protected HorizontalLayout getImageSeverityLayout(String content) { HorizontalLayout horizontalLayout = new HorizontalLayout(); Label placeholder = new Label(); placeholder.addStyleName("placeholder"); horizontalLayout.addComponent(placeholder); Label contentLabel = new Label(content); contentLabel.addStyleName("content"); horizontalLayout.addComponent(contentLabel); return horizontalLayout; }
@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); }
@Override protected Component initContent() { HorizontalLayout chooseDialogLayout = new HorizontalLayout(); chooseDialogLayout.setSizeFull(); chooseDialogLayout.setMargin(false); Component workbenchComponent = super.initContent(); chooseDialogLayout.addComponent(workbenchComponent); chooseDialogLayout.setExpandRatio(workbenchComponent, 1f); previewBar.setHeight(DEFAULT_HEIGHT); chooseDialogLayout.addComponent(previewBar); chooseDialogLayout.setExpandRatio(previewBar, 0f); return chooseDialogLayout; }
/** * This method refreshes the components. * * @param criteriaRestriction the new {@link CriteriaRestriction} * @param arr the values to be set */ private void refreshComponents(CriteriaRestriction criteriaRestriction, String[] arr) { for (AbstractComponent abstractComponent : m_componentList) { m_leftLayout.removeComponent(abstractComponent); } m_componentList.clear(); int i = 0; for (CriteriaEntry criteriaEntry : criteriaRestriction.getEntries()) { AbstractField abstractField = criteriaEntry.getComponent(m_criteriaBuilderHelper); if (arr != null && arr.length > i) { abstractField.setValue(CriteriaBuilderHelper.decode(arr[i])); } m_leftLayout.addComponent(abstractField); m_componentList.add(abstractField); i++; } }
/** * Convenience method for presenting notification indicator with string content. */ @Override public void openNotification(MessageStyleType type, boolean doesTimeout, String title, String linkText, final NotificationCallback callback) { HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); layout.addComponent(new Label(title, ContentMode.HTML)); Button button = new Button(linkText, new ClickListener() { @Override public void buttonClick(ClickEvent event) { callback.onLinkClicked(); } }); button.setStyleName(BaseTheme.BUTTON_LINK); layout.addComponent(button); openNotification(type, doesTimeout, new ViewAdapter(layout)); }
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; }
@Override public void graphChanged(GraphContainer graphContainer) { final BreadcrumbCriteria criteria = Criteria.getSingleCriteriaForGraphContainer(graphContainer, BreadcrumbCriteria.class, true); final HorizontalLayout breadcrumbLayout = (HorizontalLayout) getCompositionRoot(); breadcrumbLayout.removeAllComponents(); // Verify that breadcrumbs are enabled if (graphContainer.getTopologyServiceClient().getBreadcrumbStrategy() == BreadcrumbStrategy.SHORTEST_PATH_TO_ROOT) { final Collection<Vertex> displayVertices = graphContainer.getGraph().getDisplayVertices(); if (!displayVertices.isEmpty()) { final PathTree pathTree = BreadcrumbPathCalculator.findPath(graphContainer.getTopologyServiceClient(), displayVertices.stream().map(v -> (VertexRef) v).collect(Collectors.toSet())); final List<Breadcrumb> breadcrumbs = pathTree.toBreadcrumbs(); criteria.setBreadcrumbs(breadcrumbs); } for (Breadcrumb eachBreadcrumb : criteria.getBreadcrumbs()) { if (breadcrumbLayout.getComponentCount() >= 1) { breadcrumbLayout.addComponent(new Label(" > ")); } breadcrumbLayout.addComponent(createButton(graphContainer, eachBreadcrumb)); } } }
private Component createComponent() { Label label = new Label("Simulation Mode Enabled"); label.setDescription("Simulation Mode is enabled"); label.setIcon(FontAwesome.EXCLAMATION_TRIANGLE); label.addStyleName("warning"); HorizontalLayout layout = new HorizontalLayout(); layout.addComponent(label); layout.addStyleName("simulation"); return layout; }
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); }
private Layout createMainArea(final String description) { HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); layout.setMargin(true); layout.setWidth(100, Unit.PERCENTAGE); Label label = new Label(description, ContentMode.PREFORMATTED); label.setWidth(100, Unit.PERCENTAGE); layout.addComponent(label); return layout; }
public LayoutHintComponent(LayoutManager layoutManager, GraphContainer graphContainer) { this.layoutManager = layoutManager; final Label icon = new Label(); icon.setIcon(FontAwesome.INFO_CIRCLE); final Label text = new Label("A manual layout exists for the current selection."); final HorizontalLayout layout = new HorizontalLayout(); layout.addComponent(icon); layout.addComponent(text); layout.setDescription("Click to apply the manual layout"); layout.addLayoutClickListener((event) -> { graphContainer.setLayoutAlgorithm(new ManualLayoutAlgorithm(layoutManager)); graphContainer.redoLayout(); }); layout.setSpacing(true); setCompositionRoot(layout); }
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; }
private void construct() { mainLayout.setPrimaryStyleName("switcher"); mainLayout.addStyleName(VARIATION_GREEN.equals(colorVariation) ? cssGreenVariationClassname : cssBlackVariationClassname); // back-arrow back = new Button(""); back.setPrimaryStyleName(cssSwitcherArrowClassname); back.addStyleName("icon-arrow2_w"); mainLayout.addComponent(back); // combobox with descriptionLabel below wrapped in verticalLayout // comboLayout.setWidth(100, Unit.PERCENTAGE); combobox.setWidth(100, Unit.PERCENTAGE); comboLayout.addComponent(combobox); // descriptionLabel descriptionLabel = new Label(""); descriptionLabel.setPrimaryStyleName("switcherItemDescription"); descriptionLabel.addStyleName("descriptionLabel"); comboLayout.addComponent(descriptionLabel); mainLayout.addComponent(comboLayout); mainLayout.setExpandRatio(comboLayout, 1.0f); // forward arrow forward = new Button(""); forward.setPrimaryStyleName(cssSwitcherArrowClassname); forward.addStyleName("icon-arrow2_e"); mainLayout.addComponent(forward); updateButtonState(getValue()); updateItemDescription(); }
/** * Instantiates a new MIB object field. * * @param resourceTypes the available resource types * @param mibGroupEditable true, if the MIB group can be modified */ public MibObjField(final List<String> resourceTypes, boolean mibGroupEditable) { table.addStyleName("light"); table.setVisibleColumns(new Object[] { "oid", "instance", "alias", "type" }); table.setColumnHeaders(new String[] { "OID", "Instance", "Alias", "Type" }); table.setEditable(!isReadOnly()); table.setSelectable(true); table.setHeight("250px"); table.setWidth("100%"); table.setTableFieldFactory(new MibObjFieldFactory(resourceTypes)); if (mibGroupEditable) { toolbar.addComponent(add); toolbar.addComponent(delete); } toolbar.setVisible(table.isEditable()); setValidationVisible(true); }
@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); }
toolbar.addComponent(add); toolbar.addComponent(delete); toolbar.setVisible(table.isEditable());
@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; } });
private Component createComponent(AbstractVertex ref) { Preconditions.checkState(ref.getNodeID() != null, "no Node ID defined."); OnmsNode node = nodeDao.get(ref.getNodeID()); FormLayout formLayout = new FormLayout(); formLayout.setSpacing(false); formLayout.setMargin(false); formLayout.addComponent(createLabel("Node ID", "" + node.getId())); final HorizontalLayout nodeButtonLayout = new HorizontalLayout(); Button nodeButton = createButton(node.getLabel(), null, null, event -> new NodeInfoWindow(ref.getNodeID()).open()); nodeButton.setStyleName(BaseTheme.BUTTON_LINK); nodeButtonLayout.addComponent(nodeButton); nodeButtonLayout.setCaption("Node Label"); formLayout.addComponent(nodeButtonLayout); if (!Strings.isNullOrEmpty(node.getSysObjectId())) { formLayout.addComponent(createLabel("Enterprise OID", node.getSysObjectId())); } return formLayout; }