/** * Returns the pane with the specified ID from the current sidebar. */ public AbstractViewPane GetPane(string paneID) { if (_activeSidebar == null) { return(null); } return(_activeSidebar.GetPane(paneID)); }
public AbstractViewPane ActivateViewPane(string tabId, string paneId) { VerticalSidebar sidebar = _activeSidebar; if (sidebar == null || sidebar != _tabSidebars [tabId]) { return(null); } AbstractViewPane pane = sidebar.GetPane(paneId); if (pane == null) { return(null); } sidebar.ActivatePane(paneId); if (_activeSidebar != sidebar) { // one more check for tab switch caused by message processing during activation return(null); } return(pane); }
/// <summary> /// Shows the sidebar for the specified tab. /// </summary> public void ShowPanesForTab(string tabId, SidebarState state) { _currentTabID = tabId; Core.UIManager.BeginUpdateSidebar(); VerticalSidebar sidebar = GetSidebar(tabId); if (sidebar != _activeSidebar) { _newActiveSidebar = sidebar; if (!_populatedSidebars.Contains(tabId)) { _populatedSidebars.Add(tabId); sidebar.PopulateViewPanes(); if (state == null) { sidebar.BeginUpdate(); AbstractViewPane pane = sidebar.GetPane(StandardViewPanes.ViewsCategories); if (pane != null) { sidebar.ActivatePane(StandardViewPanes.ViewsCategories); } string structurePaneID = (string)_resourceStructurePanes [tabId]; if (structurePaneID != null) { sidebar.ActivatePane(structurePaneID); } sidebar.EndUpdate(); } } sidebar.UpdateActiveWorkspace(); if (state != null) { sidebar.CurrentState = state; } if (_activeSidebar != null) { _activeSidebar.ExpandedChanged -= OnActiveSidebarExpandedChanged; } sidebar.ExpandedChanged += OnActiveSidebarExpandedChanged; Expanded = sidebar.Expanded; // Width = Expanded ? ExpandedWidth : sidebar.CollapsedWidth; Width = Expanded ? ExpandedWidth : 0; } else { sidebar.UpdateActiveWorkspace(); if (state != null) { sidebar.CurrentState = state; } } if (sidebar != _activeSidebar) { sidebar.Visible = true; if (_activeSidebar != null) { _activeSidebar.Visible = false; } _activeSidebar = sidebar; if (ContainsFocus) { _activeSidebar.FocusActivePane(); } } Core.UIManager.EndUpdateSidebar(); _newActiveSidebar = null; }