PageRenderTime 21ms CodeModel.GetById 13ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/src/org/bitbucket/connectors/jetbrains/tasks/BitbucketIssueRepositoryType.java

https://bitbucket.org/atlassian/jetbrains-bitbucket-connector/
Java | 55 lines | 41 code | 8 blank | 6 comment | 0 complexity | 06c1ebc06f5a4d8f962bec3d79afe4f8 MD5 | raw file
 1package org.bitbucket.connectors.jetbrains.tasks;
 2
 3import com.intellij.openapi.project.Project;
 4import com.intellij.tasks.TaskRepository;
 5import com.intellij.tasks.TaskState;
 6import com.intellij.tasks.config.TaskRepositoryEditor;
 7import com.intellij.tasks.impl.BaseRepositoryType;
 8import com.intellij.util.Consumer;
 9import org.bitbucket.connectors.jetbrains.BitbucketUtil;
10import org.jetbrains.annotations.NotNull;
11
12import javax.swing.*;
13import java.util.EnumSet;
14
15/**
16 * Created by IntelliJ IDEA.
17 * User: Jon S Akhtar
18 * Date: 9/4/11
19 * Time: 3:46 PM
20 */
21public class BitbucketIssueRepositoryType extends BaseRepositoryType<BitbucketIssueRepository> {
22    @NotNull
23    @Override
24    public String getName() {
25        return BitbucketUtil.BITBUCKET;
26    }
27
28    @Override
29    public Icon getIcon() {
30        return BitbucketUtil.ICON;
31    }
32
33    @NotNull
34    @Override
35    public TaskRepository createRepository() {
36        return new BitbucketIssueRepository(this);
37    }
38
39    @Override
40    public Class<BitbucketIssueRepository> getRepositoryClass() {
41        return BitbucketIssueRepository.class;
42    }
43
44    @NotNull
45    @Override
46    public TaskRepositoryEditor createEditor(BitbucketIssueRepository repository, Project project,
47                                             Consumer<BitbucketIssueRepository> changeListener) {
48        return new BitbucketIssueRepositoryEditor(project, repository, changeListener);
49    }
50
51    @Override
52    public EnumSet<TaskState> getPossibleTaskStates() {
53        return EnumSet.of(TaskState.OPEN, TaskState.RESOLVED, TaskState.SUBMITTED);
54    }
55}