本文整理匯總了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());
}