コード例 #1
0
 private void selectContentTypeByKey(String key) {
   int index = 0;
   for (String candidat : contentTypes.keySet()) {
     if (candidat.equals(key)) {
       comboBox.selectValue(index);
       return;
     }
     index++;
   }
 }
コード例 #2
0
  @SuppressWarnings({"rawtypes", "unchecked"})
  @Override
  protected void init() {
    initContentTypes();

    comboBox = actionService.addComboBoxAction();
    comboBox.setValues(new ArrayList(contentTypes.keySet()));
    comboBox.addListener(
        new ComboBoxFacade.Listener() {

          @Override
          public void onSelected(Object value) {
            if (value instanceof String) {
              String key = (String) value;
              changeContentTypeByKey(key);
              saveContentType(key);
            }
          }
        });
    comboBox.setOrder(100);
    comboBox.setToolTipText("Content type");
  }