/** * Convenience overload to allow {@link IsWidget} to be used directly. */ public void add(IsWidget w, IsWidget tabWidget) { add(asWidgetOrNull(w), asWidgetOrNull(tabWidget)); }
/** * Programmatically selects the specified tab and fires events. * * @param index the index of the tab to be selected */ public void selectTab(int index) { selectTab(index, true); }
/** * Adds a widget to the tab panel. If the Widget is already attached to the * TabPanel, it will be moved to the right-most index. * * @param w the widget to be added * @param tabText the text to be shown on its tab */ public void add(Widget w, String tabText) { insert(w, tabText, getWidgetCount()); }
@Override public void clear() { while (getWidgetCount() > 0) { remove(getWidget(0)); } }
private void createDetailsSection(VerticalPanel vpanel) { // adds the title for the details section vpanel.add(new ContentGroupLabel("Details")); // adds the tabs for the details section bottomTabs = new TabPanel(); bottomTabs.setStyleName("default-tabpanel"); bottomTabs.addStyleName("master_detail-detail"); wizard = doCreateWizard(); doCreateAttributesTab(bottomTabs); addDetailsSectionTabs(bottomTabs); vpanel.add(bottomTabs); bottomTabs.selectTab(0); }
/** * @return this editor as a Widget. */ public Widget asWidget() { VerticalPanel panel = new VerticalPanel(); panel.add(new ContentGroupLabel(Singleton.MESSAGES.label_serviceDetails())); panel.add(new ContentDescription(Singleton.MESSAGES.description_serviceDetails())); panel.add(createImplementationDetailsPanel()); TabPanel tabs = new TabPanel(); tabs.setStyleName("default-tabpanel"); //$NON-NLS-1$ tabs.getElement().setAttribute("style", "margin-top:15px;"); //$NON-NLS-1$ //$NON-NLS-2$ tabs.add(createGatewayDetailsPanel(), Singleton.MESSAGES.label_gateways()); tabs.add(createThrottlingDetailsPanel(), Singleton.MESSAGES.label_throttling()); tabs.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() { @Override public void onBeforeSelection(BeforeSelectionEvent<Integer> event) { _toolstrip.doCancel(); } }); panel.add(tabs); tabs.selectTab(0); return panel; }
@Override public void add(View view) { int index = tabPanel.getWidgetCount(); InstanceView instanceView = new InstanceView(Integer.toString(index)); tabPanel.add(view.getWidget(), instanceView.makeTab(tabLabel(index))); if (index == 0) { tabPanel.selectTab(0); } }
@Override public void onSuccessImpl(SchemaInfoDto result) { endpointProfile = result; endpointProfileRecordPanel.setValue(result.getSchemaForm()); endpointProfileRecordPanel.setTitle(result.getSchemaName()); profileRecordsPanel.add( endpointProfileRecordPanel, Utils.constants.endpointProfile()); processLoad(); } });
profileRecordsPanel = new TabPanel(); table.setWidget(++row, 0, profileRecordsPanel);
public static void add(TabPanel source, TabListener listener) { WrappedTabListener t = new WrappedTabListener(listener); source.addBeforeSelectionHandler(t); source.addSelectionHandler(t); }
/** * Creates an empty tab panel. */ public TabPanel() { VerticalPanel panel = new VerticalPanel(); panel.add(tabBar); panel.add(deck); panel.setCellHeight(deck, "100%"); tabBar.setWidth("100%"); tabBar.addTabListener(this); initWidget(panel); setStyleName("gwt-TabPanel"); deck.setStyleName("gwt-TabPanelBottom"); // Add a11y role "tabpanel" Roles.getTabpanelRole().set(deck.getElement()); }
/** * Verifies that the actual {@link TabPanel} child widget count is equal to the given one. * * @param expected the expected widget count. * @return this assertion object. * @throws AssertionError if the actual widget count is not equal to the given one. * @see TabPanel#getWidgetCount() */ public S widgetCountEquals(int expected) { int widgetCount = actual.getWidgetCount(); if (areEqual(widgetCount, expected)) return myself; throw propertyComparisonFailed("WidgetCount", widgetCount, expected); }
TabPanel panel = ...; panel.addSelectionHandler(new SelectionHandler<Integer>() { @Override public void onSelection(SelectionEvent<Integer> event) { } });
@Override public void remove(View view) { tabPanel.remove(view.getWidget()); }
@Override public Widget asWidget() { this.tabPanel = new TabPanel(); tabPanel.setStyleName("default-tabpanel"); tabPanel.addStyleName("master_detail-detail"); VerticalPanel layout = new VerticalPanel(); final TextItem aliasItem = new TextItem("name", uiConstants.common_label_federationName()); form.setFields(aliasItem); form.setEnabled(false); layout.add(new FormLayout().setTools(null).setForm(form).build()); tabPanel.add(layout, "Attributes"); this.samlConfigurationDetails = new SAMLConfigurationDetails(this.presenter); tabPanel.add(this.samlConfigurationDetails.asWidget(), "SAML Configuration"); tabPanel.selectTab(0); return tabPanel; }
@Override public void onSuccessImpl(SchemaInfoDto result) { serverProfile = result; serverProfileRecordPanel.setValue(result.getSchemaForm()); serverProfileRecordPanel.setTitle(result.getSchemaName()); profileRecordsPanel.add( serverProfileRecordPanel, Utils.constants.serverProfile()); processLoad(); } });