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


Java ChangeListInfo类代码示例

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


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

示例1: doOKAction

import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
@Override
protected void doOKAction() {
  myTask.setSummary(mySummary.getText());
  if (myChangelist.isVisible()) {
    List<ChangeListInfo> changeLists = myTask.getChangeLists();
    changeLists.clear();
    LocalChangeList item = (LocalChangeList)myChangelist.getSelectedItem();
    if (item != null) {
      changeLists.add(new ChangeListInfo(item));
    }
  }
  if (myBranch.isVisible()) {
    List<BranchInfo> branches = myTask.getBranches();
    branches.clear();
    VcsTaskHandler.TaskInfo branch = (VcsTaskHandler.TaskInfo)myBranch.getSelectedItem();
    if (branch != null) {
      List<BranchInfo> infos = BranchInfo.fromTaskInfo(branch, false);
      branches.addAll(infos);
    }
  }
  close(OK_EXIT_CODE);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:EditTaskDialog.java

示例2: commit

import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
@Override
public void commit() {

  if (myCommitChanges.isEnabled()) {
    myTaskManager.getState().commitChanges = isCommitChanges();
  }
  if (myMergeBranches.isEnabled()) {
    myTaskManager.getState().mergeBranch = isMergeBranch();
  }
  
  if (isCommitChanges()) {
    ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
    for (ChangeListInfo info : myTask.getChangeLists()) {
      LocalChangeList list = changeListManager.getChangeList(info.id);
      if (list != null) {
        changeListManager.commitChanges(list, new ArrayList<>(list.getChanges()));
      }
    }
  }
  if (isMergeBranch()) {
    myTaskManager.mergeBranch(myTask);
  }

}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:25,代码来源:VcsCloseTaskPanel.java

示例3: isLocallyClosed

import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
@Override
public boolean isLocallyClosed(@NotNull LocalTask localTask)
{
	if(isVcsEnabled())
	{
		List<ChangeListInfo> lists = localTask.getChangeLists();
		if(lists.isEmpty())
		{
			return true;
		}
		for(ChangeListInfo list : lists)
		{
			if(StringUtil.isEmpty(list.id))
			{
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:21,代码来源:TaskManagerImpl.java

示例4: getAssociatedTask

import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
@Nullable
@Override
public LocalTask getAssociatedTask(@NotNull LocalChangeList list)
{
	for(LocalTask task : getLocalTasks())
	{
		for(ChangeListInfo changeListInfo : task.getChangeLists())
		{
			if(changeListInfo.id.equals(list.getId()))
			{
				return task;
			}
		}
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:17,代码来源:TaskManagerImpl.java

示例5: createChangeList

import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
private void createChangeList(LocalTask task, String name, @Nullable String comment)
{
	LocalChangeList changeList = myChangeListManager.findChangeList(name);
	if(changeList == null)
	{
		changeList = myChangeListManager.addChangeList(name, comment);
	}
	else
	{
		final LocalTask associatedTask = getAssociatedTask(changeList);
		if(associatedTask != null)
		{
			associatedTask.removeChangelist(new ChangeListInfo(changeList));
		}
		changeList.setComment(comment);
	}
	task.addChangelist(new ChangeListInfo(changeList));
	myChangeListManager.setDefaultChangeList(changeList);
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:20,代码来源:TaskManagerImpl.java

示例6: addControls

import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
public Consumer<LocalChangeList> addControls(JPanel bottomPanel, final LocalChangeList initial) {
  final JCheckBox checkBox = new JCheckBox("Track context");
  checkBox.setMnemonic('t');
  checkBox.setToolTipText("Reload context (e.g. open editors) when changelist is set active");
  checkBox.setSelected(initial == null ?
                       myTaskManager.getState().trackContextForNewChangelist :
                       myTaskManager.getAssociatedTask(initial) != null);
  bottomPanel.add(checkBox);
  return new Consumer<LocalChangeList>() {
    public void consume(LocalChangeList changeList) {
      if (initial == null) {
        myTaskManager.getState().trackContextForNewChangelist = checkBox.isSelected();
        if (checkBox.isSelected()) {
          myTaskManager.trackContext(changeList);
        }
        else {
          myTaskManager.getActiveTask().addChangelist(new ChangeListInfo(changeList));
        }
      }
      else {
        final LocalTask associatedTask = myTaskManager.getAssociatedTask(changeList);
        if (checkBox.isSelected()) {
          if (associatedTask == null) {
            myTaskManager.trackContext(changeList);
          }
        }
        else {
          if (associatedTask != null) {
            myTaskManager.removeTask(associatedTask);
          }
        }
      }
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:TaskChangelistSupport.java

示例7: getChangeLists

import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
@NotNull
@Property(surroundWithTag = false)
@AbstractCollection(surroundWithTag = false, elementTag = "changelist")
public List<ChangeListInfo> getChangeLists()
{
	return myChangeLists;
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:8,代码来源:LocalTaskImpl.java

示例8: addChangelist

import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
@Override
public void addChangelist(final ChangeListInfo info)
{
	if(!myChangeLists.contains(info))
	{
		myChangeLists.add(info);
	}
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:9,代码来源:LocalTaskImpl.java

示例9: TaskManagerImpl

import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
public TaskManagerImpl(Project project, WorkingContextManager contextManager, ChangeListManager changeListManager)
{

	myProject = project;
	myContextManager = contextManager;
	myChangeListManager = changeListManager;

	myChangeListListener = new ChangeListAdapter()
	{
		@Override
		public void changeListRemoved(ChangeList list)
		{
			LocalTask task = getAssociatedTask((LocalChangeList) list);
			if(task != null)
			{
				for(ChangeListInfo info : task.getChangeLists())
				{
					if(Comparing.equal(info.id, ((LocalChangeList) list).getId()))
					{
						info.id = "";
					}
				}
			}
		}

		@Override
		public void defaultListChanged(ChangeList oldDefaultList, ChangeList newDefaultList)
		{
			final LocalTask associatedTask = getAssociatedTask((LocalChangeList) newDefaultList);
			if(associatedTask != null && !getActiveTask().equals(associatedTask))
			{
				ApplicationManager.getApplication().invokeLater(() -> activateTask(associatedTask, true), myProject.getDisposed());
			}
		}
	};
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:37,代码来源:TaskManagerImpl.java

示例10: trackContext

import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
@Override
public void trackContext(@NotNull LocalChangeList changeList)
{
	ChangeListInfo changeListInfo = new ChangeListInfo(changeList);
	String changeListName = changeList.getName();
	LocalTaskImpl task = createLocalTask(changeListName);
	task.addChangelist(changeListInfo);
	addTask(task);
	if(changeList.isDefault())
	{
		activateTask(task, false);
	}
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:14,代码来源:TaskManagerImpl.java

示例11: disassociateFromTask

import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
@Override
public void disassociateFromTask(@NotNull LocalChangeList changeList)
{
	ChangeListInfo changeListInfo = new ChangeListInfo(changeList);
	for(LocalTask localTask : getLocalTasks())
	{
		if(localTask.getChangeLists().contains(changeListInfo))
		{
			localTask.removeChangelist(changeListInfo);
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:13,代码来源:TaskManagerImpl.java

示例12: testInitialState

import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
public void testInitialState() {
  assertEquals(1, myTaskManager.getLocalTasks().size());
  final LocalTask defaultTask = myTaskManager.getLocalTasks().get(0);
  assertEquals(defaultTask, myTaskManager.getActiveTask());
  assertTrue(defaultTask.isDefault());

  assertEquals(1, myChangeListManager.getChangeListsCopy().size());
  assertEquals(1, defaultTask.getChangeLists().size());

  assertEquals(defaultTask, myTaskManager.getAssociatedTask(myChangeListManager.getChangeListsCopy().get(0)));
  assertEquals(defaultTask.getChangeLists().get(0).id, myChangeListManager.getChangeListsCopy().get(0).getId());
  Assert.assertEquals(defaultTask.getChangeLists().get(0), new ChangeListInfo(myChangeListManager.getChangeListsCopy().get(0)));
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:14,代码来源:TaskVcsTest.java

示例13: testCreateComment

import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
public void testCreateComment() throws Exception {
  myRepository.setShouldFormatCommitMessage(true);
  myRepository.setCommitMessageFormat("{id} {summary} {number} {project}");
  Task task = myRepository.findTask("TEST-001");
  assertNotNull(task);
  activateAndCreateChangelist(task);
  myChangeListManager.waitUntilRefreshed();
  LocalTask localTask = myTaskManager.getActiveTask();
  assertNotNull(localTask);
  assertEquals("TEST-001", localTask.getId());
  List<ChangeListInfo> lists = localTask.getChangeLists();
  assertEquals(1, lists.size());
  assertEquals("TEST-001 Summary 001 TEST", lists.get(0).comment);
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:15,代码来源:TaskVcsTest.java

示例14: testSaveContextOnCommitForExistingTask

import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
public void testSaveContextOnCommitForExistingTask() throws Exception {
  myTaskManager.getState().saveContextOnCommit = true;

  assertEquals(1, myTaskManager.getLocalTasks().size());

  Task task = myRepository.findTask("TEST-001");
  assertNotNull(task);
  assertEquals(1, myChangeListManager.getChangeListsCopy().size());  // default change list should be here
  activateAndCreateChangelist(task);
  myChangeListManager.waitUntilRefreshed();

  assertEquals(2, myTaskManager.getLocalTasks().size());
  List<LocalChangeList> copy = myChangeListManager.getChangeListsCopy();
  assertEquals(copy.toString(), 2, copy.size());
  LocalTask localTask = myTaskManager.getActiveTask();
  List<ChangeListInfo> changelists = localTask.getChangeLists();
  ChangeListInfo info = changelists.get(0);
  LocalChangeList changeList = myChangeListManager.getChangeList(info.id);
  assertNotNull(changeList);

  CommitChangeListDialog.commitChanges(getProject(), Collections.<Change>emptyList(), changeList, null, changeList.getName());

  assertEquals(2, myTaskManager.getLocalTasks().size()); // no extra task created
  assertEquals(2, myChangeListManager.getChangeListsCopy().size());

  assertEquals(localTask, myTaskManager.getAssociatedTask(changeList)); // association should survive
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:28,代码来源:TaskVcsTest.java

示例15: setChangeLists

import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
public void setChangeLists(List<ChangeListInfo> changeLists)
{
	myChangeLists = changeLists;
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:5,代码来源:LocalTaskImpl.java


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