Revision 20637 trunk/extensions/extJCRS/src/org/gvsig/crs/persistence/RecentCRSsPersistence.java

View differences:

RecentCRSsPersistence.java
69 69
	private static final String CRS_CODE = "code";
70 70
	private static final String CRS_DATE = "date";
71 71
	
72
	
73
	public static Object pluginClassInstance = null;
74
	
75 72
	/**
76 73
	 * Constructor
77
	 * @param pluginClassInstance
78 74
	 */
79
	public RecentCRSsPersistence(Object pluginClassInstance){
80
		ps = PluginServices.getPluginServices(pluginClassInstance);
75
	public RecentCRSsPersistence(){
76
		ps = PluginServices.getPluginServices("org.gvsig.crs");
81 77
		xml = ps.getPersistentXML();
82 78
		for (int child = 0; child<xml.getChildrenCount();child++)
83 79
			if (xml.getChild(child).getPropertyValue(0).equals(CRS_RECENTS))
......
90 86
		}
91 87
	}
92 88
	
93
	/**
94
	 * Constructor
95
	 */
96
	public RecentCRSsPersistence(){
97
		ps = PluginServices.getPluginServices(pluginClassInstance);
98
		xml = ps.getPersistentXML();
99
		for (int child = 0; child<xml.getChildrenCount();child++)
100
			if (xml.getChild(child).getPropertyValue(0).equals(CRS_RECENTS))
101
				recentsXml = xml.getChild(child); 
102
		if (recentsXml == null){
103
			XMLEntity xmlEntity = new XMLEntity();
104
			xmlEntity.putProperty("groupName", CRS_RECENTS);
105
			xml.addChild(xmlEntity); 
106
			recentsXml = xmlEntity;
107
		}
108
	}
109 89

  
110 90
	/**
111 91
	 * This methos is used to save the information in an XML file

Also available in: Unified diff