Mercurial > projects > dwt-addons
comparison dwtx/jface/preference/PreferenceStore.d @ 197:0ea0c9f9008f
Remove tango deprecation warnings.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 18 Feb 2009 19:35:22 +0100 |
parents | a785420fe9ca |
children |
comparison
equal
deleted
inserted
replaced
196:66bceed20048 | 197:0ea0c9f9008f |
---|---|
33 import dwtx.jface.util.PropertyChangeEvent; | 33 import dwtx.jface.util.PropertyChangeEvent; |
34 import dwtx.jface.util.SafeRunnable; | 34 import dwtx.jface.util.SafeRunnable; |
35 | 35 |
36 import dwt.dwthelper.utils; | 36 import dwt.dwthelper.utils; |
37 // import dwtx.dwtxhelper.Collection; | 37 // import dwtx.dwtxhelper.Collection; |
38 import tango.io.Print; | 38 import tango.io.stream.Format; |
39 import tango.io.stream.FileStream; | 39 import tango.io.device.File; |
40 | 40 |
41 import tango.io.model.IConduit; | 41 import tango.io.model.IConduit; |
42 import tango.text.Util; | 42 import tango.text.Util; |
43 public class Properties { | 43 public class Properties { |
44 | 44 |
249 return *res; | 249 return *res; |
250 } | 250 } |
251 return defaultValue; | 251 return defaultValue; |
252 } | 252 } |
253 | 253 |
254 public void list(Print!(char) print){ | 254 public void list(FormatOutput!(char) print){ |
255 foreach( k, v; map ){ | 255 foreach( k, v; map ){ |
256 print( k )( '=' )( v ).newline; | 256 print( k )( '=' )( v ).newline; |
257 } | 257 } |
258 } | 258 } |
259 public bool containsKey( String key ){ | 259 public bool containsKey( String key ){ |
629 * Prints the contents of this preference store to the given print stream. | 629 * Prints the contents of this preference store to the given print stream. |
630 * | 630 * |
631 * @param out | 631 * @param out |
632 * the print stream | 632 * the print stream |
633 */ | 633 */ |
634 public void list(Print!(char) out_) { | 634 public void list(FormatOutput!(char) out_) { |
635 properties.list(out_); | 635 properties.list(out_); |
636 } | 636 } |
637 | 637 |
638 // /** | 638 // /** |
639 // * Prints the contents of this preference store to the given print writer. | 639 // * Prints the contents of this preference store to the given print writer. |
655 */ | 655 */ |
656 public void load() { | 656 public void load() { |
657 if (filename is null) { | 657 if (filename is null) { |
658 throw new IOException("File name not specified");//$NON-NLS-1$ | 658 throw new IOException("File name not specified");//$NON-NLS-1$ |
659 } | 659 } |
660 FileInput in_ = new FileInput(filename); | 660 File in_ = new File(filename, File.ReadExisting); |
661 load(in_.input); | 661 load(in_.input); |
662 in_.close(); | 662 in_.close(); |
663 } | 663 } |
664 | 664 |
665 /** | 665 /** |
724 */ | 724 */ |
725 public void save() { | 725 public void save() { |
726 if (filename is null) { | 726 if (filename is null) { |
727 throw new IOException("File name not specified");//$NON-NLS-1$ | 727 throw new IOException("File name not specified");//$NON-NLS-1$ |
728 } | 728 } |
729 FileOutput out_ = null; | 729 File out_ = null; |
730 try { | 730 try { |
731 out_ = new FileOutput(filename); | 731 out_ = new File(filename,File.WriteCreate); |
732 save(out_, null); | 732 save(out_, null); |
733 } finally { | 733 } finally { |
734 if (out_ !is null) { | 734 if (out_ !is null) { |
735 out_.close(); | 735 out_.close(); |
736 } | 736 } |