当前位置: 首页>>代码示例>>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;未经允许,请勿转载。