⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 itemambiguityexception.java

📁 基于Junit的 功能和单元测试的的测试工具。只支持Swing.
💻 JAVA
字号:
package org.uispec4j;

/**
 * Thrown by UIComponents when a search cannot identify a single result.
 */
class ItemAmbiguityException extends RuntimeException {
  public ItemAmbiguityException(String searchedValue, String[] foundItems) {
    super(computeMessage(foundItems, searchedValue));
  }

  private static String computeMessage(String[] foundItems, String searchedValue) {
    StringBuffer buffer =
      new StringBuffer(Integer.toString(foundItems.length))
        .append(" items are matching the same pattern '")
        .append(searchedValue)
        .append("': [");
    for (int i = 0; i < foundItems.length; i++) {
      buffer.append(foundItems[i]);
      buffer.append((i < foundItems.length - 1) ? "," : "]");
    }
    return buffer.toString();
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -