Ejemplo n.º 1
0
        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();
                }
            }
        }
Ejemplo n.º 2
0
        /// <inheritdoc />
        public void OnWorkbenchPartOpened(IWorkbenchPart workbenchPart)
        {
            IProblemsViewItemProvider itemProvider = workbenchPart as IProblemsViewItemProvider;

            if (itemProvider == null)
            {
                return;
            }
            itemProvider.ItemsFound += OnItemProviderItemsFound;
        }
Ejemplo n.º 3
0
        /// <inheritdoc />
        public void OnWorkbenchPartClosed(IWorkbenchPart workbenchPart)
        {
            IEditor editor = workbenchPart as IEditor;

            if (editor == null)
            {
                return;
            }
            IsEnabled            = false;
            editor.DirtyChanged -= OnEditorIsDirtyChanged;
        }
Ejemplo n.º 4
0
        /// <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);
        }
Ejemplo n.º 5
0
        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();
				}
			}
Ejemplo n.º 11
0
 public void setActivePart(IAction action, IWorkbenchPart targetPart)
 {
 }
Ejemplo n.º 12
0
		public void setActivePart(IAction action, IWorkbenchPart targetPart) {
		}
Ejemplo n.º 13
0
 /// <inheritdoc />
 public void OnWorkbenchPartActivated(IWorkbenchPart workbenchPart)
 {
     // Nothing to do
 }
Ejemplo n.º 14
0
 /// <inheritdoc />
 public void OnWorkbenchPartClosed(IWorkbenchPart workbenchPart)
 {
     IsEnabled = PlatformUI.Instance.Workbench.ActivePerspective.ActiveEditor != null;
 }
Ejemplo n.º 15
0
 public void Hide(IWorkbenchPart part)
 {
 }
Ejemplo n.º 16
0
 public void Close(IWorkbenchPart part)
 {
     throw new NotImplementedException();
 }