public void setWidth(String width) { Tabbox tb = getTabbox(); if (tb != null && tb.isVertical()) throw new UnsupportedOperationException("Set Tabs' width instead"); super.setWidth(width); }
/** * Returns the panel associated with this tab. */ public Tabpanel getLinkedPanel() { final int j = getIndex(); if (j >= 0) { final Tabbox tabbox = getTabbox(); if (tabbox != null) { final Tabpanels tabpanels = tabbox.getTabpanels(); if (tabpanels != null && tabpanels.getChildren().size() > j) return (Tabpanel) tabpanels.getChildren().get(j); } } return null; }
/** * Sets whether this tab is selected. */ public void setSelected(boolean selected) { final Tabbox tabbox = (Tabbox) getTabbox(); if (tabbox != null) { // Note: we don't update it here but let its parent does the job if (selected) { //Note that if already selected , tabbox will ignore it. tabbox.setSelectedTab(this); } else if (tabbox.getSelectedTab() == this) { //selected false and selected //clean selected tab , not set any others selected , if user call setSelected(false) manually , //they should set another tab to be selected or no any tab will be selected. tabbox.clearSelectedTab(); _selected = false; } } else if (_selected != selected) { _selected = selected; smartUpdate("selected", _selected); } }
final String cmd = request.getCommand(); if (cmd.equals(Events.ON_SELECT)) { final Tabbox tabbox = getTabbox(); final Set<Tab> prevSeldItems = new LinkedHashSet<Tab>(); if (tabbox.getSelectedTab() != null)
Tabbox tabbox = getTabbox();
final Tab newtab = (Tab) child; if (!sel && newtab.isSelected()) { if (newtab.getTabbox() != null) // B65-ZK-1597 newtab.setSelected(false); //reset it else
/** Sets the selected tab. */ /* packge */void selectTabDirectly(Tab tab, boolean byClient) { if (tab == null) throw new IllegalArgumentException("null tab"); if (tab.getTabbox() != this) throw new UiException("Not my child: " + tab); if (tab != _seltab) { if (_seltab != null) _seltab.setSelectedDirectly(false); try { // avoid recursive invoking if (getAttribute(TabboxEngine.ATTR_CHANGING_SELECTION) == null) { setAttribute(TabboxEngine.ATTR_CHANGING_SELECTION, Boolean.TRUE); _seltab = tab; _seltab.setSelectedDirectly(true); if (byClient && _model != null) { Selectable<Object> sm = getSelectableModel(); if (!sm.isSelected(_model.getElementAt(_seltab.getIndex()))) { sm.clearSelection(); sm.addToSelection(_model.getElementAt(_seltab.getIndex())); } } } } finally { removeAttribute(TabboxEngine.ATTR_CHANGING_SELECTION); } if (!byClient) smartUpdate("selectedTab", _seltab); } }
public void renderTab(Tab item, final Object data, final int index) throws Exception { final Tabbox tabbox = item.getTabbox(); final Tabs tabs = tabbox.getTabs(); final int size = tabbox.getModel().getSize();
public void render(Component comp, Writer out) throws IOException { final Tab self = (Tab) comp; final Tabbox tabbox = self.getTabbox(); if ("vertical".equals(tabbox.getOrient())) { _vtab.render(comp, out);