List of usage examples for com.vaadin.ui TabSheet addTab
public Tab addTab(Component c, String caption, Resource icon)
From source file:br.gov.frameworkdemoiselle.vaadin.util.ViewNavigator.java
License:Open Source License
@SuppressWarnings("serial") private void navigate(final String caption, final TabSheet tabSheet, final BaseVaadinView view) { final Tab saved = tabSheet.addTab(view, caption, null); saved.setClosable(true);//from w w w.j a v a 2 s. c om saved.setIcon(view.getIcon()); tabSheet.setSelectedTab(view); beanManager.fireEvent(view, new AnnotationLiteral<BeforeNavigateToView>() { }); }
From source file:com.github.mjvesa.herd.HerdIDE.java
License:Apache License
private TabSheet constructFilesAndStatus() { TabSheet tabs = new TabSheet(); tabs.setSizeFull();/* w ww .j ava2 s . co m*/ tabs.addTab(constructFilesTab(), "Files", null); tabs.addTab(constructStatusTab(), "Status", null); return tabs; }
From source file:com.github.mjvesa.herd.HerdIDE.java
License:Apache License
private Component constructEditorAndLayout() { TabSheet ts = new TabSheet(); ts.setSizeFull();//w w w . j av a2 s. com ts.addTab(constructEditorTab(), "Editor", null); ts.addTab(constructOutputTab(), "Output", null); return ts; }
From source file:com.peergreen.webconsole.scope.system.internal.bundle.BundleView.java
License:Open Source License
@PostConstruct public void createView() { setMargin(true);/*ww w . j a v a 2 s .c o m*/ setSpacing(true); /* Page.Styles styles = Page.getCurrent().getStyles(); styles.add(".no-padding {padding: 0em 0em 0em 0em !important; }"); */ HorizontalLayout header = new HorizontalLayout(); // header.setWidth("100%"); header.setSpacing(true); header.setMargin(true); Label title = new Label("OSGi Bundles"); title.addStyleName("h1"); // title.setSizeUndefined(); header.addComponent(title); header.setComponentAlignment(title, Alignment.MIDDLE_LEFT); final TextField filter = new TextField(); filter.addTextChangeListener(new FieldEvents.TextChangeListener() { @Override public void textChange(final FieldEvents.TextChangeEvent event) { data.removeAllContainerFilters(); String trimmed = event.getText().trim(); Container.Filter or = new Or(new SimpleStringFilter(BUNDLE_ID_COLUMN, trimmed, true, false), new SimpleStringFilter(BUNDLE_NAME_COLUMN, trimmed, true, false), new SimpleStringFilter(BUNDLE_SYMBOLICNAME_COLUMN, trimmed, true, false), new SimpleStringFilter(VERSION_COLUMN, trimmed, true, false), new SimpleStringFilter(PRETTY_STATE_COLUMN, trimmed, true, false)); data.addContainerFilter(or); } }); filter.setInputPrompt("Filter"); filter.addShortcutListener(new ShortcutListener("Clear", ShortcutAction.KeyCode.ESCAPE, null) { @Override public void handleAction(Object sender, Object target) { filter.setValue(""); data.removeAllContainerFilters(); } }); header.addComponent(filter); header.setExpandRatio(filter, 1); header.setComponentAlignment(filter, Alignment.MIDDLE_LEFT); // Store the header in the vertical layout (this) addComponent(header); addComponent(tabSheet); table = new Table(); table.setContainerDataSource(data); table.setSizeFull(); table.setSortContainerPropertyId(BUNDLE_ID_COLUMN); table.setSortAscending(true); table.setImmediate(true); table.setColumnHeader(BUNDLE_ID_COLUMN, "Bundle ID"); table.setColumnHeader(PRETTY_NAME_COLUMN, "Bundle Name"); table.setColumnHeader(VERSION_COLUMN, "Version"); table.setColumnHeader(PRETTY_STATE_COLUMN, "State"); table.setColumnHeader("actions", "Actions"); table.setColumnWidth(BUNDLE_ID_COLUMN, 100); table.setColumnAlignment(BUNDLE_ID_COLUMN, Table.Align.CENTER); table.setColumnAlignment(PRETTY_STATE_COLUMN, Table.Align.CENTER); table.setColumnAlignment(VERSION_COLUMN, Table.Align.CENTER); table.addGeneratedColumn("actions", new Table.ColumnGenerator() { @Override public Object generateCell(final Table source, final Object itemId, final Object columnId) { HorizontalLayout layout = new HorizontalLayout(); BeanItem<BundleItem> item = (BeanItem<BundleItem>) source.getContainerDataSource().getItem(itemId); Bundle bundle = item.getBean().getBundle(); if (BundleHelper.isState(bundle, Bundle.INSTALLED) || BundleHelper.isState(bundle, Bundle.RESOLVED)) { Button changeState = new Button(); changeState.addClickListener(new StartBundleClickListener(bundle, notifierService)); //changeState.addStyleName("no-padding"); changeState.setCaption("Start"); //changeState.setIcon(new ClassResource(BundleViewer.class, "/images/go-next.png")); if (!securityManager.isUserInRole("admin")) { changeState.setDisableOnClick(true); } layout.addComponent(changeState); } if (BundleHelper.isState(bundle, Bundle.ACTIVE)) { Button changeState = new Button(); changeState.addClickListener(new StopBundleClickListener(bundle, notifierService)); //changeState.addStyleName("no-padding"); changeState.setCaption("Stop"); if (!securityManager.isUserInRole("admin")) { changeState.setDisableOnClick(true); } //changeState.setIcon(new ClassResource(BundleViewer.class, "/images/media-record.png")); layout.addComponent(changeState); } // Update Button update = new Button(); update.addClickListener(new UpdateBundleClickListener(bundle, notifierService)); //update.addStyleName("no-padding"); update.setCaption("Update"); if (!securityManager.isUserInRole("admin")) { update.setDisableOnClick(true); } //update.setIcon(new ClassResource(BundleViewer.class, "/images/view-refresh.png")); layout.addComponent(update); // Trash Button trash = new Button(); trash.addClickListener(new UninstallBundleClickListener(bundle, notifierService)); //trash.addStyleName("no-padding"); trash.setCaption("Delete"); if (!securityManager.isUserInRole("admin")) { trash.setDisableOnClick(true); } //trash.setIcon(new ClassResource(BundleViewer.class, "/images/user-trash-full.png")); layout.addComponent(trash); return layout; } }); table.setVisibleColumns(BUNDLE_ID_COLUMN, PRETTY_NAME_COLUMN, VERSION_COLUMN, PRETTY_STATE_COLUMN, "actions"); table.addItemClickListener(new ItemClickEvent.ItemClickListener() { @Override public void itemClick(final ItemClickEvent event) { if (event.isDoubleClick()) { BeanItem<BundleItem> item = (BeanItem<BundleItem>) table.getContainerDataSource() .getItem(event.getItemId()); Bundle bundle = item.getBean().getBundle(); showBundle(bundle); } } }); createBundleTracker(); tabSheet.setSizeFull(); selectedTabListener = new SelectedTabListener(uiContext.getViewNavigator()); selectedTabListener.addLocation(table, uiContext.getViewNavigator().getLocation(this.getClass().getName())); tabSheet.addSelectedTabChangeListener(selectedTabListener); tabSheet.addTab(table, "Bundles", new ClassResource(BundleView.class, "/images/22x22/user-home.png")); setExpandRatio(tabSheet, 1.5f); tabSheet.setCloseHandler(new TabSheet.CloseHandler() { @Override public void onTabClose(TabSheet tabsheet, Component tabContent) { for (Map.Entry<Long, Component> tab : openTabs.entrySet()) { if (tabContent.equals(tab.getValue())) { openTabs.remove(tab.getKey()); } } tabsheet.removeComponent(tabContent); selectedTabListener.removeLocation(tabContent); } }); }
From source file:de.mendelson.comm.as2.webclient2.TransactionDetailsDialog.java
private TabSheet createTabSheet() { TabSheet tabsheet = new TabSheet(); this.logPanel = this.createLogTab(); tabsheet.addTab(this.logPanel, "Log", null); this.rawMessageDecryptedPanel = this.createRawMessageDecryptedPanel(); tabsheet.addTab(rawMessageDecryptedPanel, "Raw message decrypted", null); this.messageHeaderPanel = this.createMessageHeaderPanel(); tabsheet.addTab(this.messageHeaderPanel, "Message header", null); this.payloadPanel = this.createPayloadPanel(); for (int i = 0; i < this.payloadPanel.length; i++) { String tabTitle = "Payload"; if (this.payloadPanel.length > 1) { tabTitle += " " + (i + 1); }/*from w w w.j a va 2 s. com*/ tabsheet.addTab(this.payloadPanel[i], tabTitle, null); } tabsheet.setSizeFull(); return (tabsheet); }
From source file:fr.univlorraine.mondossierweb.views.EtatCivilView.java
License:Apache License
/** * Initialise la vue/* ww w. j av a 2 s .c om*/ */ @PostConstruct public void init() { LOG.debug(userController.getCurrentUserName() + " EtatCivilView"); //On vrifie le droit d'accder la vue if (UI.getCurrent() instanceof MainUI && (userController.isEnseignant() || userController.isEtudiant())) { if (MainUI.getCurrent() != null && MainUI.getCurrent().getEtudiant() != null) { LOG.debug(userController.getCurrentUserName() + " init EtatCivilView"); /* Style */ setMargin(true); setSpacing(true); /* Titre */ Label title = new Label(applicationContext.getMessage(NAME + ".title", null, getLocale())); title.addStyleName(ValoTheme.LABEL_H1); addComponent(title); VerticalLayout globalLayout = new VerticalLayout(); globalLayout.setSizeFull(); globalLayout.setSpacing(true); //Layout avec les infos etatcivil et contact CssLayout idLayout = new CssLayout(); idLayout.setSizeFull(); idLayout.setStyleName("flexwrap"); globalLayout.addComponent(idLayout); // Enable Responsive CSS selectors for the layout Responsive.makeResponsive(idLayout); /* Generalites */ FormLayout formGeneralitesLayout = new FormLayout(); formGeneralitesLayout.setSpacing(true); formGeneralitesLayout.setMargin(true); Panel panelGeneralites = new Panel( applicationContext.getMessage(NAME + ".generalites.title", null, getLocale())); String captionNumDossier = applicationContext.getMessage(NAME + ".numdossier.title", null, getLocale()); Label fieldNumDossier = new Label(); formatLabel(fieldNumDossier, captionNumDossier, MainUI.getCurrent().getEtudiant().getCod_etu()); formGeneralitesLayout.addComponent(fieldNumDossier); String captionNNE = applicationContext.getMessage(NAME + ".nne.title", null, getLocale()); Label fieldNNE = new Label(); formatLabel(fieldNNE, captionNNE, MainUI.getCurrent().getEtudiant().getCod_nne()); formGeneralitesLayout.addComponent(fieldNNE); String captionNom = applicationContext.getMessage(NAME + ".nom.title", null, getLocale()); Label fieldNom = new Label(); formatLabel(fieldNom, captionNom, MainUI.getCurrent().getEtudiant().getNom()); formGeneralitesLayout.addComponent(fieldNom); String captionMail = applicationContext.getMessage(NAME + ".mail.title", null, getLocale()); Label mailLabel = new Label(); mailLabel.setCaption(captionMail); String mail = MainUI.getCurrent().getEtudiant().getEmail(); if (StringUtils.hasText(mail)) { mail = "<a href=\"mailto:" + mail + "\">" + mail + "</a>"; mailLabel.setValue(mail); mailLabel.setContentMode(ContentMode.HTML); } mailLabel.setSizeFull(); formGeneralitesLayout.addComponent(mailLabel); String captionNationalite = applicationContext.getMessage(NAME + ".nationalite.title", null, getLocale()); Label fieldNationalite = new Label(); formatLabel(fieldNationalite, captionNationalite, MainUI.getCurrent().getEtudiant().getNationalite()); formGeneralitesLayout.addComponent(fieldNationalite); String captionDateNaissance = applicationContext.getMessage(NAME + ".naissance.title", null, getLocale()); Label fieldDateNaissance = new Label(); formatLabel(fieldDateNaissance, captionDateNaissance, MainUI.getCurrent().getEtudiant().getDatenaissance()); formGeneralitesLayout.addComponent(fieldDateNaissance); String captionLieuNaissance = applicationContext.getMessage(NAME + ".lieunaissance.title", null, getLocale()); Label fieldLieuNaissance = new Label(); formatLabel(fieldLieuNaissance, captionLieuNaissance, MainUI.getCurrent().getEtudiant().getLieunaissance()); formGeneralitesLayout.addComponent(fieldLieuNaissance); String captionDepNaissance = applicationContext.getMessage(NAME + ".depnaissance.title", null, getLocale()); Label fieldDepNaissance = new Label(); formatLabel(fieldDepNaissance, captionDepNaissance, MainUI.getCurrent().getEtudiant().getDepartementnaissance()); formGeneralitesLayout.addComponent(fieldDepNaissance); panelGeneralites.setContent(formGeneralitesLayout); HorizontalLayout generalitesGlobalLayout = new HorizontalLayout(); generalitesGlobalLayout.setSizeUndefined(); generalitesGlobalLayout.setStyleName("firstitembox"); generalitesGlobalLayout.addComponent(panelGeneralites); generalitesGlobalLayout.setExpandRatio(panelGeneralites, 1); idLayout.addComponent(generalitesGlobalLayout); /* Bac */ Panel panelBac = new Panel(applicationContext.getMessage(NAME + ".bac.title", null, getLocale())); //Si plusieurs bac if (MainUI.getCurrent().getEtudiant().getListeBac() != null && MainUI.getCurrent().getEtudiant().getListeBac().size() > 1) { panelBac.setCaption(applicationContext.getMessage(NAME + ".bacs.title", null, getLocale())); TabSheet bacTabSheet = new TabSheet(); VerticalLayout vBacLayout = new VerticalLayout(); vBacLayout.setSizeFull(); bacTabSheet.setSizeFull(); bacTabSheet.addStyleName(ValoTheme.TABSHEET_FRAMED); for (BacEtatCivil bec : MainUI.getCurrent().getEtudiant().getListeBac()) { FormLayout tabBacLayout = new FormLayout(); tabBacLayout.setSizeFull(); tabBacLayout.setMargin(false); ajouterBacToView(tabBacLayout, bec); bacTabSheet.addTab(tabBacLayout, bec.getCod_bac(), FontAwesome.GRADUATION_CAP); } vBacLayout.addComponent(bacTabSheet); panelBac.setContent(vBacLayout); } else { //Si un seul bac FormLayout formBacLayout = new FormLayout(); formBacLayout.setSizeFull(); if (MainUI.getCurrent().getEtudiant().getListeBac() != null && MainUI.getCurrent().getEtudiant().getListeBac().size() == 1) { formBacLayout.setSpacing(true); formBacLayout.setMargin(true); ajouterBacToView(formBacLayout, MainUI.getCurrent().getEtudiant().getListeBac().get(0)); } panelBac.setContent(formBacLayout); } HorizontalLayout bacGlobalLayout = new HorizontalLayout(); bacGlobalLayout.setSizeUndefined(); bacGlobalLayout.setStyleName("itembox"); bacGlobalLayout.addComponent(panelBac); bacGlobalLayout.setExpandRatio(panelBac, 1); idLayout.addComponent(bacGlobalLayout); /* Info de contact */ panelContact = new Panel(applicationContext.getMessage(NAME + ".contact.title", null, getLocale())); renseignerPanelContact(); globalLayout.addComponent(panelContact); addComponent(globalLayout); } else { /* Erreur */ addComponent(new BasicErreurMessageLayout(applicationContext)); } } }
From source file:org.eclipse.hawkbit.ui.artifacts.smtable.SoftwareModuleDetails.java
License:Open Source License
@Override protected void addTabs(final TabSheet detailsTab) { detailsTab.addTab(createDetailsLayout(), getI18n().get("caption.tab.details"), null); detailsTab.addTab(createDescriptionLayout(), getI18n().get("caption.tab.description"), null); detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null); detailsTab.addTab(swmMetadataTable, getI18n().get("caption.metadata"), null); }
From source file:org.eclipse.hawkbit.ui.management.dstable.DistributionDetails.java
License:Open Source License
@Override protected void addTabs(final TabSheet detailsTab) { detailsTab.addTab(createDetailsLayout(), getI18n().get("caption.tab.details"), null); detailsTab.addTab(createDescriptionLayout(), getI18n().get("caption.tab.description"), null); detailsTab.addTab(createSoftwareModuleTab(), getI18n().get("caption.softwares.distdetail.tab"), null); detailsTab.addTab(createTagsLayout(), getI18n().get("caption.tags.tab"), null); detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null); detailsTab.addTab(dsMetadataTable, getI18n().get("caption.metadata"), null); }
From source file:org.metawidget.vaadin.ui.layout.TabSheetLayoutDecorator.java
License:LGPL
@Override protected ComponentContainer createSectionWidget(ComponentContainer previousSectionWidget, String section, Map<String, String> attributes, ComponentContainer container, VaadinMetawidget metawidget) { TabSheet tabSheet; // Whole new tabbed pane? if (previousSectionWidget == null) { tabSheet = new TabSheet(); tabSheet.setWidth("100%"); // Add to parent container Map<String, String> tabbedPaneAttributes = CollectionUtils.newHashMap(); tabbedPaneAttributes.put(LABEL, ""); tabbedPaneAttributes.put(LARGE, TRUE); getDelegate().layoutWidget(tabSheet, PROPERTY, tabbedPaneAttributes, container, metawidget); } else {//from w ww . ja va2 s . c om tabSheet = (TabSheet) previousSectionWidget.getParent(); } // New tab Panel tabPanel = new Panel(); // Tab name (possibly localized) String localizedSection = metawidget.getLocalizedKey(StringUtils.camelCase(section)); if (localizedSection == null) { localizedSection = section; } tabSheet.addTab(tabPanel, localizedSection, null); return tabPanel; }
From source file:org.opennms.features.topology.app.internal.TopologyWidgetTestApplication.java
License:Open Source License
/** * Gets a {@link TabSheet} view for all widgets in this manager. * /* ww w.j a v a2 s . c o m*/ * @return TabSheet */ private TabSheet getTabSheet(WidgetManager manager, WidgetContext widgetContext) { TabSheet tabSheet = new TabSheet(); tabSheet.setSizeFull(); for (IViewContribution viewContrib : manager.getWidgets()) { // Create a new view instance Component view = viewContrib.getView(widgetContext); try { m_selectionManager.addSelectionListener((SelectionListener) view); } catch (ClassCastException e) { } try { ((SelectionNotifier) view).addSelectionListener(m_selectionManager); } catch (ClassCastException e) { } if (viewContrib.getIcon() != null) { tabSheet.addTab(view, viewContrib.getTitle(), viewContrib.getIcon()); } else { tabSheet.addTab(view, viewContrib.getTitle()); } view.setSizeFull(); } return tabSheet; }