本文整理汇总了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();
}
示例2: getDocFooter
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
@Override
protected String getDocFooter() {
StringBuilder sb = new StringBuilder();
final String indent = " ";
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();
}
示例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 "";
}
示例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());
}
}
}
示例6: getTaskText
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
public String getTaskText() {
return StringUtil.notNullize(myPanel.getAnswerPlaceholderText());
}
示例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());
}
示例8: getName
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
@NotNull
public String getName() {
return StringUtil.notNullize(myName.getText());
}
示例9: getDescription
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
@NotNull
public String getDescription() {
return StringUtil.notNullize(myDescription.getText());
}