public void Show(IWorkbenchPart part) { if (part is IViewPart) { IViewPart view = part as IViewPart; //ContentConfiguration content; if (part != m_viewPart1 || part != m_viewPart2) { CreateAndShowView(view); } else { Focus(view); } } else if (part is IToolbarPart) { IToolbarPart toolbar = part as IToolbarPart; ToolStrip toolStrip; if (!TryGetExistingToolStrip(toolbar, out toolStrip)) { toolStrip = GetToolbarWidget(toolbar); Page.TopToolStripPanel.Controls.Add(toolStrip); } else { toolStrip.Show(); } } }
/// <inheritdoc /> public void OnWorkbenchPartOpened(IWorkbenchPart workbenchPart) { IProblemsViewItemProvider itemProvider = workbenchPart as IProblemsViewItemProvider; if (itemProvider == null) { return; } itemProvider.ItemsFound += OnItemProviderItemsFound; }
/// <inheritdoc /> public void OnWorkbenchPartClosed(IWorkbenchPart workbenchPart) { IEditor editor = workbenchPart as IEditor; if (editor == null) { return; } IsEnabled = false; editor.DirtyChanged -= OnEditorIsDirtyChanged; }
/// <summary> Is invoked when the dock content got the focus. </summary> /// <param name="sender">Event sender</param> /// <param name="eventArgs">Event arguments</param> private void OnDockContentGotFocus(object sender, EventArgs eventArgs) { DockContent dockContent = sender as DockContent; if (dockContent == null) { return; } IWorkbenchPart workbenchPart = dockContent.Tag as IWorkbenchPart; if (workbenchPart == null) { return; } PerspectiveEventManager.Dispatch(lstnr => lstnr.OnWorkbenchPartActivated(workbenchPart), OnDispatchWorkbenchEventException); }
public void Focus(IWorkbenchPart part) { if (part == null) { throw new ArgumentNullException(); } IViewPart viewPart = part as IViewPart; if (null != viewPart) { return; } //ContentWidget content; //@todo Refactor: this is ugly... //Trace.Assert(viewPart.Widget.Parent.Parent.Parent is ContentWidget); //content = viewPart.Widget.Parent.Parent.Parent as ContentWidget; SelectedPart = viewPart; }
public void partOpened(IWorkbenchPart part) { }
public void partClosed(IWorkbenchPart part) { }
public void partBroughtToTop(IWorkbenchPart part) { }
public void partDeactivated(IWorkbenchPart part) { if (part == editor) { editor.IsActive = false; } }
public void partActivated(IWorkbenchPart part) { if (part == editor) { editor.IsActive = true; editor.backgroundCompiler.compileAsync(); } }
public void setActivePart(IAction action, IWorkbenchPart targetPart) { }
/// <inheritdoc /> public void OnWorkbenchPartActivated(IWorkbenchPart workbenchPart) { // Nothing to do }
/// <inheritdoc /> public void OnWorkbenchPartClosed(IWorkbenchPart workbenchPart) { IsEnabled = PlatformUI.Instance.Workbench.ActivePerspective.ActiveEditor != null; }
public void Hide(IWorkbenchPart part) { }
public void Close(IWorkbenchPart part) { throw new NotImplementedException(); }