List of usage examples for com.vaadin.ui.themes ValoTheme TABSHEET_FRAMED
String TABSHEET_FRAMED
To view the source code for com.vaadin.ui.themes ValoTheme TABSHEET_FRAMED.
Click Source Link
From source file:fr.univlorraine.mondossierweb.views.EtatCivilView.java
License:Apache License
/** * Initialise la vue//from w w w .j a va2 s .com */ @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:gov.osti.doecode.RepositoryForm.java
/** * Create a basic form UI for editing software metadata information. * //from w ww. j a va 2s. co m * @param ui link to the MyUI parent UI */ public RepositoryForm(MyUI ui) { this.ui = ui; setSizeUndefined(); agentGrid.setColumns("firstName", "lastName", "email"); agentGrid.setHeightMode(HeightMode.ROW); agentGrid.setHeightByRows(8); idGrid.setColumns("relationType", "identifierType", "value"); idGrid.setHeightMode(HeightMode.ROW); idGrid.setHeightByRows(8); idForm = new IdentifierForm(this); agentForm = new AgentForm(this); TabSheet tabs = new TabSheet(); tabs.addStyleName(ValoTheme.TABSHEET_FRAMED); tabs.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR); addComponent(tabs); HorizontalLayout main = new HorizontalLayout(); main.setSpacing(true); main.setMargin(true); FormLayout left = new FormLayout(); FormLayout right = new FormLayout(); countryCode.addItems(countryCodes); left.addComponents(url, loadButton, name, openSource, siteOwnershipCode, acronym, doi, countryCode); right.addComponents(keywords, rights, license, operatingSystem, siteAccessionNumber, otherRequirements); loadButton.addClickListener(e -> { try { SoftwareRepository repo = Reader.loadRepository("doecode"); setSoftwareRepository(repo); } catch (IOException ex) { setComponentError(new UserError("Unable to load: " + ex.getMessage())); } }); main.addComponents(left, right); tabs.addTab(main, "Metadata"); Button agentAddButton = new Button("New"); agentAddButton.setStyleName(BaseTheme.BUTTON_LINK); agentAddButton.setIcon(FontAwesome.PLUS); agentAddButton.addClickListener(e -> { agentForm.setAgent(new Agent()); }); VerticalLayout innerAgent = new VerticalLayout(agentAddButton, agentGrid); innerAgent.setSizeUndefined(); HorizontalLayout agentLayout = new HorizontalLayout(innerAgent, agentForm); agentLayout.setSpacing(true); agentLayout.setMargin(true); tabs.addTab(agentLayout, "Agents"); Button idAddButton = new Button("New"); idAddButton.setIcon(FontAwesome.PLUS); idAddButton.setStyleName(BaseTheme.BUTTON_LINK); idAddButton.setSizeUndefined(); idAddButton.addClickListener(e -> { idForm.setIdentifier(new Identifier()); }); VerticalLayout innerId = new VerticalLayout(idAddButton, idGrid); HorizontalLayout idTab = new HorizontalLayout(innerId, idForm); idTab.setSpacing(true); idTab.setMargin(true); tabs.addTab(idTab, "Identifiers"); agentGrid.addSelectionListener(e -> { if (!e.getSelected().isEmpty()) { Agent agent = (Agent) e.getSelected().iterator().next(); agentForm.setAgent(agent); System.out.println("Selected " + agent.getFirstName()); } }); idGrid.addSelectionListener(e -> { if (!e.getSelected().isEmpty()) { Identifier identifier = (Identifier) e.getSelected().iterator().next(); idForm.setIdentifier(identifier); } }); }
From source file:life.qbic.components.qOfferManager.java
License:Open Source License
private void init() { DBManager.setCredentials();//from w ww . j av a 2 s.c om DBManager.getDatabaseInstance(); db = Database.Instance; managerTabs = new TabSheet(); /* System.out.println(ft.format(dNow) + " INFO Offer Manager accessed! - User: " + LiferayAndVaadinUtils.getUser().getScreenName());*/ managerTabs.addStyleName(ValoTheme.TABSHEET_FRAMED); managerTabs.addStyleName(ValoTheme.TABSHEET_EQUAL_WIDTH_TABS); final GridLayout gridLayout = new GridLayout(6, 6); gridLayout.setMargin(true); gridLayout.setSpacing(true); try { managerTabs.addTab(createOfferGeneratorTab(), "Offer Generator"); managerTabs.addTab(createOfferManagerTab(), "Offer Manager"); managerTabs.addTab(createPackageManagerTab(), "Package Manager"); managerTabs.setSelectedTab(1); // show the offer manager first, since this will probably be mostly in use // TODO: make this more elegant // if one changes the tab e.g. from the offer manager to the package manager, creates a new package and goes // back to the offer manager tab, the package won't be updated -> workaround: // since the selected offer in the offer manager grid won't requery the database for the information needed, we // deselect the current offer (if any has been selected), so the user has to select the offer again -> information // for the database is queried again and e.g. the newly created packages are shown properly) managerTabs.addSelectedTabChangeListener((TabSheet.SelectedTabChangeListener) event -> { OfferManagerTab.getOfferManagerGrid().deselectAll(); OfferManagerTab.getDetailsLayout().removeAllComponents(); }); } catch (SQLException e1) { e1.printStackTrace(); } try { gridLayout.addComponent(managerTabs, 0, 1, 5, 1); } catch (OverlapsException | OutOfBoundsException e) { e.printStackTrace(); } gridLayout.setSizeFull(); setCompositionRoot(gridLayout); }
From source file:main.ProjectwizardUI.java
License:Open Source License
@Override protected void init(VaadinRequest request) { tabs.addStyleName(ValoTheme.TABSHEET_FRAMED); VerticalLayout layout = new VerticalLayout(); // read in the configuration file config = ConfigurationManagerFactory.getInstance(); tmpFolder = config.getTmpFolder();/*from ww w.j av a 2s.c o m*/ MSLabelingMethods = config.getVocabularyMSLabeling(); layout.setMargin(true); setContent(layout); String userID = ""; boolean success = true; if (LiferayAndVaadinUtils.isLiferayPortlet()) { logger.info("Wizard " + version + " is running on Liferay and user is logged in."); userID = LiferayAndVaadinUtils.getUser().getScreenName(); } else { if (isDevelopment()) { logger.warn("Checks for local dev version successful. User is granted admin status."); userID = "admin"; isAdmin = true; } else { success = false; logger.info("User \"" + userID + "\" not found. Probably running on Liferay and not logged in."); layout.addComponent(new Label("User not found. Are you logged in?")); } } // establish connection to the OpenBIS API if (!isDevelopment() || !testMode) { try { logger.debug("trying to connect to openbis"); this.openbis = new OpenBisClient(config.getDataSourceUser(), config.getDataSourcePassword(), config.getDataSourceUrl()); this.openbis.login(); } catch (Exception e) { success = false; logger.error("User \"" + userID + "\" could not connect to openBIS and has been informed of this."); layout.addComponent(new Label( "Data Management System could not be reached. Please try again later or contact us.")); } } if (isDevelopment() && testMode) { logger.error("No connection to openBIS. Trying mock version for testing."); this.openbis = new OpenBisClientMock(config.getDataSourceUser(), config.getDataSourcePassword(), config.getDataSourceUrl()); layout.addComponent(new Label( "openBIS could not be reached. Resuming with mock version. Some options might be non-functional. Reload to retry.")); } if (success) { // stuff from openbis Map<String, String> taxMap = openbis.getVocabCodesAndLabelsForVocab("Q_NCBI_TAXONOMY"); Map<String, String> tissueMap = openbis.getVocabCodesAndLabelsForVocab("Q_PRIMARY_TISSUES"); Map<String, String> deviceMap = openbis.getVocabCodesAndLabelsForVocab("Q_MS_DEVICES"); Map<String, String> cellLinesMap = openbis.getVocabCodesAndLabelsForVocab("Q_CELL_LINES"); Map<String, String> enzymeMap = openbis.getVocabCodesAndLabelsForVocab("Q_DIGESTION_PROTEASES"); Map<String, String> chromTypes = openbis.getVocabCodesAndLabelsForVocab("Q_CHROMATOGRAPHY_TYPES"); List<String> sampleTypes = openbis.getVocabCodesForVocab("Q_SAMPLE_TYPES"); Map<String, String> purificationMethods = openbis .getVocabCodesAndLabelsForVocab("Q_PROTEIN_PURIFICATION_METHODS"); List<String> fractionationTypes = openbis.getVocabCodesForVocab("Q_MS_FRACTIONATION_PROTOCOLS"); List<String> enrichmentTypes = openbis.getVocabCodesForVocab("Q_MS_ENRICHMENT_PROTOCOLS"); Map<String, String> antibodiesWithLabels = openbis.getVocabCodesAndLabelsForVocab("Q_ANTIBODY"); List<String> msProtocols = openbis.getVocabCodesForVocab("Q_MS_PROTOCOLS"); List<String> lcmsMethods = openbis.getVocabCodesForVocab("Q_MS_LCMS_METHODS"); final List<String> spaces = openbis.getUserSpaces(userID); isAdmin = openbis.isUserAdmin(userID); // stuff from mysql database DBConfig mysqlConfig = new DBConfig(config.getMysqlHost(), config.getMysqlPort(), config.getMysqlDB(), config.getMysqlUser(), config.getMysqlPass()); DBManager dbm = new DBManager(mysqlConfig); Map<String, Integer> peopleMap = dbm.fetchPeople(); DBVocabularies vocabs = new DBVocabularies(taxMap, tissueMap, cellLinesMap, sampleTypes, spaces, peopleMap, expTypes, enzymeMap, antibodiesWithLabels, deviceMap, msProtocols, lcmsMethods, chromTypes, fractionationTypes, enrichmentTypes, purificationMethods); // initialize the View with sample types, spaces and the dictionaries of tissues and species initView(dbm, vocabs, userID); layout.addComponent(tabs); } if (LiferayAndVaadinUtils.isLiferayPortlet()) try { for (com.liferay.portal.model.Role r : LiferayAndVaadinUtils.getUser().getRoles()) if (r.getName().equals("Administrator")) {// TODO what other roles? layout.addComponent(new Label(version)); layout.addComponent(new Label("User: " + userID)); } } catch (Exception e) { success = false; layout.addComponent(new Label("Unkown user. Are you logged in?")); } else { layout.addComponent(new Label(version)); layout.addComponent(new Label("User: " + userID)); } }
From source file:org.eclipse.hawkbit.ui.components.SPUITabSheet.java
License:Open Source License
/** * Decorate. */ private void decorate() { addStyleName(ValoTheme.TABSHEET_COMPACT_TABBAR); addStyleName(ValoTheme.TABSHEET_FRAMED); }
From source file:org.jumpmind.metl.ui.common.TabbedPanel.java
License:Open Source License
public TabbedPanel() { setSizeFull();// w w w . ja va 2 s . co m addStyleName(ValoTheme.TABSHEET_FRAMED); addSelectedTabChangeListener((event) -> { Component selected = event.getTabSheet().getSelectedTab(); if (selectedTab != null) { selectedTab.deselected(); selectedTab = null; } if (selected instanceof IUiPanel) { selectedTab = ((IUiPanel) selected); selectedTab.selected(); } String id = contentToId.get(selectedTab); if (id != null && !closing) { selectedOrder.add(id); } }); setCloseHandler((tabsheet, tabContent) -> close(tabContent)); ContextMenu menu = new ContextMenu(this, true); menu.addItem("Close", (selectedItem) -> close()); menu.addItem("Close Others", (selectedItem) -> closeOthers()); menu.addItem("Close To the Left", (selectedItem) -> closeToTheLeft()); menu.addItem("Close To the Right", (selectedItem) -> closeToTheRight()); menu.addSeparator(); menu.addItem("Close All", (selectedItem) -> closeAll()); }
From source file:org.jumpmind.vaadin.ui.common.CommonUiUtils.java
License:Open Source License
public static void styleTabSheet(TabSheet tabSheet) { tabSheet.setSizeFull();/*from w ww. ja va 2 s . co m*/ tabSheet.addStyleName(ValoTheme.TABSHEET_FRAMED); tabSheet.addStyleName(ValoTheme.TABSHEET_COMPACT_TABBAR); tabSheet.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR); }
From source file:org.jumpmind.vaadin.ui.common.TabbedApplicationPanel.java
License:Open Source License
public TabbedApplicationPanel() { setSizeFull();// w w w. j a v a 2 s . co m addStyleName(ValoTheme.TABSHEET_FRAMED); addStyleName(ValoTheme.TABSHEET_COMPACT_TABBAR); addSelectedTabChangeListener(new SelectedTabChangeListener() { private static final long serialVersionUID = 1L; @Override public void selectedTabChange(SelectedTabChangeEvent event) { Component selected = event.getTabSheet().getSelectedTab(); if (selected instanceof IUiPanel) { ((IUiPanel) selected).selected(); } } }); setCloseHandler(new CloseHandler() { private static final long serialVersionUID = 1L; @Override public void onTabClose(TabSheet tabsheet, Component tabContent) { if (tabContent instanceof IUiPanel) { if (((IUiPanel) tabContent).closing()) { tabsheet.removeComponent(tabContent); } } else { tabsheet.removeComponent(tabContent); } } }); }
From source file:org.opencms.workplace.tools.git.ui.CmsGitToolOptionsPanel.java
License:Open Source License
/** * Creates a new instance.<p>//ww w. j ava 2 s . c o m * * @param checkinBean the bean to be used for the check-in operation. */ public CmsGitToolOptionsPanel(CmsGitCheckin checkinBean) { m_checkinBean = checkinBean; if (!checkinBean.hasValidConfiguration()) { setMargin(true); Label errorLabel = new Label(CmsVaadinUtils.getMessageText(Messages.GUI_GIT_APP_UNCONFIGURED_0)); errorLabel.setContentMode(ContentMode.HTML); addComponent(errorLabel); return; } CmsVaadinUtils.readAndLocalizeDesign(this, CmsVaadinUtils.getWpMessagesForCurrentLocale(), null); configureConfigurationSelector(); updateForNewConfiguration(m_checkinBean.getCurrentConfiguration()); m_user = A_CmsUI.getCmsObject().getRequestContext().getCurrentUser(); restoreFieldsFromUserInfo(); setAdvancedVisible(false); m_toggleOptions.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; public void buttonClick(ClickEvent event) { setAdvancedVisible(!m_advancedVisible); } }); m_okButton.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; @SuppressWarnings("synthetic-access") public void buttonClick(ClickEvent event) { if (m_dialogTab == DialogTab.checkIn) { runAction(ActionType.checkIn); } else { runAction(ActionType.checkOut); } } }); m_cancel.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; public void buttonClick(ClickEvent event) { A_CmsUI.get().getPage().setLocation(CmsVaadinUtils.getWorkplaceLink()); } }); m_deselectAll.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; public void buttonClick(ClickEvent event) { for (Map.Entry<String, CheckBox> entry : m_moduleCheckboxes.entrySet()) { CheckBox checkBox = entry.getValue(); checkBox.setValue(Boolean.FALSE); } } }); m_tabs.addStyleName(ValoTheme.TABSHEET_FRAMED); m_tabs.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR); m_tabs.addSelectedTabChangeListener(new SelectedTabChangeListener() { private static final long serialVersionUID = 1L; @SuppressWarnings("synthetic-access") public void selectedTabChange(SelectedTabChangeEvent event) { DialogTab tab; if (m_tabs.getSelectedTab() == m_checkoutTab) { tab = DialogTab.checkOut; } else { tab = DialogTab.checkIn; } CmsGitToolOptionsPanel.this.setTab(tab); } }); m_fetchAndReset.setValue(Boolean.TRUE); setTab(m_dialogTab); }
From source file:qbic.vaadincomponents.InputFilesComponent.java
License:Open Source License
public InputFilesComponent() { this.setCaption(String.format("<font color=#FF0000> Select input file(s) </font>")); this.setCaptionAsHtml(true); inputFileForm.setHeight(100.0f, Unit.PERCENTAGE); inputFileForm.addStyleName(ValoTheme.TABSHEET_FRAMED); inputFileForm.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR); setCompositionRoot(inputFileForm);//w w w .ja v a 2 s. c om }