コード例 #1
0
  public void selectDropDownStrategy(int index) {
    logger.debug("selectDropDownStrategy() index: " + index);

    if (getStrategiesList().size() != strategiesDropDown.getItemCount()) {
      return;
    }

    strategiesDropDown.setSelectedIndex(index);

    StrategyT tempStrategy = getStrategiesList().get(index);

    if (!strategiesDropDown
        .getItemAt(index)
        .equals(Atdl4jHelper.getStrategyUiRepOrName(tempStrategy))) {
      throw new IllegalStateException(
          "UNEXPECTED ERROR: strategiesDropDown.getItem("
              + index
              + "): "
              + strategiesDropDown.getItemAt(index)
              + " DID NOT MATCH tempStrategy: "
              + Atdl4jHelper.getStrategyUiRepOrName(tempStrategy));
    }

    fireStrategySelectedEvent(tempStrategy);
  }
コード例 #2
0
  public void loadStrategyList(List<StrategyT> aStrategyList) {
    strategiesDropDown.removeAllItems();

    setStrategiesList(aStrategyList);

    if (getStrategiesList() == null) {
      return;
    }

    for (StrategyT tempStrategy : getStrategiesList()) {
      logger.debug(
          "loadStrategyList() ["
              + strategiesDropDown.getItemCount()
              + "] strategiesDropDown.add: "
              + Atdl4jHelper.getStrategyUiRepOrName(tempStrategy));
      strategiesDropDown.addItem(Atdl4jHelper.getStrategyUiRepOrName(tempStrategy));
    }
  }