Example #1
0
        /// <inheritdoc />
        public override void CreateContents(IGridPanel gridComposite)
        {
            gridComposite.GridColumns = 1;
            gridComposite.GridRows    = 1;

            IListViewer listViewer = WidgetFactory.CreateInstance <IListViewer>(gridComposite);

            gridComposite.AddWidget(listViewer);

            listViewer.ContentProvider = new ProblemsViewListContentProvider();
            listViewer.LabelProvider   = new ProblemsViewListLabelProvider();
            listViewer.Input           = new[] { _errorCollection, _warningCollection, _infoCollection };
            listViewer.Update();

            _timer = new Timer(state => {
                lock (_dataChanged) {
                    if (!_dataChanged.Get())
                    {
                        return;
                    }
                    _dataChanged.Set(false);
                }
                PlatformUI.Instance.Invoker.InvokeAsync(() => listViewer.Update());
            }, null, TimeSpan.Zero, TimeSpan.FromSeconds(1));
        }
Example #2
0
        /// <inheritdoc />
        public override void CreateContents(IGridPanel gridComposite)
        {
            gridComposite.GridColumns = 1;
            gridComposite.GridRows    = 1;

            _listViewer = WidgetFactory.CreateInstance <IListViewer>(gridComposite);
            gridComposite.AddWidget(_listViewer);

            _listViewer.ContentProvider         = new ErrorsViewListContentProvider();
            _listViewer.LabelProvider           = new ErrorsViewListLabelProvider();
            _listViewer.Input                   = _errorViewItemSet;
            _listViewer.SelectionDoubleClicked += OnSelectionDoubleClicked;
            _listViewer.Update();
        }
        /// <inheritdoc />
        public override void Run()
        {
            ITitledAreaDialog dialogWindow = UIFactory.NewShell <ITitledAreaDialog>();

            dialogWindow.Title       = Messages.WindowMenuShowViewsMenuHandler_DialogTitle;
            dialogWindow.Description = Messages.WindowMenuShowViewsMenuHandler_DialogDescription;
            dialogWindow.Width       = 460;

            IGridPanel gridComposite = UIFactory.NewWidget <IGridPanel>(dialogWindow);

            gridComposite.GridColumns = 1;
            gridComposite.GridRows    = 1;
            IListViewer listViewer = UIFactory.NewWidget <IListViewer>(gridComposite);

            gridComposite.AddWidget(listViewer);

            IViewReference selectedViewReference = null;
            bool           closedOk = false;

            listViewer.ContentProvider = new ListViewerContentProviderImpl();
            listViewer.LabelProvider   = new ListViewerLabelProviderImpl();
            listViewer.Input           = DataViewRegistry.Instance.GetViewReferences().OrderBy(view => view.Title).ToArray();
            listViewer.Update();
            listViewer.SelectionChanged += (sender, args) => selectedViewReference = (IViewReference)args.Selection;
            dialogWindow.AddButton(Messages.WindowMenuShowViewsMenuHandler_DialogButtonCancel,
                                   new ActionHandlerDelegate(() => dialogWindow.Close()));
            dialogWindow.AddButton(Messages.WindowMenuShowViewsMenuHandler_DialogButtonOk,
                                   new ActionHandlerDelegate(() => {
                closedOk = true;
                dialogWindow.Close();
            }));

            dialogWindow.SetContent(gridComposite);
            dialogWindow.Show(true);

            if (closedOk && selectedViewReference != null)
            {
                string viewId = selectedViewReference.Id;
                PlatformUI.Instance.Workbench.ActivePerspective.OpenView(viewId, EViewPosition.Bottom);
            }
        }