本文整理汇总了Java中com.intellij.tasks.TaskRepository类的典型用法代码示例。如果您正苦于以下问题:Java TaskRepository类的具体用法?Java TaskRepository怎么用?Java TaskRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TaskRepository类属于com.intellij.tasks包,在下文中一共展示了TaskRepository类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRepository
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
@Override
public TaskRepository createRepository() {
Document document;
try {
String configFileName = myName.toLowerCase() + ".xml";
//URL resourceUrl = ResourceUtil.getResource(GenericRepositoryType.class, "connectors", configFileName);
URL resourceUrl = GenericRepository.class.getResource("connectors/" + configFileName);
if (resourceUrl == null) {
throw new AssertionError("Repository configuration file '" + configFileName + "' not found");
}
document = JDOMUtil.loadResourceDocument(resourceUrl);
}
catch (Exception e) {
throw new AssertionError(e);
}
GenericRepository repository = XmlSerializer.deserialize(document.getRootElement(), GenericRepository.class);
if (repository != null) {
repository.setRepositoryType(GenericRepositoryType.this);
repository.setSubtypeName(getName());
}
return repository;
}
示例2: findTaskInRepositories
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
@Nullable
private static Task findTaskInRepositories(String message, TaskManager manager) {
TaskRepository[] repositories = manager.getAllRepositories();
for (TaskRepository repository : repositories) {
String id = repository.extractId(message);
if (id == null) continue;
LocalTask localTask = manager.findTask(id);
if (localTask != null) return localTask;
try {
Task task = repository.findTask(id);
if (task != null) {
return task;
}
}
catch (Exception ignore) {
}
}
return null;
}
示例3: updateIssues
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
public void updateIssues(final @Nullable Runnable onComplete)
{
TaskRepository first = ContainerUtil.find(getAllRepositories(), repository -> repository.isConfigured());
if(first == null)
{
myIssueCache.clear();
if(onComplete != null)
{
onComplete.run();
}
return;
}
myUpdating = true;
if(ApplicationManager.getApplication().isUnitTestMode())
{
doUpdate(onComplete);
}
else
{
ApplicationManager.getApplication().executeOnPooledThread(() -> doUpdate(onComplete));
}
}
示例4: notifyAboutConnectionFailure
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
private void notifyAboutConnectionFailure(final TaskRepository repository, String details)
{
Notifications.Bus.register(TASKS_NOTIFICATION_GROUP, NotificationDisplayType.BALLOON);
String content = "<p><a href=\"\">Configure server...</a></p>";
if(!StringUtil.isEmpty(details))
{
content = "<p>" + details + "</p>" + content;
}
Notifications.Bus.notify(new Notification(TASKS_NOTIFICATION_GROUP, "Cannot connect to " + repository.getUrl(), content, NotificationType.WARNING, new NotificationListener()
{
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event)
{
TaskRepositoriesConfigurable configurable = new TaskRepositoriesConfigurable(myProject);
ShowSettingsUtil.getInstance().editConfigurable(myProject, configurable);
if(!ArrayUtil.contains(repository, getAllRepositories()))
{
notification.expire();
}
}
}), myProject);
}
示例5: testProjectWithDash
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
public void testProjectWithDash() throws Exception {
LocalTaskImpl task = new LocalTaskImpl("foo-bar-001", "summary") {
@Override
public TaskRepository getRepository() {
return myRepository;
}
@Override
public boolean isIssue() {
return true;
}
};
assertEquals("foo-bar", task.getProject());
assertEquals("001", task.getNumber());
String name = myTaskManager.getChangelistName(task);
assertEquals("foo-bar-001 summary", name);
}
示例6: navigate
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
@Override
public void navigate(boolean b) {
final Task task = getTask();
TaskRepository repository = task.getRepository();
if (repository instanceof YouTrackRepository) {
ToolWindowManager manager = ToolWindowManager.getInstance(getProject());
ToolWindow toolWindow = manager.getToolWindow("YouTrack");
if (toolWindow != null) {
// TODO: Add some logic
}
}
final String url = task.getIssueUrl();
if (url != null) {
BrowserUtil.open(url);
} else {
LOG.warn("Cannot open task in browser: url is null for task :" + task);
}
}
示例7: createUIComponents
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
private void createUIComponents() {
myStateCombo = new TaskStateCombo(myProject, myTask) {
@Nullable
@Override
protected CustomTaskState getPreferredState(@NotNull TaskRepository repository, @NotNull Collection<CustomTaskState> available) {
return repository.getPreferredCloseTaskState();
}
};
}
示例8: getRepositories
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
public Set<TaskRepository> getRepositories() {
return new THashSet<TaskRepository>(ContainerUtil.findAll(myRepositories, new Condition<TaskRepository>() {
public boolean value(TaskRepository repository) {
return !StringUtil.isEmptyOrSpaces(repository.getUrl());
}
}), HASHING_STRATEGY);
}
示例9: doAddReps
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
private boolean doAddReps(Collection<TaskRepository> repositories) {
for (TaskRepository repository : repositories) {
if (!StringUtil.isEmptyOrSpaces(repository.getUrl())) {
if (myRepositories.size() == 10) {
return true;
}
myRepositories.add(repository);
}
}
return false;
}
示例10: addRepositoryEditor
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
private void addRepositoryEditor(TaskRepository repository) {
TaskRepositoryEditor editor = repository.getRepositoryType().createEditor(repository, myProject, myChangeListener);
myEditors.add(editor);
JComponent component = editor.createComponent();
String name = myRepoNames.get(repository);
myRepositoryEditor.add(component, name);
myRepositoryEditor.doLayout();
}
示例11: apply
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
public void apply() throws ConfigurationException {
List<TaskRepository> newRepositories = ContainerUtil.map(myRepositories, new Function<TaskRepository, TaskRepository>() {
public TaskRepository fun(TaskRepository taskRepository) {
return taskRepository.clone();
}
});
myManager.setRepositories(newRepositories);
myManager.updateIssues(null);
RecentTaskRepositories.getInstance().addRepositories(myRepositories);
}
示例12: stateUpdatesSupportedFor
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
public static boolean stateUpdatesSupportedFor(@Nullable Task task) {
if (task == null || !task.isIssue()) {
return false;
}
final TaskRepository repository = task.getRepository();
return repository != null && repository.isSupported(TaskRepository.STATE_UPDATING);
}
示例13: getState
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
public TaskProjectConfiguration getState() {
servers.clear();
for (TaskRepository repository : myManager.getAllRepositories()) {
if (repository.isShared()) {
SharedServer server = new SharedServer();
server.type = repository.getRepositoryType().getName();
server.url = repository.getUrl();
servers.add(server);
}
}
return this;
}
示例14: getChangeListComment
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
@Nullable
public static String getChangeListComment(Task task) {
final TaskRepository repository = task.getRepository();
if (repository == null || !repository.isShouldFormatCommitMessage()) {
return null;
}
return formatTask(task, repository.getCommitMessageFormat());
}
示例15: CloseTaskDialog
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
public CloseTaskDialog(Project project, LocalTask task) {
super(project, false);
setTitle("Close Task");
myTaskLabel.setText(task.getSummary());
myTaskLabel.setIcon(task.getIcon());
TaskRepository repository = task.getRepository();
boolean visible = task.isIssue() && repository != null && repository.getRepositoryType().getPossibleTaskStates().contains(TaskState.RESOLVED);
myCloseIssue.setVisible(visible);
myTaskManager = (TaskManagerImpl)TaskManager.getManager(project);
myCloseIssue.setSelected(visible && myTaskManager.getState().closeIssue);
if (myTaskManager.isVcsEnabled()) {
myCommitChanges.setEnabled(!task.getChangeLists().isEmpty());
myCommitChanges.setSelected(myTaskManager.getState().commitChanges);
if (myTaskManager.getActiveVcs().getType() == VcsType.distributed) {
boolean enabled = !task.getBranches(true).isEmpty() && !task.getBranches(false).isEmpty();
myMergeBranches.setEnabled(enabled);
myMergeBranches.setSelected(enabled && myTaskManager.getState().mergeBranch);
}
else {
myMergeBranches.setVisible(false);
}
}
else {
myVcsPanel.setVisible(false);
}
init();
}