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


Java FSRecords.invalidateCaches方法代码示例

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


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

示例1: getFileById

import com.intellij.openapi.vfs.newvfs.persistent.FSRecords; //导入方法依赖的package包/类
@Nullable
public static VirtualFileSystemEntry getFileById(int id, VirtualDirectoryImpl parent) {
  Segment segment = getSegment(id, false);
  if (segment == null) return null;

  int offset = getOffset(id);
  Object o = segment.myObjectArray.get(offset);
  if (o == null) return null;

  if (o == ourDeadMarker) {
    throw reportDeadFileAccess(new VirtualFileImpl(id, segment, parent));
  }
  final int nameId = segment.getNameId(id);
  if (nameId <= 0) {
    FSRecords.invalidateCaches();
    throw new AssertionError("nameId=" + nameId + "; data=" + o + "; parent=" + parent + "; parent.id=" + parent.getId() + "; db.parent=" + FSRecords.getParent(id));
  }

  return o instanceof DirectoryData ? new VirtualDirectoryImpl(id, segment, (DirectoryData)o, parent, parent.getFileSystem())
                                    : new VirtualFileImpl(id, segment, parent);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:VfsData.java

示例2: deleteFile

import com.intellij.openapi.vfs.newvfs.persistent.FSRecords; //导入方法依赖的package包/类
@Override
public void deleteFile(final Object requestor, @NotNull final VirtualFile file) throws IOException {
  final FSItem fsItem = convert(file);
  if (fsItem == null) {
    FSRecords.invalidateCaches();
    throw new IllegalStateException("failed to delete file " + file.getPath());
  }
  fsItem.getParent().removeChild(fsItem);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:TempFileSystem.java

示例3: actionPerformed

import com.intellij.openapi.vfs.newvfs.persistent.FSRecords; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  final ApplicationEx app = (ApplicationEx)ApplicationManager.getApplication();
  final boolean mac = Messages.canShowMacSheetPanel();
  boolean canRestart = app.isRestartCapable();
  
  String[] options = new String[canRestart ? 4 : 3];
  options[0] = canRestart ? "Invalidate and Restart" : "Invalidate and Exit";
  options[1] = mac ? "Cancel" : "Invalidate";
  options[2] = mac ? "Invalidate" : "Cancel";
  if (canRestart) {
    options[3] = "Just Restart";
  }

  int result = Messages.showDialog(e.getData(PlatformDataKeys.PROJECT),
                                   "The caches will be invalidated and rebuilt on the next startup.\n" +
                                   "WARNING: Local History will be also cleared.\n\n" +
                                   "Would you like to continue?\n\n",
                                   "Invalidate Caches",
                                   options, 0,
                                   Messages.getWarningIcon());

  if (result == -1 || result == (mac ? 1 : 2)) {
    return;
  }
  
  if (result == 3) {
    app.restart(true);
    return;
  }

  FSRecords.invalidateCaches();
  if (result == 0) app.restart(true);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:34,代码来源:InvalidateCachesAction.java

示例4: deleteFile

import com.intellij.openapi.vfs.newvfs.persistent.FSRecords; //导入方法依赖的package包/类
@Override
public void deleteFile(final Object requestor, @Nonnull final VirtualFile file) throws IOException {
  final FSItem fsItem = convert(file);
  if (fsItem == null) {
    FSRecords.invalidateCaches();
    throw new IllegalStateException("failed to delete file " + file.getPath());
  }
  fsItem.getParent().removeChild(fsItem);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:TempFileSystem.java


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