public void addResultsTab(Component resultComponent, String title, Resource icon, int position) { Tab tab = resultsTabs.addTab(resultComponent, title, icon, position); tab.setClosable(true); resultsTabs.setSelectedTab(tab.getComponent()); if (errorTab != null) { resultsTabs.removeTab(errorTab); errorTab = null; } if (maxNumberOfResultTabs > 0 && resultsTabs.getComponentCount() > maxNumberOfResultTabs) { resultsTabs.removeTab(resultsTabs.getTab(resultsTabs.getComponentCount() - 1)); } if (icon == FontAwesome.STOP) { errorTab = tab; } }
@Override public void onClick(UIApplication<?> application) { if (IUnoVaadinApplication.class.isAssignableFrom(application.getConcreteApplicationClass())) { final IUnoVaadinApplication vaadinApp = (IUnoVaadinApplication) application.getConcreteApplication(); @SuppressWarnings("unchecked") final Component windowComponent = vaadinComponentManager.getComponent(this, (UIApplication<IUnoVaadinApplication>) application); final Tab tab = vaadinApp.getMainTabSheet().addTab(windowComponent, "Tasks"); tab.setClosable(true); vaadinApp.getMainTabSheet().addListener(new ComponentDetachListener() { private static final long serialVersionUID = 703653779132116478L; @Override public void componentDetachedFromContainer(ComponentDetachEvent event) { if (event.getDetachedComponent() == windowComponent) { vaadinComponentManager.disposeComponent(UsertaskNotification.this); vaadinApp.getMainTabSheet().removeListener(this); } } }); vaadinApp.getMainTabSheet().setSelectedTab(tab); } else { application.showMessage(MessageType.WARNING, "User task graphical user interface not ready for actual user interface"); } }
private void buildComponents() { userPresenter = PresenterResolver.getPresenter(UserPresenter.class); groupTab.addTab(userPresenter.getView(), UserUIContext.getMessage(UserI18nEnum.LIST)); rolePresenter = PresenterResolver.getPresenter(RolePresenter.class); groupTab.addTab(rolePresenter.getView(), UserUIContext.getMessage(RoleI18nEnum.LIST)); groupTab.addSelectedTabChangeListener(new SelectedTabChangeListener() { private static final long serialVersionUID = 1L; @Override public void selectedTabChange(SelectedTabChangeEvent event) { Tab tab = ((TabSheetDecorator) event.getTabSheet()).getSelectedTabInfo(); String caption = tab.getCaption(); if (UserUIContext.getMessage(UserI18nEnum.LIST).equals(caption)) { userPresenter.go(UserPermissionManagementViewImpl.this, null); } else if (UserUIContext.getMessage(RoleI18nEnum.LIST).equals(caption)) { rolePresenter.go(UserPermissionManagementViewImpl.this, null); } } }); }
private void buildComponents() { settingTab.addTab(constructNotificationSettingView(), "notification", "Notifications"); settingTab.addTab(constructCustomLayoutView(), "customlayout", "Custom Layouts"); settingTab.addSelectedTabChangeListener(new SelectedTabChangeListener() { private static final long serialVersionUID = 1L; @Override public void selectedTabChange(SelectedTabChangeEvent event) { Tab tab = ((VerticalTabsheet) event.getSource()).getSelectedTab(); String tabId = ((TabImpl) tab).getTabId(); if ("notification".equals(tabId)) { notificationPresenter.go(CrmSettingContainer.this, new NotificationSettingScreenData.Read()); } else if ("customlayout".equals(tabId)) { customViewPresenter.go(CrmSettingContainer.this, new CustomViewScreenData.Read()); } } }); }
private void buildComponents() { activityTabs.addTab(constructCalendarView(), "calendar", UserUIContext.getMessage(ActivityI18nEnum.TAB_CALENDAR_TITLE), new ExternalResource(StorageUtils.generateAssetRelativeLink("icons/22/crm/calendar.png"))); activityTabs.addTab(constructActivityListView(), "activities", UserUIContext.getMessage(ActivityI18nEnum.TAB_ACTIVITY_TITLE), new ExternalResource(StorageUtils.generateAssetRelativeLink("icons/22/crm/activitylist.png"))); activityTabs.addSelectedTabChangeListener(selectedTabChangeEvent -> { Tab tab = ((VerticalTabsheet) selectedTabChangeEvent.getSource()).getSelectedTab(); String caption = tab.getCaption(); if (UserUIContext.getMessage(ActivityI18nEnum.TAB_CALENDAR_TITLE).equals(caption)) { calendarPresenter.go(ActivityRootView.this, new ActivityScreenData.GotoCalendar()); } else if (UserUIContext.getMessage(ActivityI18nEnum.TAB_ACTIVITY_TITLE).equals(caption)) { ActivitySearchCriteria criteria = new ActivitySearchCriteria(); criteria.setSaccountid(new NumberSearchField(AppUI.getAccountId())); eventPresenter.go(ActivityRootView.this, new ActivityScreenData.GotoActivityList(criteria)); } }); }
public Component selectTab(String viewId) { Tab tab = compMap.get(viewId); Button btn = getButtonById(viewId); if (btn != null) { selectedButton = btn; clearTabSelection(true); selectedButton.addStyleName(TAB_SELECTED_STYLENAME); selectedComp = tab; tabContainer.removeAllComponents(); Component tabComponent = tab.getComponent(); tabContainer.addComponent(tabComponent); tabContainer.setExpandRatio(tabComponent, 1.0f); return tabComponent; } else { return null; } }
@Override protected void setCompositionRoot(Component compositionRoot) { if (mainTab != null && mainTab.getComponent().equals(compositionRoot)) { // Already set, just update selected tab index. tabSheet.setSelectedTab(0); return; } final Tab newTab = tabSheet.addTab(compositionRoot, this.ctx.tr(DPU_CONFIGURATION_TAB_NAME)); // Remove old one if set, and set new as a master tab (tab with DPU's configuration). if (mainTab != null) { tabSheet.removeTab(mainTab); } mainTab = newTab; tabSheet.setTabPosition(newTab, 0); tabSheet.setSelectedTab(0); }
/** * Wrap the given component into a component identified by the given uri * fragment. * <p> * 'tabsheet' wraps it to Tabsheet component. * <p> * Returns by default the component itself. * * @param uriragment * @param component * @return */ public static Component wrapByUriFragment(String uriragment, Gantt gantt) { if (uriragment == null) { return gantt; } if (uriragment.contains("tabsheet")) { TabSheet tabsheet = new TabSheet(); tabsheet.setSizeFull(); Tab tab = tabsheet.addTab(gantt); tab.setCaption("Tabsheet test"); return tabsheet; } else if (uriragment.startsWith("grid")) { return new GridGanttLayout(gantt); } else if (uriragment.startsWith("treegrid")) { return new TreeGridGanttLayout(gantt); } return gantt; }
private Tab getTabByOrganization(Organization organization) { @SuppressWarnings("rawtypes") Iterator itr = tabSheetOrganization.getComponentIterator(); while(itr.hasNext()) { Component cmp = (Component) itr.next(); Tree treeSelected = (Tree) cmp; Organization organizationSelected = (Organization)treeSelected.getData(); if (organizationSelected.equals(organization)) return tabSheetOrganization.getTab(cmp); } return null; }
public void setTabSheet(TabSheet tabSheet) { this.tabSheet = tabSheet; // get userOrganizationCollectionField from Tab component Tab userOrganization = tabSheet.getTab(TAB_USER_ORGANIZATION); VerticalLayout userOrganizationLayout = (VerticalLayout)userOrganization.getComponent(); userOrganizationCollectionField = (UserOrganizationCollectionField) userOrganizationLayout.getComponent(0); Tab userApplication = tabSheet.getTab(TAB_USER_APPLICATION); VerticalLayout userApplicationLayout = (VerticalLayout)userApplication.getComponent(); userApplicationCollectionField = (UserApplicationCollectionField) userApplicationLayout.getComponent(0); Tab userRole = tabSheet.getTab(TAB_USER_ROLE); VerticalLayout userRoleLayout = (VerticalLayout)userRole.getComponent(); userRoleCollectionField = (UserRoleCollectionField) userRoleLayout.getComponent(0); }
@Override public void addModule(String id, String name, IViewContainer viewComponent, boolean closeable, Resource icon, LOCATION location) { if (tabSheetModule.getComponentCount() == 0) tabSheetModule.hideTabs(false); // add module to the list modules.put(id, viewComponent); // create new tab for the current module Tab tab = tabSheetModule.addTab((Component) viewComponent, name, icon); // set closable flag tab.setClosable(closeable); tabSheetModule.setSelectedTab((Component) viewComponent); }
public Tabsheet() { TabBarView tabBarView = new TabBarView(); tabBarView.addTab(getTable(), "First", new ThemeResource( "../runo/icons/64/folder.png")); tabBarView.addTab(getDateSelector(), "Other", new ThemeResource( "../runo/icons/64/document.png")); tabBarView.addTab(getComboBox(), "Third", new ThemeResource( "../runo/icons/64/document-pdf.png")); Tab tab = tabBarView.addTab(getFields(), "4th", new ThemeResource( "../runo/icons/64/email.png")); tabBarView.setSelectedTab(tab); makeSmallTabletSize(tabBarView); addComponent(tabBarView); }
private VerticalLayout createResultTab(String caption) { final VerticalLayout vl = new VerticalLayout(); vl.setMargin(true); final Tab t = tabSheet.addTab(vl, caption); t.setClosable(true); tabSheet.setSelectedTab(t); return vl; }
private void openModuleTab(ModuleLinkButton moduleLinkButton) { Tab tab = getModuleTab(moduleLinkButton.getModule()); if (tab == null) { switch (moduleLinkButton.getModule().getType()) { case FORM: tab = tabSheet.addTab(new FormEditor(moduleLinkButton.getModule()), moduleLinkButton.getCaption()); tab.setClosable(true); break; case CONNECTOR: tab = tabSheet.addTab(new ConnectorEditor(moduleLinkButton.getModule()), moduleLinkButton.getCaption()); tab.setClosable(true); break; case DATA: tab = tabSheet.addTab(new DataEditor(moduleLinkButton.getModule()), moduleLinkButton.getCaption()); tab.setClosable(true); break; case PROCESS: tab = tabSheet.addTab(new ProcessEditor(moduleLinkButton.getModule()), moduleLinkButton.getCaption()); tab.setClosable(true); break; case CHART: tab = tabSheet.addTab(new ChartEditor(moduleLinkButton.getModule()), moduleLinkButton.getCaption()); tab.setClosable(true); break; } } tabSheet.setSelectedTab(tab); }
public void openTab(Component component, Module Module) { Tab tab = getTestTab(Module); if (tab != null) { tabSheet.removeTab(tab); } tab = tabSheet.addTab(component, Module.getName()); tab.setClosable(true); tabSheet.setSelectedTab(tab); }
private Tab getModuleTab(Module Module) { for (Component component : tabSheet) { if (component instanceof AbstractEditor && Objects.equals(((AbstractEditor) component).getModule().getId(), Module.getId())) { return tabSheet.getTab(component); } } return null; }
private Tab getTestTab(Module module) { for (Component component : tabSheet) { if (Objects.equals(module.getType(), Module.MODULE_TYPE.FORM) && Objects.equals(module.getSubType(), Module.MODULE_SUBTYPE.TASK_FORM) && tabSheet.getTab(component).getCaption().equals(module.getName())) { return tabSheet.getTab(component); } } return null; }
private void openDocumentTab(String documentId) { Tab tab = getTab(documentId); if (tab == null) { if (HybridbpmUI.getDocumentAPI().getMyDocumentPermissions(documentId).contains(Permission.PERMISSION.VIEW)) { tab = tabSheet.addTab(new DocumentLayout(documentId)); tab.setClosable(true); tabSheet.setSelectedTab(tab); } } else { tabSheet.setSelectedTab(tab); } }
private Tab getTab(String documentId) { for (Component component : tabSheet) { if (component instanceof DocumentLayout && Objects.equals(((DocumentLayout) component).getDocumentId(), documentId)) { return tabSheet.getTab(component); } } return null; }
private void createTabs() { tabSheet.removeAllComponents(); if (this.viewDefinition != null) { for (TabDefinition tabDefinition : HybridbpmUI.getDashboardAPI().getTabDefinitionByView(this.viewDefinition.getId().toString())) { TabSheet.Tab tab = tabSheet.addTab(new DashboardTab(tabDefinition, this.viewDefinition), tabDefinition.getTitle().getValue(HybridbpmUI.getCurrent().getLocale()), FontAwesome.valueOf(tabDefinition.getIcon())); tab.setClosable(HybridbpmUI.getDeveloperMode()); } } }
private void openDashboardTab(String tabId) { Tab tab = getTab(tabId); if (tab != null) { tabSheet.removeSelectedTabChangeListener(this); tabSheet.setSelectedTab(tab); tabSheet.addSelectedTabChangeListener(this); } }
private Tab getTab(String tabid) { for (Component component : tabSheet) { if (component instanceof DashboardTab && Objects.equals(((DashboardTab) component).getTabDefinition().getId().toString(), tabid)) { return tabSheet.getTab(component); } } return null; }
/** * Creates the page visit history. * * @param pageName * the page name * @param pageId * the page id * @param panelContent * the panel content */ protected final void createPageVisitHistory(final String pageName, final String pageId, final VerticalLayout panelContent) { final TabSheet tabsheet = new TabSheet(); tabsheet.setWidth(100, Unit.PERCENTAGE); tabsheet.setHeight(100, Unit.PERCENTAGE); panelContent.addComponent(tabsheet); panelContent.setExpandRatio(tabsheet, ContentRatio.LARGE); final HorizontalLayout tabContentPageItemRankHistory = new HorizontalLayout(); tabContentPageItemRankHistory.setWidth(100, Unit.PERCENTAGE); tabContentPageItemRankHistory.setHeight(100, Unit.PERCENTAGE); final Tab tabPageItemRankHistory = tabsheet.addTab(tabContentPageItemRankHistory); tabPageItemRankHistory.setCaption(CURRENT_PAGE_VISIT_HISTORY); adminChartDataManager.createApplicationActionEventPageElementDailySummaryChart(tabContentPageItemRankHistory, pageName, pageId); final HorizontalLayout tabContentPageModeSummary = new HorizontalLayout(); tabContentPageModeSummary.setWidth(100, Unit.PERCENTAGE); tabContentPageModeSummary.setHeight(100, Unit.PERCENTAGE); final Tab tabPageModeSummary = tabsheet.addTab(tabContentPageModeSummary); tabPageModeSummary.setCaption(GENERAL_PAGE_MODE_PAGE_VISIT); adminChartDataManager.createApplicationActionEventPageModeDailySummaryChart(tabContentPageModeSummary, pageName); }
@Override public void createChart(final Tab tab,final AbstractOrderedLayout content,final ViewRiksdagenVoteDataBallotSummary viewRiksdagenVoteDataBallotSummary) { final DataSeries dataSeries = new DataSeries(); dataSeries.newSeries().add("Yes", viewRiksdagenVoteDataBallotSummary.getYesVotes()); dataSeries.newSeries().add("No", viewRiksdagenVoteDataBallotSummary.getNoVotes()); dataSeries.newSeries().add("Abstain", viewRiksdagenVoteDataBallotSummary.getAbstainVotes()); dataSeries.newSeries().add("Absent", viewRiksdagenVoteDataBallotSummary.getAbsentVotes()); final String caption = "Summary : " +viewRiksdagenVoteDataBallotSummary.getEmbeddedId().getIssue() + " " + viewRiksdagenVoteDataBallotSummary.getEmbeddedId().getConcern(); tab.setCaption(caption); addChart(content,caption, new DCharts().setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsDonoutChart()).show(), true); }
@Override public void createChart(final Tab tab,final AbstractOrderedLayout content,final List<ViewRiksdagenVoteDataBallotPartySummary> partyList) { final DataSeries dataSeries = new DataSeries(); final Series series = new Series(); series.addSeries(new XYseries().setLabel("Yes")); series.addSeries(new XYseries().setLabel("No")); series.addSeries(new XYseries().setLabel("Abstain")); series.addSeries(new XYseries().setLabel("Absent")); String caption=null; for (final ViewRiksdagenVoteDataBallotPartySummary viewRiksdagenVoteDataBallotPartySummary : partyList) { if (caption == null) { caption = "Party Summary : " + viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getIssue() + " " + viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getConcern(); content.setCaption(caption); tab.setCaption(caption); } dataSeries.newSeries() .add(getPartyName(viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getParty()), viewRiksdagenVoteDataBallotPartySummary.getPartyYesVotes()) .add(getPartyName(viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getParty()),viewRiksdagenVoteDataBallotPartySummary.getPartyNoVotes()) .add(getPartyName(viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getParty()),viewRiksdagenVoteDataBallotPartySummary.getPartyAbstainVotes()) .add(getPartyName(viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getParty()),viewRiksdagenVoteDataBallotPartySummary.getPartyAbsentVotes()); } addChart(content,caption + " ( 4 circles Yes/No/Abstain/Absent votes by party )", new DCharts().setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsDonoutChartWithSeries(series)).show(), true); }
public void applyI18N(Component component, Locale locale) { super.applyI18N(component, locale); for (Entry<Tab, String> entry : tabMap.entrySet()) { if (StringHelper.isNotEmptyWithTrim(entry.getValue())) { String value = provider.getTitle(locale, entry.getValue()); entry.getKey().setCaption(value); } } }
public TriggerInfoPanel(Trigger trigger, IDb db, Settings settings, String selectedTabCaption) { setSizeFull(); tabSheet = CommonUiUtils.createTabSheet(); tabSheet.addSelectedTabChangeListener(new SelectedTabChangeListener() { private static final long serialVersionUID = 1L; @Override public void selectedTabChange(SelectedTabChangeEvent event) { selectedCaption = tabSheet.getTab(tabSheet.getSelectedTab()).getCaption(); } }); addComponent(tabSheet); refreshSource(trigger); refreshDetails(trigger, db, settings); Iterator<Component> i = tabSheet.iterator(); while (i.hasNext()) { Component component = i.next(); Tab tab = tabSheet.getTab(component); if (tab.getCaption().equals(selectedTabCaption)) { tabSheet.setSelectedTab(component); break; } } }
protected boolean reExecute(String sql) { Component comp = resultsTabs.getSelectedTab(); Tab tab = resultsTabs.getTab(comp); int tabPosition = resultsTabs.getTabPosition(tab); if (generalResultsTab != null && generalResultsTab == tab) { return execute(false, sql, tabPosition); } else { resultsTabs.removeTab(tab); return execute(false, sql, tabPosition, true); } }
protected QueryPanel openQueryWindow(IDb db) { String dbName = db.getName(); DefaultButtonBar buttonBar = new DefaultButtonBar(); QueryPanel panel = new QueryPanel(db, settingsProvider, buttonBar, user); buttonBar.init(db, settingsProvider, panel, additionalMenuItems); Tab tab = contentTabs.addTab(panel, getTabName(dbName)); tab.setClosable(true); tab.setIcon(QUERY_ICON); selectContentTab(panel); return panel; }
protected String getTabName(String name) { int tabs = contentTabs.getComponentCount(); String tabName = tabs > 0 ? null : name; if (tabName == null) { for (int j = 0; j < 10; j++) { boolean alreadyUsed = false; String suffix = ""; for (int i = 0; i < tabs; i++) { Tab tab = contentTabs.getTab(i); String currentTabName = tab.getCaption(); if (j > 0) { suffix = "-" + j; } if (currentTabName.equals(name + suffix)) { alreadyUsed = true; } } if (!alreadyUsed) { tabName = name + suffix; break; } } } return tabName; }
@Override public void menuSelected(MenuItem selectedItem) { if (windowComponent == null) windowComponent = windowFactory.createWindowComponent(window, application); final TabSheet tabSheet = application.getConcreteApplication().getMainTabSheet(); tabSheet.addListener(new ComponentContainer.ComponentDetachListener() { private static final long serialVersionUID = 1L; @Override public void componentDetachedFromContainer(ComponentDetachEvent event) { if (event.getDetachedComponent() == windowComponent) { windowComponent = null; tabSheet.removeListener(this); } } }); Tab tab = tabSheet.addTab(windowComponent, window.getName()); tab.setClosable(true); tab.setDescription(window.getDescription()); tabSheet.setSelectedTab(tab); }
@Override public final void addFlowlet(final Flowlet flowlet) { flowlet.setFlow(this); views.put(flowlet.getClass(), flowlet); final Tab tab = tabSheet.addTab((Component) flowlet); tabs.put(flowlet.getClass(), tab); }
public void removeTab(String viewId) { Tab tabImpl = compMap.get(viewId); if (tabImpl != null) { ButtonTabImpl button = getButtonById(viewId); if (button != null) { navigatorContainer.removeComponent(button); compMap.remove(viewId); } } }
public void selectedTabChange(SelectedTabChangeEvent event) { TabSheet tabsheet = event.getTabSheet(); Tab tab = tabsheet.getTab(tabsheet.getSelectedTab()); if (tab != null) { getWindow().showNotification("Selected tab: " + tab.getCaption()); } }
/** * Adds the given component as a tab or window acordingly to current visualizacion settings. * @param component component to add. * @param caption Tab or Window caption. * @param icon Tab or Window icon. * @param closable true if the user can close the tab or window. * @param confirmClosing true to show a confirmation dialog before closing the tab or window. */ public void addWorkbenchContent(Component component, String caption, Resource icon, boolean closable, boolean confirmClosing) { component.setSizeFull(); if(windowsMenuItem != null && !windowsMenuItem.isVisible()) { VerticalLayout layout = new VerticalLayout(); layout.setSizeFull(); layout.setMargin(false); layout.addComponent(component); Window window = new Window(caption); window.setIcon(icon); window.setClosable(closable); window.setContent(layout); window.setWidth("80%"); window.setHeight("80%"); window.getContent().setSizeFull(); placeWindow(window); UI.getCurrent().addWindow(window); } else { Tab tab = tabsheet.addTab(component, caption, icon); tab.setClosable(closable); tabsheet.setSelectedTab(component); } if(confirmClosing) { confirmClosingComponents.add(component); } }
public Resource(String id, String caption, com.vaadin.terminal.Resource resource, LOCATION location, boolean autoStart, boolean closeable, IViewContainer componentView, MenuItem menu, Tab tab) { this.id = id; this.caption = caption; this.resource = resource; this.location = location; this.autoStart = autoStart; this.closeable = closeable; this.componentView = componentView; this.menu = menu; this.tab = tab; }
public TabView() { Tab t = addTab(mainManager); t.setIcon(FontAwesome.FILE_TEXT); t = addTab(new Components()); t.setIcon(FontAwesome.CALENDAR); t = addTab(new Notifications()); t.setIcon(FontAwesome.EXCLAMATION_TRIANGLE); t = addTab(new TableThing()); t.setIcon(FontAwesome.LIST); }
public DefaultTabBuilder(TabsBuilder<C> parentBuilder, Tab tab) { super(); this.parentBuilder = parentBuilder; this.tab = tab; }
public void setTab(Tab tab) { this.tab = tab; this.setupCaption(); }
public I18NTabSheetHandler(final Component component) { super(component); this.tabMap = new HashMap<Tab, String> (); initialize(component); }