Revision 11142 branches/v10/libraries/libCorePlugin/src/com/iver/core/preferences/general/ExtensionPage.java

View differences:

ExtensionPage.java
19 19
import java.io.Writer;
20 20
import java.util.HashMap;
21 21
import java.util.Iterator;
22
import java.util.Map.Entry;
22 23

  
23 24
import javax.swing.BorderFactory;
24 25
import javax.swing.ImageIcon;
......
119 120
	 */
120 121
	public void marshalPlugins() {
121 122
		HashMap pc = Launcher.getPluginConfig();
122
		Iterator iter = pc.keySet().iterator();
123
		Iterator iter = pc.entrySet().iterator();
123 124

  
125
		Entry entry;
126
		File configFile;
127
		PluginConfig pconfig;
128
		String pluginName;
129
		Writer writer;
130
		FileOutputStream fos;
131
		
132
		
124 133
		while (iter.hasNext()) {
125
			Object obj = iter.next();
126
			PluginConfig pconfig = (PluginConfig) pc.get(obj);
127
			Writer writer;
134
			entry =(Entry)iter.next();
135
			pluginName = (String) entry.getKey();
136
			pconfig = (PluginConfig) entry.getValue();
128 137

  
138
			configFile = new File(Launcher.getAndamiConfig().getPluginsDirectory() +
139
					File.separator + pluginName + File.separator +
140
					"config.xml");
141
			if (!configFile.canWrite()){
142
				continue;
143
			}
144

  
129 145
			try {
130
				FileOutputStream fos = new FileOutputStream(Launcher.getAndamiConfig().getPluginsDirectory() +
131
						File.separator + (String) obj + File.separator +
132
						"config.xml");
146
				fos = new FileOutputStream(configFile);
133 147
				// castor uses xerces, and xerces uses UTF-8 by default, so we should use
134 148
				// UTF-8 to create the writer, as long as we continue using castor+xerces
135 149
				writer = new BufferedWriter(new OutputStreamWriter(fos, "UTF-8"));
......
338 352
	public void setChangesApplied() {
339 353
		changed = false;
340 354
	}
355
	
356
	public void setReadOnly(boolean readOnly){		
357
		getChbActivar().setEnabled(!readOnly);
358
		getJTextField().setEnabled(!readOnly);		 
359
	}
341 360
}  //  @jve:decl-index=0:visual-constraint="10,10"

Also available in: Unified diff