J2K: JetUsageInfo
This commit is contained in:
+1
-1
@@ -165,7 +165,7 @@ public class JetCallableDefinitionUsage<T extends PsiElement> extends JetUsageIn
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean processUsage(JetChangeInfo changeInfo, PsiElement element) {
|
public boolean processUsage(@NotNull JetChangeInfo changeInfo, @NotNull PsiElement element) {
|
||||||
if (!(element instanceof JetNamedDeclaration)) return true;
|
if (!(element instanceof JetNamedDeclaration)) return true;
|
||||||
|
|
||||||
JetPsiFactory psiFactory = JetPsiFactory(element.getProject());
|
JetPsiFactory psiFactory = JetPsiFactory(element.getProject());
|
||||||
|
|||||||
+11
-22
@@ -14,30 +14,19 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.jetbrains.kotlin.idea.refactoring.changeSignature.usages;
|
package org.jetbrains.kotlin.idea.refactoring.changeSignature.usages
|
||||||
|
|
||||||
import com.intellij.psi.PsiElement;
|
import com.intellij.psi.PsiElement
|
||||||
import com.intellij.psi.PsiReference;
|
import com.intellij.psi.PsiReference
|
||||||
import com.intellij.usageView.UsageInfo;
|
import com.intellij.usageView.UsageInfo
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.kotlin.idea.refactoring.changeSignature.JetChangeInfo
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
import org.jetbrains.kotlin.idea.refactoring.changeSignature.JetChangeInfo;
|
|
||||||
|
|
||||||
public abstract class JetUsageInfo<T extends PsiElement> extends UsageInfo {
|
public abstract class JetUsageInfo<T : PsiElement> : UsageInfo {
|
||||||
public JetUsageInfo(@NotNull T element) {
|
public constructor(element: T) : super(element)
|
||||||
super(element);
|
public constructor(reference: PsiReference) : super(reference)
|
||||||
}
|
|
||||||
|
|
||||||
public JetUsageInfo(@NotNull PsiReference reference) {
|
@suppress("UNCHECKED_CAST")
|
||||||
super(reference);
|
override fun getElement() = super.getElement() as T?
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
public abstract fun processUsage(changeInfo: JetChangeInfo, element: T): Boolean
|
||||||
@Override
|
|
||||||
public T getElement() {
|
|
||||||
//noinspection unchecked
|
|
||||||
return (T) super.getElement();
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract boolean processUsage(JetChangeInfo changeInfo, T element);
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user