本文整理汇总了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);
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}
}
}
};
}
示例7: getChangeLists
import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
@NotNull
@Property(surroundWithTag = false)
@AbstractCollection(surroundWithTag = false, elementTag = "changelist")
public List<ChangeListInfo> getChangeLists()
{
return myChangeLists;
}
示例8: addChangelist
import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
@Override
public void addChangelist(final ChangeListInfo info)
{
if(!myChangeLists.contains(info))
{
myChangeLists.add(info);
}
}
示例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());
}
}
};
}
示例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);
}
}
示例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);
}
}
}
示例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)));
}
示例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);
}
示例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
}
示例15: setChangeLists
import com.intellij.tasks.ChangeListInfo; //导入依赖的package包/类
public void setChangeLists(List<ChangeListInfo> changeLists)
{
myChangeLists = changeLists;
}