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


Java TaskRepository.isSupported方法代码示例

本文整理汇总了Java中com.intellij.tasks.TaskRepository.isSupported方法的典型用法代码示例。如果您正苦于以下问题:Java TaskRepository.isSupported方法的具体用法?Java TaskRepository.isSupported怎么用?Java TaskRepository.isSupported使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.tasks.TaskRepository的用法示例。


在下文中一共展示了TaskRepository.isSupported方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: doOKAction

import com.intellij.tasks.TaskRepository; //导入方法依赖的package包/类
@Override
protected void doOKAction() {
  String timeSpentText = myFromPreviousPostRadioButton.isSelected() ? myFromPreviousPostTextField.getText()
                         : myTotallyRadioButton.isSelected() ? myTotallyTextField.getText() : myCustomTextField.getText();
  final Matcher matcher = PATTERN.matcher(timeSpentText);
  if (matcher.matches()) {
    final int timeSpent = Integer.valueOf(matcher.group(1)) * 24 * 60 + Integer.valueOf(matcher.group(2)) * 60 + Integer.valueOf(
      matcher.group(3));

    final TaskRepository repository = myTask.getRepository();
    if (repository != null &&
        repository.isSupported(TaskRepository.TIME_MANAGEMENT)) {
      try {
        repository.updateTimeSpent(myTask, timeSpentText, myCommentTextArea.getText());
        myTask.setLastPost(new Date());
      }
      catch (Exception e1) {
        Messages
          .showErrorDialog(myProject, "<html>Could not send information for " + myTask.getPresentableName() + "<br/>" + e1.getMessage(),
                           "Error");
        LOG.warn(e1);
      }
    }
  }


  super.doOKAction();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:29,代码来源:SendTimeTrackingInformationDialog.java

示例3: 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:consulo,项目名称:consulo-tasks,代码行数:10,代码来源:TaskStateCombo.java

示例4: isStateSupported

import com.intellij.tasks.TaskRepository; //导入方法依赖的package包/类
@Contract("null, _ -> false")
public static boolean isStateSupported(@Nullable TaskRepository repository, @NotNull TaskState state)
{
	if(repository == null || !repository.isSupported(TaskRepository.STATE_UPDATING))
	{
		return false;
	}
	return repository.getRepositoryType().getPossibleTaskStates().contains(state);
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:10,代码来源:TaskUtil.java

示例5: getIssuesFromRepositories

import com.intellij.tasks.TaskRepository; //导入方法依赖的package包/类
@Nullable
private List<Task> getIssuesFromRepositories(@Nullable String request, int offset, int limit, boolean withClosed, boolean forceRequest, @NotNull final ProgressIndicator cancelled)
{
	List<Task> issues = null;
	for(final TaskRepository repository : getAllRepositories())
	{
		if(!repository.isConfigured() || (!forceRequest && myBadRepositories.contains(repository)))
		{
			continue;
		}
		try
		{
			long start = System.currentTimeMillis();
			Task[] tasks = repository.getIssues(request, offset, limit, withClosed, cancelled);
			long timeSpent = System.currentTimeMillis() - start;
			LOG.info(String.format("Total %s ms to download %d issues from '%s' (pattern '%s')", timeSpent, tasks.length, repository.getUrl(), request));
			myBadRepositories.remove(repository);
			if(issues == null)
			{
				issues = new ArrayList<>(tasks.length);
			}
			if(!repository.isSupported(TaskRepository.NATIVE_SEARCH) && request != null)
			{
				List<Task> filteredTasks = TaskSearchSupport.filterTasks(request, ContainerUtil.list(tasks));
				ContainerUtil.addAll(issues, filteredTasks);
			}
			else
			{
				ContainerUtil.addAll(issues, tasks);
			}
		}
		catch(ProcessCanceledException ignored)
		{
			// OK
		}
		catch(Exception e)
		{
			String reason = "";
			// Fix to IDEA-111810
			//noinspection InstanceofCatchParameter
			if(e.getClass() == Exception.class || e instanceof RequestFailedException)
			{
				// probably contains some message meaningful to end-user
				reason = e.getMessage();
			}
			//noinspection InstanceofCatchParameter
			if(e instanceof SocketTimeoutException || e instanceof HttpRequests.HttpStatusException)
			{
				LOG.warn("Can't connect to " + repository + ": " + e.getMessage());
			}
			else
			{
				LOG.warn("Cannot connect to " + repository, e);
			}
			myBadRepositories.add(repository);
			if(forceRequest)
			{
				notifyAboutConnectionFailure(repository, reason);
			}
		}
	}
	return issues;
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:64,代码来源:TaskManagerImpl.java


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