本文整理汇总了Java中com.intellij.util.ArrayUtil.toStringArray方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayUtil.toStringArray方法的具体用法?Java ArrayUtil.toStringArray怎么用?Java ArrayUtil.toStringArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.ArrayUtil
的用法示例。
在下文中一共展示了ArrayUtil.toStringArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getNames
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@Override
@NotNull
public String[] getNames(Project project, boolean includeNonProjectItems) {
if (FileBasedIndex.ourEnableTracingOfKeyHashToVirtualFileMapping) {
final THashSet<String> names = new THashSet<String>(1000);
IdFilter filter = IdFilter.getProjectIdFilter(project, includeNonProjectItems);
processNames(new Processor<String>() {
@Override
public boolean process(String s) {
names.add(s);
return true;
}
}, FindSymbolParameters.searchScopeFor(project, includeNonProjectItems), filter);
if (IdFilter.LOG.isDebugEnabled()) {
IdFilter.LOG.debug("All names retrieved2:" + names.size());
}
return ArrayUtil.toStringArray(names);
} else {
return FilenameIndex.getAllFilenames(project);
}
}
示例2: getStaticallyDefinedSubtags
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@NotNull
public static String[] getStaticallyDefinedSubtags(@NotNull ManifestElement element) {
List<String> strings = new ArrayList<String>();
if (element instanceof Manifest) {
Collections.addAll(strings, "application", "instrumentation", "permission", "permission-group",
"permission-tree", "uses-permission", "compatible-screens", "uses-sdk", "uses-feature");
}
else if (element instanceof Application) {
Collections.addAll(strings, "activity", "activity-alias", "service", "provider", "receiver", "uses-library", "meta-data");
}
else if (element instanceof Activity || element instanceof ActivityAlias || element instanceof Receiver || element instanceof Service) {
Collections.addAll(strings, "intent-filter", "meta-data");
}
else if (element instanceof Provider) {
Collections.addAll(strings, "meta-data");
}
else if (element instanceof IntentFilter) {
strings.add("action");
strings.add("category");
}
return ArrayUtil.toStringArray(strings);
}
示例3: getGroups
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
private String[] getGroups() {
List<String> result = new ArrayList<String>();
for (ToolsGroup group : getGroupList()) {
result.add(group.getName());
}
return ArrayUtil.toStringArray(result);
}
示例4: sample
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
private String[] sample(String[] words, int wordsCount) {
int len = words.length;
int iterations = Math.min(len, wordsCount);
Set<String> result = new TreeSet<String>();
while (result.size() < iterations) {
int i = rand(0, len - 1);
result.add(words[i]);
}
return ArrayUtil.toStringArray(result);
}
示例5: collectResourceDirsForCompilation
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@NotNull
public static String[] collectResourceDirsForCompilation(@NotNull JpsAndroidModuleExtension extension,
boolean withCacheDirs,
@NotNull BuildDataPaths dataPaths,
boolean checkExistence) {
final Collection<String> result = new OrderedSet<String>();
addCompilableResourceDirsForModule(extension, withCacheDirs, dataPaths, result, checkExistence);
for (JpsAndroidModuleExtension depExtension : getAllAndroidDependencies(extension.getModule(), true)) {
addCompilableResourceDirsForModule(depExtension, withCacheDirs, dataPaths, result, checkExistence);
}
return ArrayUtil.toStringArray(result);
}
示例6: getDefaultApks
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
private static String[] getDefaultApks(@NotNull Module module) {
List<String> result = new ArrayList<String>();
String path = AndroidCompileUtil.getOutputPackage(module);
if (path != null) {
result.add(path);
}
AndroidMavenProvider mavenProvider = AndroidMavenUtil.getMavenProvider();
if (mavenProvider != null && mavenProvider.isMavenizedModule(module)) {
String buildDirectory = mavenProvider.getBuildDirectory(module);
if (buildDirectory != null) {
result.add(FileUtil.toSystemDependentName(buildDirectory + '/' + AndroidCompileUtil.getApkName(module)));
}
}
return ArrayUtil.toStringArray(result);
}
示例7: collectModifiers
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@NotNull
private String[] collectModifiers(PsiClass targetClass) {
String modifier = isEscalateVisibility() ? PsiModifier.PRIVATE : settings.getVisibilityModifier();
ArrayList<String> modifiers = new ArrayList<String>();
if (modifier!= null && !PsiModifier.PACKAGE_LOCAL.equals(modifier)) {
modifiers.add(modifier);
}
if (!targetClass.isInterface()) {
modifiers.add(PsiModifier.STATIC);
modifiers.add(PsiModifier.FINAL);
}
return ArrayUtil.toStringArray(modifiers);
}
示例8: collectTabNames
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
private static String[] collectTabNames(final Collection<PaletteGroup> groups) {
Set<String> result = new TreeSet<String>();
for (PaletteGroup group : groups) {
result.add(group.getTabName());
}
return ArrayUtil.toStringArray(result);
}
示例9: getNames
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@Override
@NotNull
public String[] getNames(final Project project, boolean includeNonProjectItems) {
Set<String> result = ContainerUtil.newHashSet();
for (Module module : getAcceptableModules(project)) {
addNames(module, result);
}
return ArrayUtil.toStringArray(result);
}
示例10: getPropertyFileBaseNames
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
public String[] getPropertyFileBaseNames(@NotNull final GlobalSearchScope searchScope, final BundleNameEvaluator bundleNameEvaluator) {
final ArrayList<String> result = new ArrayList<String>();
processPropertiesFiles(searchScope, new PropertiesFileProcessor() {
public boolean process(String baseName, PropertiesFile propertiesFile) {
result.add(baseName);
return true;
}
}, bundleNameEvaluator);
return ArrayUtil.toStringArray(result);
}
示例11: getFilters
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@Nullable
private static String[] getFilters(JavaCoverageEnabledConfiguration coverageEnabledConfiguration) {
final ClassFilter[] patterns = coverageEnabledConfiguration.getCoveragePatterns();
if (patterns != null) {
final List<String> filters = new ArrayList<String>();
for (ClassFilter classFilter : patterns) {
filters.add(classFilter.getPattern());
}
return ArrayUtil.toStringArray(filters);
}
return null;
}
示例12: enumExporters
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
private static String[] enumExporters() {
List<String> names = new ArrayList<String>();
Collection<SchemeExporterEP<CodeStyleScheme>> extensions = SchemeExporterEP.getExtensions(CodeStyleScheme.class);
for (SchemeExporterEP<CodeStyleScheme> extension : extensions) {
names.add(extension.name);
}
return ArrayUtil.toStringArray(names);
}
示例13: getTemplateNames
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
public String[] getTemplateNames() {
final Set<String> names = new LinkedHashSet<String>();
for (TemplateResource resource : getAllTemplates()) {
names.add(getTemplateBaseName(resource));
}
return ArrayUtil.toStringArray(names);
}
示例14: mergeLines
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
private static String[] mergeLines(String[] curLines, String[] prevLines) {
if (prevLines.length == 0) {
return curLines;
}
ArrayList<String> merged = new ArrayList<String>();
int curIdx = 0, prevIdx = 0;
String cur, prev;
boolean classScope = false;
boolean importMerged = false;
for (int i = 0; i < Math.max(curLines.length, prevLines.length); i++) {
cur = curIdx < curLines.length ? curLines[curIdx] : "";
prev = prevIdx < prevLines.length ? prevLines[prevIdx] : "";
if (classScope) {
merged.addAll(Arrays.asList(curLines).subList(curIdx, curLines.length));
break;
} else if (prev.trim().startsWith("import ") || cur.trim().startsWith("import ")) {
if (importMerged) {
continue;
}
importMerged = true;
int[] indices = new int[]{curIdx, prevIdx};
mergeImports(merged, curLines, prevLines, indices);
curIdx = indices[0];
prevIdx = indices[1];
} else if (cur.equals(prev)) {
if (cur.trim().startsWith("public interface ")
|| cur.trim().startsWith("public enum ")) {
classScope = true;
}
merged.add(cur);
curIdx++;
prevIdx++;
} else if (prev.trim().startsWith("@")) {
merged.add(prev);
prevIdx++;
} else if (cur.trim().startsWith("@")) {
merged.add(cur);
curIdx++;
} else if (cur.trim().startsWith("package ") && prev.trim().startsWith("package ")) {
merged.add(prev);
curIdx++;
prevIdx++;
} else if (cur.trim().startsWith("public interface ") && prev.trim().startsWith("public interface ")) {
classScope = true;
prevIdx = addAllStringsUpTo(merged, prevLines, prevIdx, "{");
curIdx = addAllStringsUpTo(null, curLines, curIdx, "{");
} else if (cur.trim().startsWith("* ")) {
curIdx = addAllStringsUpTo(merged, curLines, curIdx, "*/");
if (prev.trim().startsWith("* ") || prev.trim().endsWith("*/")) {
prevIdx = addAllStringsUpTo(null, prevLines, prevIdx, "*/");
}
} else {
merged.add(cur);
curIdx++;
prevIdx++;
}
}
String[] mergedLines = ArrayUtil.toStringArray(merged);
if (compareLines(mergedLines, prevLines, 2) == 0) {
return prevLines;
} else if (compareLines(mergedLines, curLines, 2) == 0) {
return curLines;
} else {
return mergedLines;
}
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:67,代码来源:MergingFileManager.java
示例15: getEntries
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@Override
protected String[] getEntries(JpsModule model) {
return ArrayUtil.toStringArray(model.getContentRootsList().getUrls());
}