public EditCustomFilter(JiraServer server, JiraCustomFilter filter)
        {
            this.server = server;
            this.filter = filter;

            InitializeComponent();

            listViewIssueTypes.Columns.Add("Name", listViewIssueTypes.Width - 10, HorizontalAlignment.Left);

            StartPosition = FormStartPosition.CenterParent;

            SortedDictionary <string, JiraProject> projects = JiraServerCache.Instance.getProjects(server);

            foreach (string projectKey in projects.Keys)
            {
                listBoxProjects.Items.Add(projects[projectKey]);
            }
            refillIssueTypes(null);
            refillFixFor(null);
            refillComponents(null);
            refillAffectsVersions(null);

            manageSelections();

            listBoxProjects.SelectedValueChanged += listBoxProjects_SelectedValueChanged;
        }
Exemple #2
0
        public void removeCustomFilter(JiraCustomFilterTreeNode node)
        {
            if (node == null)
            {
                return;
            }
            DialogResult result =
                MessageBox.Show("Do you really want to remove this local filter?",
                                Constants.QUESTION_CAPTION, MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (DialogResult.Yes != result)
            {
                return;
            }

            TreeNodeWithJiraServer groupNode = findGroupNode(node.Server, typeof(JiraCustomFiltersGroupTreeNode));

            if (groupNode == null)
            {
                return;
            }

            groupNode.Nodes.Remove(node);
            SelectedNode = groupNode;
            JiraCustomFilter.remove(node.Filter);
            reloadIssues();
        }
        public CustomFilterTreeNode(JiraServer server, JiraCustomFilter filter, int imageIdx) : base("Custom Filter", imageIdx)
        {
            this.server = server;
            Filter      = filter;

            Tag = filter;
        }
 public void addCustomFilterNodes(JiraServer server) {
     TreeNodeWithJiraServer node = findGroupNode(server, typeof(JiraCustomFiltersGroupTreeNode));
     if (node == null) {
         return;
     }
     foreach (JiraCustomFilter filter in JiraCustomFilter.getAll(server)) {
         addCustomFilterTreeNode(server, node, filter);
     }
 }
 public void addCustomFilter(TreeNodeWithJiraServer node) {
     if (node == null) {
         return;
     }
     JiraCustomFilter newFilter = new JiraCustomFilter(node.Server);
     EditCustomFilter ecf = new EditCustomFilter(node.Server, newFilter, false);
     ecf.ShowDialog();
     if (!ecf.Changed) return;
     JiraCustomFilter.add(newFilter);
     JiraCustomFilterTreeNode newNode = addCustomFilterTreeNode(node.Server, node, newFilter);
     SelectedNode = newNode;
 }
        public void editCustomFilter(JiraCustomFilterTreeNode node) {
            if (node == null) {
                return;
            }

            EditCustomFilter ecf = new EditCustomFilter(node.Server, node.Filter, true);
            ecf.ShowDialog();
            if (!ecf.Changed) return;

            node.setFilterName(node.Filter.Name);

            JiraCustomFilter.save();
            reloadIssues();
        }
Exemple #7
0
 public void solutionEventsOpened()
 {
     try
     {
         JiraServerModel.Instance.clear();
         JiraServerModel.Instance.load(applicationObject.Solution.Globals);
         RecentlyViewedIssuesModel.Instance.load(applicationObject.Globals, applicationObject.Solution.FullName);
         JiraCustomFilter.load(applicationObject.Globals, applicationObject.Solution.FullName);
         createJiraWindow();
         IssueDetailsWindow.Instance.Solution = applicationObject.Solution;
     }
     catch (Exception e)
     {
         Debug.WriteLine(e);
     }
 }
Exemple #8
0
        public FilterContextMenu(JiraServer server, JiraCustomFilter filter, RunOnEditDialogOk runOnEditDialogOk)
        {
            this.server            = server;
            this.filter            = filter;
            this.runOnEditDialogOk = runOnEditDialogOk;

            items = new[]
            {
                new ToolStripMenuItem("Edit Filter", Properties.Resources.edit_in_browser, new EventHandler(editFilter)),
                new ToolStripMenuItem("View Filter in Browser", Properties.Resources.view_in_browser, new EventHandler(browseFilter)),
            };

            Items.Add("dummy");

            Opened += filterContextMenuOpened;
        }
Exemple #9
0
        private void addCustomFilterNodes(JiraServer server)
        {
            JiraServerTreeNode node = findNode(server);

            if (node == null)
            {
                return;
            }
            foreach (JiraCustomFilter filter in JiraCustomFilter.getAll(server))
            {
                CustomFilterTreeNode cfNode = new CustomFilterTreeNode(server, filter, 2)
                {
                    ContextMenuStrip = new FilterContextMenu(server, filter, reloadIssues),
                    ToolTipText      = server.Name
                };
                node.Nodes.Add(cfNode);
            }
        }
Exemple #10
0
 public void solutionEventsBeforeClosing()
 {
     try
     {
         if (jiraWindow == null)
         {
             return;
         }
         JiraServerModel.Instance.save(applicationObject.Solution.Globals);
         JiraCustomFilter.save(applicationObject.Globals, applicationObject.Solution.FullName);
         JiraIssueListModel.Instance.removeAllListeners();
         jiraWindow.Visible = false;
         jiraWindow.Close(vsSaveChanges.vsSaveChangesYes);
         jiraWindow = null;
         RecentlyViewedIssuesModel.Instance.save(applicationObject.Globals, applicationObject.Solution.FullName);
         IssueDetailsWindow.Instance.clearAllIssues();
         IssueDetailsWindow.Instance.WindowInstance.Visible = false;
     }
     catch (Exception e)
     {
         Debug.WriteLine(e);
     }
 }
Exemple #11
0
        public int OnAfterOpenSolution(object pUnkReserved, int fNewSolution)
        {
            PlvsLogger.log("SolutionEventSink.OnAfterOpenSolution()");
            try {
                GlobalSettings.checkFirstRun();

                JiraServerModel.Instance.clear();
                JiraServerModel.Instance.load();
                BambooServerModel.Instance.clear();
                BambooServerModel.Instance.load();
                RecentlyViewedIssuesModel.Instance.load();
                JiraCustomFilter.load();

                DTE dte = (DTE)Package.GetGlobalService(typeof(DTE));
                PlvsUtils.Dte = dte;

                ToolWindowManager.Instance.AtlassianWindow = createAtlassianWindow();

                AtlassianPanel.Instance.reinitialize(dte, package);

                ToolWindowManager.Instance.IssueDetailsWindow = createIssueDetailsWindow();
                ToolWindowManager.Instance.BuildDetailsWindow = createBuildDetailsWindow();

                IssueDetailsWindow.Instance.Solution = dte.Solution;
                BuildDetailsWindow.Instance.Solution = dte.Solution;

                JiraEditorLinkManager.OnSolutionOpened();
                Autoupdate.Instance.initialize();
            }
            catch (Exception e) {
                Debug.WriteLine(e);
                new ExceptionViewer("Failed to initialize JIRA tool windows", e).ShowDialog();
            }

            return(VSConstants.S_OK);
        }
        public EditCustomFilter(JiraServer server, JiraCustomFilter filter, bool editMode)
        {
            this.server = server;
            this.filter = filter;

            InitializeComponent();

            Text = editMode ? "Edit Local Filter" : "Add Local Filter";

            listViewProjects.Columns.Add(NAME_COLUMN, listViewProjects.Width - 30, HorizontalAlignment.Left);
            listViewAffectsVersions.Columns.Add(NAME_COLUMN, listViewAffectsVersions.Width - 30, HorizontalAlignment.Left);
            listViewFixForVersions.Columns.Add(NAME_COLUMN, listViewFixForVersions.Width - 30, HorizontalAlignment.Left);
            listViewComponents.Columns.Add(NAME_COLUMN, listViewComponents.Width - 30, HorizontalAlignment.Left);
            listViewResolutions.Columns.Add(NAME_COLUMN, listViewResolutions.Width - 30, HorizontalAlignment.Left);
            listViewIssueTypes.Columns.Add(NAME_COLUMN, listViewIssueTypes.Width - 30, HorizontalAlignment.Left);
            listViewPriorities.Columns.Add(NAME_COLUMN, listViewPriorities.Width - 30, HorizontalAlignment.Left);
            listViewStatuses.Columns.Add(NAME_COLUMN, listViewStatuses.Width - 30, HorizontalAlignment.Left);

            StartPosition = FormStartPosition.CenterParent;

            textBoxFilterName.Text = filter.Name;

            listViewProjects.SelectedIndexChanged += listViewProjects_SelectedValueChanged;
        }
Exemple #13
0
        private JiraCustomFilterTreeNode addCustomFilterTreeNode(JiraServer server, TreeNode node, JiraCustomFilter filter)
        {
            JiraCustomFilterTreeNode cfNode = new JiraCustomFilterTreeNode(server, filter, 1);

            cfNode.ContextMenuStrip = new CustomFilterContextMenu(server, cfNode, editCustomFilter, removeCustomFilter);

            node.Nodes.Add(cfNode);
            return(cfNode);
        }
        public List <JiraIssue> getCustomFilterIssues(JiraServer server, JiraCustomFilter filter, int start, int count)
        {
            RssClient rss = new RssClient(server);

            return(rss.getCustomFilterIssues(filter.getFilterQueryString(), "priority", "DESC", start, count));
        }