Available Methods
- isEmpty ( )
- join ( )
- isEmptyOrSpaces ( )
- isNotEmpty ( )
- notNullize ( )
- split ( )
- equals ( )
- replace ( )
- endsWithChar ( )
- trimEnd ( )
- capitalize ( )
- convertLineSeparators ( )
- startsWithChar ( )
- repeatSymbol ( )
- trimStart ( )
- startsWith ( )
- getShortName ( )
- startsWithIgnoreCase ( )
- containsIgnoreCase ( )
- toUpperCase ( )
- toLowerCase ( )
- indexOf ( )
- unquoteString ( )
- nullize ( )
- decapitalize ( )
- trimTrailing ( )
- unescapeXml ( )
- lineColToOffset ( )
- repeat ( )
- shortenTextWithEllipsis ( )
- endsWithIgnoreCase ( )
- contains ( )
- compare ( )
- tokenize ( )
- first ( )
- containsAnyChar ( )
- countNewLines ( )
- equalsIgnoreCase ( )
- pluralize ( )
- isJavaIdentifierPart ( )
- isWhiteSpace ( )
- isJavaIdentifierStart ( )
- indexOfIgnoreCase ( )
- endsWith ( )
- formatDuration ( )
- getPackageName ( )
- replaceChar ( )
- defaultIfEmpty ( )
- splitByLines ( )
- escapeStringCharacters ( )
- strip ( )
- getThrowableText ( )
- notNullizeIfEmpty ( )
- escapeXml ( )
- countChars ( )
- parseInt ( )
- equalsIgnoreWhitespaces ( )
- stripHtml ( )
- compareVersionNumbers ( )
- capitalizeWords ( )
- stringHashCode ( )
- offsetToLineNumber ( )
Related Classes
- java.util.Arrays
- java.io.File
- java.util.Collections
- java.util.regex.Pattern
- java.util.regex.Matcher
- javax.annotation.Nullable
- javax.annotation.Nonnull
- org.jetbrains.annotations.NotNull
- org.jetbrains.annotations.Nullable
- com.intellij.openapi.project.Project
- com.intellij.openapi.vfs.VirtualFile
- com.intellij.openapi.actionSystem.AnActionEvent
- com.intellij.openapi.application.ApplicationManager
- com.intellij.psi.PsiFile
- com.intellij.openapi.editor.Editor
- com.intellij.psi.PsiElement
- org.jdom.Element
- com.intellij.openapi.editor.Document
- org.jetbrains.annotations.NonNls
- com.intellij.openapi.ui.Messages
- com.intellij.openapi.util.TextRange
- com.intellij.openapi.actionSystem.DataContext
- com.intellij.openapi.module.Module
- com.intellij.util.ui.UIUtil
- com.intellij.util.IncorrectOperationException
Java Code Examples for com.intellij.openapi.util.text.StringUtil#defaultIfEmpty()
The following examples show how to use
com.intellij.openapi.util.text.StringUtil#defaultIfEmpty() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HaxeLookupElementFactory.java From intellij-haxe with Apache License 2.0 | 5 votes |
@Nullable public static LookupElementBuilder create(@NotNull HaxeModel model, @Nullable String alias) { PsiElement basePsi = model.getBasePsi(); HaxeNamedComponent namedComponent = getNamedComponent(basePsi); if (namedComponent == null) return null; String name = StringUtil.defaultIfEmpty(alias, model.getName()); String presentableText = null; String tailText = getParentPath(model); Icon icon = null; ItemPresentation presentation = namedComponent.getPresentation(); if (presentation != null) { icon = presentation.getIcon(false); presentableText = presentation.getPresentableText(); } LookupElementBuilder lookupElement = LookupElementBuilder.create(basePsi, name); if (presentableText != null) { if (alias != null && presentableText.startsWith(model.getName())) { presentableText = presentableText.replace(model.getName(), alias); } lookupElement = lookupElement.withPresentableText(presentableText); } if (icon != null) lookupElement = lookupElement.withIcon(icon); if (tailText != null) { if (alias != null) { tailText = HaxeBundle.message("haxe.lookup.alias", tailText + "." + model.getName()); } tailText = " " + tailText; lookupElement = lookupElement.withTailText(tailText, true); } return lookupElement; }
Example 2
Source File: GotoActionModel.java From consulo with Apache License 2.0 | 5 votes |
@Nonnull private static String calcHit(@Nonnull OptionDescription value) { //if (value instanceof RegistryTextOptionDescriptor) { // return value.getHit() + " = " + value.getValue(); //} String hit = StringUtil.defaultIfEmpty(value.getHit(), value.getOption()); return StringUtil.unescapeXmlEntities(StringUtil.notNullize(hit)).replace(BundleBase.MNEMONIC_STRING, "").replace(" ", " "); // avoid extra spaces from mnemonics and xml conversion }
Example 3
Source File: ShowFilePathAction.java From consulo with Apache License 2.0 | 4 votes |
private static String getXdgDataDirectories() { String dataHome = System.getenv("XDG_DATA_HOME"); String dataDirs = System.getenv("XDG_DATA_DIRS"); return StringUtil.defaultIfEmpty(dataHome, SystemProperties.getUserHome() + "/.local/share") + ':' + StringUtil.defaultIfEmpty(dataDirs, "/usr/local/share:/usr/share"); }