/** * Adds a new tab into TabSheet. Component caption and icon are copied to * the tab metadata at creation time. * * @see #addTab(Component) * * @param c * the component to be added. */ @Override public void addComponent(Component c) { addTab(c); }
/** * Adds a new tab into TabSheet. * * The first tab added to a tab sheet is automatically selected and a tab * selection event is fired. * * If the component is already present in the tab sheet, changes its caption * and returns the corresponding (old) tab, preserving other tab metadata. * * @param c * the component to be added onto tab - should not be null. * @param caption * the caption to be set for the component and used rendered in * tab bar * @return the created {@link Tab} */ public Tab addTab(Component c, String caption) { return addTab(c, caption, null); }
/** * Adds a new tab into TabSheet. Component caption and icon are copied to * the tab metadata at creation time. * * If the tab sheet already contains the component, its tab is returned. * * @param c * the component to be added onto tab - should not be null. * @return the created {@link Tab} */ public Tab addTab(Component c) { return addTab(c, components.size()); }
/** * Adds a new tab into TabSheet. * * The first tab added to a tab sheet is automatically selected and a tab * selection event is fired. * * If the component is already present in the tab sheet, changes its caption * and icon and returns the corresponding (old) tab, preserving other tab * metadata. * * @param c * the component to be added onto tab - should not be null. * @param caption * the caption to be set for the component and used rendered in * tab bar * @param icon * the icon to be set for the component and used rendered in tab * bar * @return the created {@link Tab} */ public Tab addTab(Component c, String caption, Resource icon) { return addTab(c, caption, icon, components.size()); }
/** * Adds a new tab into TabSheet. Component caption and icon are copied to * the tab metadata at creation time. * * If the tab sheet already contains the component, its tab is returned. * * @param component * the component to be added onto tab - should not be null. * @param position * The position where the tab should be added * @return the created {@link Tab} */ public Tab addTab(Component component, int position) { Tab result = tabs.get(component); if (result == null) { result = addTab(component, component.getCaption(), component.getIcon(), position); } return result; }
/** * Moves all components from another container to this container. The * components are removed from the other container. * * If the source container is a {@link TabSheet}, component captions and * icons are copied from it. * * @param source * the container components are removed from. */ @Override public void moveComponentsFrom(ComponentContainer source) { for (final Iterator<Component> i = source.getComponentIterator(); i .hasNext();) { final Component c = i.next(); String caption = null; Resource icon = null; String iconAltText = ""; if (TabSheet.class.isAssignableFrom(source.getClass())) { Tab tab = ((TabSheet) source).getTab(c); caption = tab.getCaption(); icon = tab.getIcon(); iconAltText = tab.getIconAlternateText(); } source.removeComponent(c); Tab tab = addTab(c, caption, icon); tab.setIconAlternateText(iconAltText); } }
/** * Sets the visibility of the Swatches tab. * * @param visible * The visibility of the Swatches tab */ public void setSwatchesTabVisible(boolean visible) { if (visible && !isTabVisible(swatchesTab)) { tabs.addTab(swatchesTab, "Swatches", null); checkIfTabsNeeded(); } else if (!visible && isTabVisible(swatchesTab)) { tabs.removeComponent(swatchesTab); checkIfTabsNeeded(); } }
/** * Sets the RGB tab visibility. * * @param visible * The visibility of the RGB tab */ public void setRGBTabVisible(boolean visible) { if (visible && !isTabVisible(rgbTab)) { tabs.addTab(rgbTab, "RGB", null); checkIfTabsNeeded(); } else if (!visible && isTabVisible(rgbTab)) { tabs.removeComponent(rgbTab); checkIfTabsNeeded(); } }
/** * Sets the HSV tab visibility. * * @param visible * The visibility of the HSV tab */ public void setHSVTabVisible(boolean visible) { if (visible && !isTabVisible(hsvTab)) { tabs.addTab(hsvTab, "HSV", null); checkIfTabsNeeded(); } else if (!visible && isTabVisible(hsvTab)) { tabs.removeComponent(hsvTab); checkIfTabsNeeded(); } }
newTab = addTab(newComponent, oldLocation);
/** * This is used a workaround for NMS-7560. */ protected void togglePlusTab() { removeComponent(m_plusTab); super.addTab(m_plusTab, m_plusTab.getCaption(), null); }
@Override public void createRow(final UiVaadin c) { tabIndex .add(c); //String name = c.getName(); Component editor = c.createEditor(); DataSource ds = getForm().getDataSource(); String caption = c.getCaption(ds); layout.addTab(editor, caption); }
final TabSheet tabSheet = new TabSheet(); Button button = new Button("Add the tab"); button.addListener(new Button.ClickListener(){ public void buttonClick(ClickEvent event) { VerticalLayout content = new VerticalLayout(); content.addComponent(new Label("This is the tab content.")); Tab tab = tabSheet.addTab(content, "The new Tab", null); } }
@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); } }
Tab tab = this.addTab(child); if (attr.hasKey("visible")) { tab.setVisible(DesignAttributeHandler.readAttribute("visible", attr,
private final void addDetailsTab() { getDetailsTab().addTab(getDetailsLayout(), getI18n().getMessage("caption.tab.details"), null); getDetailsTab().addTab(getDescriptionLayout(), getI18n().getMessage("caption.tab.description"), null); getDetailsTab().addTab(softwareModuleTab, getI18n().getMessage("caption.softwares.distdetail.tab"), null); getDetailsTab().addTab(getTagsLayout(), getI18n().getMessage("caption.tags.tab"), null); getDetailsTab().addTab(getLogLayout(), getI18n().getMessage("caption.logs.tab"), null); getDetailsTab().addTab(dsMetadataTable, getI18n().getMessage("caption.metadata"), null); }
private final void addDetailsTab() { getDetailsTab().addTab(getDetailsLayout(), getI18n().getMessage("caption.tab.details"), null); getDetailsTab().addTab(getDescriptionLayout(), getI18n().getMessage("caption.tab.description"), null); getDetailsTab().addTab(getLogLayout(), getI18n().getMessage("caption.logs.tab"), null); getDetailsTab().addTab(swmMetadataTable, getI18n().getMessage("caption.metadata"), null); }
private final void addDetailsTab() { getDetailsTab().addTab(getDetailsLayout(), getI18n().getMessage("caption.tab.details"), null); getDetailsTab().addTab(getDescriptionLayout(), getI18n().getMessage("caption.tab.description"), null); getDetailsTab().addTab(getAttributesLayout(), getI18n().getMessage("caption.attributes.tab"), null); getDetailsTab().addTab(createAssignedDistLayout(), getI18n().getMessage("header.target.assigned"), null); getDetailsTab().addTab(createInstalledDistLayout(), getI18n().getMessage("header.target.installed"), null); getDetailsTab().addTab(getTagsLayout(), getI18n().getMessage("caption.tags.tab"), null); getDetailsTab().addTab(getLogLayout(), getI18n().getMessage("caption.logs.tab"), null); getDetailsTab().addTab(targetMetadataTable, getI18n().getMessage("caption.metadata"), null); }
@Override public void modelChanged(Mbean newModel) { tabSheet.removeAllComponents(); int no = 1; for (CompAttrib attrib : newModel.getCompAttrib()) { final String tabLabel = String.format("#%d %s", no++, attrib.getName()); final CompositeTabLayout tabContent = new CompositeTabLayout(getCompositeForm(newModel, attrib), getCompAttribTable(newModel, attrib)); tabSheet.addTab(tabContent, tabLabel); } }