Github: allow to change issue state
[idea/community.git] / plugins / github / src / org / jetbrains / plugins / github / tasks / GithubRepositoryType.java
1 package org.jetbrains.plugins.github.tasks;
2
3 import com.intellij.openapi.project.Project;
4 import com.intellij.tasks.TaskRepository;
5 import com.intellij.tasks.TaskState;
6 import com.intellij.tasks.config.TaskRepositoryEditor;
7 import com.intellij.tasks.impl.BaseRepositoryType;
8 import com.intellij.util.Consumer;
9 import icons.TasksIcons;
10 import org.jetbrains.annotations.NotNull;
11
12 import javax.swing.*;
13 import java.util.EnumSet;
14
15 /**
16  * @author Dennis.Ushakov
17  */
18 public class GithubRepositoryType extends BaseRepositoryType<GithubRepository> {
19
20   @NotNull
21   @Override
22   public String getName() {
23     return "GitHub";
24   }
25
26   @NotNull
27   @Override
28   public Icon getIcon() {
29     return TasksIcons.Github;
30   }
31
32   @NotNull
33   @Override
34   public TaskRepository createRepository() {
35     return new GithubRepository(this);
36   }
37
38   @Override
39   public Class<GithubRepository> getRepositoryClass() {
40     return GithubRepository.class;
41   }
42
43   @NotNull
44   @Override
45   public TaskRepositoryEditor createEditor(GithubRepository repository,
46                                            Project project,
47                                            Consumer<GithubRepository> changeListener) {
48     return new GithubRepositoryEditor(project, repository, changeListener);
49   }
50
51   public EnumSet<TaskState> getPossibleTaskStates() {
52     return EnumSet.of(TaskState.OPEN, TaskState.RESOLVED);
53   }
54
55 }