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;
}
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;
}
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());
}
}
}
}
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;
}
Aggregations