本文整理汇总了Java中com.intellij.ide.util.DeleteHandler类的典型用法代码示例。如果您正苦于以下问题:Java DeleteHandler类的具体用法?Java DeleteHandler怎么用?Java DeleteHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeleteHandler类属于com.intellij.ide.util包,在下文中一共展示了DeleteHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteElement
import com.intellij.ide.util.DeleteHandler; //导入依赖的package包/类
@Override
public void deleteElement(@NotNull DataContext dataContext) {
List<PsiDirectory> allElements = Arrays.asList(getSelectedDirectories());
List<PsiElement> validElements = new ArrayList<PsiElement>();
for (PsiElement psiElement : allElements) {
if (psiElement != null && psiElement.isValid()) validElements.add(psiElement);
}
final PsiElement[] elements = PsiUtilCore.toPsiElementArray(validElements);
LocalHistoryAction a = LocalHistory.getInstance().startAction(IdeBundle.message("progress.deleting"));
try {
DeleteHandler.deletePsiElement(elements, myProject);
}
finally {
a.finish();
}
}
示例2: deleteElement
import com.intellij.ide.util.DeleteHandler; //导入依赖的package包/类
@Override
public void deleteElement(@NotNull DataContext dataContext) {
List<PsiElement> allElements = Arrays.asList(getElementsToDelete());
List<PsiElement> validElements = new ArrayList<PsiElement>();
for (PsiElement psiElement : allElements) {
if (psiElement != null && psiElement.isValid()) validElements.add(psiElement);
}
final PsiElement[] elements = PsiUtilCore.toPsiElementArray(validElements);
LocalHistoryAction a = LocalHistory.getInstance().startAction(IdeBundle.message("progress.deleting"));
try {
DeleteHandler.deletePsiElement(elements, myProject);
}
finally {
a.finish();
}
}
示例3: deleteElement
import com.intellij.ide.util.DeleteHandler; //导入依赖的package包/类
@Override
public void deleteElement(@NotNull DataContext dataContext) {
List<PsiElement> allElements = Arrays.asList(getSelectedPsiElements());
ArrayList<PsiElement> validElements = new ArrayList<PsiElement>();
for (PsiElement psiElement : allElements) {
if (psiElement != null && psiElement.isValid()) validElements.add(psiElement);
}
final PsiElement[] elements = PsiUtilCore.toPsiElementArray(validElements);
LocalHistoryAction a = LocalHistory.getInstance().startAction(IdeBundle.message("progress.deleting"));
try {
DeleteHandler.deletePsiElement(elements, myProject);
}
finally {
a.finish();
}
}
示例4: deleteElement
import com.intellij.ide.util.DeleteHandler; //导入依赖的package包/类
@Override
public void deleteElement(@Nonnull DataContext dataContext) {
List<PsiElement> allElements = Arrays.asList(getElementsToDelete());
List<PsiElement> validElements = new ArrayList<>();
for (PsiElement psiElement : allElements) {
if (psiElement != null && psiElement.isValid()) validElements.add(psiElement);
}
final PsiElement[] elements = PsiUtilCore.toPsiElementArray(validElements);
LocalHistoryAction a = LocalHistory.getInstance().startAction(IdeBundle.message("progress.deleting"));
try {
DeleteHandler.deletePsiElement(elements, myProject);
}
finally {
a.finish();
}
}
示例5: deleteElement
import com.intellij.ide.util.DeleteHandler; //导入依赖的package包/类
@Override
public void deleteElement(@Nonnull DataContext dataContext) {
List<PsiDirectory> allElements = Arrays.asList(getSelectedDirectories());
List<PsiElement> validElements = new ArrayList<PsiElement>();
for (PsiElement psiElement : allElements) {
if (psiElement != null && psiElement.isValid()) validElements.add(psiElement);
}
final PsiElement[] elements = PsiUtilCore.toPsiElementArray(validElements);
LocalHistoryAction a = LocalHistory.getInstance().startAction(IdeBundle.message("progress.deleting"));
try {
DeleteHandler.deletePsiElement(elements, myProject);
}
finally {
a.finish();
}
}
示例6: deleteElement
import com.intellij.ide.util.DeleteHandler; //导入依赖的package包/类
@Override
public void deleteElement(@Nonnull DataContext dataContext) {
List<PsiElement> allElements = Arrays.asList(getSelectedPsiElements());
ArrayList<PsiElement> validElements = new ArrayList<PsiElement>();
for (PsiElement psiElement : allElements) {
if (psiElement != null && psiElement.isValid()) validElements.add(psiElement);
}
final PsiElement[] elements = PsiUtilBase.toPsiElementArray(validElements);
LocalHistoryAction a = LocalHistory.getInstance().startAction(IdeBundle.message("progress.deleting"));
try {
DeleteHandler.deletePsiElement(elements, myProject);
}
finally {
a.finish();
}
}
示例7: deleteElement
import com.intellij.ide.util.DeleteHandler; //导入依赖的package包/类
@Override
public final void deleteElement(@NotNull final DataContext dataContext) {
final PsiElement aClass = getSelectedElement();
if (!canBeDeleted(aClass)) return;
LocalHistoryAction a = LocalHistory.getInstance().startAction(IdeBundle.message("progress.deleting.class", getQualifiedName(aClass)));
try {
final PsiElement[] elements = {aClass};
DeleteHandler.deletePsiElement(elements, myProject);
}
finally {
a.finish();
}
}
示例8: canDeleteElement
import com.intellij.ide.util.DeleteHandler; //导入依赖的package包/类
@Override
public final boolean canDeleteElement(@NotNull final DataContext dataContext) {
final PsiElement aClass = getSelectedElement();
if (!canBeDeleted(aClass)) {
return false;
}
final PsiElement[] elements = {aClass};
return DeleteHandler.shouldEnableDeleteAction(elements);
}
示例9: deleteElement
import com.intellij.ide.util.DeleteHandler; //导入依赖的package包/类
@Override
public void deleteElement(@NotNull final DataContext dataContext) {
LocalHistoryAction a = LocalHistory.getInstance().startAction(IdeBundle.message("progress.deleting"));
try {
final PsiElement[] elements = getSelectedElements();
DeleteHandler.deletePsiElement(elements, myProject);
}
finally {
a.finish();
}
}
示例10: deleteElement
import com.intellij.ide.util.DeleteHandler; //导入依赖的package包/类
@Override
public final void deleteElement(@Nonnull final DataContext dataContext) {
final PsiElement aClass = getSelectedElement();
if (!canBeDeleted(aClass)) return;
LocalHistoryAction a = LocalHistory.getInstance().startAction(IdeBundle.message("progress.deleting.class", getQualifiedName(aClass)));
try {
final PsiElement[] elements = {aClass};
DeleteHandler.deletePsiElement(elements, myProject);
}
finally {
a.finish();
}
}
示例11: canDeleteElement
import com.intellij.ide.util.DeleteHandler; //导入依赖的package包/类
@Override
public final boolean canDeleteElement(@Nonnull final DataContext dataContext) {
final PsiElement aClass = getSelectedElement();
if (!canBeDeleted(aClass)) {
return false;
}
final PsiElement[] elements = {aClass};
return DeleteHandler.shouldEnableDeleteAction(elements);
}
示例12: deleteElement
import com.intellij.ide.util.DeleteHandler; //导入依赖的package包/类
@Override
public void deleteElement(@Nonnull final DataContext dataContext) {
LocalHistoryAction a = LocalHistory.getInstance().startAction(IdeBundle.message("progress.deleting"));
try {
final PsiElement[] elements = getSelectedElements();
DeleteHandler.deletePsiElement(elements, myProject);
}
finally {
a.finish();
}
}
示例13: canDeleteElement
import com.intellij.ide.util.DeleteHandler; //导入依赖的package包/类
@Override
public boolean canDeleteElement(@NotNull final DataContext dataContext) {
final PsiElement[] elements = getSelectedElements();
return DeleteHandler.shouldEnableDeleteAction(elements);
}
示例14: createPsiBasedDeleteProvider
import com.intellij.ide.util.DeleteHandler; //导入依赖的package包/类
@Override
public DeleteProvider createPsiBasedDeleteProvider() {
return new DeleteHandler.DefaultDeleteProvider();
}
示例15: canDeleteElement
import com.intellij.ide.util.DeleteHandler; //导入依赖的package包/类
@Override
public boolean canDeleteElement(@NotNull DataContext dataContext) {
final PsiElement[] elements = getElementsToDelete();
return DeleteHandler.shouldEnableDeleteAction(elements);
}