Example #1
0
  /**
   * Returns the profile represented by this table model.
   *
   * @return The profile for the Configuration table.
   * @throws ProfileException
   */
  public Profile getProfile() throws ProfileException {
    Properties props = new Properties();
    for (ConfigurationData data : getData()) {
      String value = data.getProfileData();
      String attribute = data.getProfileAttr();
      if (value != null) {
        props.setProperty(attribute, value);
      }
    }

    Profile profile = null;
    switch (profileType) {
      case T3G:
        if (file != null) {
          profile = new Profile3G(file, props);
        } else {
          profile = new Profile3G(name, props);
        }
        break;
      case LTE:
        if (file != null) {
          profile = new ProfileLTE(file, props);
        } else {
          profile = new ProfileLTE(name, props);
        }
        break;
    }
    return profile;
  }
Example #2
0
 @Override
 protected Object getColumnValue(ConfigurationData item, int columnIndex) {
   switch (columnIndex) {
     case PROFILE_ATTRIBUTE_COLUMN:
       return item.getProfileDesc();
     case PROFILE_DATA_COLUMN:
       return item.getProfileData();
   }
   return null;
 }
Example #3
0
  /**
   * Sets the value of the specified profile data item.
   *
   * @param Value – The value to set for the data item.
   * @param rowIndex – The row index of the data item.
   * @param columnIndex - The column index of the data item.
   */
  @Override
  public void setValueAt(Object value, int rowIndex, int columnIndex) {
    // data[rowIndex][columnIndex] = value;
    // fireTableCellUpdated(rowIndex, columnIndex);
    super.setValueAt(value, rowIndex, columnIndex);

    if (columnIndex == PROFILE_DATA_COLUMN) {
      String s = value.toString();
      ConfigurationData cd = getValueAt(rowIndex);

      cd.setProfileData(s);
      fireTableCellUpdated(rowIndex, PROFILE_DATA_COLUMN);
    }
  }