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


Java VcsDataKeys.SELECTED_CHANGES属性代码示例

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


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

示例1: getData

public Object getData(@Nonnull Key<?> dataId) {
  if (CommittedChangesBrowserUseCase.DATA_KEY == dataId) {
    return myUseCase;
  }

  else if (VcsDataKeys.SELECTED_CHANGES == dataId) {
    final List<Change> list = myViewer.getSelectedChanges();
    return list.toArray(new Change[list.size()]);
  }
  else if (VcsDataKeys.CHANGE_LEAD_SELECTION == dataId) {
    final Change highestSelection = myViewer.getHighestLeadSelection();
    return (highestSelection == null) ? new Change[]{} : new Change[]{highestSelection};
  }
  else {
    final TypeSafeDataProviderAdapter adapter = new TypeSafeDataProviderAdapter(this);
    return adapter.getData(dataId);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:RepositoryChangesBrowser.java

示例2: calcData

public void calcData(final Key key, final DataSink sink) {
  if (PlatformDataKeys.COPY_PROVIDER == key) {
    sink.put(PlatformDataKeys.COPY_PROVIDER, myCopyProvider);
  }
  else if (PlatformDataKeys.TREE_EXPANDER == key) {
    sink.put(PlatformDataKeys.TREE_EXPANDER, myTreeExpander);
  }
  else {
    if (VcsDataKeys.SELECTED_CHANGES == key || VcsDataKeys.CHANGE_LEAD_SELECTION == key || CommittedChangesBrowserUseCase.DATA_KEY == key) {
      final Object data = myDetailsView.getData(key);
      if (data != null) {
        sink.put(key, data);
      }
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:16,代码来源:CommittedChangesTreeBrowser.java

示例3: calcData

@Override
public void calcData(DataKey key, DataSink sink) {
  if (VcsLogDataKeys.VCS_LOG == key) {
    sink.put(key, myLog);
  }
  else if (VcsLogDataKeys.VCS_LOG_UI == key) {
    sink.put(key, myUI);
  }
  else if (VcsLogDataKeys.VCS_LOG_DATA_PROVIDER == key) {
    sink.put(key, myLogDataHolder);
  }
  else if (VcsDataKeys.CHANGES == key || VcsDataKeys.SELECTED_CHANGES == key) {
    List<Change> selectedChanges = getSelectedChanges();
    if (selectedChanges != null) {
      sink.put(key, ArrayUtil.toObjectArray(selectedChanges, Change.class));
    }
  }
  else if (VcsDataKeys.VCS_REVISION_NUMBERS == key) {
    List<Hash> hashes = myUI.getVcsLog().getSelectedCommits();
    sink.put(key, ArrayUtil.toObjectArray(ContainerUtil.map(hashes, new Function<Hash, VcsRevisionNumber>() {
      @Override
      public VcsRevisionNumber fun(Hash hash) {
        return new TextRevisionNumber(hash.asString(), hash.toShortString());
      }
    }), VcsRevisionNumber.class));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:MainFrame.java

示例4: calcData

@Override
public void calcData(DataKey key, DataSink sink) {
  if (key == VcsDataKeys.SELECTED_CHANGES) {
    final List<Change> list = myViewer.getSelectedChanges();
    sink.put(VcsDataKeys.SELECTED_CHANGES, list.toArray(new Change[list.size()]));
  }
  super.calcData(key, sink);
}
 
开发者ID:ktisha,项目名称:Crucible4IDEA,代码行数:8,代码来源:DetailsPanel.java


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