當前位置: 首頁>>代碼示例>>Java>>正文


Java StringUtil.notNullize方法代碼示例

本文整理匯總了Java中com.intellij.openapi.util.text.StringUtil.notNullize方法的典型用法代碼示例。如果您正苦於以下問題:Java StringUtil.notNullize方法的具體用法?Java StringUtil.notNullize怎麽用?Java StringUtil.notNullize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.util.text.StringUtil的用法示例。


在下文中一共展示了StringUtil.notNullize方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getTypeDescription

import com.intellij.openapi.util.text.StringUtil; //導入方法依賴的package包/類
protected String getTypeDescription() {
  StringBuilder sb = new StringBuilder();
  sb.append("<p>");
  String type = StringUtil.capitalizeWords(getType(), true);
  sb.append(type.toLowerCase().contains("dictionary") ? type.substring(10) : type).append(" <b>").append(name).append("</b>");
  if (this instanceof AppleScriptClass) {
    AppleScriptClass parentClass = ((AppleScriptClass) this).getParentClass();
    if (parentClass != null) {
      sb.append(" [inh. ");
      String ext = "";
      int recursionGuard = 15;
      do {
        recursionGuard--;
        sb.append(ext);
        AppleScriptDocHelper.appendElementLink(sb, parentClass, parentClass.getName());
        parentClass = parentClass.getParentClass();
        ext = " > ";
      } while (parentClass != null && recursionGuard > 0);
      sb.append(" ]");
    }
  } else if (this instanceof CommandParameter) {
    CommandParameter param = (CommandParameter) this;
    String pType = StringUtil.notNullize(param.getTypeSpecifier());
    sb.append(" [").append(pType).append("]");
  }
  sb.append(" : ").append(StringUtil.notNullize(getDescription()));
  return sb.toString();
}
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:29,代碼來源:AbstractDictionaryComponent.java

示例2: getDocFooter

import com.intellij.openapi.util.text.StringUtil; //導入方法依賴的package包/類
@Override
  protected String getDocFooter() {
    StringBuilder sb = new StringBuilder();
    final String indent = "&nbsp;&nbsp;&nbsp;&nbsp;";
    CommandDirectParameter p = getDirectParameter();
    List<CommandParameter> parameters = getParameters();
    if (p != null || !parameters.isEmpty()) {
      sb.append("<p><b>Parameters:</b></p>");
    }
    if (p != null)
      sb.append(indent).append(indent).append(p.getTypeSpecifier()).append(" : ")
          .append(StringUtil.notNullize(p.getDescription())).append("<br>");

    for (CommandParameter par : parameters) {
      String op = "";
      String cl = "";
      if (par.isOptional()) {
        op = "[";
        cl = "]";
      }
      String pType = StringUtil.notNullize(par.getTypeSpecifier());
      sb.append(indent).append(indent).append(op).append("<b>").append(par.getName()).append("</b> ").append(pType)
          .append(cl).append(" : ").append(par.getDescription()).append("<br>");
    }
    CommandResult res = getResult();
    if (res != null) {
      sb.append("<p>").append("<b>Returns:</b></p>").append(indent).append(indent).
          append(res.getType()).append(" : ").append(StringUtil.notNullize(res.getDescription()));
    }
//    if (!StringUtil.isEmpty(documentation)) {
//      sb.append("<p>").append(documentation).append("</p>");
//    }
    return sb.toString();
  }
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:35,代碼來源:AppleScriptCommandImpl.java

示例3: getDescriptiveName

import com.intellij.openapi.util.text.StringUtil; //導入方法依賴的package包/類
@NotNull
@Override
public String getDescriptiveName(@NotNull PsiElement element) {
  if (element instanceof PsiNamedElement) {
    return StringUtil.notNullize(((PsiNamedElement) element).getName());
  }
  return "";
}
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:9,代碼來源:AppleScriptFindUsagesProvider.java

示例4: ReferenceEndImpl

import com.intellij.openapi.util.text.StringUtil; //導入方法依賴的package包/類
public ReferenceEndImpl(
    final @NotNull TSMetaModelImpl metaModel,
    final @NotNull TSMetaReference owner,
    final @NotNull RelationElement dom
) {
    myOwner = owner;
    myMetaModel = metaModel;
    myDomAnchor = DomService.getInstance().createAnchor(dom);
    myTypeName = StringUtil.notNullize(dom.getType().getStringValue());
    myRole = StringUtil.notNullize(dom.getQualifier().getStringValue());
    myNavigatable = Optional.ofNullable(dom.getNavigable().getValue()).orElse(true);
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:13,代碼來源:TSMetaReferenceImpl.java

示例5: createFromText

import com.intellij.openapi.util.text.StringUtil; //導入方法依賴的package包/類
private static void createFromText(@NotNull Project project, @Nullable String taskFileName, @NotNull Task task) {
  TaskFile taskFile = task.getTaskFile(taskFileName);
  VirtualFile taskDir = task.getTaskDir(project);
  if (taskFile != null && taskDir != null) {
    taskFile.text = StringUtil.notNullize(taskFile.text);
    nameTaskFileAfterContainingClass(task, taskFile, project);

    try {
      StudyGenerator.createTaskFile(taskDir, taskFile);
    }
    catch (IOException e) {
      LOG.warn(e.getMessage());
    }
  }
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:16,代碼來源:EduIntellijUtils.java

示例6: getTaskText

import com.intellij.openapi.util.text.StringUtil; //導入方法依賴的package包/類
public String getTaskText() {
  return StringUtil.notNullize(myPanel.getAnswerPlaceholderText());
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:4,代碼來源:CCCreateAnswerPlaceholderDialog.java

示例7: createDialog

import com.intellij.openapi.util.text.StringUtil; //導入方法依賴的package包/類
protected CCCreateAnswerPlaceholderDialog createDialog(Project project, AnswerPlaceholder answerPlaceholder) {
  String answerPlaceholderText = StringUtil.notNullize(answerPlaceholder.getTaskText());
  return new CCCreateAnswerPlaceholderDialog(project, answerPlaceholderText.isEmpty() ? "type here" : answerPlaceholderText,
                                             answerPlaceholder.getHints());
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:6,代碼來源:CCAddAnswerPlaceholder.java

示例8: getName

import com.intellij.openapi.util.text.StringUtil; //導入方法依賴的package包/類
@NotNull
public String getName() {
  return StringUtil.notNullize(myName.getText());
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:5,代碼來源:CCNewProjectPanel.java

示例9: getDescription

import com.intellij.openapi.util.text.StringUtil; //導入方法依賴的package包/類
@NotNull
public String getDescription() {
  return StringUtil.notNullize(myDescription.getText());
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:5,代碼來源:CCNewProjectPanel.java


注:本文中的com.intellij.openapi.util.text.StringUtil.notNullize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。