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


Java Change.getFileStatus方法代码示例

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


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

示例1: update

import com.intellij.openapi.vcs.changes.Change; //导入方法依赖的package包/类
@Override
protected void update(final VcsContext vcsContext, final Presentation presentation) {
  super.update(vcsContext, presentation);
  if (presentation.isVisible() && presentation.isEnabled()) {
    final ChangeList[] selectedChangeLists = vcsContext.getSelectedChangeLists();
    final Change[] selectedChanges = vcsContext.getSelectedChanges();
    if (vcsContext.getPlace().equals(ActionPlaces.CHANGES_VIEW_POPUP)) {
      if (selectedChangeLists != null && selectedChangeLists.length > 0) {
        presentation.setEnabled(selectedChangeLists.length == 1 && !ContainerUtil.isEmpty(selectedChangeLists[0].getChanges()));
      }
      else {
        presentation.setEnabled (selectedChanges != null && selectedChanges.length > 0);
      }
    }
    if (presentation.isEnabled() && selectedChanges != null) {
      final ChangeListManager changeListManager = ChangeListManager.getInstance(vcsContext.getProject());
      for(Change c: selectedChanges) {
        if (c.getFileStatus() == FileStatus.HIJACKED && changeListManager.getChangeList(c) == null) {
          presentation.setEnabled(false);
          break;
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:AbstractCommitChangesAction.java

示例2: containsUnresolvedConflicts

import com.intellij.openapi.vcs.changes.Change; //导入方法依赖的package包/类
private static boolean containsUnresolvedConflicts(@NotNull CheckinProjectPanel panel) {
  for (Change change : panel.getSelectedChanges()) {
    FileStatus status = change.getFileStatus();
    if (status.equals(FileStatus.MERGE) || status.equals(FileStatus.MERGED_WITH_BOTH_CONFLICTS) ||
        status.equals(FileStatus.MERGED_WITH_CONFLICTS) || status.equals(FileStatus.MERGED_WITH_PROPERTY_CONFLICTS)) {
      return true;
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:UnresolvedMergeCheckFactory.java

示例3: isEnabled

import com.intellij.openapi.vcs.changes.Change; //导入方法依赖的package包/类
@Override
protected boolean isEnabled(@NotNull AnActionEvent event) {
  final Collection<Change> changes = ChangeListManager.getInstance(event.getProject()).getAllChanges();
  if (changes.size() > 1000) {
    return true;
  }
  for (Change change : changes) {
    if (change.getFileStatus() == FileStatus.MERGED_WITH_CONFLICTS) {
      return true;
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:GitResolveConflictsAction.java

示例4: IncomingChangeState

import com.intellij.openapi.vcs.changes.Change; //导入方法依赖的package包/类
public IncomingChangeState(final Change change, final String revision, State state) {
  myRevision = revision;
  myStatus = change.getFileStatus();
  myPath = ChangesUtil.getFilePath(change);
  myState = state;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:IncomingChangeState.java


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