/** * 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); } }
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 void updateItemDescription() { String description = null; final Object itemId = getValue(); final Item item = getContainerDataSource().getItem(itemId); boolean isDescriptionBlank = true; if (item != null) { Property property = item.getItemProperty(descriptionPropertyName); if (property != null && property.getValue() != null) { description = property.getValue().toString(); } isDescriptionBlank = StringUtils.isBlank(description); descriptionLabel.setValue(isDescriptionBlank ? "" : description); } if (isDescriptionBlank) { mainLayout.removeStyleName("has-description"); } else { mainLayout.addStyleName("has-description"); } descriptionLabel.setVisible(!isDescriptionBlank); } }
HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSpacing(true); horizontalLayout.addStyleName("summary"); horizontalLayout.addStyleName(OnmsSeverity.MINOR.name().toLowerCase()); } else { if (i == 1) { horizontalLayout.addStyleName(OnmsSeverity.MINOR.name().toLowerCase()); } else { horizontalLayout.addStyleName(OnmsSeverity.MAJOR.name().toLowerCase());
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(); }
HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSpacing(true); horizontalLayout.addStyleName("summary"); horizontalLayout.addStyleName(onmsSeverity.name().toLowerCase());
/** * 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; }
layout.addStyleName("map-layout"); layout.addComponent(m_infoPanel); layout.addComponent(mapLayout);