/** * Sets whether this tab is disabled. If a tab is disabled, then it cann't * be selected or closed by user, but it still can be controlled by server * side program. * * @since 3.0.0 */ public void setDisabled(boolean disabled) { if (_disabled != disabled) { _disabled = disabled; smartUpdate("disabled", _disabled); } }
/** * Sets whether this tab is closable. If closable, a button is displayed and * the onClose event is sent if an user clicks the button. * <p> * Default: false. * <p> * You can intercept the default behavior by either overriding * {@link #onClose}, or listening the onClose event. * * <p>If {@link Tabbox#getModel()} is assigned, there is no an action to do with {@link #onClose}, * i.e. developer has to listen onClose event to delete that item in model not * component itself. (since 7.0.0) */ public void setClosable(boolean closable) { if (_closable != closable) { _closable = closable; smartUpdate("closable", _closable); } }
/** * 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); } }