diff --git a/plugins/properties/src/com/intellij/codeInsight/editorActions/enter/EnterInPropertiesFileHandler.java b/plugins/properties/src/com/intellij/codeInsight/editorActions/enter/EnterInPropertiesFileHandler.java index 4ccbd3add3e7..59256b476a32 100644 --- a/plugins/properties/src/com/intellij/codeInsight/editorActions/enter/EnterInPropertiesFileHandler.java +++ b/plugins/properties/src/com/intellij/codeInsight/editorActions/enter/EnterInPropertiesFileHandler.java @@ -31,6 +31,7 @@ import com.intellij.psi.tree.IElementType; import org.jetbrains.annotations.NotNull; public class EnterInPropertiesFileHandler extends EnterHandlerDelegateAdapter { + @Override public Result preprocessEnter(@NotNull final PsiFile file, @NotNull final Editor editor, @NotNull final Ref caretOffsetRef, @NotNull final Ref caretAdvance, @NotNull final DataContext dataContext, final EditorActionHandler originalHandler) { if (file instanceof PropertiesFile) { diff --git a/plugins/properties/src/com/intellij/ide/favoritesTreeView/ResourcesFavoriteNodeProvider.java b/plugins/properties/src/com/intellij/ide/favoritesTreeView/ResourcesFavoriteNodeProvider.java index 8ef3661cfb2b..943aff3c0425 100644 --- a/plugins/properties/src/com/intellij/ide/favoritesTreeView/ResourcesFavoriteNodeProvider.java +++ b/plugins/properties/src/com/intellij/ide/favoritesTreeView/ResourcesFavoriteNodeProvider.java @@ -39,6 +39,7 @@ import java.util.List; public class ResourcesFavoriteNodeProvider extends FavoriteNodeProvider { + @Override public Collection getFavoriteNodes(final DataContext context, final ViewSettings viewSettings) { final Project project = CommonDataKeys.PROJECT.getData(context); if (project == null) { @@ -56,6 +57,7 @@ public class ResourcesFavoriteNodeProvider extends FavoriteNodeProvider { return null; } + @Override public boolean elementContainsFile(final Object element, final VirtualFile vFile) { if (element instanceof ResourceBundle) { ResourceBundle bundle = (ResourceBundle)element; @@ -71,14 +73,17 @@ public class ResourcesFavoriteNodeProvider extends FavoriteNodeProvider { return false; } + @Override public int getElementWeight(final Object element, final boolean isSortByType) { return -1; } + @Override public String getElementLocation(final Object element) { return null; } + @Override public boolean isInvalidElement(final Object element) { if (element instanceof ResourceBundle) { ResourceBundle resourceBundle = (ResourceBundle)element; @@ -91,11 +96,13 @@ public class ResourcesFavoriteNodeProvider extends FavoriteNodeProvider { return false; } + @Override @NotNull public String getFavoriteTypeId() { return "resource_bundle"; } + @Override public String getElementUrl(final Object element) { if (element instanceof ResourceBundleImpl) { return ((ResourceBundleImpl)element).getUrl(); @@ -103,10 +110,12 @@ public class ResourcesFavoriteNodeProvider extends FavoriteNodeProvider { return null; } + @Override public String getElementModuleName(final Object element) { return null; } + @Override public Object[] createPathFromUrl(final Project project, final String url, final String moduleName) { return new Object[]{PropertiesImplUtil.createByUrl(url, project)}; } diff --git a/plugins/properties/src/com/intellij/lang/properties/PropertiesDescriptionProvider.java b/plugins/properties/src/com/intellij/lang/properties/PropertiesDescriptionProvider.java index 501bb1223552..c96db89e07a9 100644 --- a/plugins/properties/src/com/intellij/lang/properties/PropertiesDescriptionProvider.java +++ b/plugins/properties/src/com/intellij/lang/properties/PropertiesDescriptionProvider.java @@ -28,6 +28,7 @@ import org.jetbrains.annotations.NotNull; * @author yole */ public class PropertiesDescriptionProvider implements ElementDescriptionProvider { + @Override public String getElementDescription(@NotNull final PsiElement element, @Nullable final ElementDescriptionLocation location) { if (element instanceof IProperty) { if (location instanceof DeleteTypeDescriptionLocation) { diff --git a/plugins/properties/src/com/intellij/lang/properties/PropertiesDocumentationProvider.java b/plugins/properties/src/com/intellij/lang/properties/PropertiesDocumentationProvider.java index 825241f1b6c9..269a753c0c1c 100644 --- a/plugins/properties/src/com/intellij/lang/properties/PropertiesDocumentationProvider.java +++ b/plugins/properties/src/com/intellij/lang/properties/PropertiesDocumentationProvider.java @@ -34,6 +34,7 @@ import org.jetbrains.annotations.Nullable; import java.awt.*; public class PropertiesDocumentationProvider extends AbstractDocumentationProvider { + @Override @Nullable public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) { if (element instanceof IProperty) { @@ -56,6 +57,7 @@ public class PropertiesDocumentationProvider extends AbstractDocumentationProvid return StringUtil.escapeXml(raw); } + @Override public String generateDoc(final PsiElement element, @Nullable final PsiElement originalElement) { if (element instanceof IProperty) { IProperty property = (IProperty)element; diff --git a/plugins/properties/src/com/intellij/lang/properties/PropertiesFileTypeFactory.java b/plugins/properties/src/com/intellij/lang/properties/PropertiesFileTypeFactory.java index 110b483fbfed..b5c388b9517b 100644 --- a/plugins/properties/src/com/intellij/lang/properties/PropertiesFileTypeFactory.java +++ b/plugins/properties/src/com/intellij/lang/properties/PropertiesFileTypeFactory.java @@ -23,6 +23,7 @@ import org.jetbrains.annotations.NotNull; * @author Maxim.Mossienko */ public class PropertiesFileTypeFactory extends FileTypeFactory { + @Override public void createFileTypes(@NotNull FileTypeConsumer consumer) { consumer.consume(PropertiesFileType.INSTANCE, PropertiesFileType.DEFAULT_EXTENSION); } diff --git a/plugins/properties/src/com/intellij/lang/properties/PropertiesJoinLinesHandler.java b/plugins/properties/src/com/intellij/lang/properties/PropertiesJoinLinesHandler.java index 06b7230edc4b..5d0faf64e3d7 100644 --- a/plugins/properties/src/com/intellij/lang/properties/PropertiesJoinLinesHandler.java +++ b/plugins/properties/src/com/intellij/lang/properties/PropertiesJoinLinesHandler.java @@ -21,6 +21,7 @@ import com.intellij.openapi.editor.Document; import com.intellij.psi.PsiFile; public class PropertiesJoinLinesHandler implements JoinLinesHandlerDelegate { + @Override public int tryJoinLines(final Document doc, final PsiFile psiFile, int start, final int end) { if (!(psiFile instanceof PropertiesFile)) return -1; // strip continuation char diff --git a/plugins/properties/src/com/intellij/lang/properties/PropertiesWordCompletionFilter.java b/plugins/properties/src/com/intellij/lang/properties/PropertiesWordCompletionFilter.java index ea728f02504d..056ed1385eb3 100644 --- a/plugins/properties/src/com/intellij/lang/properties/PropertiesWordCompletionFilter.java +++ b/plugins/properties/src/com/intellij/lang/properties/PropertiesWordCompletionFilter.java @@ -24,6 +24,7 @@ import com.intellij.lang.properties.parsing.PropertiesElementTypes; import com.intellij.psi.tree.IElementType; public class PropertiesWordCompletionFilter extends DefaultWordCompletionFilter { + @Override public boolean isWordCompletionEnabledIn(final IElementType element) { return super.isWordCompletionEnabledIn(element) || element == PropertiesElementTypes.PROPERTY; } diff --git a/plugins/properties/src/com/intellij/lang/properties/ResourceBundleReference.java b/plugins/properties/src/com/intellij/lang/properties/ResourceBundleReference.java index c3e519fcf967..a29447dc376b 100644 --- a/plugins/properties/src/com/intellij/lang/properties/ResourceBundleReference.java +++ b/plugins/properties/src/com/intellij/lang/properties/ResourceBundleReference.java @@ -58,12 +58,14 @@ public class ResourceBundleReference extends PsiReferenceBase return ReflectionUtil.isAssignable(PsiFile.class, elementClass); } + @Override @Nullable public PsiElement resolve() { ResolveResult[] resolveResults = multiResolve(false); return resolveResults.length == 1 ? resolveResults[0].getElement() : null; } + @Override @NotNull public ResolveResult[] multiResolve(final boolean incompleteCode) { PropertiesReferenceManager referenceManager = PropertiesReferenceManager.getInstance(myElement.getProject()); @@ -71,11 +73,13 @@ public class ResourceBundleReference extends PsiReferenceBase return PsiElementResolveResult.createResults(ContainerUtil.map(propertiesFiles, PROPERTIES_FILE_PSI_ELEMENT_FUNCTION)); } + @Override @NotNull public String getCanonicalText() { return myBundleName; } + @Override public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException { if (newElementName.endsWith(PropertiesFileType.DOT_DEFAULT_EXTENSION)) { newElementName = newElementName.substring(0, newElementName.lastIndexOf(PropertiesFileType.DOT_DEFAULT_EXTENSION)); @@ -95,6 +99,7 @@ public class ResourceBundleReference extends PsiReferenceBase return StringUtil.indexOf(getValue(), '/') != -1 ? '/' : '.'; } + @Override public PsiElement bindToElement(@NotNull final PsiElement element) throws IncorrectOperationException { if (!(element instanceof PropertiesFile)) { throw new IncorrectOperationException(); @@ -104,6 +109,7 @@ public class ResourceBundleReference extends PsiReferenceBase } + @Override public boolean isReferenceTo(PsiElement element) { if (element instanceof PropertiesFile) { final String name = ResourceBundleManager.getInstance(element.getProject()).getFullName((PropertiesFile)element); @@ -114,6 +120,7 @@ public class ResourceBundleReference extends PsiReferenceBase return false; } + @Override @NotNull public Object[] getVariants() { final ProjectFileIndex projectFileIndex = ProjectFileIndex.SERVICE.getInstance(getElement().getProject()); @@ -139,6 +146,7 @@ public class ResourceBundleReference extends PsiReferenceBase return variants.toArray(new LookupElement[variants.size()]); } + @Override public String evaluateBundleName(final PsiFile psiFile) { return BundleNameEvaluator.DEFAULT.evaluateBundleName(psiFile); } diff --git a/plugins/properties/src/com/intellij/lang/properties/ResourceBundleReferenceProvider.java b/plugins/properties/src/com/intellij/lang/properties/ResourceBundleReferenceProvider.java index 729dec180109..41f5f7e4734e 100644 --- a/plugins/properties/src/com/intellij/lang/properties/ResourceBundleReferenceProvider.java +++ b/plugins/properties/src/com/intellij/lang/properties/ResourceBundleReferenceProvider.java @@ -36,6 +36,7 @@ public class ResourceBundleReferenceProvider extends PsiReferenceProvider { mySoft = soft; } + @Override @NotNull public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull final ProcessingContext context) { ResourceBundleReference reference = new ResourceBundleReference(element, mySoft); diff --git a/plugins/properties/src/com/intellij/lang/properties/editor/PropertiesGroupingStructureViewComponent.java b/plugins/properties/src/com/intellij/lang/properties/editor/PropertiesGroupingStructureViewComponent.java index d45cb6c544bc..4439ba3ab5b2 100644 --- a/plugins/properties/src/com/intellij/lang/properties/editor/PropertiesGroupingStructureViewComponent.java +++ b/plugins/properties/src/com/intellij/lang/properties/editor/PropertiesGroupingStructureViewComponent.java @@ -86,6 +86,7 @@ public class PropertiesGroupingStructureViewComponent extends StructureViewCompo refillActionGroup(); } + @Override public final void update(AnActionEvent e) { String separator = getCurrentSeparator(); Presentation presentation = e.getPresentation(); @@ -121,6 +122,7 @@ public class PropertiesGroupingStructureViewComponent extends StructureViewCompo super(PropertiesBundle.message("select.separator.action.with.empty.separator.name")); } + @Override public final void actionPerformed(AnActionEvent e) { String[] strings = ArrayUtil.toStringArray(myPredefinedSeparators); String current = getCurrentSeparator(); diff --git a/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleFileType.java b/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleFileType.java index 031ffff861ff..d89af006cb74 100644 --- a/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleFileType.java +++ b/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleFileType.java @@ -24,16 +24,19 @@ import org.jetbrains.annotations.NotNull; * @author cdr */ class ResourceBundleFileType extends FakeFileType { + @Override @NotNull public String getName() { return "ResourceBundle"; } + @Override @NotNull public String getDescription() { return PropertiesBundle.message("resourcebundle.fake.file.type.description"); } + @Override public boolean isMyFileType(@NotNull VirtualFile file) { return file instanceof ResourceBundleAsVirtualFile; } diff --git a/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleStructureViewComponent.java b/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleStructureViewComponent.java index afc5690a16fa..3d89f29db3a8 100644 --- a/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleStructureViewComponent.java +++ b/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleStructureViewComponent.java @@ -95,6 +95,7 @@ public class ResourceBundleStructureViewComponent extends PropertiesGroupingStru return PsiFile.EMPTY_ARRAY; } + @Override public Object getData(final String dataId) { if (CommonDataKeys.VIRTUAL_FILE.is(dataId)) { return new ResourceBundleAsVirtualFile(myResourceBundle); @@ -183,6 +184,7 @@ public class ResourceBundleStructureViewComponent extends PropertiesGroupingStru return super.getData(dataId); } + @Override protected boolean showScrollToFromSourceActions() { return false; } @@ -225,6 +227,7 @@ public class ResourceBundleStructureViewComponent extends PropertiesGroupingStru } } + @Override @NonNls public String getHelpID() { return "editing.propertyFile.bundleEditor"; diff --git a/plugins/properties/src/com/intellij/lang/properties/editor/inspections/incomplete/IncompletePropertyInspectionOptionsPanel.java b/plugins/properties/src/com/intellij/lang/properties/editor/inspections/incomplete/IncompletePropertyInspectionOptionsPanel.java index c2bb4d537446..06fddaddd257 100644 --- a/plugins/properties/src/com/intellij/lang/properties/editor/inspections/incomplete/IncompletePropertyInspectionOptionsPanel.java +++ b/plugins/properties/src/com/intellij/lang/properties/editor/inspections/incomplete/IncompletePropertyInspectionOptionsPanel.java @@ -107,10 +107,12 @@ public class IncompletePropertyInspectionOptionsPanel { } private class MyListModel extends AbstractListModel { + @Override public int getSize() { return mySuffixes.size(); } + @Override public Object getElementAt(int index) { return ArrayUtil.toStringArray(mySuffixes)[index]; } diff --git a/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleDeleteProvider.java b/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleDeleteProvider.java index e148ae20d7f3..8d73212adbb3 100644 --- a/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleDeleteProvider.java +++ b/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleDeleteProvider.java @@ -36,6 +36,7 @@ import java.util.Arrays; public class ResourceBundleDeleteProvider implements DeleteProvider { private static final Logger LOG = Logger.getInstance(ResourceBundleDeleteProvider.class); + @Override public void deleteElement(@NotNull DataContext dataContext) { final ResourceBundle[] resourceBundles = ResourceBundle.ARRAY_DATA_KEY.getData(dataContext); if (resourceBundles != null && resourceBundles.length != 0) { @@ -57,6 +58,7 @@ public class ResourceBundleDeleteProvider implements DeleteProvider { } } + @Override public boolean canDeleteElement(@NotNull DataContext dataContext) { final Project project = CommonDataKeys.PROJECT.getData(dataContext); return project != null; diff --git a/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleGrouper.java b/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleGrouper.java index 9af67bf067cf..a17e28a8e392 100644 --- a/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleGrouper.java +++ b/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleGrouper.java @@ -42,6 +42,7 @@ public class ResourceBundleGrouper implements TreeStructureProvider, DumbAware { myProject = project; } + @Override @NotNull public Collection modify(@NotNull AbstractTreeNode parent, @NotNull final Collection children, final ViewSettings settings) { if (parent instanceof ResourceBundleNode) return children; @@ -114,6 +115,7 @@ public class ResourceBundleGrouper implements TreeStructureProvider, DumbAware { }); } + @Override public Object getData(Collection selected, String dataName) { if (selected == null) return null; if (PlatformDataKeys.DELETE_ELEMENT_PROVIDER.is(dataName)) { diff --git a/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleMoveProvider.java b/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleMoveProvider.java index 6af4386172c0..4f6718af1f1e 100644 --- a/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleMoveProvider.java +++ b/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleMoveProvider.java @@ -40,6 +40,7 @@ public class ResourceBundleMoveProvider extends MoveHandlerDelegate { return ResourceBundle.ARRAY_DATA_KEY.getData(dataContext) != null; } + @Override public boolean canMove(PsiElement[] elements, @Nullable final PsiElement targetContainer) { return false; } diff --git a/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleNode.java b/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleNode.java index bc063567e084..2b5eb3540071 100644 --- a/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleNode.java +++ b/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleNode.java @@ -57,6 +57,7 @@ public class ResourceBundleNode extends ProjectViewNode implemen super(project, resourceBundle, settings); } + @Override @NotNull public Collection getChildren() { List propertiesFiles = getValue().getPropertiesFiles(); @@ -68,6 +69,7 @@ public class ResourceBundleNode extends ProjectViewNode implemen return children; } + @Override public boolean contains(@NotNull VirtualFile file) { if (!file.isValid()) return false; PsiFile psiFile = PsiManager.getInstance(getProject()).findFile(file); @@ -75,6 +77,7 @@ public class ResourceBundleNode extends ProjectViewNode implemen return propertiesFile != null && getValue().getPropertiesFiles().contains(propertiesFile); } + @Override public VirtualFile getVirtualFile() { final List list = getValue().getPropertiesFiles(); if (!list.isEmpty()) { @@ -83,28 +86,34 @@ public class ResourceBundleNode extends ProjectViewNode implemen return null; } + @Override public void update(PresentationData presentation) { presentation.setIcon(AllIcons.Nodes.ResourceBundle); presentation.setPresentableText(PropertiesBundle.message("project.view.resource.bundle.tree.node.text", getValue().getBaseName())); } + @Override public boolean canNavigateToSource() { return true; } + @Override public boolean canNavigate() { return true; } + @Override public void navigate(final boolean requestFocus) { OpenFileDescriptor descriptor = new OpenFileDescriptor(getProject(), new ResourceBundleAsVirtualFile(getValue())); FileEditorManager.getInstance(getProject()).openTextEditor(descriptor, requestFocus); } + @Override public boolean isSortByFirstChild() { return true; } + @Override public Comparable getTypeSortKey() { return new PsiFileNode.ExtensionSortKey(StdFileTypes.PROPERTIES.getDefaultExtension()); } diff --git a/plugins/properties/src/com/intellij/lang/properties/refactoring/PropertiesFilesSafeDeleteProcessor.java b/plugins/properties/src/com/intellij/lang/properties/refactoring/PropertiesFilesSafeDeleteProcessor.java index f2fc86601019..cacfd6c583e5 100644 --- a/plugins/properties/src/com/intellij/lang/properties/refactoring/PropertiesFilesSafeDeleteProcessor.java +++ b/plugins/properties/src/com/intellij/lang/properties/refactoring/PropertiesFilesSafeDeleteProcessor.java @@ -36,10 +36,12 @@ import java.util.List; * @author yole */ public class PropertiesFilesSafeDeleteProcessor implements SafeDeleteProcessorDelegate { + @Override public boolean handlesElement(final PsiElement element) { return element instanceof PropertiesFile; } + @Override public NonCodeUsageSearchInfo findUsages(@NotNull final PsiElement element, @NotNull final PsiElement[] allElementsToDelete, @NotNull final List result) { PropertiesFile file = (PropertiesFile) element; List elements = new ArrayList<>(); @@ -53,23 +55,28 @@ public class PropertiesFilesSafeDeleteProcessor implements SafeDeleteProcessorDe return new NonCodeUsageSearchInfo(SafeDeleteProcessor.getDefaultInsideDeletedCondition(allElementsToDelete), elements); } + @Override public Collection getElementsToSearch(@NotNull final PsiElement element, @NotNull final Collection allElementsToDelete) { return Collections.singletonList(element); } + @Override public Collection getAdditionalElementsToDelete(@NotNull final PsiElement element, @NotNull final Collection allElementsToDelete, final boolean askUser) { return null; } + @Override public Collection findConflicts(@NotNull final PsiElement element, @NotNull final PsiElement[] allElementsToDelete) { return null; } + @Override public UsageInfo[] preprocessUsages(final Project project, final UsageInfo[] usages) { return usages; } + @Override public void prepareForDeletion(final PsiElement element) throws IncorrectOperationException { } diff --git a/plugins/properties/src/com/intellij/lang/properties/refactoring/PropertiesRefactoringSupportProvider.java b/plugins/properties/src/com/intellij/lang/properties/refactoring/PropertiesRefactoringSupportProvider.java index 5c3fd1f013c0..7dcd06894a01 100644 --- a/plugins/properties/src/com/intellij/lang/properties/refactoring/PropertiesRefactoringSupportProvider.java +++ b/plugins/properties/src/com/intellij/lang/properties/refactoring/PropertiesRefactoringSupportProvider.java @@ -24,6 +24,7 @@ import com.intellij.psi.PsiElement; import org.jetbrains.annotations.NotNull; public class PropertiesRefactoringSupportProvider extends RefactoringSupportProvider { + @Override public boolean isSafeDeleteAvailable(@NotNull PsiElement element) { return true; } diff --git a/plugins/properties/src/com/intellij/lang/properties/refactoring/rename/RenamePropertyProcessor.java b/plugins/properties/src/com/intellij/lang/properties/refactoring/rename/RenamePropertyProcessor.java index 7d085fc6b4f1..e42b52d0d24b 100644 --- a/plugins/properties/src/com/intellij/lang/properties/refactoring/rename/RenamePropertyProcessor.java +++ b/plugins/properties/src/com/intellij/lang/properties/refactoring/rename/RenamePropertyProcessor.java @@ -35,11 +35,13 @@ import java.util.List; import java.util.Map; public class RenamePropertyProcessor extends RenamePsiElementProcessor { + @Override public boolean canProcessElement(@NotNull final PsiElement element) { return element instanceof IProperty || (element instanceof PomTargetPsiElement && ((PomTargetPsiElement)element).getTarget() instanceof XmlProperty); } + @Override public void prepareRenaming(final PsiElement element, final String newName, final Map allRenames) { ResourceBundle resourceBundle = PropertiesImplUtil.getProperty(element).getPropertiesFile().getResourceBundle(); diff --git a/plugins/properties/src/com/intellij/lang/properties/refactoring/rename/ResourceBundleRenameUtil.java b/plugins/properties/src/com/intellij/lang/properties/refactoring/rename/ResourceBundleRenameUtil.java index 7bf5c719e33b..745127a3310d 100644 --- a/plugins/properties/src/com/intellij/lang/properties/refactoring/rename/ResourceBundleRenameUtil.java +++ b/plugins/properties/src/com/intellij/lang/properties/refactoring/rename/ResourceBundleRenameUtil.java @@ -115,10 +115,12 @@ public class ResourceBundleRenameUtil { myResourceBundle = resourceBundle; } + @Override public boolean checkInput(String inputString) { return inputString.indexOf(File.separatorChar) < 0 && inputString.indexOf('/') < 0; } + @Override public boolean canClose(final String inputString) { final List propertiesFiles = myResourceBundle.getPropertiesFiles(); for (PropertiesFile propertiesFile : propertiesFiles) { diff --git a/plugins/properties/src/com/intellij/lang/properties/references/CreatePropertyFix.java b/plugins/properties/src/com/intellij/lang/properties/references/CreatePropertyFix.java index dcafd106f21a..dbdab41f87e7 100644 --- a/plugins/properties/src/com/intellij/lang/properties/references/CreatePropertyFix.java +++ b/plugins/properties/src/com/intellij/lang/properties/references/CreatePropertyFix.java @@ -57,16 +57,19 @@ public class CreatePropertyFix implements IntentionAction, LocalQuickFix { myPropertiesFiles = propertiesFiles; } + @Override @NotNull public String getName() { return NAME; } + @Override @NotNull public String getFamilyName() { return getText(); } + @Override public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement psiElement = descriptor.getPsiElement(); if (isAvailable(project, null, null)) { @@ -74,15 +77,18 @@ public class CreatePropertyFix implements IntentionAction, LocalQuickFix { } } + @Override @NotNull public String getText() { return NAME; } + @Override public boolean isAvailable(@NotNull Project project, @Nullable Editor editor, @Nullable PsiFile file) { return myElement != null && myElement.retrieve() != null; } + @Override public void invoke(@NotNull final Project project, @Nullable Editor editor, @NotNull PsiFile file) { invokeAction(project, file, myElement.retrieve(), myKey, myPropertiesFiles); } @@ -97,18 +103,22 @@ public class CreatePropertyFix implements IntentionAction, LocalQuickFix { if (ApplicationManager.getApplication().isUnitTestMode()) { model = new I18nizeQuickFixModel() { + @Override public String getValue() { return ""; } + @Override public String getKey() { return dialogCustomization.getSuggestedName(); } + @Override public boolean hasValidData() { return true; } + @Override public Collection getAllPropertiesFiles() { return propertiesFiles; } @@ -160,6 +170,7 @@ public class CreatePropertyFix implements IntentionAction, LocalQuickFix { }, CodeInsightBundle.message("quickfix.i18n.command.name"), project)); } + @Override public boolean startInWriteAction() { return false; } diff --git a/plugins/properties/src/com/intellij/lang/properties/structureView/PropertiesFileStructureViewComponent.java b/plugins/properties/src/com/intellij/lang/properties/structureView/PropertiesFileStructureViewComponent.java index 9840c1bc8994..1a4b85ba5f8c 100644 --- a/plugins/properties/src/com/intellij/lang/properties/structureView/PropertiesFileStructureViewComponent.java +++ b/plugins/properties/src/com/intellij/lang/properties/structureView/PropertiesFileStructureViewComponent.java @@ -33,6 +33,7 @@ public class PropertiesFileStructureViewComponent extends PropertiesGroupingStru myPropertiesFile = propertiesFile; } + @Override public Object getData(String dataId) { if (CommonDataKeys.VIRTUAL_FILE.is(dataId)) { return myPropertiesFile.getVirtualFile(); diff --git a/plugins/properties/src/com/intellij/lang/properties/structureView/PropertiesStructureViewBuilderFactory.java b/plugins/properties/src/com/intellij/lang/properties/structureView/PropertiesStructureViewBuilderFactory.java index 477e80fed24b..eef1d221d360 100644 --- a/plugins/properties/src/com/intellij/lang/properties/structureView/PropertiesStructureViewBuilderFactory.java +++ b/plugins/properties/src/com/intellij/lang/properties/structureView/PropertiesStructureViewBuilderFactory.java @@ -30,9 +30,11 @@ import com.intellij.psi.PsiFile; import org.jetbrains.annotations.NotNull; public class PropertiesStructureViewBuilderFactory implements PsiStructureViewFactory { + @Override @NotNull public StructureViewBuilder getStructureViewBuilder(final PsiFile psiFile) { return new StructureViewBuilder() { + @Override @NotNull public StructureView createStructureView(FileEditor fileEditor, @NotNull Project project) { return new PropertiesFileStructureViewComponent(project, (PropertiesFileImpl)psiFile, fileEditor); diff --git a/plugins/properties/src/com/intellij/openapi/options/colors/pages/PropertiesColorsPage.java b/plugins/properties/src/com/intellij/openapi/options/colors/pages/PropertiesColorsPage.java index 040dce3cb556..69507dac94a9 100644 --- a/plugins/properties/src/com/intellij/openapi/options/colors/pages/PropertiesColorsPage.java +++ b/plugins/properties/src/com/intellij/openapi/options/colors/pages/PropertiesColorsPage.java @@ -41,30 +41,36 @@ public class PropertiesColorsPage implements ColorSettingsPage { } } + @Override @NotNull public String getDisplayName() { return OptionsBundle.message("properties.options.display.name"); } + @Override public Icon getIcon() { return AllIcons.FileTypes.Properties; } + @Override @NotNull public AttributesDescriptor[] getAttributeDescriptors() { return ATTRS; } + @Override @NotNull public ColorDescriptor[] getColorDescriptors() { return ColorDescriptor.EMPTY_ARRAY; } + @Override @NotNull public SyntaxHighlighter getHighlighter() { return new PropertiesHighlighter(); } + @Override @NotNull public String getDemoText() { return "# Comment on keys and values\n" + @@ -74,6 +80,7 @@ public class PropertiesColorsPage implements ColorSettingsPage { ; } + @Override public Map getAdditionalHighlightingTagToDescriptorMap() { return null; }