/**
 * 
 */
package net.sf.taverna.t2.component.ui.preference;

import java.util.HashMap;
import java.util.Map;

import javax.swing.JPanel;

import net.sf.taverna.t2.component.preference.ComponentPreference;
import net.sf.taverna.t2.workbench.configuration.AbstractConfigurable;
import net.sf.taverna.t2.workbench.configuration.Configurable;
import net.sf.taverna.t2.workbench.configuration.ConfigurationUIFactory;

/**
 * @author alanrw
 * 
 */
public class ComponentPreferenceUIFactory extends AbstractConfigurable
		implements ConfigurationUIFactory {

	public static final String DISPLAY_NAME = "Components";
	private final JPanel configPanel;
	private static ComponentPreference pref = ComponentPreference.getInstance();

	public ComponentPreferenceUIFactory() {
		super();
		this.configPanel = new ComponentPreferencePanel();
	}

	@Override
	public boolean canHandle(String uuid) {
		return (uuid.equals(pref.getUUID()));
	}

	@Override
	public Configurable getConfigurable() {
		return this;
	}

	@Override
	public JPanel getConfigurationPanel() {
		return this.configPanel;
	}

	@Override
	public String getCategory() {
		return "general";
	}

	@Override
	public Map<String, String> getDefaultPropertyMap() {
		return new HashMap<String, String>();
	}

	@Override
	public String getDisplayName() {
		return DISPLAY_NAME;
	}

	@Override
	public String getFilePrefix() {
		return pref.getFilePrefix();
	}

	@Override
	public String getUUID() {
		return pref.getUUID();
	}
}

@@ -61,34 +61,8 @@
 e;%0A%0A
-import java.util.HashMap;%0A
 impo
@@ -1197,35 +1197,33 @@
 urn 
-new HashMap%3CString, String%3E
+pref.getDefaultProperties
 ();%0A

Fix some weird configuration problems.