Code example for Preferences

Methods: get, put

0
    // ---------------------------------------------------------- 
    // --- Settings 
    // ---------------------------------------------------------- 
 
    public File getAdbExecutable() {
        String f = applicationPreferences.get("adbExecutable", null);
        if (f != null) return new File(f);
        return null; 
    } 
 
    public void setAdbExecutable(File value) {
        File oldExe = getAdbExecutable();
        applicationPreferences.put("adbExecutable", value.getAbsolutePath());
        savePreferences(); 
        propSupport.firePropertyChange("adbExecutable", oldExe, value);
    } 
 
    public boolean isAskBeforeQuit() { 
        try { 
            return applicationPreferences.getBoolean("askBeforeQuit", true);
        } catch (Exception e) { return false; }