Revision 33275 branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/layout/LayoutDocument.java

View differences:

LayoutDocument.java
43 43
import org.gvsig.app.project.documents.AbstractDocument;
44 44
import org.gvsig.app.project.documents.DocumentManager;
45 45
import org.gvsig.app.project.documents.layout.gui.LayoutPanel;
46
import org.gvsig.app.project.documents.view.BaseViewDocument;
47
import org.gvsig.tools.ToolsLocator;
48
import org.gvsig.tools.dynobject.DynStruct;
49
import org.gvsig.tools.persistence.PersistenceManager;
46 50
import org.gvsig.tools.persistence.PersistentState;
47 51
import org.gvsig.tools.persistence.exception.PersistenceException;
48 52

  
......
59 63
	 */
60 64
	private static final long serialVersionUID = 7320640550072493414L;
61 65

  
66
	public static final String PERSISTENCE_DEFINITION_NAME = "LayoutDocument";
67

  
62 68
	private LayoutPanel model;
63 69

  
64 70
	public LayoutDocument(DocumentManager factory) {
......
108 114
		state.set("layout", model);
109 115
	}
110 116

  
117
	public static void registerPersistent() {
118
		LayoutPanel.registerPersistent();
119
		
120
		PersistenceManager manager = ToolsLocator.getPersistenceManager();
121
		DynStruct definition = manager.addDefinition(
122
				BaseViewDocument.class,
123
				PERSISTENCE_DEFINITION_NAME,
124
				"Layout document persistence definition",
125
				null, 
126
				null
127
		);  
128
		definition.extend(manager.getDefinition(AbstractDocument.PERSISTENCE_DEFINITION_NAME));
129

  
130
		definition.addDynFieldObject("layout").setClassOfValue(LayoutPanel.class).setMandatory(true);
131
	}
132

  
111 133
}

Also available in: Unified diff