Revision 36631
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/gui/WizardPanel.java | ||
---|---|---|
71 | 71 |
|
72 | 72 |
abstract public void initWizard(); |
73 | 73 |
|
74 |
/** |
|
75 |
* @deprecated use {@link #executeWizard()} instead. |
|
76 |
*/ |
|
74 | 77 |
abstract public void execute(); |
75 | 78 |
|
79 |
/** |
|
80 |
* Executes the wizard and returns anything created in the process. |
|
81 |
* |
|
82 |
* @return anything created in the process |
|
83 |
*/ |
|
84 |
public Object executeWizard() { |
|
85 |
execute(); |
|
86 |
return null; |
|
87 |
} |
|
88 |
|
|
76 | 89 |
abstract public void close(); |
77 | 90 |
|
78 | 91 |
abstract public DataStoreParameters[] getParameters(); |
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/ProjectManager.java | ||
---|---|---|
149 | 149 |
return doc; |
150 | 150 |
} |
151 | 151 |
|
152 |
/** |
|
153 |
* @deprecated use {@link #createDocumentsByUser(String)} instead |
|
154 |
*/ |
|
152 | 155 |
public Document createDocumentByUser(String type) { |
153 | 156 |
Document doc = getDocumentManager(type).createDocumentByUser(); |
154 | 157 |
return doc; |
155 | 158 |
} |
156 | 159 |
|
160 |
/** |
|
161 |
* Creates a group of documents of a given type through the user interface. |
|
162 |
* |
|
163 |
* @param type |
|
164 |
* the type of documents to create |
|
165 |
* @return the created documents |
|
166 |
*/ |
|
167 |
public Iterator<? extends Document> createDocumentsByUser(String type) { |
|
168 |
return getDocumentManager(type).createDocumentsByUser(); |
|
169 |
} |
|
170 |
|
|
157 | 171 |
public Project createProject() { |
158 | 172 |
return new DefaultProject(); |
159 | 173 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/AbstractDocumentManager.java | ||
---|---|---|
30 | 30 |
|
31 | 31 |
import java.lang.reflect.Constructor; |
32 | 32 |
import java.util.ArrayList; |
33 |
import java.util.HashSet; |
|
34 |
import java.util.Iterator; |
|
33 | 35 |
import java.util.List; |
34 | 36 |
import java.util.Map; |
37 |
import java.util.Set; |
|
35 | 38 |
|
36 | 39 |
import javax.swing.ImageIcon; |
37 | 40 |
|
... | ... | |
100 | 103 |
return PluginServices.getText(this, "documento"); |
101 | 104 |
} |
102 | 105 |
|
103 |
/** |
|
104 |
* Introdece a gui to be able from the characteristics that we want a ProjectDocument |
|
105 |
* |
|
106 |
* @param project present Project. |
|
107 |
* |
|
108 |
* @return new ProjectDocument. |
|
109 |
*/ |
|
110 | 106 |
public AbstractDocument createDocumentByUser() { |
111 | 107 |
return createDocument(); |
112 | 108 |
} |
113 | 109 |
|
110 |
public Iterator<? extends Document> createDocumentsByUser() { |
|
111 |
Set<AbstractDocument> doc = new HashSet<AbstractDocument>(1); |
|
112 |
doc.add(createDocumentByUser()); |
|
113 |
return doc.iterator(); |
|
114 |
} |
|
115 |
|
|
114 | 116 |
/** |
115 | 117 |
* @see ExtensionBuilder |
116 | 118 |
*/ |
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/gui/ProjectWindow.java | ||
---|---|---|
34 | 34 |
import java.util.Collections; |
35 | 35 |
import java.util.Comparator; |
36 | 36 |
import java.util.Enumeration; |
37 |
import java.util.Iterator; |
|
37 | 38 |
import java.util.List; |
38 | 39 |
|
39 | 40 |
import javax.swing.AbstractButton; |
... | ... | |
278 | 279 |
refreshDocuments(); |
279 | 280 |
} |
280 | 281 |
|
281 |
private Document createDocumentInProject(String doctype) { |
|
282 |
try { |
|
283 |
Document document = |
|
284 |
ProjectManager.getInstance().createDocumentByUser(doctype); |
|
285 |
if (document == null) { |
|
286 |
return null; |
|
282 |
private void createDocumentsInProject(String doctype) { |
|
283 |
Iterator<? extends Document> documents = |
|
284 |
ProjectManager.getInstance().createDocumentsByUser(doctype); |
|
285 |
for (; documents.hasNext();) { |
|
286 |
try { |
|
287 |
Document document = documents.next(); |
|
288 |
project.add(document); |
|
289 |
int index = |
|
290 |
((DefaultListModel) lstDocs.getModel()).indexOf(document); |
|
291 |
lstDocs.setSelectedIndex(index); |
|
292 |
lstDocs.requestFocus(); |
|
293 |
openDocumentWindow(document); |
|
294 |
} catch (Exception e) { |
|
295 |
NotificationManager.addError(e); |
|
287 | 296 |
} |
288 |
project.add(document); |
|
289 |
int index = |
|
290 |
((DefaultListModel) lstDocs.getModel()).indexOf(document); |
|
291 |
lstDocs.setSelectedIndex(index); |
|
292 |
lstDocs.requestFocus(); |
|
293 |
return document; |
|
294 |
} catch (Exception e) { |
|
295 |
NotificationManager.addError(e); |
|
296 | 297 |
} |
297 |
return null; |
|
298 | 298 |
} |
299 | 299 |
|
300 | 300 |
/** |
... | ... | |
305 | 305 |
*/ |
306 | 306 |
private void newProjectDocument() throws Exception { |
307 | 307 |
String doctype = getDocumentSelected(); |
308 |
Document doc = createDocumentInProject(doctype); |
|
309 |
openDocumentWindow(doc); |
|
308 |
createDocumentsInProject(doctype); |
|
310 | 309 |
} |
311 | 310 |
|
312 | 311 |
/** |
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/DocumentManager.java | ||
---|---|---|
1 | 1 |
package org.gvsig.app.project.documents; |
2 | 2 |
|
3 |
import java.util.Iterator; |
|
4 |
|
|
3 | 5 |
import javax.swing.ImageIcon; |
4 | 6 |
|
5 | 7 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
... | ... | |
41 | 43 |
*/ |
42 | 44 |
public AbstractDocument createDocument(); |
43 | 45 |
|
44 |
/** |
|
45 |
* Introdece a gui to be able from the characteristics that we want a ProjectDocument |
|
46 |
* |
|
47 |
* @param project present Project. |
|
48 |
* |
|
49 |
* @return new ProjectDocument. |
|
50 |
*/ |
|
46 |
/** |
|
47 |
* Uses a gui to be able from the characteristics that we want a |
|
48 |
* ProjectDocument |
|
49 |
* |
|
50 |
* @return a new Document |
|
51 |
* |
|
52 |
* @deprecated user {@link #createDocumentsByUser()} instead |
|
53 |
*/ |
|
51 | 54 |
public AbstractDocument createDocumentByUser(); |
52 | 55 |
|
56 |
/** |
|
57 |
* Uses a gui to be able from the characteristics that we want a |
|
58 |
* ProjectDocument |
|
59 |
* |
|
60 |
* @return the created documents |
|
61 |
*/ |
|
62 |
public Iterator<? extends Document> createDocumentsByUser(); |
|
63 |
|
|
53 | 64 |
/** |
54 | 65 |
* Returns the title of type of document. |
55 | 66 |
* |
Also available in: Unified diff