コード例 #1
0
 /* (non-Javadoc)
  * @see ca.odell.glazedlists.gui.TableFormat#getColumnValue(java.lang.Object, int)
  */
 @Override
 public Object getColumnValue(IUnitModel iunit, int column) {
   switch (column) {
     case 0:
       return new Boolean(iunit.isSelected());
     case 1:
       return iunit.getName();
     case 2:
       return iunit.getDescription();
     case 3:
       return iunit.getVersion();
     default:
       throw new RuntimeException("Imposible column index: " + column);
   }
 }
コード例 #2
0
  private void install() {
    ArrayList<IUnitModel> iunits = new ArrayList<IUnitModel>();
    for (int i = 0; i < repoAppsList.size(); i++) {
      IUnitModel iunit = repoAppsList.get(i);
      if (iunit.isSelected()) {
        iunits.add(iunit);
      }
    }

    if (P2.get().install(iunits)) {
      ADialog.info(0, this, Msg.getMsg(Env.getAD_Language(ctx), "OK"));
    } else {
      ADialog.error(
          0, this, Msg.getMsg(Env.getAD_Language(ctx), "Updates are not correctly installed "));
    }
  }
コード例 #3
0
  /* (non-Javadoc)
   * @see ca.odell.glazedlists.gui.WritableTableFormat#setColumnValue(java.lang.Object, java.lang.Object, int)
   */
  @Override
  public IUnitModel setColumnValue(IUnitModel baseObject, Object editedValue, int column) {
    if (column != 0) {
      return null;
    }

    Boolean value = (Boolean) editedValue;
    baseObject.setSelected(value);
    return baseObject;
  }