mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Maven: rename handlers
This commit is contained in:
+1
-3
@@ -55,8 +55,6 @@ public class MavenPropertyRenameHandler extends PsiElementRenameHandler {
|
||||
}
|
||||
|
||||
private PsiElement findTarget(DataContext context) {
|
||||
PsiElement target = MavenTargetUtil.getRefactorTarget(PlatformDataKeys.EDITOR.getData(context),
|
||||
LangDataKeys.PSI_FILE.getData(context));
|
||||
return isVetoed(target) ? null : target;
|
||||
return MavenTargetUtil.getRefactorTarget(PlatformDataKeys.EDITOR.getData(context), LangDataKeys.PSI_FILE.getData(context));
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -18,9 +18,10 @@ package org.jetbrains.idea.maven.dom.refactorings;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.idea.maven.dom.MavenDomUtil;
|
||||
import org.jetbrains.idea.maven.dom.references.MavenPsiElementWrapper;
|
||||
|
||||
public class MavenVetoModelRenameCondition implements Condition<PsiElement> {
|
||||
public boolean value(PsiElement target) {
|
||||
return MavenDomUtil.isMavenFile(target) && !MavenDomUtil.isMavenProperty(target);
|
||||
return target instanceof MavenPsiElementWrapper || MavenDomUtil.isMavenFile(target);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import org.jetbrains.idea.maven.dom.MavenDomUtil;
|
||||
public class MavenTargetUtil {
|
||||
public static PsiElement getRefactorTarget(Editor editor, PsiFile file) {
|
||||
PsiElement target = getFindTarget(editor, file);
|
||||
return target == null || !MavenDomUtil.isMavenFile(target) ? null : target;
|
||||
return target == null || !MavenDomUtil.isMavenProperty(target) ? null : target;
|
||||
}
|
||||
|
||||
public static PsiElement getFindTarget(Editor editor, PsiFile file) {
|
||||
|
||||
Reference in New Issue
Block a user