Abstract class icon added (KT-7810)
#KT-7810 Fixed
This commit is contained in:
@@ -99,7 +99,8 @@ public final class KotlinDescriptorIconProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (descriptor instanceof ClassDescriptor) {
|
if (descriptor instanceof ClassDescriptor) {
|
||||||
switch (((ClassDescriptor) descriptor).getKind()) {
|
ClassDescriptor classDescriptor = (ClassDescriptor) descriptor;
|
||||||
|
switch (classDescriptor.getKind()) {
|
||||||
case INTERFACE:
|
case INTERFACE:
|
||||||
return KotlinIcons.INTERFACE;
|
return KotlinIcons.INTERFACE;
|
||||||
case ENUM_CLASS:
|
case ENUM_CLASS:
|
||||||
@@ -111,7 +112,9 @@ public final class KotlinDescriptorIconProvider {
|
|||||||
case OBJECT:
|
case OBJECT:
|
||||||
return KotlinIcons.OBJECT;
|
return KotlinIcons.OBJECT;
|
||||||
case CLASS:
|
case CLASS:
|
||||||
return KotlinIcons.CLASS;
|
return Modality.ABSTRACT == classDescriptor.getModality() ?
|
||||||
|
KotlinIcons.ABSTRACT_CLASS :
|
||||||
|
KotlinIcons.CLASS;
|
||||||
default:
|
default:
|
||||||
LOG.warn("No icon for descriptor: " + descriptor);
|
LOG.warn("No icon for descriptor: " + descriptor);
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import org.jetbrains.kotlin.idea.caches.resolve.lightClasses.KtLightClassForDeco
|
|||||||
import org.jetbrains.kotlin.lexer.KtTokens
|
import org.jetbrains.kotlin.lexer.KtTokens
|
||||||
import org.jetbrains.kotlin.psi.*
|
import org.jetbrains.kotlin.psi.*
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
|
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
|
||||||
|
import org.jetbrains.kotlin.psi.psiUtil.isAbstract
|
||||||
import javax.swing.Icon
|
import javax.swing.Icon
|
||||||
|
|
||||||
class KotlinIconProvider : IconProvider(), DumbAware {
|
class KotlinIconProvider : IconProvider(), DumbAware {
|
||||||
@@ -104,7 +105,7 @@ class KotlinIconProvider : IconProvider(), DumbAware {
|
|||||||
isEnum() -> KotlinIcons.ENUM
|
isEnum() -> KotlinIcons.ENUM
|
||||||
isAnnotation() -> KotlinIcons.ANNOTATION
|
isAnnotation() -> KotlinIcons.ANNOTATION
|
||||||
this is KtEnumEntry && getPrimaryConstructorParameterList() == null -> KotlinIcons.ENUM
|
this is KtEnumEntry && getPrimaryConstructorParameterList() == null -> KotlinIcons.ENUM
|
||||||
else -> KotlinIcons.CLASS
|
else -> if (isAbstract()) KotlinIcons.ABSTRACT_CLASS else KotlinIcons.CLASS
|
||||||
}
|
}
|
||||||
is KtObjectDeclaration -> KotlinIcons.OBJECT
|
is KtObjectDeclaration -> KotlinIcons.OBJECT
|
||||||
is KtParameter -> {
|
is KtParameter -> {
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public interface KotlinIcons {
|
|||||||
Icon SMALL_LOGO_13 = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/kotlin13.png");
|
Icon SMALL_LOGO_13 = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/kotlin13.png");
|
||||||
|
|
||||||
Icon CLASS = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/classKotlin.png");
|
Icon CLASS = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/classKotlin.png");
|
||||||
|
Icon ABSTRACT_CLASS = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/abstractClassKotlin.png");
|
||||||
Icon ENUM = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/enumKotlin.png");
|
Icon ENUM = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/enumKotlin.png");
|
||||||
Icon FILE = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/kotlin_file.png");
|
Icon FILE = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/kotlin_file.png");
|
||||||
Icon ACTIVITY = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/kotlin_activity.png");
|
Icon ACTIVITY = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/kotlin_activity.png");
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 407 B |
Binary file not shown.
|
After Width: | Height: | Size: 879 B |
Reference in New Issue
Block a user