From 13f69cd8332d401e9d3a321c3baed710d9cea235 Mon Sep 17 00:00:00 2001 From: junichi11 Date: Sat, 29 Aug 2015 00:20:55 +0900 Subject: [PATCH] Add missing items to some GeneratePanel lists #34 --- .../backlog/query/ui/GeneralPanel.java | 99 +++++++++++++++++-- .../backlog/query/ui/Bundle_ja_JP.properties | 6 ++ 2 files changed, 98 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/junichi11/netbeans/modules/backlog/query/ui/GeneralPanel.java b/src/main/java/com/junichi11/netbeans/modules/backlog/query/ui/GeneralPanel.java index b206005..52abc97 100644 --- a/src/main/java/com/junichi11/netbeans/modules/backlog/query/ui/GeneralPanel.java +++ b/src/main/java/com/junichi11/netbeans/modules/backlog/query/ui/GeneralPanel.java @@ -41,6 +41,13 @@ */ package com.junichi11.netbeans.modules.backlog.query.ui; +import com.junichi11.netbeans.modules.backlog.Backlog.FileType; +import com.junichi11.netbeans.modules.backlog.BacklogData; +import com.junichi11.netbeans.modules.backlog.query.BacklogQuery; +import com.junichi11.netbeans.modules.backlog.query.QueryUtils; +import com.junichi11.netbeans.modules.backlog.repository.BacklogRepository; +import com.junichi11.netbeans.modules.backlog.ui.AttributesListCellRenderer; +import com.junichi11.netbeans.modules.backlog.utils.StringUtils; import com.nulabinc.backlog4j.Category; import com.nulabinc.backlog4j.Issue; import com.nulabinc.backlog4j.Issue.PriorityType; @@ -63,13 +70,7 @@ import java.util.Collections; import java.util.List; import javax.swing.DefaultListModel; -import com.junichi11.netbeans.modules.backlog.Backlog.FileType; -import com.junichi11.netbeans.modules.backlog.BacklogData; -import com.junichi11.netbeans.modules.backlog.query.BacklogQuery; -import com.junichi11.netbeans.modules.backlog.query.QueryUtils; -import com.junichi11.netbeans.modules.backlog.repository.BacklogRepository; -import com.junichi11.netbeans.modules.backlog.ui.AttributesListCellRenderer; -import com.junichi11.netbeans.modules.backlog.utils.StringUtils; +import org.openide.util.NbBundle; /** * @@ -198,6 +199,7 @@ private void setCategory(List categories) { } categoryListModel.removeAllElements(); categoryListModel.addElement(new CategoryJSONImpl()); + categoryListModel.addElement(new NoCategory()); for (Category category : categories) { categoryListModel.addElement(category); } @@ -209,6 +211,7 @@ private void setVersion(List versions) { } versionListModel.removeAllElements(); versionListModel.addElement(new VersionJSONImpl()); + versionListModel.addElement(new NoVersion()); for (Version version : versions) { versionListModel.addElement(version); } @@ -220,6 +223,7 @@ private void setMilestone(List milestones) { } milestoneListModel.removeAllElements(); milestoneListModel.addElement(new VersionJSONImpl()); + milestoneListModel.addElement(new NoMilestone()); for (Version milestone : milestones) { milestoneListModel.addElement(milestone); } @@ -231,6 +235,7 @@ private void setResolution(List resolutions) { } resolutionListModel.removeAllElements(); resolutionListModel.addElement(new ResolutionJSONImpl()); + resolutionListModel.addElement(new NoResolution()); for (Resolution resolution : resolutions) { resolutionListModel.addElement(resolution); } @@ -242,6 +247,7 @@ private void setAssignee(List assignees) { } assigneeListModel.removeAllElements(); assigneeListModel.addElement(new UserJSONImpl()); + assigneeListModel.addElement(new UnassignedUser()); for (User assignee : assignees) { assigneeListModel.addElement(assignee); } @@ -867,4 +873,83 @@ private void notClosedLinkButtonActionPerformed(java.awt.event.ActionEvent evt) private javax.swing.JList versionList; private javax.swing.JScrollPane versionScrollPane; // End of variables declaration//GEN-END:variables + + //~ inner classes + private static class UnassignedUser extends UserJSONImpl { + + @Override + public long getId() { + return -1L; + } + + @NbBundle.Messages("UnassignedUser.name=Unassigned") + @Override + public String getName() { + return Bundle.UnassignedUser_name(); + } + + } + + private static class NoCategory extends CategoryJSONImpl { + + @Override + public long getId() { + return -1L; + } + + @NbBundle.Messages("NoCategory.name=No Category") + @Override + public String getName() { + return Bundle.NoCategory_name(); + } + } + + private static class NoVersion extends VersionJSONImpl { + + @Override + public long getId() { + return -1L; + } + + @NbBundle.Messages("NoVersion.name=No Version") + @Override + public String getName() { + return Bundle.NoVersion_name(); + } + } + + private static class NoMilestone extends VersionJSONImpl { + + @Override + public long getId() { + return -1L; + } + + @NbBundle.Messages("NoMilestone.name=No Milestone") + @Override + public String getName() { + return Bundle.NoMilestone_name(); + } + } + + private static class NoResolution extends ResolutionJSONImpl { + + @Override + public long getId() { + return -1L; + } + + @NbBundle.Messages("NoResolution.name=No Resolution") + @Override + public String getName() { + return Bundle.NoResolution_name(); + } + + @Override + public ResolutionType getResolution() { + return ResolutionType.NotSet; + } + + } + } diff --git a/src/main/resources/com/junichi11/netbeans/modules/backlog/query/ui/Bundle_ja_JP.properties b/src/main/resources/com/junichi11/netbeans/modules/backlog/query/ui/Bundle_ja_JP.properties index e341fb0..1248ca4 100644 --- a/src/main/resources/com/junichi11/netbeans/modules/backlog/query/ui/Bundle_ja_JP.properties +++ b/src/main/resources/com/junichi11/netbeans/modules/backlog/query/ui/Bundle_ja_JP.properties @@ -69,3 +69,9 @@ GeneralPanel.registeredByMeLinkButton.text=\u79c1\u3092\u9078\u629e GeneralPanel.resolutionLabel.text=\u5b8c\u4e86\u7406\u7531 GeneralPanel.statusLabel.text=\u72b6\u614b GeneralPanel.versionLabel.text=\u767a\u751f\u30d0\u30fc\u30b8\u30e7\u30f3 + +UnassignedUser.name=\u672a\u8a2d\u5b9a +NoCategory.name=\u672a\u8a2d\u5b9a +NoVersion.name=\u672a\u8a2d\u5b9a +NoMilestone.name=\u672a\u8a2d\u5b9a +NoResolution.name=\u672a\u8a2d\u5b9a