public override void Start() { _contextMenuFilter = _setupHelper.GetContextMenuFilter() ?? ViewerActionFilter.Null; _contextMenuFilter.SetImageViewer(this); _toolSet = new ToolSet(CreateTools(), CreateToolContext()); // since the keyboard action model is otherwise never used, we explicitly invoke it here to apply the persisted action model values to the actions ActionModelRoot.CreateModel(ActionsNamespace, PrintKeyboardSite, _toolSet.Actions); foreach (ITool tool in _toolSet.Tools) { _shortcutManager.RegisterImageViewerTool(tool); } base.Start(); }
public override void Start() { base.Start(); var tools = new ArrayList(new StudyBrowserToolExtensionPoint().CreateExtensions()); tools.Add(new FilterDuplicateStudiesTool(this)); _toolSet = new ToolSet(tools, new StudyBrowserToolContext(this)); _toolbarModel = ActionModelRoot.CreateModel(GetType().FullName, "dicomstudybrowser-toolbar", _toolSet.Actions); _contextMenuModel = ActionModelRoot.CreateModel(GetType().FullName, "dicomstudybrowser-contextmenu", _toolSet.Actions); _searchResultColumnOptions = SearchResult.ColumnOptions; DicomExplorerConfigurationSettings.Default.PropertyChanged += OnConfigurationSettingsChanged; }
/// <summary> /// Builds the action model for the specified site. /// </summary> private ActionModelNode BuildActionModel(string site) { string @namespace = typeof(DesktopWindow).FullName; IActionSet actions = this.DesktopTools.Actions; if (this.ActiveWorkspace != null) { actions = actions.Union(this.Workspaces.ActiveWorkspace.Actions); if (this.ActiveWorkspace.Component is IApplicationComponent) { @namespace = ((IApplicationComponent)this.ActiveWorkspace.Component).GlobalActionsNamespace; } } return(ActionModelRoot.CreateModel(@namespace, site, actions)); }
public StudyFilterComponentPanel(StudyFilterComponent component) : this() { _component = component; _component.FilterPredicatesChanged += new EventHandler(_component_FilterPredicatesChanged); ActionModelRoot toolbarActions = ActionModelRoot.CreateModel("ClearCanvas.ImageViewer.Utilities.StudyFilters.View.WinForms", StudyFilterTool.DefaultToolbarActionSite, _component.ExportedActions); ToolStripBuilder.ToolStripBuilderStyle defaultStyle = new ToolStripBuilder.ToolStripBuilderStyle(); ToolStripBuilder.ToolStripBuilderStyle myStyle = new ToolStripBuilder.ToolStripBuilderStyle(ToolStripItemDisplayStyle.ImageAndText, defaultStyle.ToolStripAlignment, defaultStyle.TextImageRelation); ToolStripBuilder.BuildToolbar(_toolbar.Items, toolbarActions.ChildNodes, myStyle); _tableView.Table = component.Table; _tableView.MultiSelect = true; _tableView.ColumnFilterMenuStripClosed += new EventHandler(_tableView_ColumnFilterMenuStripClosed); _tableView.ContextActionModelDelegate = this.GetContextMenuModel; _tableView.ColumnFilterActionModelDelegate = this.GetColumnFilterMenuModel; _tableView.ReadOnly = true; }
//TODO (CR Sept 2010): Create methods usually return an object. protected void CreateActionModelRoot(ActionModelRoot actionModelRoot) { foreach (AbstractActionModelTreeNode child in this.Subtree.Items) { if (child is AbstractActionModelTreeBranch) { ((AbstractActionModelTreeBranch)child).CreateActionModelRoot(actionModelRoot); } else if (child is AbstractActionModelTreeLeafAction) { actionModelRoot.InsertAction(((AbstractActionModelTreeLeafAction)child).BuildAction()); } else if (child is AbstractActionModelTreeLeafSeparator) { actionModelRoot.InsertSeparator(((AbstractActionModelTreeLeafSeparator)child).GetSeparatorPath()); } } }
/// <summary> /// Called by the host to initialize the application component. /// </summary> public override void Start() { base.Start(); ClipboardToolContext toolContext = new ClipboardToolContext(this); _toolSet = new ToolSet(new ClipboardToolExtensionPoint(), toolContext); _resolver = new ApplicationThemeResourceResolver(GetType(), true); ActionSet toolActions = new ActionSet(_toolSet.Actions); ActionSet deleteToolActions = new ActionSet(GetDeleteActions()); IActionSet allActions = toolActions.Union(deleteToolActions); _toolbarModel = ActionModelRoot.CreateModel(typeof(ClipboardComponent).FullName, _toolbarSite, allActions); _contextMenuModel = ActionModelRoot.CreateModel(typeof(ClipboardComponent).FullName, _menuSite, allActions); _items.BindingList.ListChanged += OnBindingListChanged; }
private void BuildMenus(IWorkspace workspace) { foreach (Widget w in _mainMenu) { _mainMenu.Remove(w); w.Destroy(); } ActionModelRoot model = new ActionModelRoot(""); //model.Merge(WorkstationModel.ToolManager.MenuModel); model.Merge(DesktopApplication.ToolSet.MenuModel); if (workspace != null) { //model.Merge(workspace.ToolManager.MenuModel); model.Merge(workspace.ToolSet.MenuModel); } GtkMenuBuilder.BuildMenu(_mainMenu, model); _mainMenu.ShowAll(); }
/// <summary> /// Constructs a <see cref="GalleryComponent"/> with the specified data source, automatically adding the actions of /// <see cref="GalleryToolExtensionPoint"/>s at the specified action sites. /// </summary> /// <param name="dataSource">An <see cref="IBindingList"/> of <see cref="IGalleryItem"/>s.</param> /// <param name="toolbarSite">The site for toolbar actions.</param> /// <param name="contextMenuSite">The site for context menu actions.</param> public GalleryComponent(IBindingList dataSource, string toolbarSite, string contextMenuSite) { _dataSource = dataSource; if (toolbarSite != null || contextMenuSite != null) { GalleryToolExtensionPoint xp = new GalleryToolExtensionPoint(); ToolContext context = new ToolContext(this); ToolSet ts = new ToolSet(xp, context); if (contextMenuSite != null) { _menuModel = ActionModelRoot.CreateModel(typeof(GalleryComponent).FullName, contextMenuSite, ts.Actions); } if (toolbarSite != null) { _toolbarModel = ActionModelRoot.CreateModel(typeof(GalleryComponent).FullName, toolbarSite, ts.Actions); } _toolSet = ts; } }
private void BuildToolbars(IWorkspace workspace) { _toolBarBox.Remove(_toolBar); _toolBar.Destroy(); // make sure the old one is cleaned up! _toolBar = new Toolbar(); _toolBar.ToolbarStyle = ToolbarStyle.Icons; _toolBarBox.PackStart(_toolBar, true, true, 0); _tooltips = new Tooltips(); ActionModelRoot model = new ActionModelRoot(""); //model.Merge(WorkstationModel.ToolManager.ToolbarModel); model.Merge(DesktopApplication.ToolSet.ToolbarModel); if (workspace != null) { //model.Merge(workspace.ToolManager.ToolbarModel); model.Merge(workspace.ToolSet.ToolbarModel); } GtkToolbarBuilder.BuildToolbar(_toolBar, _tooltips, model); _toolBar.ShowAll(); }
public ActionModelConfigurationComponent(string @namespace, string site, IActionSet actionSet, IDesktopWindow desktopWindow, bool flatActionModel) { _namespace = @namespace; _site = site; _desktopWindow = desktopWindow; if (_desktopWindow is DesktopWindow) { DesktopWindow concreteDesktopWindow = (DesktopWindow)_desktopWindow; if (_site == DesktopWindow.GlobalMenus || _site == DesktopWindow.GlobalToolbars) { actionSet = actionSet.Union(concreteDesktopWindow.DesktopTools.Actions); } } _actionModel = ActionModelSettings.DefaultInstance.BuildAbstractActionModel(_namespace, _site, actionSet.Select(a => a.Path.Site == site)); _actionModelTreeRoot = new AbstractActionModelTreeRoot(_site); _enforceFlatActionModel = flatActionModel; if (flatActionModel) { BuildFlatActionModelTree(_actionModel, _actionModelTreeRoot); } else { BuildActionModelTree(_actionModel, _actionModelTreeRoot); } _actionNodeMapDictionary = new ActionNodeMapDictionary(); foreach (AbstractActionModelTreeNode node in _actionModelTreeRoot.EnumerateDescendants()) { if (node is AbstractActionModelTreeLeafAction) { _actionNodeMapDictionary.AddToMap((AbstractActionModelTreeLeafAction)node); } } }
public ActionModelNode GetContextMenuActionModel(IStudyItem item, StudyFilterColumn column) { _toolContext.SetActiveCell(item, column); return(ActionModelRoot.CreateModel(this.GetType().FullName, StudyFilterTool.DefaultContextMenuActionSite, _actions)); }