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) {
|
||||
switch (((ClassDescriptor) descriptor).getKind()) {
|
||||
ClassDescriptor classDescriptor = (ClassDescriptor) descriptor;
|
||||
switch (classDescriptor.getKind()) {
|
||||
case INTERFACE:
|
||||
return KotlinIcons.INTERFACE;
|
||||
case ENUM_CLASS:
|
||||
@@ -111,7 +112,9 @@ public final class KotlinDescriptorIconProvider {
|
||||
case OBJECT:
|
||||
return KotlinIcons.OBJECT;
|
||||
case CLASS:
|
||||
return KotlinIcons.CLASS;
|
||||
return Modality.ABSTRACT == classDescriptor.getModality() ?
|
||||
KotlinIcons.ABSTRACT_CLASS :
|
||||
KotlinIcons.CLASS;
|
||||
default:
|
||||
LOG.warn("No icon for descriptor: " + descriptor);
|
||||
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.psi.*
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
|
||||
import org.jetbrains.kotlin.psi.psiUtil.isAbstract
|
||||
import javax.swing.Icon
|
||||
|
||||
class KotlinIconProvider : IconProvider(), DumbAware {
|
||||
@@ -104,7 +105,7 @@ class KotlinIconProvider : IconProvider(), DumbAware {
|
||||
isEnum() -> KotlinIcons.ENUM
|
||||
isAnnotation() -> KotlinIcons.ANNOTATION
|
||||
this is KtEnumEntry && getPrimaryConstructorParameterList() == null -> KotlinIcons.ENUM
|
||||
else -> KotlinIcons.CLASS
|
||||
else -> if (isAbstract()) KotlinIcons.ABSTRACT_CLASS else KotlinIcons.CLASS
|
||||
}
|
||||
is KtObjectDeclaration -> KotlinIcons.OBJECT
|
||||
is KtParameter -> {
|
||||
|
||||
@@ -28,6 +28,7 @@ public interface KotlinIcons {
|
||||
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 ABSTRACT_CLASS = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/abstractClassKotlin.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 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