本文整理匯總了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;
}