mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cosmetic
This commit is contained in:
+7
-4
@@ -15,10 +15,11 @@
|
||||
*/
|
||||
package com.intellij.openapi.fileTypes.impl;
|
||||
|
||||
import com.intellij.ui.ListCellRendererWrapper;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.FileTypeManager;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.LayeredIcon;
|
||||
import com.intellij.ui.ListCellRendererWrapper;
|
||||
import com.intellij.util.ui.EmptyIcon;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -67,12 +68,14 @@ public class FileTypeRenderer extends ListCellRendererWrapper<FileType> {
|
||||
|
||||
setIcon(layeredIcon);
|
||||
|
||||
if (isDuplicated(type.getDescription())) {
|
||||
setText(type.getDescription() + " (" + type.getName() + ")");
|
||||
String description = type.getDescription();
|
||||
String trimmedDescription = StringUtil.capitalizeWords(description.replaceAll("(?i)\\s*file(?:s)?$", ""), true);
|
||||
if (isDuplicated(description)) {
|
||||
setText(trimmedDescription + " (" + type.getName() + ")");
|
||||
|
||||
}
|
||||
else {
|
||||
setText(type.getDescription());
|
||||
setText(trimmedDescription);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public class RestColorsPage implements ColorSettingsPage {
|
||||
|
||||
@NotNull
|
||||
public String getDisplayName() {
|
||||
return "ReST file";
|
||||
return "reStructuredText";
|
||||
}
|
||||
|
||||
public Icon getIcon() {
|
||||
|
||||
@@ -31,8 +31,6 @@ import javax.swing.*;
|
||||
public class RestFileType extends LanguageFileType {
|
||||
public static final RestFileType INSTANCE = new RestFileType();
|
||||
@NonNls public static final String DEFAULT_EXTENSION = "rst";
|
||||
@NonNls private static final String NAME = "ReST";
|
||||
@NonNls private static final String DESCRIPTION = "reStructuredText files";
|
||||
|
||||
private RestFileType() {
|
||||
super(RestLanguage.INSTANCE);
|
||||
@@ -40,12 +38,12 @@ public class RestFileType extends LanguageFileType {
|
||||
|
||||
@NotNull
|
||||
public String getName() {
|
||||
return NAME;
|
||||
return "ReST";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getDescription() {
|
||||
return DESCRIPTION;
|
||||
return "reStructuredText files";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user