本文整理汇总了Java中com.intellij.util.ArrayUtil.newStringArray方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayUtil.newStringArray方法的具体用法?Java ArrayUtil.newStringArray怎么用?Java ArrayUtil.newStringArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.ArrayUtil
的用法示例。
在下文中一共展示了ArrayUtil.newStringArray方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildThrowsList
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
private static String[] buildThrowsList(String[] exceptions, List<String> throwables, boolean parsedViaGenericSignature) {
if (exceptions == null) return ArrayUtil.EMPTY_STRING_ARRAY;
if (parsedViaGenericSignature && throwables != null && exceptions.length > throwables.size()) {
// There seem to be an inconsistency (or bug) in class format. For instance, java.lang.Class.forName() method has
// signature equal to "(Ljava/lang/String;)Ljava/lang/Class<*>;" (i.e. no exceptions thrown) but exceptions actually not empty,
// method throws ClassNotFoundException
parsedViaGenericSignature = false;
}
if (parsedViaGenericSignature && throwables != null) {
return ArrayUtil.toStringArray(throwables);
}
else {
String[] converted = ArrayUtil.newStringArray(exceptions.length);
for (int i = 0; i < converted.length; i++) {
converted[i] = getClassName(exceptions[i]);
}
return converted;
}
}
示例2: getTexts
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
private static String[] getTexts(LighterAST tree, LighterASTNode node) {
List<LighterASTNode> refs = LightTreeUtil.getChildrenOfType(tree, node, JavaElementType.JAVA_CODE_REFERENCE);
String[] texts = ArrayUtil.newStringArray(refs.size());
for (int i = 0; i < refs.size(); i++) {
texts[i] = LightTreeUtil.toFilteredString(tree, refs.get(i), null);
}
return texts;
}
示例3: getReferencedNames
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@Override
public String[] getReferencedNames() {
String[] names = ArrayUtil.newStringArray(myNames.length);
for (int i = 0; i < names.length; i++) {
names[i] = StringRef.toString(myNames[i]);
}
return names;
}
示例4: addLibraryJars
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@Override
public JavaModuleFixtureBuilder addLibraryJars(String libraryName, String basePath, String... jars) {
if (!basePath.endsWith("/")) {
basePath += "/";
}
String[] classPath = ArrayUtil.newStringArray(jars.length);
for (int i = 0; i < jars.length; i++) {
classPath[i] = basePath + jars[i];
}
return addLibrary(libraryName, classPath);
}
示例5: saveData
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@Override
public void saveData() {
TableUtil.stopEditing(myTable);
final int count = myTable.getRowCount();
String[] urls = ArrayUtil.newStringArray(count);
for (int row = 0; row < count; row++) {
final TableItem item = ((MyTableModel)myTable.getModel()).getTableItemAt(row);
urls[row] = item.getUrl();
}
getModel().getModuleExtension(JavaModuleExternalPaths.class).setExternalAnnotationUrls(urls);
}
示例6: saveData
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@Override
public void saveData() {
TableUtil.stopEditing(myTable);
final int count = myTable.getRowCount();
String[] urls = ArrayUtil.newStringArray(count);
for (int row = 0; row < count; row++) {
final TableItem item = ((MyTableModel)myTable.getModel()).getTableItemAt(row);
urls[row] = item.getUrl();
}
getModel().getModuleExtension(JavaModuleExternalPaths.class).setJavadocUrls(urls);
}
示例7: getRegexpPatterns
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
private String[] getRegexpPatterns() {
String[] patterns = ArrayUtil.newStringArray(myRegexpResourcePatterns.size());
int index = 0;
for (final Pattern myRegexpResourcePattern : myRegexpResourcePatterns) {
patterns[index++] = myRegexpResourcePattern.getPattern();
}
return patterns;
}
示例8: list
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@Override
public String[] list() {
String[] names = ArrayUtil.newStringArray(myChildren.size());
for (int i = 0; i < names.length; i++) {
names[i] = myChildren.get(i).myName;
}
return names;
}
示例9: createEventObject
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
private ExecuteCompositeTargetEvent createEventObject() {
final ListModel model = myTargetList.getModel();
final int size = model.getSize();
final String[] names = ArrayUtil.newStringArray(size);
for (int idx = 0; idx < size; idx++) {
names[idx] = (String)model.getElementAt(idx);
}
final ExecuteCompositeTargetEvent event = new ExecuteCompositeTargetEvent(names);
event.setPresentableName(myTfName.getText().trim());
return event;
}