@Override public Component createLayout(TabbedLayoutDefinition definition, Map<String, Component> mappings) { TabSheet tabSheetComponent = new TabSheet(); tabSheetComponent.addStyleName(ValoTheme.TABSHEET_FRAMED); tabSheetComponent.setSizeFull(); if (definition.getTabs().size() == 1) { tabSheetComponent.addStyleName("single-tab"); } definition.getTabs().forEach(tabDefinition -> { FormLayout formSection = new FormLayout(); formSection.setMargin(true); formSection.setSizeFull(); tabDefinition.getFields().forEach(field -> { final Component fieldComponent = mappings.get(field.getName()); if (fieldComponent != null) { formSection.addComponent(fieldComponent); // TODO formSection.setComponentHelpDescription(fieldComponent, fieldComponent.getDescription()); } else { log.warn(String.format("Could not retrieve component field named %s from mappings", field.getName())); } }); tabSheetComponent.addTab(formSection, StringUtils.defaultIfBlank(tabDefinition.getLabel(), tabDefinition.getName())); }); return tabSheetComponent; } }
@Override public void init(VaadinRequest request) { if (dataCollectionDao == null) throw new RuntimeException("dataCollectionDao cannot be null."); TabSheet tabs = new TabSheet(); tabs.addStyleName("light"); tabs.setSizeFull(); tabs.addTab(new SnmpCollectionPanel(dataCollectionDao, new SimpleLogger())); tabs.addTab(new DataCollectionGroupAdminPanel(dataCollectionDao)); setContent(tabs); } }
@Override public void init(VaadinRequest request) { if (dataCollectionDao == null) throw new RuntimeException("dataCollectionDao cannot be null."); TabSheet tabs = new TabSheet(); tabs.addStyleName("light"); tabs.setSizeFull(); tabs.addTab(new SnmpCollectionPanel(dataCollectionDao, new SimpleLogger())); tabs.addTab(new DataCollectionGroupAdminPanel(dataCollectionDao)); setContent(tabs); } }
tabSheet.addStyleName(Reindeer.TABSHEET_BORDERLESS);
tabSheet.addStyleName(Reindeer.TABSHEET_BORDERLESS);
protected void createComponents() { caption = createHeaderCaption(); caption.setImmediate(true); caption.setContentMode(ContentMode.HTML); caption.setId(getDetailsHeaderCaptionId()); editButton = SPUIComponentProvider.getButton("", "", i18n.getMessage(UIMessageIdProvider.TOOLTIP_UPDATE), null, false, FontAwesome.PENCIL_SQUARE_O, SPUIButtonStyleNoBorder.class); editButton.setId(getEditButtonId()); editButton.addClickListener(this::onEdit); editButton.setEnabled(false); manageMetadataBtn = SPUIComponentProvider.getButton("", "", i18n.getMessage(UIMessageIdProvider.TOOLTIP_METADATA_ICON), null, false, FontAwesome.LIST_ALT, SPUIButtonStyleNoBorder.class); manageMetadataBtn.setId(getMetadataButtonId()); manageMetadataBtn.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_METADATA_ICON)); manageMetadataBtn.addClickListener(this::showMetadata); manageMetadataBtn.setEnabled(false); detailsTab = SPUIComponentProvider.getDetailsTabSheet(); detailsTab.setImmediate(true); detailsTab.setWidth(98, Unit.PERCENTAGE); detailsTab.setHeight(90, Unit.PERCENTAGE); detailsTab.addStyleName(SPUIStyleDefinitions.DETAILS_LAYOUT_STYLE); detailsTab.setId(getTabSheetId()); }
protected void createComponents() { caption = createHeaderCaption(); caption.setImmediate(true); caption.setContentMode(ContentMode.HTML); caption.setId(getDetailsHeaderCaptionId()); editButton = SPUIComponentProvider.getButton("", "", i18n.getMessage(UIMessageIdProvider.TOOLTIP_UPDATE), null, false, FontAwesome.PENCIL_SQUARE_O, SPUIButtonStyleNoBorder.class); editButton.setId(getEditButtonId()); editButton.addClickListener(this::onEdit); editButton.setEnabled(false); manageMetadataBtn = SPUIComponentProvider.getButton("", "", i18n.getMessage(UIMessageIdProvider.TOOLTIP_METADATA_ICON), null, false, FontAwesome.LIST_ALT, SPUIButtonStyleNoBorder.class); manageMetadataBtn.setId(getMetadataButtonId()); manageMetadataBtn.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_METADATA_ICON)); manageMetadataBtn.addClickListener(this::showMetadata); manageMetadataBtn.setEnabled(false); detailsTab = SPUIComponentProvider.getDetailsTabSheet(); detailsTab.setImmediate(true); detailsTab.setWidth(98, Unit.PERCENTAGE); detailsTab.setHeight(90, Unit.PERCENTAGE); detailsTab.addStyleName(SPUIStyleDefinitions.DETAILS_LAYOUT_STYLE); detailsTab.setId(getTabSheetId()); }
tabs.addStyleName("light"); tabs.setSizeFull(); tabs.addTab(resourceTypes, "Resource Types");
tabs.addStyleName("light"); tabs.setSizeFull(); tabs.addTab(resourceTypes, "Resource Types");