Lines Matching refs:tab

7  * @fileoverview This implements a tab control.
9 * An individual tab within a tab control is, unsurprisingly, a Tab.
30 * Creates a new tab element. A tab element is one of multiple tabs
45 * Title for the tab.
58 * Creates a new tab button element in the tabstrip
68 this.classList.add('tab-button');
74 get tab() {
77 set tab(tab) {
79 throw Error('Cannot set tab once set.');
80 this.tab_ = tab;
104 * Creates a new tab control element.
116 * Initializes the tab control element.
120 this.classList.add('tab-control');
123 this.tabStrip_.classList.add('tab-strip');
139 * Adds an element to the tab control.
141 addTab: function(tab) {
142 if (tab.parentNode == this.tabs_)
144 if (!(tab instanceof Tab))
146 this.tabs_.appendChild(tab);
148 tab.addEventListener('selectedChange', this.boundOnTabSelectedChange_);
151 button.tab = tab;
152 tab.tabStripButton_ = button;
161 * Removes a tab from the tab control.
162 * changing the selected tab if needed.
164 removeTab: function(tab) {
165 if (tab.parentNode != this.tabs_)
168 tab.removeEventListener('selectedChange', this.boundOnTabSelectedChange_);
170 if (this.selectedTab_ == tab) {
178 this.tabs_.removeChild(tab);
179 tab.tabStripButton_.parentNode.removeChild(
180 tab.tabStripButton_);
184 * Gets the currently selected tab element.
191 * Sets the currently selected tab element.
193 set selectedTab(tab) {
194 if (tab.parentNode != this.tabs_)
196 tab.selected = true;
200 * Hides the previously selected tab element and dispatches a
204 var tab = e.target;
206 // Usually we can ignore this event, as the tab becoming unselected
208 // tab is deselected, we do need to do some work.
209 if (tab == this.selectedTab_) {
213 if (this.tabs_.children[i] != tab) {
228 this.selectedTab_ = tab;
238 * not the same as this.children because the actual tab elements are