本文整理汇总了Java中com.intellij.openapi.util.text.StringUtil.isEmptyOrSpaces方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtil.isEmptyOrSpaces方法的具体用法?Java StringUtil.isEmptyOrSpaces怎么用?Java StringUtil.isEmptyOrSpaces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.util.text.StringUtil
的用法示例。
在下文中一共展示了StringUtil.isEmptyOrSpaces方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initDictionariesInfoFromCache
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
/**
* Fill {@link #dictionaryInfoMap} from saved data
*
* @param systemDictionaryRegistry application component, which saves/loads the data
*/
private void initDictionariesInfoFromCache(@NotNull AppleScriptSystemDictionaryRegistryComponent systemDictionaryRegistry) {
notScriptableApplicationList.addAll(systemDictionaryRegistry.getNotScriptableApplications());
for (DictionaryInfo.State dInfoState : systemDictionaryRegistry.getDictionariesPersistedInfo()) {
String appName = dInfoState.applicationName;
String dictionaryUrl = dInfoState.dictionaryUrl;
String applicationUrl = dInfoState.applicationUrl;
if (!StringUtil.isEmptyOrSpaces(appName) && !StringUtil.isEmptyOrSpaces(dictionaryUrl)) {
File dictionaryFile = !StringUtil.isEmpty(dictionaryUrl) ? new File(dictionaryUrl) : null;
File applicationFile = !StringUtil.isEmpty(applicationUrl) ? new File(applicationUrl) : null;
if (dictionaryFile != null && dictionaryFile.exists()) {
DictionaryInfo dInfo = new DictionaryInfo(appName, dictionaryFile, applicationFile);
addDictionaryInfo(dInfo);
}
}
}
}
示例2: getInitializedInfo
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
/**
* Initializes dictionary information for given application either from previously generated and saved dictionary
* file or creates new dictionary file for this application and saves it for later use <br> by
* {@link ApplicationDictionary} psi class. Standard folders are checked when searching for application's location
*
* @param applicationName Name of the Mac OS application
* @return {@link DictionaryInfo} of the generated and cached dictionary for the application
*/
@Nullable
public DictionaryInfo getInitializedInfo(@NotNull final String applicationName) {
if (StringUtil.isEmptyOrSpaces(applicationName) || isNotScriptable(applicationName) || isInUnknownList(applicationName)) return null;
final DictionaryInfo savedDictionaryInfo = getDictionaryInfo(applicationName);
if (savedDictionaryInfo != null) {
if (savedDictionaryInfo.isInitialized() || initializeDictionaryFromInfo(savedDictionaryInfo)) {
return savedDictionaryInfo;
}
}
final File appFile = findApplicationBundleFile(applicationName);
if (appFile != null) {
return createAndInitializeInfo(appFile, applicationName);
}
return null;
}
示例3: addAvailableCourses
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
static void addAvailableCourses(List<Course> result, StepicWrappers.CoursesContainer coursesContainer) throws IOException {
final List<RemoteCourse> courses = coursesContainer.courses;
for (RemoteCourse info : courses) {
if (!info.isAdaptive() && StringUtil.isEmptyOrSpaces(info.getType())) continue;
setCourseLanguage(info);
if (canBeOpened(info)) {
final ArrayList<StepicUser> authors = new ArrayList<>();
for (Integer instructor : info.getInstructors()) {
final StepicUser author = EduStepicClient.getFromStepic(EduStepicNames.USERS + String.valueOf(instructor),
StepicWrappers.AuthorWrapper.class).users.get(0);
authors.add(author);
}
info.setAuthors(authors);
if (info.isAdaptive()) {
info.setDescription("This is a Stepik Adaptive course.\n\n" + info.getDescription() + ADAPTIVE_NOTE);
}
result.add(info);
}
}
}
示例4: parseApplicationName
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
/**
* @param b {@link PsiBuilder}
* @param l Level deep
* @param tellStatementStartCondition If this is the application reference of a <tell> or <using terms
* from> statements
* @return true if parsed
*/
public static boolean parseApplicationName(PsiBuilder b, int l, Parser tellStatementStartCondition) {
if (!recursion_guard_(b, l, "parseApplicationName")) return false;
boolean r;
consumeToken(b, THE_KW);
if (!nextTokenIs(b, "", APPLICATION, APP)) return false;
PsiBuilder.Marker mCls = enter_section_(b, l, _NONE_, "<parse application name>");
r = consumeToken(b, APPLICATION);
if (!r) r = consumeToken(b, APP);
exit_section_(b, l, mCls, DICTIONARY_CLASS_NAME, r, false, null);
if (!nextTokenIs(b, "", STRING_LITERAL, ID)) return false;
PsiBuilder.Marker mProp = enter_section_(b, l, _NONE_, "<parse application name>");
boolean idReference = consumeToken(b, ID);
exit_section_(b, l, mProp, DICTIONARY_PROPERTY_NAME, idReference, false, null);
PsiBuilder.Marker m = enter_section_(b);
String applicationNameString = b.getTokenText();
r = consumeToken(b, STRING_LITERAL);
// if this is start of <tell compound> or <tell simple> or <using terms from> statements, push the application name
// which dictionary will be consulted for terms parsing (only the last pushed application is queried)
if (r && applicationNameString != null) {
applicationNameString = applicationNameString.replace("\"", "");
if (!StringUtil.isEmptyOrSpaces(applicationNameString) && tellStatementStartCondition.parse(b, l + 1)) {
pushTargetApplicationName(b, applicationNameString);
}
}
exit_section_(b, m, null, r);
return r;
}
示例5: loadPredefinedPaths
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
/**
* Loads predefined paths from agent configuration file
* @param params map of agent configuration parameters
* @see PowerShellBitness#getPathKey()
*
* @return map with specific PowerShell paths
*/
private Map<PowerShellBitness, String> loadPredefinedPaths(@NotNull final Map<String, String> params) {
final Map<PowerShellBitness, String> result = new HashMap<PowerShellBitness, String>();
for (PowerShellBitness bit: PowerShellBitness.values()) {
String val = params.get(bit.getPathKey());
if (!StringUtil.isEmptyOrSpaces(val)) {
result.put(bit, val);
}
}
return result;
}
示例6: loadSearchPaths
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
private List<String> loadSearchPaths(@NotNull final Map<String, String> params) {
String val = params.get(PARAM_SEARCH_PATHS);
List<String> result;
if (!StringUtil.isEmptyOrSpaces(val)) {
result = StringUtil.split(val, ";");
} else {
result = Collections.emptyList();
}
return result;
}
示例7: resolveToPsiField
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
public static PsiField resolveToPsiField(@NotNull final Property property, @Nullable final String name) {
if (StringUtil.isEmptyOrSpaces(name)) {
return null;
}
if (!(property.getParent() instanceof Bean)) {
return null;
}
final Bean bean = (Bean) property.getParent();
final GenericAttributeValue<String> clazz = bean.getClazz();
if (!clazz.exists()) {
return null;
}
final XmlAttributeValue xmlValue = clazz.getXmlAttributeValue();
if (xmlValue == null) {
return null;
}
return Arrays.stream(xmlValue.getReferences())
.map(PsiReference::resolve)
.map(o -> ObjectUtils.tryCast(o, PsiClass.class))
.filter(Objects::nonNull)
.map(nextClass -> nextClass.findFieldByName(name, false))
.filter(Objects::nonNull)
.findAny()
.orElse(null);
}
示例8: setNameAndTooltip
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
protected void setNameAndTooltip(String name, @Nullable String tooltip, @Nullable String hint) {
setNameAndTooltip(name, tooltip, getPlainAttributes());
if (structure.showDescriptions() && !StringUtil.isEmptyOrSpaces(hint)) {
getTemplatePresentation().clearText();
getTemplatePresentation().addText(new ColoredFragment(" (" + hint + ")", SimpleTextAttributes.GRAY_ATTRIBUTES));
}
}
示例9: ensureDictionaryInitialized
import com.intellij.openapi.util.text.StringUtil; //导入方法依赖的package包/类
/**
* Is called from Annotator to make sure the application's dictionary is initialized
*
* @param anyApplicationName name of the application
* @return true if dictionary was initialized
*/
public boolean ensureDictionaryInitialized(@NotNull String anyApplicationName) {
return ensureKnownApplicationDictionaryInitialized(anyApplicationName)
|| !StringUtil.isEmptyOrSpaces(anyApplicationName) && !isNotScriptable(anyApplicationName)
&& !isInUnknownList(anyApplicationName) && getInitializedInfo(anyApplicationName) != null;
}