本文整理汇总了Java中com.intellij.openapi.vfs.VirtualFile.exists方法的典型用法代码示例。如果您正苦于以下问题:Java VirtualFile.exists方法的具体用法?Java VirtualFile.exists怎么用?Java VirtualFile.exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.vfs.VirtualFile
的用法示例。
在下文中一共展示了VirtualFile.exists方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tableChanged
import com.intellij.openapi.vfs.VirtualFile; //导入方法依赖的package包/类
/**
* TableModel listener
*
* @param e
*/
@Override
public void tableChanged(TableModelEvent e) {
// TODO Do something with the data...
System.out.println(e.getType());
if (e.getType() == TableModelEvent.INSERT) {
//TODO update all files
// TranslationTableModel model = (TranslationTableModel) editor.getTable1().getModel();
String lang = editor.getCurrentLang();
VirtualFile file = getFileMap().get(lang);
if (file.exists()) {
YAMLFileImpl yamlFile = (YAMLFileImpl) PsiManager.getInstance(project).findFile(file);
if (yamlFile != null) {
System.out.println(yamlFile);
}
}
}
}
示例2: discoverInstalledApplicationNames
import com.intellij.openapi.vfs.VirtualFile; //导入方法依赖的package包/类
private void discoverInstalledApplicationNames() {
for (String applicationsDirectory : ApplicationDictionary.APP_BUNDLE_DIRECTORIES) {
VirtualFile appsDirVFile = LocalFileSystem.getInstance().findFileByPath(applicationsDirectory);
if (appsDirVFile != null && appsDirVFile.exists()) {
discoverApplicationsInDirectory(appsDirVFile);
}
}
LOG.info("List of installed applications initialized. Count: " + discoveredApplicationNames.size());
}
示例3: deleteWindowsFile
import com.intellij.openapi.vfs.VirtualFile; //导入方法依赖的package包/类
private static void deleteWindowsFile(@NotNull final VirtualFile taskDir, @NotNull final String name) {
final VirtualFile fileWindows = taskDir.findChild(name);
if (fileWindows != null && fileWindows.exists()) {
ApplicationManager.getApplication().runWriteAction(() -> {
try {
fileWindows.delete(taskDir);
}
catch (IOException e) {
LOG.warn("Tried to delete non existed _windows file");
}
});
}
}
示例4: getLanguageFileType
import com.intellij.openapi.vfs.VirtualFile; //导入方法依赖的package包/类
public static LangFileEditorType getLanguageFileType(@NotNull final VirtualFile file) {
VirtualFile parent = file.getParent();
if (GravYamlFiles.withYamlExtension(file) && parent != null && parent.exists() && parent.getName().equalsIgnoreCase("languages")) {
return LANGUAGE_FOLDER;
} else if (GravYamlFiles.withYamlExtension(file) && file.getNameWithoutExtension().equalsIgnoreCase("languages")) {
return LANGUAGE_FILE;
}
return NONE;
}