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


Java ByteContent类代码示例

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


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

示例1: putLabel

import com.intellij.history.ByteContent; //导入依赖的package包/类
private LabelImpl putLabel(@NotNull final PutLabelChange c) {
  addChange(c);
  return new LabelImpl() {
    @Override
    public ByteContent getByteContent(RootEntry root, String path) {
      return getByteContentBefore(root, path, c);
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:LocalHistoryFacade.java

示例2: getByteContentBefore

import com.intellij.history.ByteContent; //导入依赖的package包/类
private ByteContent getByteContentBefore(RootEntry root, String path, Change change) {
  root = root.copy();
  revertUpTo(root, "", null, change, false, false);
  Entry entry = root.findEntry(path);
  if (entry == null) return new ByteContent(false, null);
  if (entry.isDirectory()) return new ByteContent(true, null);

  return new ByteContent(false, entry.getContent().getBytesIfAvailable());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:LocalHistoryFacade.java

示例3: loadContent

import com.intellij.history.ByteContent; //导入依赖的package包/类
@NotNull
private static byte[] loadContent(@NotNull VirtualFilePointer filePointer, @NotNull Label label) throws DiffRequestProducerException {
  String path = filePointer.getPresentableUrl();
  ByteContent byteContent = label.getByteContent(FileUtil.toSystemIndependentName(path));

  if (byteContent == null || byteContent.isDirectory() || byteContent.getBytes() == null) {
    throw new DiffRequestProducerException("Can't load content");
  }

  return byteContent.getBytes();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ShowUpdatedDiffAction.java

示例4: convert

import com.intellij.history.ByteContent; //导入依赖的package包/类
@Nullable
public String convert(final VirtualFilePointer pointer) {
  if (pointer == null) return null;
  final String path = pointer.getPresentableUrl();
  final ByteContent byteContent = myLabel.getByteContent(FileUtil.toSystemIndependentName(path));
  if (byteContent == null || byteContent.isDirectory() || byteContent.getBytes() == null) {
    return null;
  }
  final VirtualFile vf = pointer.getFile();
  if (vf == null) {
    return LoadTextUtil.getTextByBinaryPresentation(byteContent.getBytes(), EncodingManager.getInstance().getDefaultCharset()).toString();
  } else {
    return LoadTextUtil.getTextByBinaryPresentation(byteContent.getBytes(), vf).toString();
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:ShowUpdatedDiffAction.java

示例5: putLabel

import com.intellij.history.ByteContent; //导入依赖的package包/类
private LabelImpl putLabel(@Nonnull final PutLabelChange c) {
  addChange(c);
  return new LabelImpl() {

    @Override
    public long getLabelChangeId() {
      return c.getId();
    }

    @Override
    public ByteContent getByteContent(RootEntry root, String path) {
      return getByteContentBefore(root, path, c);
    }
  };
}
 
开发者ID:consulo,项目名称:consulo,代码行数:16,代码来源:LocalHistoryFacade.java

示例6: getByteContentBefore

import com.intellij.history.ByteContent; //导入依赖的package包/类
private ByteContent getByteContentBefore(RootEntry root, String path, Change change) {
  root = root.copy();
  String newPath = revertUpTo(root, path, null, change, false, false);
  Entry entry = root.findEntry(newPath);
  if (entry == null) return new ByteContent(false, null);
  if (entry.isDirectory()) return new ByteContent(true, null);

  return new ByteContent(false, entry.getContent().getBytesIfAvailable());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:LocalHistoryFacade.java

示例7: loadContent

import com.intellij.history.ByteContent; //导入依赖的package包/类
@Nonnull
private static byte[] loadContent(@Nonnull FilePath filePointer, @Nonnull Label label) throws DiffRequestProducerException {
  String path = filePointer.getPresentableUrl();
  ByteContent byteContent = label.getByteContent(FileUtil.toSystemIndependentName(path));

  if (byteContent == null || byteContent.isDirectory() || byteContent.getBytes() == null) {
    throw new DiffRequestProducerException("Can't load content");
  }

  return byteContent.getBytes();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:ShowUpdatedDiffAction.java

示例8: getByteContent

import com.intellij.history.ByteContent; //导入依赖的package包/类
ByteContent getByteContent(RootEntry root, String path); 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:2,代码来源:LabelImpl.java


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