001 /* 002 Copyright (C) 2003 Adam Olsen 003 004 This program is free software; you can redistribute it and/or modify 005 it under the terms of the GNU General Public License as published by 006 the Free Software Foundation; either version 1, or (at your option) 007 any later version. 008 009 This program is distributed in the hope that it will be useful, 010 but WITHOUT ANY WARRANTY; without even the implied warranty of 011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 012 GNU General Public License for more details. 013 014 You should have received a copy of the GNU General Public License 015 along with this program; if not, write to the Free Software 016 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 017 */ 018 019 package com.valhalla.settings; 020 021 import java.io.BufferedReader; 022 import java.io.File; 023 import java.util.Properties; 024 025 /** 026 * A temporary storage container for Settings - used in 027 * <code>com.valhalla.jbother.plugins.PluginDialog.java</code> 028 * 029 * @author Adam Olsen 030 * @version 1.0 031 **/ 032 public class TempSettings extends Properties 033 { 034 /** 035 * Gets a boolean from a value 036 * 037 * @param key the key to get 038 * @return true or false 039 **/ 040 public boolean getBoolean( String key) 041 { 042 if( getProperty( key ) != null && getProperty( key ).equals( "!!REMOVED!!" ) ) return false; 043 return ( getProperty( key ) != null ); 044 } 045 046 /** 047 * Sets a boolean 048 * 049 * @param key the key to set 050 * @param value true or false 051 **/ 052 public void setBoolean( String key, boolean value ) 053 { 054 if( value ) setProperty( key, "true" ); 055 else setProperty( key, "!!REMOVED!!" ); 056 } 057 }