当前位置: 首页>>代码示例>>Java>>正文


Java ArrayUtil.newStringArray方法代码示例

本文整理汇总了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;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:StubBuildingVisitor.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:JavaClassReferenceListElementType.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:PsiClassReferenceListStubImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:JavaModuleFixtureBuilderImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:AnnotationsEditor.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:JavadocEditor.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:CompilerConfigurationImpl.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:TempFileSystem.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:SaveMetaTargetDialog.java


注:本文中的com.intellij.util.ArrayUtil.newStringArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。