当前位置: 首页>>代码示例>>Java>>正文


Java TaskRepository类代码示例

本文整理汇总了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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:GenericRepositoryType.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:TaskCheckinHandlerFactory.java

示例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));
	}
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:23,代码来源:TaskManagerImpl.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:22,代码来源:TaskManagerImpl.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:18,代码来源:TaskVcsTest.java

示例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);
  }
}
 
开发者ID:VladRassokhin,项目名称:intellij-tasks-navigate,代码行数:20,代码来源:OpenableTaskPsiElement.java

示例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();
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:CloseTaskDialog.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:RecentTaskRepositories.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:RecentTaskRepositories.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:TaskRepositoriesConfigurable.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:TaskRepositoriesConfigurable.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:TaskStateCombo.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:TaskProjectConfiguration.java

示例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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:TaskUtil.java

示例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();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:32,代码来源:CloseTaskDialog.java


注:本文中的com.intellij.tasks.TaskRepository类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。