update copyright
[fedora-idea.git] / java / java-impl / src / com / intellij / refactoring / inline / InlineViewDescriptor.java
blob6a904dcafbc2fd3a7fa8f219bc374f47e270036c
2 /*
3 * Copyright 2000-2009 JetBrains s.r.o.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 package com.intellij.refactoring.inline;
19 import com.intellij.psi.PsiClass;
20 import com.intellij.psi.PsiElement;
21 import com.intellij.psi.PsiMethod;
22 import com.intellij.refactoring.RefactoringBundle;
23 import com.intellij.usageView.UsageViewBundle;
24 import com.intellij.usageView.UsageViewDescriptor;
25 import org.jetbrains.annotations.NotNull;
27 class InlineViewDescriptor implements UsageViewDescriptor{
29 private final PsiElement myElement;
31 public InlineViewDescriptor(PsiElement element) {
32 myElement = element;
35 @NotNull
36 public PsiElement[] getElements() {
37 return new PsiElement[] {myElement};
40 public String getProcessedElementsHeader() {
41 if (myElement instanceof PsiClass) {
42 return RefactoringBundle.message("inline.class.elements.header");
44 return myElement instanceof PsiMethod ?
45 RefactoringBundle.message("inline.method.elements.header") :
46 RefactoringBundle.message("inline.field.elements.header");
49 public String getCodeReferencesText(int usagesCount, int filesCount) {
50 return RefactoringBundle.message("invocations.to.be.inlined", UsageViewBundle.getReferencesString(usagesCount, filesCount));
53 public String getCommentReferencesText(int usagesCount, int filesCount) {
54 return RefactoringBundle.message("comments.elements.header",
55 UsageViewBundle.getOccurencesString(usagesCount, filesCount));