protected override void OnCancel() { ITitledAreaDialog dialog = UIFactory.NewViewPart <ITitledAreaDialog>(); IGridComposite gridComposite = UIFactory.NewWidget <IGridComposite>(); gridComposite.GridColumns = 1; gridComposite.GridRows = 1; gridComposite.AddWidget(new Canvas { ShowGrid = true }); dialog.ContentPane = gridComposite; dialog.Show(); }
/// <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); } }
/// <inheritdoc /> public virtual void Open() { _dialog.Show(); }
/// <summary> /// Shows the wizard. /// </summary> public void Open() { iDialog.Show(); }