當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。