@Override public void customize(JList list, @Nullable GoTestRunConfiguration.Kind kind, int index, boolean selected, boolean hasFocus) { if (kind != null) { String kindName = StringUtil.capitalize(kind.toString().toLowerCase(Locale.US)); setText(kindName); } } };
@Override public void customize(JList list, @Nullable GoApplicationConfiguration.Kind kind, int index, boolean selected, boolean hasFocus) { if (kind != null) { String kindName = StringUtil.capitalize(kind.toString().toLowerCase(Locale.US)); setText(kindName); } } };
@Override public void customize(JList list, @Nullable RunConfigurationKind kind, int index, boolean selected, boolean hasFocus) { if (kind != null) { String kindName = StringUtil.capitalize(kind.toString().toLowerCase(Locale.US)); setText(kindName); } } };
private static void registerProblem(@NotNull ProblemsHolder holder, @NotNull GoNamedElement element) { PsiElement identifier = element.getIdentifier(); if (identifier != null) { String elementDescription = ElementDescriptionUtil.getElementDescription(element, UsageViewTypeLocation.INSTANCE); String message = StringUtil.capitalize(elementDescription) + " <code>#ref</code> collides with imported package name #loc"; holder.registerProblem(identifier, message, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, new GoRenameQuickFix(element)); } } }
private static void registerProblem(@NotNull ProblemsHolder holder, @NotNull GoNamedElement element, @NotNull GoNamedElement builtinElement) { PsiElement identifier = element.getIdentifier(); if (identifier == null) return; String elementDescription = ElementDescriptionUtil.getElementDescription(element, UsageViewTypeLocation.INSTANCE); String builtinElementDescription = ElementDescriptionUtil.getElementDescription(builtinElement, UsageViewTypeLocation.INSTANCE); String message = StringUtil.capitalize(elementDescription) + " <code>#ref</code> collides with builtin " + builtinElementDescription; holder.registerProblem(identifier, message, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, new GoRenameQuickFix(element)); } }
public GotestGenerateAction(@NotNull GoTestFunctionType type) { super(GotestFramework.INSTANCE, new GenerateActionHandler(type)); String presentationName = StringUtil.capitalize(type.toString().toLowerCase(Locale.US)); Presentation presentation = getTemplatePresentation(); presentation.setText(presentationName); presentation.setDescription("Generate " + presentationName + " function"); }
name = StringUtil.capitalize(name);
return true; String lookupString = !typeText.isEmpty() ? StringUtil.capitalize(typeText) + "_" + methodName : methodName; addVariants(declaration, lookupString, fileNameWithoutTestPrefix, allTestFunctionNames, resultSet);
private static String clean(String txt) { return StringUtil.capitalize(txt.toLowerCase(Locale.ENGLISH).replace("_", " ")); }
private String formatArgName(String s) { String argName = s.trim(); return N.argPrefix + (N.argPrefix.isEmpty() || "_".equals(N.argPrefix) ? argName : StringUtil.capitalize(argName)); }
@NotNull public String getMethodSuffix() { return this == DEFAULT ? "" : StringUtil.capitalize(name().toLowerCase()); }
@NotNull private static String suggestSdkName(@Nullable VersionDescriptor descriptor, @NotNull PerlHostData hostData, @NotNull PerlVersionManagerData versionManagerData) { return StringUtil.capitalize(hostData.getShortName()) + ", " + StringUtil.capitalize(versionManagerData.getShortName()) + ": " + "Perl" + (descriptor == null ? "" : " " + descriptor.version); }
@NotNull @Contract(pure = true) public static String capitalizeWithJavaBeanConvention(@NotNull String s) { if (s.length() > 1 && Character.isUpperCase(s.charAt(1))) { return s; } return capitalize(s); }
@Nullable @Override public String valueOf(P4RemoteChangelist.CommittedFile f) { // TODO the displayed text should be localized. return f == null ? null : StringUtil.capitalize(f.getAction().toString().toLowerCase().replace('_', ' ')); }
@NotNull @Contract(pure = true) public static String capitalizeWords(@NotNull String text, @NotNull String tokenizerDelim, boolean allWords, boolean leaveOriginalDelims) { final StringTokenizer tokenizer = new StringTokenizer(text, tokenizerDelim, leaveOriginalDelims); final StringBuilder out = new StringBuilder(text.length()); boolean toCapitalize = true; while (tokenizer.hasMoreTokens()) { final String word = tokenizer.nextToken(); if (!leaveOriginalDelims && out.length() > 0) { out.append(' '); } out.append(toCapitalize ? capitalize(word) : word); if (!allWords) { toCapitalize = false; } } return out.toString(); }
private static void renderPair(@NotNull ColoredListCellRenderer<Perl5SdkWrapper> renderer, @NotNull String primary, @Nullable String secondary) { renderer.append(StringUtil.capitalize(primary)); if (secondary != null) { renderer.append(secondary, SimpleTextAttributes.GRAY_ATTRIBUTES); } renderer.append(", "); }
static String getGrammarName(BnfFile bnfFile) { String parser = bnfFile.findAttributeValue(null, KnownAttribute.PARSER_CLASS, null); if (!KnownAttribute.PARSER_CLASS.getDefaultValue().equals(parser)) { String shortName = StringUtil.getShortName(parser); int len = "Parser".length(); String result = shortName.endsWith("Parser") ? shortName.substring(0, shortName.length() - len) : shortName; if (StringUtil.isNotEmpty(result)) return result; } return StringUtil.capitalize(FileUtil.getNameWithoutExtension(bnfFile.getName())); }
@Override public void mouseMoved(final MouseEvent e) { Point point = e.getPoint(); int column = columnAtPoint(point); if (column != ICONS_COLUMN) { return; } int row = rowAtPoint(point); final TreePath path = getTree().getPathForRow(row); if (path == null) { return; } Object obj = path.getLastPathComponent(); if (obj instanceof RulesTreeNode.Rule) { RulesTreeNode.Rule rule = (RulesTreeNode.Rule) obj; JLabel label = new JLabel(); String l = rule.severity() + " " + rule.type(); label.setText(StringUtil.capitalize(l.replace('_', ' ').toLowerCase(Locale.US))); IdeTooltipManager.getInstance().show(new IdeTooltip(RulesTreeTable.this, point, label), false); } } });
@Override public void createSdkInteractively(@NotNull Project project, @NotNull PerlHostHandler<?, ?> hostHandler, @Nullable Consumer<Sdk> sdkConsumer, @NotNull Disposable disposable) { hostHandler.chooseFileInteractively( PerlBundle.message("perl.vm.choose.executable", StringUtil.capitalize(getPresentableName())), hostData -> suggestDefaultVersionManagerPath(hostData, disposable), true, it -> StringUtil.equals(it, getExecutableName()), it -> { String fileName = new File(it).getName(); return StringUtil.equals(fileName, getExecutableName()) ? null : PerlBundle.message("perl.vm.wrong.file", fileName, getPresentableName()); }, (path, perlHostData) -> createSdkInteractively(project, path, perlHostData, sdkConsumer), disposable); }
name = StringUtil.capitalize(name); } else { name = StringUtil.decapitalize(name);