本文整理汇总了Java中com.intellij.tasks.TaskRepository类的典型用法代码示例。如果您正苦于以下问题:Java TaskRepository类的具体用法?Java TaskRepository怎么用?Java TaskRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TaskRepository类属于com.intellij.tasks包,在下文中一共展示了TaskRepository类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: addRepositoryEditor
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
private void addRepositoryEditor(TaskRepository repository, boolean requestFocus) {
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();
JComponent preferred = editor.getPreferredFocusedComponent();
if (preferred != null && requestFocus) {
IdeFocusManager.getInstance(myProject).requestFocus(preferred, false);
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:TaskRepositoriesConfigurable.java
示例17: 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
示例18: createTask
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
public void createTask()
{
final TaskManagerImpl taskManager = (TaskManagerImpl) TaskManager.getManager(myProject);
if(myUpdateState.isSelected())
{
final CustomTaskState taskState = myTaskStateCombo.getSelectedState();
final TaskRepository repository = myTask.getRepository();
if(repository != null && taskState != null)
{
try
{
repository.setTaskState(myTask, taskState);
repository.setPreferredOpenTaskState(taskState);
}
catch(Exception ex)
{
Messages.showErrorDialog(myProject, ex.getMessage(), "Cannot Set State For Issue");
LOG.warn(ex);
}
}
}
taskManager.activateTask(myTask, isClearContext());
if(myTask.getType() == TaskType.EXCEPTION && AnalyzeTaskStacktraceAction.hasTexts(myTask))
{
AnalyzeTaskStacktraceAction.analyzeStacktrace(myTask, myProject);
}
for(TaskDialogPanel panel : myPanels)
{
panel.commit();
}
}
开发者ID:consulo,项目名称:consulo-tasks,代码行数:34,代码来源:OpenTaskDialog.java
示例19: createUIComponents
import com.intellij.tasks.TaskRepository; //导入依赖的package包/类
private void createUIComponents()
{
myTaskStateCombo = new TaskStateCombo(myProject, myTask)
{
@Nullable
@Override
protected CustomTaskState getPreferredState(@NotNull TaskRepository repository, @NotNull Collection<CustomTaskState> available)
{
return repository.getPreferredOpenTaskState();
}
};
}
开发者ID:consulo,项目名称:consulo-tasks,代码行数:13,代码来源:OpenTaskDialog.java
示例20: 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:consulo,项目名称:consulo-tasks,代码行数:13,代码来源:CloseTaskDialog.java
注:本文中的com.intellij.tasks.TaskRepository类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论