if (TabMode.SERVER.equals(tab.getMode()) && UIContextHolder.getCurrent().getFocussed() == null) { tab.setFocussed();
/** * Creates a new tabset with all the tab types. * * @return a new tabset with content. */ private static WTabSet createTabSet() { WTabSet tabSet = new WTabSet(); for (WTabSet.TabMode mode : WTabSet.TabMode.values()) { tabSet.addTab(new WText(mode + " content"), mode + " tab", mode); } return tabSet; }
/** * {@inheritDoc} */ @Override public void handleRequest(final Request request) { // If is LAZY or DYNAMIC and is the current trigger, then process the WTabSet for the correct open/closed tabs if ((TabMode.LAZY.equals(getMode()) || TabMode.DYNAMIC.equals(getMode())) && AjaxHelper.isCurrentAjaxTrigger(this)) { WTabSet tabSet = (WTabSet) WebUtilities.getAncestorOfClass(WTabSet.class, this); tabSet.handleRequest(request); } }
/** * Set the mode of operation for this tab. See * <a href="https://github.com/BorderTech/wcomponents/issues/692">#692</a>. * * @param mode the tab mode. */ public void setMode(final TabMode mode) { getOrCreateComponentModel().mode = TabMode.SERVER.equals(mode) ? TabMode.DYNAMIC : mode; }