コード例 #1
0
 public static boolean validElement(@NotNull PsiElement element) {
   if (element instanceof PsiFile) return true;
   if (!element.isPhysical()) return false;
   final RefactoringSupportProvider provider =
       LanguageRefactoringSupport.INSTANCE.forLanguage(element.getLanguage());
   return provider.isSafeDeleteAvailable(element);
 }
コード例 #2
0
ファイル: XPathLanguage.java プロジェクト: jexp/idea2
 @Override
 public boolean isSafeDeleteAvailable(PsiElement element) {
   if (!element.isWritable() || element.getContainingFile() == null) return false;
   final RefactoringSupportProvider realProvider =
       ContextProvider.getContextProvider(element).getRefactoringSupportProvider();
   return realProvider != null && realProvider.isSafeDeleteAvailable(element);
 }