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 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; }
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; }
@Override public Component initContent() { HorizontalLayout layout = new HorizontalLayout(); layout.addComponent(selectField); return layout; }
/** * Adds the css style which ensures that the switcher comes with border on top and on bottom, if set true. * When set to false, the style gets removed. * @param withBorder */ public void withBorder(boolean withBorder){ if(withBorder){ mainLayout.addStyleName(cssSwitcherBorderClassname); }else{ mainLayout.removeStyleName(cssSwitcherBorderClassname); } }
/** * 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)); }
HorizontalLayout leftButtonGroup = new HorizontalLayout(); leftButtonGroup.setSpacing(true); leftButtonGroup.addComponent(createButton); leftButtonGroup.addComponent(collapseButton); leftButtonGroup.addComponent(expandButton); leftButtonGroup.setDefaultComponentAlignment(Alignment.TOP_LEFT); HorizontalLayout rightButtonGroup = new HorizontalLayout(); rightButtonGroup.setSpacing(true); rightButtonGroup.addComponent(filterTextField); rightButtonGroup.addComponent(clearFilterButton); rightButtonGroup.addComponent(refreshButton); rightButtonGroup.addComponent(reloadButton); rightButtonGroup.setDefaultComponentAlignment(Alignment.TOP_RIGHT); HorizontalLayout upperLayout = new HorizontalLayout(); upperLayout.setSpacing(true); 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; }
public BreadcrumbComponent() { final HorizontalLayout rootLayout = new HorizontalLayout(); rootLayout.setSpacing(true); setCompositionRoot(rootLayout); setId("breadcrumbs"); }
HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setWidth(100, Unit.PERCENTAGE); horizontalLayout.setSpacing(false); horizontalLayout.setPrimaryStyleName("v-caption-surveillance-view"); horizontalLayout.addComponent(new Label("Resource Graphs")); addComponent(horizontalLayout); HorizontalLayout selectionBoxesLayout = new HorizontalLayout(); selectionBoxesLayout.setSizeFull(); selectionBoxesLayout.addComponent(m_nodeSelect); selectionBoxesLayout.addComponent(m_resourceSelect); selectionBoxesLayout.addComponent(m_graphSelect);
HorizontalLayout horizontalLayout1= new HorizontalLayout(); horizontalLayout1.setWidth("100%"); horizontalLayout1.setDefaultComponentAlignment(Alignment.TOP_RIGHT); HorizontalLayout horizontalLayout2= new HorizontalLayout(); horizontalLayout1.addComponent(horizontalLayout2); Link link = new Link(name, urlResource); Label label= new Label(" ", ContentMode.HTML); // adds space between links horizontalLayout2.addComponent(link); horizontalLayout2.addComponent(label);
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); }
mapLayout.setSizeFull(); HorizontalLayout layout = new HorizontalLayout(); layout.addStyleName("map-layout"); layout.addComponent(m_infoPanel); layout.addComponent(mapLayout); layout.addComponent(m_toolbarPanel); layout.setExpandRatio(mapLayout, 1); layout.setSizeFull();
HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.addComponent(label); horizontalLayout.setWidth(100, Unit.PERCENTAGE); horizontalLayout.setComponentAlignment(label, Alignment.MIDDLE_LEFT);
/** * 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 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; } });
@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 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; }
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(); }
protected Component createDefaultHeader() { return new HorizontalLayout(); }