本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}