a677fad0d7818371de9b97ce61d437285fd411b7
[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.config.TaskRepositoryEditor;
6 import com.intellij.tasks.impl.BaseRepositoryType;
7 import com.intellij.util.Consumer;
8 import icons.TasksIcons;
9 import org.jetbrains.annotations.NotNull;
10
11 import javax.swing.*;
12
13 /**
14  * @author Dennis.Ushakov
15  */
16 public class GithubRepositoryType extends BaseRepositoryType<GithubRepository> {
17
18   @NotNull
19   @Override
20   public String getName() {
21     return "GitHub";
22   }
23
24   @NotNull
25   @Override
26   public Icon getIcon() {
27     return TasksIcons.Github;
28   }
29
30   @NotNull
31   @Override
32   public TaskRepository createRepository() {
33     return new GithubRepository(this);
34   }
35
36   @Override
37   public Class<GithubRepository> getRepositoryClass() {
38     return GithubRepository.class;
39   }
40
41   @NotNull
42   @Override
43   public TaskRepositoryEditor createEditor(GithubRepository repository,
44                                            Project project,
45                                            Consumer<GithubRepository> changeListener) {
46     return new GithubRepositoryEditor(project, repository, changeListener);
47   }
48 }