Ejemplo n.º 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;
  }
Ejemplo n.º 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;
 }