Search in sources :

Example 1 with UserPreferences

use of com.att.aro.core.preferences.UserPreferences in project VideoOptimzer by attdevsupport.

the class AWSDialog method chooseTraceFolder.

private File chooseTraceFolder(int mode, String title) {
    UserPreferences userPreferences = UserPreferencesFactory.getInstance().create();
    File tracePath = null;
    JFileChooser chooser = new JFileChooser();
    chooser.setDialogTitle(title);
    chooser.setFileSelectionMode(mode);
    String defaultDir = userPreferences.getLastTraceDirectory() == null ? System.getProperty("user.home") : userPreferences.getLastTraceDirectory().toString();
    chooser.setCurrentDirectory(new File(defaultDir));
    chooser.setAcceptAllFileFilterUsed(false);
    if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
        tracePath = chooser.getSelectedFile();
    }
    return tracePath;
}
Also used : UserPreferences(com.att.aro.core.preferences.UserPreferences) JFileChooser(javax.swing.JFileChooser) File(java.io.File)

Example 2 with UserPreferences

use of com.att.aro.core.preferences.UserPreferences in project VideoOptimzer by attdevsupport.

the class ProfileManager method getProfile.

/**
 * Loads the profile that is stored in the specified file.
 *
 * @param file
 *            The profile file to load.
 *
 * @return A Profile object containing the profile, or null, if the profile
 *         file is not found.
 *
 * @throws java.io.IOException
 *             An unexpected exception that occurs when there is an error
 *             reading the profile.
 *
 * @throws ProfileException
 */
public Profile getProfile(File file) throws FileNotFoundException, IOException, ProfileException, IllegalArgumentException {
    Profile result = createFromFile(file);
    UserPreferences userPreferences = UserPreferencesFactory.getInstance().create();
    userPreferences.setLastProfile(result);
    userPreferences.setLastProfileDirectory(file.getParentFile());
    return result;
}
Also used : UserPreferences(com.att.aro.core.preferences.UserPreferences) Profile(com.att.aro.core.configuration.pojo.Profile)

Example 3 with UserPreferences

use of com.att.aro.core.preferences.UserPreferences in project VideoOptimzer by attdevsupport.

the class TransmissionPrivateDataImpl method getKeywordsFromPreference.

/**
 * get keywords from user preference
 *
 * @param builder
 */
private void getKeywordsFromPreference(SearchingPatternBuilder builder) {
    UserPreferences pref = UserPreferencesFactory.getInstance().create();
    List<PrivateDataInfo> list = pref.getPrivateData();
    if (list != null) {
        for (PrivateDataInfo info : list) {
            if (info.isSelected()) {
                String encodeURL = Util.encodeUrlEncoding(info.getValue());
                builder.add(encodeURL, info.getType());
            }
        }
    }
}
Also used : UserPreferences(com.att.aro.core.preferences.UserPreferences) PrivateDataInfo(com.att.aro.core.peripheral.pojo.PrivateDataInfo)

Example 4 with UserPreferences

use of com.att.aro.core.preferences.UserPreferences in project VideoOptimzer by attdevsupport.

the class PrivateDataDialog method savePreference.

/**
 * save preference
 */
private boolean savePreference() {
    List<PrivateDataInfo> infos = prepareSerializeUserPreference(entries);
    if (infos == null) {
        return false;
    }
    UserPreferences prefs = UserPreferencesFactory.getInstance().create();
    prefs.setPrivateData(infos);
    return true;
}
Also used : PrivateDataInfo(com.att.aro.core.peripheral.pojo.PrivateDataInfo) UserPreferences(com.att.aro.core.preferences.UserPreferences)

Aggregations

UserPreferences (com.att.aro.core.preferences.UserPreferences)4 PrivateDataInfo (com.att.aro.core.peripheral.pojo.PrivateDataInfo)2 Profile (com.att.aro.core.configuration.pojo.Profile)1 File (java.io.File)1 JFileChooser (javax.swing.JFileChooser)1