Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
supporting property references (IDEADEV-34519)
- Loading branch information
Maxim Mossienko
authored and
Maxim Mossienko
committed
Feb 11, 2009
1 parent
c0671e2
commit fb71f10
Showing
108 changed files
with
764 additions
and
458 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
inspections/impl/com/intellij/codeInspection/i18n/JavaCreatePropertyFix.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.intellij.codeInspection.i18n; | ||
|
||
import com.intellij.lang.properties.psi.PropertiesFile; | ||
import com.intellij.lang.properties.references.CreatePropertyFix; | ||
import com.intellij.lang.properties.references.I18nizeQuickFixDialog; | ||
import com.intellij.openapi.project.Project; | ||
import com.intellij.openapi.util.Pair; | ||
import com.intellij.psi.PsiElement; | ||
import com.intellij.psi.PsiFile; | ||
import com.intellij.psi.PsiLiteralExpression; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Created by IntelliJ IDEA. | ||
* User: Maxim.Mossienko | ||
* Date: 06.02.2009 | ||
* Time: 21:13:07 | ||
* To change this template use File | Settings | File Templates. | ||
*/ | ||
public class JavaCreatePropertyFix extends CreatePropertyFix { | ||
public JavaCreatePropertyFix() {} | ||
|
||
public JavaCreatePropertyFix(PsiElement element, String key, final List<PropertiesFile> propertiesFiles) { | ||
super(element, key, propertiesFiles); | ||
} | ||
|
||
@Nullable | ||
protected static Pair<String, String> invokeAction(@NotNull final Project project, | ||
@NotNull PsiFile file, | ||
@NotNull PsiElement psiElement, | ||
@Nullable final String suggestedKey, | ||
@Nullable String suggestedValue, | ||
@Nullable final List<PropertiesFile> propertiesFiles) { | ||
final PsiLiteralExpression literalExpression = psiElement instanceof PsiLiteralExpression ? (PsiLiteralExpression)psiElement : null; | ||
final String propertyValue = suggestedValue == null ? "" : suggestedValue; | ||
|
||
final I18nizeQuickFixDialog dialog = new JavaI18nizeQuickFixDialog( | ||
project, | ||
file, | ||
literalExpression, | ||
propertyValue, | ||
createDefaultCustomization(suggestedKey, propertiesFiles), | ||
false, | ||
false | ||
); | ||
return doAction(project, psiElement, dialog); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.