List of usage examples for com.vaadin.ui TabSheet setHeight
@Override public void setHeight(String height)
From source file:com.m4gik.views.component.LibraryScreen.java
/** * @param audioFile/*from ww w . ja v a 2s. com*/ * @return */ private CssLayout addDetails(AudioFile audioFile) { CssLayout details = new CssLayout(); details.setWidth("100%"); Label title = new Label("<h3>" + audioFile.getArtist() + "–" + audioFile.getTitle() + "</h3>", ContentMode.HTML); details.addComponent(title); title.setSizeUndefined(); TabSheet tabs = new TabSheet(); tabs.addStyleName(Runo.TABSHEET_SMALL); tabs.setWidth("100%"); tabs.setHeight("180px"); details.addComponent(tabs); FormLayout formLayout = new FormLayout(); tabs.addTab(formLayout, "Info"); Label text = new Label(audioFile.getTitle()); text.setCaption("Title:"); formLayout.addComponent(text); text = new Label(audioFile.getArtist()); text.setCaption("Artist:"); formLayout.addComponent(text); text = new Label(audioFile.getAlbum()); text.setCaption("Album:"); formLayout.addComponent(text); text = new Label(audioFile.getGenre()); text.setCaption("Genre:"); formLayout.addComponent(text); text = new Label(audioFile.getPrice() + "$"); text.setCaption("Price"); formLayout.addComponent(text); formLayout = new FormLayout(); tabs.addTab(formLayout, "Decription"); text = new Label(audioFile.getAbout()); formLayout.addComponent(text); formLayout = new FormLayout(); tabs.addTab(formLayout, "Lyrics"); text = new Label(audioFile.getLyrics()); formLayout.addComponent(text); return details; }
From source file:de.catma.ui.tabbedview.TabbedView.java
License:Open Source License
public void onTabClose(TabSheet tabsheet, Component tabContent) { tabsheet.removeComponent(tabContent); ((ClosableTab) tabContent).close();//from w w w .ja v a 2s . co m if (tabsheet.getComponentCount() == 0) { //setVisible(false) doesn't work here because of out of sync errors tabSheet.hideTabs(true); tabSheet.setHeight("0px"); addComponent(noOpenTabsLabel, 0); noOpenTabsLabel.setVisible(true); setMargin(true); } }
From source file:dhbw.clippinggorilla.userinterface.windows.PreferencesWindow.java
public PreferencesWindow(User user) { //setHeight("480px"); //setWidth("720px"); VerticalLayout windowContent = new VerticalLayout(); windowContent.setWidth("100%"); windowContent.setHeight("100%"); windowContent.setMargin(new MarginInfo(true, false, false, false)); TabSheet preferencesCategories = new TabSheet(); preferencesCategories.setWidth("100%"); preferencesCategories.setHeight("100%"); preferencesCategories.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR); preferencesCategories.addStyleName(ValoTheme.TABSHEET_ICONS_ON_TOP); preferencesCategories.addStyleName(ValoTheme.TABSHEET_CENTERED_TABS); windowContent.addComponent(preferencesCategories); windowContent.setExpandRatio(preferencesCategories, 1f); preferencesCategories.addComponent(buildUserTab(user)); preferencesCategories.addComponent(buildClippingsTab(user)); preferencesCategories.addComponent(buildSupportTab(user)); preferencesCategories.setSelectedTab(0); windowContent.addComponent(buildFooter(user)); setContent(windowContent);//from w ww. ja v a 2 s. c om setModal(true); addCloseShortcut(KeyCode.ENTER, null); setResizable(false); setClosable(false); setHeight("480px"); setWidth("720px"); }
From source file:org.apache.ace.webui.vaadin.EditWindow.java
License:Apache License
/** * @param object//from w ww . j a v a 2 s. c o m * @param factories */ protected void initDialog(final NamedObject object, List<UIExtensionFactory> factories) { VerticalLayout fields = new VerticalLayout(); fields.setSpacing(true); fields.addComponent(m_name); fields.addComponent(m_description); TabSheet tabs = new TabSheet(); tabs.setHeight("350px"); tabs.setWidth("100%"); tabs.setVisible(!factories.isEmpty()); Map<String, Object> context = new HashMap<>(); context.put("object", object); populateContext(context); for (UIExtensionFactory factory : factories) { try { tabs.addTab(factory.create(context)); } catch (Throwable ex) { // We ignore extension factories that throw exceptions // TODO: log this or something ex.printStackTrace(); } } Button okButton = new Button("Ok", new Button.ClickListener() { public void buttonClick(ClickEvent event) { try { onOk((String) m_name.getValue(), (String) m_description.getValue()); close(); } catch (Exception e) { handleError(e); } } }); // Allow enter to be used to close this dialog with enter directly... okButton.setClickShortcut(KeyCode.ENTER); okButton.addStyleName("primary"); Button cancelButton = new Button("Cancel", new Button.ClickListener() { public void buttonClick(ClickEvent event) { close(); } }); cancelButton.setClickShortcut(KeyCode.ESCAPE); HorizontalLayout buttonBar = new HorizontalLayout(); buttonBar.setSpacing(true); buttonBar.addComponent(okButton); buttonBar.addComponent(cancelButton); VerticalLayout layout = (VerticalLayout) getContent(); layout.setMargin(true); layout.setSpacing(true); layout.addComponent(fields); layout.addComponent(tabs); layout.addComponent(buttonBar); // The components added to the window are actually added to the window's // layout; you can use either. Alignments are set using the layout layout.setComponentAlignment(buttonBar, Alignment.BOTTOM_RIGHT); m_name.focus(); }
From source file:org.apache.tamaya.ui.views.ConfigView.java
License:Apache License
public ConfigView() { Label caption = new Label("Raw Configuration"); Label description = new Label( "This view shows the overall <b>raw</b> configuration configArea. Dependening on your access rights you" + "may see partial or masked data. Similarly configuration can be <i>read-only</i> or <i>mutable</i>.", ContentMode.HTML);/*from www. j av a 2s . c o m*/ TabSheet tabPane = new TabSheet(); tabPane.setHeight("100%"); tabPane.setWidth("100%"); tabPane.addTab(createConfigTab(), "Configuration"); tabPane.addTab(createEnvTab(), "Environment Properties"); tabPane.addTab(createSysPropsTab(), "System Properties"); tabPane.addTab(createRuntimeTab(), "Runtime Properties"); addComponents(caption, description, tabPane); caption.addStyleName(UIConstants.LABEL_HUGE); description.addStyleName(UIConstants.LABEL_LARGE); }
From source file:org.apache.usergrid.chop.webapp.view.main.MainView.java
License:Apache License
private VerticalLayout addTabSheet() { VerticalLayout tabLayout = new VerticalLayout(); TabSheet tabSheet = new TabSheet(); tabSheet.setHeight("100%"); tabSheetManager = new TabSheetManager(tabSheet); tabLayout.addComponent(tabSheet);//from w w w . ja v a2s .c o m return tabLayout; }