Skip to content

Commit

Permalink
Add missing items to some GeneratePanel lists #34
Browse files Browse the repository at this point in the history
  • Loading branch information
junichi11 committed Aug 28, 2015
1 parent d356c60 commit 13f69cd
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

/**
*
Expand Down Expand Up @@ -198,6 +199,7 @@ private void setCategory(List<Category> categories) {
}
categoryListModel.removeAllElements();
categoryListModel.addElement(new CategoryJSONImpl());
categoryListModel.addElement(new NoCategory());
for (Category category : categories) {
categoryListModel.addElement(category);
}
Expand All @@ -209,6 +211,7 @@ private void setVersion(List<Version> versions) {
}
versionListModel.removeAllElements();
versionListModel.addElement(new VersionJSONImpl());
versionListModel.addElement(new NoVersion());
for (Version version : versions) {
versionListModel.addElement(version);
}
Expand All @@ -220,6 +223,7 @@ private void setMilestone(List<Version> milestones) {
}
milestoneListModel.removeAllElements();
milestoneListModel.addElement(new VersionJSONImpl());
milestoneListModel.addElement(new NoMilestone());
for (Version milestone : milestones) {
milestoneListModel.addElement(milestone);
}
Expand All @@ -231,6 +235,7 @@ private void setResolution(List<Resolution> resolutions) {
}
resolutionListModel.removeAllElements();
resolutionListModel.addElement(new ResolutionJSONImpl());
resolutionListModel.addElement(new NoResolution());
for (Resolution resolution : resolutions) {
resolutionListModel.addElement(resolution);
}
Expand All @@ -242,6 +247,7 @@ private void setAssignee(List<User> assignees) {
}
assigneeListModel.removeAllElements();
assigneeListModel.addElement(new UserJSONImpl());
assigneeListModel.addElement(new UnassignedUser());
for (User assignee : assignees) {
assigneeListModel.addElement(assignee);
}
Expand Down Expand Up @@ -867,4 +873,83 @@ private void notClosedLinkButtonActionPerformed(java.awt.event.ActionEvent evt)
private javax.swing.JList<Version> 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;
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 13f69cd

Please sign in to comment.