private boolean buildTabs(int availableWidth) {
		allTabs.clear();
		removeAll();

		// reserve space for the selected tab
		GTab<T> selectedTab = selectedValue != null ? new GTab<>(this, selectedValue, true) : null;
		availableWidth -= getParentedComponentWidth(selectedTab);

		boolean selectedTabAdded = false;
		for (T value : allValues) {
			boolean isSelectedValue = value == selectedValue;
			GTab<T> nextTab = isSelectedValue ? selectedTab : new GTab<>(this, value, false);
			int tabWidth = isSelectedValue ? 0 : getParentedComponentWidth(nextTab);
			if (tabWidth > availableWidth) {
				break;
			}
			allTabs.add(nextTab);
			add(nextTab);
			selectedTabAdded |= isSelectedValue;
			availableWidth -= tabWidth;
		}

		// if we ran out of space before adding the selected tab, add it now if it fits since
		// we always want the selected tab visible and we reserved space for it (unless there 
		// wasn't space for any tabs)
		if (selectedTab != null && !selectedTabAdded && availableWidth >= 0) {
			allTabs.add(selectedTab);
			add(selectedTab);
		}

		// returns true only if all tabs fit
		return allTabs.size() == allValues.size();
	}
Returns the value of the tab that generated the given mouse event. If the mouse event
is not from one of the tabs, then null is returned.
@param event the MouseEvent to get a value for
@return the value of the tab that generated the mouse event
Ghidra/Framework/Docking/src/main/java/docking/widgets/tab/GTabPanel.java