protected Component createDefaultHeader() { return new HorizontalLayout(); }
protected Component createDefaultFooter() { return new HorizontalLayout(); }
@Override public Component initContent() { HorizontalLayout layout = new HorizontalLayout(); layout.addComponent(selectField); return layout; }
@Inject public DamFilePreviewComponent(String workspace, ComponentProvider componentProvider, AssetProviderRegistry assetProviderRegistry, DamAppConfiguration damAppConfig, SimpleTranslator i18n) { super(workspace); this.componentProvider = componentProvider; this.assetProviderRegistry = assetProviderRegistry; this.damAppConfig = damAppConfig; this.i18n = i18n; this.rootLayout = new HorizontalLayout(); setCompositionRoot(rootLayout); }
public BreadcrumbComponent() { final HorizontalLayout rootLayout = new HorizontalLayout(); rootLayout.setSpacing(true); setCompositionRoot(rootLayout); setId("breadcrumbs"); }
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 Component initContent() { HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); layout.setWidth("100%"); layout.addComponent(oidType); layout.addComponent(oidValue); layout.setExpandRatio(oidValue, 1); return layout; }
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; }
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; }
/** * 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 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; }
/** * 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 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; }
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); }
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); }
@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; } });
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(); }
HorizontalLayout contentLayout = new HorizontalLayout(progress, label); contentLayout.setSpacing(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(); }
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; }