Revision 5680
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/managehistory/VCSGisJRestoreHistoryImpl.java | ||
---|---|---|
23 | 23 |
|
24 | 24 |
import java.awt.Cursor; |
25 | 25 |
import java.io.File; |
26 |
import java.util.ArrayList; |
|
27 |
import java.util.Collection; |
|
28 |
import java.util.List; |
|
29 |
import javax.swing.DefaultListModel; |
|
26 | 30 |
import javax.swing.ImageIcon; |
27 | 31 |
import javax.swing.JComponent; |
28 | 32 |
import javax.swing.SwingUtilities; |
29 | 33 |
import javax.swing.event.ChangeEvent; |
30 |
import javax.swing.filechooser.FileFilter; |
|
34 |
import javax.swing.event.ListSelectionEvent; |
|
35 |
import javax.swing.event.ListSelectionListener; |
|
36 |
import org.apache.commons.io.FileUtils; |
|
31 | 37 |
import org.apache.commons.io.FilenameUtils; |
38 |
import org.apache.commons.io.IOCase; |
|
39 |
import org.apache.commons.io.filefilter.FileFilterUtils; |
|
40 |
import org.apache.commons.io.filefilter.SuffixFileFilter; |
|
32 | 41 |
import org.apache.commons.lang3.StringUtils; |
33 | 42 |
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters; |
34 | 43 |
import org.gvsig.tools.ToolsLocator; |
... | ... | |
37 | 46 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
38 | 47 |
import org.gvsig.tools.swing.api.ToolsSwingManager; |
39 | 48 |
import org.gvsig.tools.swing.api.ToolsSwingUtils; |
40 |
import org.gvsig.tools.swing.api.pickercontroller.FilePickerController;
|
|
49 |
import org.gvsig.tools.swing.api.pickercontroller.FolderPickerController;
|
|
41 | 50 |
import org.gvsig.tools.swing.api.pickercontroller.PickerController; |
42 | 51 |
import org.gvsig.tools.swing.api.task.TaskStatusController; |
43 | 52 |
import org.gvsig.tools.swing.api.task.TaskStatusSwingManager; |
44 | 53 |
import org.gvsig.tools.swing.api.windowmanager.Dialog; |
45 | 54 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
46 | 55 |
import org.gvsig.tools.task.SimpleTaskStatus; |
56 |
import org.gvsig.tools.util.LabeledValue; |
|
57 |
import org.gvsig.tools.util.LabeledValueImpl; |
|
47 | 58 |
import org.gvsig.vcsgis.lib.UserCancelledException; |
48 |
import org.gvsig.vcsgis.lib.VCSGisEntity; |
|
49 | 59 |
import static org.gvsig.vcsgis.lib.VCSGisManager.ERR_CANT_CHECKOUT; |
50 | 60 |
import static org.gvsig.vcsgis.lib.VCSGisManager.ERR_OK; |
51 | 61 |
import org.gvsig.vcsgis.lib.VCSGisRuntimeException; |
... | ... | |
79 | 89 |
private boolean processing; |
80 | 90 |
private PickerController<VCSGisWorkspace> workspacePicker; |
81 | 91 |
private TaskStatusController taskStatusController; |
82 |
private FilePickerController fileController;
|
|
92 |
private FolderPickerController folderController;
|
|
83 | 93 |
|
84 | 94 |
public VCSGisJRestoreHistoryImpl() { |
85 | 95 |
processing = false; |
... | ... | |
114 | 124 |
doChangeWorkspace(); |
115 | 125 |
doUpdateComponents(); |
116 | 126 |
}); |
117 |
|
|
118 |
this.fileController = ToolsSwingLocator.getToolsSwingManager().createFilePickerController(
|
|
119 |
txtEntitiesFile,
|
|
120 |
btnSelectFolder
|
|
127 |
|
|
128 |
this.folderController = ToolsSwingLocator.getToolsSwingManager().createFolderPickerController(
|
|
129 |
txtFolder,
|
|
130 |
btnFolder |
|
121 | 131 |
); |
122 |
|
|
123 |
this.fileController.setFileFilter(new FileFilter() { |
|
124 |
@Override |
|
125 |
public boolean accept(File f) { |
|
126 |
String name = f.getName(); |
|
127 |
if(f.isDirectory()){ |
|
128 |
return true; |
|
129 |
} |
|
130 |
if(FilenameUtils.isExtension(name.toLowerCase(), "csv") && |
|
131 |
StringUtils.startsWithIgnoreCase(name, ENTITIES_FILE_PREFIX)) { |
|
132 |
return true; |
|
133 |
}; |
|
134 |
return false; |
|
135 |
} |
|
136 | 132 |
|
137 |
@Override |
|
138 |
public String getDescription() { |
|
139 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
140 |
return i18n.getTranslation("_Entity_history_backup_files"); |
|
141 |
} |
|
133 |
// this.folderController.setFileFilter(new FileFilter() { |
|
134 |
// @Override |
|
135 |
// public boolean accept(File f) { |
|
136 |
// String name = f.getName(); |
|
137 |
// if(f.isDirectory()){ |
|
138 |
// return true; |
|
139 |
// } |
|
140 |
// if(FilenameUtils.isExtension(name.toLowerCase(), "csv") && |
|
141 |
// StringUtils.startsWithIgnoreCase(name, ENTITIES_FILE_PREFIX)) { |
|
142 |
// return true; |
|
143 |
// }; |
|
144 |
// return false; |
|
145 |
// } |
|
146 |
// |
|
147 |
// @Override |
|
148 |
// public String getDescription() { |
|
149 |
// I18nManager i18n = ToolsLocator.getI18nManager(); |
|
150 |
// return i18n.getTranslation("_Entity_history_backup_files"); |
|
151 |
// } |
|
152 |
// }); |
|
153 |
this.folderController.addChangeListener((ChangeEvent e) -> { |
|
154 |
doChangeFolder(); |
|
142 | 155 |
}); |
143 |
|
|
144 |
this.fileController.addChangeListener((ChangeEvent e) -> {
|
|
156 |
|
|
157 |
this.lstEntities.addListSelectionListener((ListSelectionEvent e) -> {
|
|
145 | 158 |
doUpdateComponents(); |
146 | 159 |
}); |
147 |
|
|
148 | 160 |
showMessage(" ", null); |
149 | 161 |
|
150 | 162 |
ToolsSwingUtils.ensureRowsCols(this, 22, 60); |
... | ... | |
180 | 192 |
this.processing = true; |
181 | 193 |
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); |
182 | 194 |
VCSGisWorkspace ws = this.getWorkspace(); |
183 |
if(!isValidWorkspace(ws)){
|
|
195 |
if (!isValidWorkspace(ws)) {
|
|
184 | 196 |
showMessage(i18n.getTranslation("_Working_copy_not_valid"), i18n.getTranslation("_The_repository_of_the_selected_working_copy_is_not_accessible_by_this_tool")); |
185 | 197 |
} |
186 | 198 |
doUpdateComponents(); |
... | ... | |
209 | 221 |
} |
210 | 222 |
VCSGisWorkspace workspace = getWorkspace(); |
211 | 223 |
boolean isProcessing = this.processing; |
212 |
boolean canRestore = !isProcessing && workspace != null && |
|
213 |
isValidWorkspace(workspace) && |
|
214 |
this.fileController.get()!=null; |
|
224 |
boolean canRestore = !isProcessing && workspace != null |
|
225 |
&& isValidWorkspace(workspace) |
|
226 |
&& this.folderController.get() != null |
|
227 |
&& !this.lstEntities.getSelectedValuesList().isEmpty(); |
|
215 | 228 |
|
216 | 229 |
this.workspacePicker.setEnabled(!isProcessing); |
217 |
this.fileController.setEnabled(!isProcessing);
|
|
230 |
this.folderController.setEnabled(!isProcessing);
|
|
218 | 231 |
|
219 | 232 |
if (dialog != null) { |
220 | 233 |
this.dialog.setButtonEnabled(WindowManager_v2.BUTTON_OK, canRestore); |
... | ... | |
245 | 258 |
public static void selfRegister() { |
246 | 259 |
String[][] iconsInfo = new String[][]{ |
247 | 260 |
new String[]{ICON_PROVIDER_NAME, ICON_GROUP_NAME, "vcsgis-restore-history"} //, |
248 |
// new String[]{ICON_PROVIDER_NAME, ICON_COMMON_GROUP_NAME, "common-check-off"}, |
|
249 |
// new String[]{ICON_PROVIDER_NAME, ICON_COMMON_GROUP_NAME, "common-check-on"}, |
|
250 |
}; |
|
261 |
// new String[]{ICON_PROVIDER_NAME, ICON_COMMON_GROUP_NAME, "common-check-off"},
|
|
262 |
// new String[]{ICON_PROVIDER_NAME, ICON_COMMON_GROUP_NAME, "common-check-on"},
|
|
263 |
};
|
|
251 | 264 |
registerIcons(iconsInfo); |
252 | 265 |
} |
253 | 266 |
|
... | ... | |
258 | 271 |
|
259 | 272 |
@Override |
260 | 273 |
public int restoreHistory() { |
261 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
262 | 274 |
setVisibleStatus(true); |
263 | 275 |
|
264 | 276 |
final VCSGisWorkspace workspace = this.getWorkspace(); |
265 |
boolean replaceLayerIfExists = true; |
|
266 |
|
|
277 |
if (workspace == null) { |
|
278 |
return ERR_OK; |
|
279 |
} |
|
280 |
List<LabeledValue<File>> files = this.lstEntities.getSelectedValuesList(); |
|
281 |
if (files.isEmpty()) { |
|
282 |
return ERR_OK; |
|
283 |
} |
|
284 |
try { |
|
285 |
processing = true; |
|
286 |
doUpdateComponents(); |
|
287 |
for (LabeledValue<File> entitiesFile : files) { |
|
288 |
int n = restoreHistory(workspace, entitiesFile.getValue()); |
|
289 |
if( n!=ERR_OK ) { |
|
290 |
return n; |
|
291 |
} |
|
292 |
} |
|
293 |
} finally { |
|
294 |
processing = false; |
|
295 |
doUpdateComponents(); |
|
296 |
} |
|
297 |
return ERR_OK; |
|
298 |
} |
|
267 | 299 |
|
268 |
File entitiesFile = fileController.get(); |
|
269 |
if (workspace != null && entitiesFile != null && entitiesFile.exists() ) { |
|
300 |
private int restoreHistory(VCSGisWorkspace workspace, File entitiesFile) { |
|
301 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
302 |
setVisibleStatus(true); |
|
303 |
|
|
304 |
if (workspace != null && entitiesFile != null && entitiesFile.exists()) { |
|
270 | 305 |
SimpleTaskStatus taskStatus = ToolsLocator.getTaskStatusManager().createDefaultSimpleTaskStatus("Download changes"); |
271 | 306 |
try { |
272 | 307 |
taskStatus.setAutoremove(true); |
... | ... | |
274 | 309 |
taskStatus.setRangeOfValues(0, 1); |
275 | 310 |
taskStatus.setCurValue(0); |
276 | 311 |
this.taskStatusController.bind(taskStatus); |
277 |
processing = true; |
|
278 |
doUpdateComponents(); |
|
279 | 312 |
|
280 | 313 |
VCSGisRepository repository = workspace.getRepository(); |
281 | 314 |
JDBCServerExplorerParameters serverExplorerParameters = null; |
282 |
if(repository instanceof VCSGisRepositoryLocaldb){
|
|
283 |
serverExplorerParameters = ((VCSGisRepositoryLocaldb)repository).getServerExplorer().getParameters(); |
|
315 |
if (repository instanceof VCSGisRepositoryLocaldb) {
|
|
316 |
serverExplorerParameters = ((VCSGisRepositoryLocaldb) repository).getServerExplorer().getParameters();
|
|
284 | 317 |
} |
285 | 318 |
int res = ERR_OK; |
286 | 319 |
// Note: RestoreHistory only restore one entity per file |
287 |
// for (VCSGisEntity entity : entities) { |
|
288 |
taskStatus.setTitle("Restore history" + " - " + entitiesFile.getName() + taskStatus.getProgressLabel()); |
|
289 |
showMessage(i18n.getTranslation("_Processing"), null); |
|
290 |
RestoreHistory restoreHistory = new RestoreHistory( |
|
291 |
serverExplorerParameters, |
|
292 |
entitiesFile, taskStatus); |
|
293 |
res = restoreHistory.call(); |
|
294 |
if(res != ERR_OK){ |
|
295 |
showMessage(i18n.getTranslation("_Aborting_process"), null); |
|
296 |
taskStatus.abort(); |
|
297 |
return res; |
|
298 |
} |
|
299 |
taskStatus.incrementCurrentValue(); |
|
300 |
// } |
|
320 |
taskStatus.setTitle("Restore history" + " - " + entitiesFile.getName() + taskStatus.getProgressLabel()); |
|
321 |
showMessage(i18n.getTranslation("_Processing"), null); |
|
322 |
RestoreHistory restoreHistory = new RestoreHistory( |
|
323 |
serverExplorerParameters, |
|
324 |
entitiesFile, taskStatus); |
|
325 |
res = restoreHistory.call(); |
|
326 |
if (res != ERR_OK) { |
|
327 |
showMessage(i18n.getTranslation("_Aborting_process"), null); |
|
328 |
taskStatus.abort(); |
|
329 |
return res; |
|
330 |
} |
|
331 |
taskStatus.incrementCurrentValue(); |
|
301 | 332 |
showMessage(i18n.getTranslation("_Ended_process"), null); |
302 | 333 |
taskStatus.terminate(); |
303 | 334 |
return res; |
304 |
} catch(UserCancelledException ex) { |
|
335 |
} catch (UserCancelledException ex) {
|
|
305 | 336 |
LOGGER.warn("User cancelled"); |
306 | 337 |
taskStatus.cancel(); |
307 |
} catch(Exception ex) { |
|
338 |
} catch (Exception ex) {
|
|
308 | 339 |
LOGGER.warn("Can't restore history", ex); |
309 | 340 |
taskStatus.abort(); |
310 |
} finally { |
|
311 |
processing = false; |
|
312 |
doUpdateComponents(); |
|
313 | 341 |
} |
314 | 342 |
} |
315 |
|
|
316 |
|
|
317 |
|
|
318 |
|
|
319 | 343 |
return ERR_CANT_CHECKOUT; |
320 | 344 |
} |
321 | 345 |
|
322 | 346 |
private boolean isValidWorkspace(VCSGisWorkspace ws) { |
323 | 347 |
final VCSGisWorkspace workspace = this.getWorkspace(); |
324 |
|
|
348 |
|
|
325 | 349 |
if (workspace != null) { |
326 | 350 |
VCSGisRepository repository = workspace.getRepository(); |
327 | 351 |
return (repository instanceof VCSGisRepositoryLocaldb); |
... | ... | |
329 | 353 |
return false; |
330 | 354 |
} |
331 | 355 |
|
356 |
private void doChangeFolder() { |
|
357 |
File folder = this.folderController.get(); |
|
358 |
if (folder == null) { |
|
359 |
this.lstEntities.setModel(new DefaultListModel()); |
|
360 |
doUpdateComponents(); |
|
361 |
return; |
|
362 |
} |
|
363 |
DefaultListModel<LabeledValue<File>> model = new DefaultListModel<>(); |
|
364 |
Collection<File> files0 = FileUtils.listFiles( |
|
365 |
folder, |
|
366 |
FileFilterUtils.suffixFileFilter(".csv",IOCase.INSENSITIVE), |
|
367 |
FileFilterUtils.falseFileFilter() |
|
368 |
); |
|
369 |
List<File> files = new ArrayList<>(files0); |
|
370 |
files.sort((File o1, File o2) -> o1.getName().compareTo(o2.getName())); |
|
371 |
for (File file : files) { |
|
372 |
String fname = FilenameUtils.getBaseName(file.getName()); |
|
373 |
if (StringUtils.startsWithIgnoreCase(fname, ENTITIES_FILE_PREFIX)) { |
|
374 |
String entityName = StringUtils.removeStart(fname, ENTITIES_FILE_PREFIX); |
|
375 |
model.addElement(new LabeledValueImpl<>(entityName, file)); |
|
376 |
}; |
|
377 |
} |
|
378 |
this.lstEntities.setModel(model); |
|
379 |
doUpdateComponents(); |
|
380 |
} |
|
332 | 381 |
} |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/managehistory/VCSGisJRestoreHistoryView.xml | ||
---|---|---|
24 | 24 |
</at> |
25 | 25 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
26 | 26 |
</super> |
27 |
<at name="id">/home/fdiaz/projects/gvSIG/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/managehistory/VCSGisJRestoreHistoryView.xml</at>
|
|
28 |
<at name="path">src/main/java/org/gvsig/vcsgis/swing/impl/managehistory/VCSGisJRestoreHistoryView.xml</at> |
|
29 |
<at name="rowspecs">CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE</at> |
|
27 |
<at name="id">/home/jjdelcerro/datos/devel/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/managehistory/VCSGisJRestoreHistoryView.xml</at>
|
|
28 |
<at name="path">datos/devel/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/managehistory/VCSGisJRestoreHistoryView.xml</at>
|
|
29 |
<at name="rowspecs">CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE</at>
|
|
30 | 30 |
<at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE</at> |
31 | 31 |
<at name="components"> |
32 | 32 |
<object classname="java.util.LinkedList"> |
... | ... | |
75 | 75 |
</object> |
76 | 76 |
</at> |
77 | 77 |
<at name="name">lblWorkspace</at> |
78 |
<at name="width">76</at>
|
|
78 |
<at name="width">75</at>
|
|
79 | 79 |
<at name="text">_Workingcopy</at> |
80 | 80 |
<at name="fill"> |
81 | 81 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
82 | 82 |
<at name="name">fill</at> |
83 | 83 |
</object> |
84 | 84 |
</at> |
85 |
<at name="height">14</at>
|
|
85 |
<at name="height">16</at>
|
|
86 | 86 |
</object> |
87 | 87 |
</at> |
88 | 88 |
</object> |
... | ... | |
135 | 135 |
</object> |
136 | 136 |
</at> |
137 | 137 |
<at name="name">cboWorkspaces</at> |
138 |
<at name="width">1169</at>
|
|
138 |
<at name="width">582</at>
|
|
139 | 139 |
<at name="items"> |
140 | 140 |
<object classname="com.jeta.forms.store.properties.ItemsProperty"> |
141 | 141 |
<at name="name">items</at> |
142 | 142 |
</object> |
143 | 143 |
</at> |
144 |
<at name="height">20</at>
|
|
144 |
<at name="height">22</at>
|
|
145 | 145 |
</object> |
146 | 146 |
</at> |
147 | 147 |
</object> |
... | ... | |
199 | 199 |
</at> |
200 | 200 |
<at name="actionCommand">...</at> |
201 | 201 |
<at name="name">btnInitWorkspace</at> |
202 |
<at name="width">16</at>
|
|
202 |
<at name="width">13</at>
|
|
203 | 203 |
<at name="text">...</at> |
204 |
<at name="height">18</at>
|
|
204 |
<at name="height">20</at>
|
|
205 | 205 |
</object> |
206 | 206 |
</at> |
207 | 207 |
</object> |
... | ... | |
216 | 216 |
<at name="cellconstraints"> |
217 | 217 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
218 | 218 |
<at name="column">2</at> |
219 |
<at name="row">6</at>
|
|
219 |
<at name="row">10</at>
|
|
220 | 220 |
<at name="colspan">4</at> |
221 | 221 |
<at name="rowspan">1</at> |
222 | 222 |
<at name="halign">default</at> |
... | ... | |
254 | 254 |
</object> |
255 | 255 |
</at> |
256 | 256 |
<at name="name">lblStatusTitle</at> |
257 |
<at name="width">1263</at>
|
|
257 |
<at name="width">673</at>
|
|
258 | 258 |
<at name="fill"> |
259 | 259 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
260 | 260 |
<at name="name">fill</at> |
... | ... | |
275 | 275 |
<at name="cellconstraints"> |
276 | 276 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
277 | 277 |
<at name="column">2</at> |
278 |
<at name="row">8</at>
|
|
278 |
<at name="row">12</at>
|
|
279 | 279 |
<at name="colspan">4</at> |
280 | 280 |
<at name="rowspan">1</at> |
281 | 281 |
<at name="halign">default</at> |
... | ... | |
313 | 313 |
</object> |
314 | 314 |
</at> |
315 | 315 |
<at name="name">pbStatus</at> |
316 |
<at name="width">1263</at>
|
|
316 |
<at name="width">673</at>
|
|
317 | 317 |
<at name="percentComplete">0.25</at> |
318 | 318 |
<at name="value">25</at> |
319 | 319 |
<at name="height">14</at> |
... | ... | |
369 | 369 |
</object> |
370 | 370 |
</at> |
371 | 371 |
<at name="name">lblEntitiesFile</at> |
372 |
<at name="width">76</at>
|
|
373 |
<at name="text">_EntitiesFile</at>
|
|
372 |
<at name="width">75</at>
|
|
373 |
<at name="text">_Folder</at>
|
|
374 | 374 |
<at name="fill"> |
375 | 375 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
376 | 376 |
<at name="name">fill</at> |
377 | 377 |
</object> |
378 | 378 |
</at> |
379 |
<at name="height">14</at>
|
|
379 |
<at name="height">16</at>
|
|
380 | 380 |
</object> |
381 | 381 |
</at> |
382 | 382 |
</object> |
... | ... | |
428 | 428 |
</at> |
429 | 429 |
</object> |
430 | 430 |
</at> |
431 |
<at name="name">txtEntitiesFile</at>
|
|
432 |
<at name="width">1169</at>
|
|
433 |
<at name="height">20</at>
|
|
431 |
<at name="name">txtFolder</at>
|
|
432 |
<at name="width">582</at>
|
|
433 |
<at name="height">22</at>
|
|
434 | 434 |
</object> |
435 | 435 |
</at> |
436 | 436 |
</object> |
... | ... | |
487 | 487 |
</object> |
488 | 488 |
</at> |
489 | 489 |
<at name="actionCommand">...</at> |
490 |
<at name="name">btnSelectFolder</at>
|
|
491 |
<at name="width">16</at>
|
|
490 |
<at name="name">btnFolder</at> |
|
491 |
<at name="width">13</at>
|
|
492 | 492 |
<at name="text">...</at> |
493 |
<at name="height">18</at>
|
|
493 |
<at name="height">20</at>
|
|
494 | 494 |
</object> |
495 | 495 |
</at> |
496 | 496 |
</object> |
... | ... | |
505 | 505 |
<at name="cellconstraints"> |
506 | 506 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
507 | 507 |
<at name="column">2</at> |
508 |
<at name="row">10</at>
|
|
508 |
<at name="row">14</at>
|
|
509 | 509 |
<at name="colspan">4</at> |
510 | 510 |
<at name="rowspan">1</at> |
511 | 511 |
<at name="halign">default</at> |
... | ... | |
543 | 543 |
</object> |
544 | 544 |
</at> |
545 | 545 |
<at name="name">lblStatusMessages</at> |
546 |
<at name="width">1263</at>
|
|
546 |
<at name="width">673</at>
|
|
547 | 547 |
<at name="fill"> |
548 | 548 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
549 | 549 |
<at name="name">fill</at> |
... | ... | |
557 | 557 |
</object> |
558 | 558 |
</at> |
559 | 559 |
</item> |
560 |
<item > |
|
561 |
<at name="value"> |
|
562 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
563 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
564 |
<at name="cellconstraints"> |
|
565 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
566 |
<at name="column">2</at> |
|
567 |
<at name="row">6</at> |
|
568 |
<at name="colspan">3</at> |
|
569 |
<at name="rowspan">1</at> |
|
570 |
<at name="halign">default</at> |
|
571 |
<at name="valign">default</at> |
|
572 |
<at name="insets" object="insets">0,0,0,0</at> |
|
573 |
</object> |
|
574 |
</at> |
|
575 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
576 |
</super> |
|
577 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
578 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
579 |
<at name="beanproperties"> |
|
580 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
581 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
582 |
<at name="properties"> |
|
583 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
584 |
<at name="border"> |
|
585 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
586 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
587 |
<at name="name">border</at> |
|
588 |
</super> |
|
589 |
<at name="borders"> |
|
590 |
<object classname="java.util.LinkedList"> |
|
591 |
<item > |
|
592 |
<at name="value"> |
|
593 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
594 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
595 |
<at name="name">border</at> |
|
596 |
</super> |
|
597 |
</object> |
|
598 |
</at> |
|
599 |
</item> |
|
600 |
</object> |
|
601 |
</at> |
|
602 |
</object> |
|
603 |
</at> |
|
604 |
<at name="name">lblSelectEntities</at> |
|
605 |
<at name="width">667</at> |
|
606 |
<at name="text">_Select_entities_to_restore</at> |
|
607 |
<at name="fill"> |
|
608 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
609 |
<at name="name">fill</at> |
|
610 |
</object> |
|
611 |
</at> |
|
612 |
<at name="height">16</at> |
|
613 |
</object> |
|
614 |
</at> |
|
615 |
</object> |
|
616 |
</at> |
|
617 |
</object> |
|
618 |
</at> |
|
619 |
</item> |
|
620 |
<item > |
|
621 |
<at name="value"> |
|
622 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
623 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
624 |
<at name="cellconstraints"> |
|
625 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
626 |
<at name="column">2</at> |
|
627 |
<at name="row">8</at> |
|
628 |
<at name="colspan">3</at> |
|
629 |
<at name="rowspan">1</at> |
|
630 |
<at name="halign">default</at> |
|
631 |
<at name="valign">default</at> |
|
632 |
<at name="insets" object="insets">0,0,0,0</at> |
|
633 |
</object> |
|
634 |
</at> |
|
635 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
636 |
</super> |
|
637 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
638 |
<at name="beanclass">javax.swing.JList</at> |
|
639 |
<at name="beanproperties"> |
|
640 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
641 |
<at name="classname">javax.swing.JList</at> |
|
642 |
<at name="properties"> |
|
643 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
644 |
<at name="border"> |
|
645 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
646 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
647 |
<at name="name">border</at> |
|
648 |
</super> |
|
649 |
<at name="borders"> |
|
650 |
<object classname="java.util.LinkedList"> |
|
651 |
<item > |
|
652 |
<at name="value"> |
|
653 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
654 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
655 |
<at name="name">border</at> |
|
656 |
</super> |
|
657 |
</object> |
|
658 |
</at> |
|
659 |
</item> |
|
660 |
</object> |
|
661 |
</at> |
|
662 |
</object> |
|
663 |
</at> |
|
664 |
<at name="scrollableTracksViewportHeight">true</at> |
|
665 |
<at name="scrollableTracksViewportWidth">true</at> |
|
666 |
<at name="name">lstEntities</at> |
|
667 |
<at name="width">665</at> |
|
668 |
<at name="items"> |
|
669 |
<object classname="com.jeta.forms.store.properties.ItemsProperty"> |
|
670 |
<at name="name">items</at> |
|
671 |
</object> |
|
672 |
</at> |
|
673 |
<at name="scollBars"> |
|
674 |
<object classname="com.jeta.forms.store.properties.ScrollBarsProperty"> |
|
675 |
<at name="name">scollBars</at> |
|
676 |
<at name="verticalpolicy">20</at> |
|
677 |
<at name="horizontalpolicy">30</at> |
|
678 |
</object> |
|
679 |
</at> |
|
680 |
<at name="height">634</at> |
|
681 |
</object> |
|
682 |
</at> |
|
683 |
</object> |
|
684 |
</at> |
|
685 |
</object> |
|
686 |
</at> |
|
687 |
</item> |
|
560 | 688 |
</object> |
561 | 689 |
</at> |
562 | 690 |
<at name="properties"> |
... | ... | |
614 | 742 |
<at name="cellpainters"> |
615 | 743 |
<object classname="com.jeta.forms.store.support.Matrix"> |
616 | 744 |
<at name="rows"> |
617 |
<object classname="[Ljava.lang.Object;" size="11">
|
|
745 |
<object classname="[Ljava.lang.Object;" size="15">
|
|
618 | 746 |
<at name="item" index="0"> |
619 | 747 |
<object classname="[Ljava.lang.Object;" size="7"/> |
620 | 748 |
</at> |
... | ... | |
648 | 776 |
<at name="item" index="10"> |
649 | 777 |
<object classname="[Ljava.lang.Object;" size="7"/> |
650 | 778 |
</at> |
779 |
<at name="item" index="11"> |
|
780 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
781 |
</at> |
|
782 |
<at name="item" index="12"> |
|
783 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
784 |
</at> |
|
785 |
<at name="item" index="13"> |
|
786 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
787 |
</at> |
|
788 |
<at name="item" index="14"> |
|
789 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
790 |
</at> |
|
651 | 791 |
</object> |
652 | 792 |
</at> |
653 | 793 |
</object> |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/managehistory/VCSGisJRestoreHistoryView.java | ||
---|---|---|
13 | 13 |
import javax.swing.JComboBox; |
14 | 14 |
import javax.swing.JFrame; |
15 | 15 |
import javax.swing.JLabel; |
16 |
import javax.swing.JList; |
|
16 | 17 |
import javax.swing.JPanel; |
17 | 18 |
import javax.swing.JProgressBar; |
19 |
import javax.swing.JScrollPane; |
|
18 | 20 |
import javax.swing.JTextField; |
19 | 21 |
import javax.swing.border.EmptyBorder; |
20 | 22 |
|
... | ... | |
27 | 29 |
JLabel lblStatusTitle = new JLabel(); |
28 | 30 |
JProgressBar pbStatus = new JProgressBar(); |
29 | 31 |
JLabel lblEntitiesFile = new JLabel(); |
30 |
JTextField txtEntitiesFile = new JTextField();
|
|
31 |
JButton btnSelectFolder = new JButton();
|
|
32 |
JTextField txtFolder = new JTextField();
|
|
33 |
JButton btnFolder = new JButton(); |
|
32 | 34 |
JLabel lblStatusMessages = new JLabel(); |
35 |
JLabel lblSelectEntities = new JLabel(); |
|
36 |
JList lstEntities = new JList(); |
|
33 | 37 |
|
34 | 38 |
/** |
35 | 39 |
* Default constructor |
... | ... | |
121 | 125 |
public JPanel createPanel() |
122 | 126 |
{ |
123 | 127 |
JPanel jpanel1 = new JPanel(); |
124 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE","CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE"); |
|
128 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE","CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE");
|
|
125 | 129 |
CellConstraints cc = new CellConstraints(); |
126 | 130 |
jpanel1.setLayout(formlayout1); |
127 | 131 |
|
... | ... | |
140 | 144 |
jpanel1.add(btnInitWorkspace,cc.xy(6,2)); |
141 | 145 |
|
142 | 146 |
lblStatusTitle.setName("lblStatusTitle"); |
143 |
jpanel1.add(lblStatusTitle,cc.xywh(2,6,4,1));
|
|
147 |
jpanel1.add(lblStatusTitle,cc.xywh(2,10,4,1));
|
|
144 | 148 |
|
145 | 149 |
pbStatus.setName("pbStatus"); |
146 | 150 |
pbStatus.setValue(25); |
147 |
jpanel1.add(pbStatus,cc.xywh(2,8,4,1));
|
|
151 |
jpanel1.add(pbStatus,cc.xywh(2,12,4,1));
|
|
148 | 152 |
|
149 | 153 |
lblEntitiesFile.setName("lblEntitiesFile"); |
150 |
lblEntitiesFile.setText("_EntitiesFile");
|
|
154 |
lblEntitiesFile.setText("_Folder");
|
|
151 | 155 |
jpanel1.add(lblEntitiesFile,cc.xy(2,4)); |
152 | 156 |
|
153 |
txtEntitiesFile.setName("txtEntitiesFile");
|
|
154 |
jpanel1.add(txtEntitiesFile,cc.xy(4,4));
|
|
157 |
txtFolder.setName("txtFolder");
|
|
158 |
jpanel1.add(txtFolder,cc.xy(4,4));
|
|
155 | 159 |
|
156 |
btnSelectFolder.setActionCommand("...");
|
|
157 |
btnSelectFolder.setName("btnSelectFolder");
|
|
158 |
btnSelectFolder.setText("...");
|
|
160 |
btnFolder.setActionCommand("..."); |
|
161 |
btnFolder.setName("btnFolder");
|
|
162 |
btnFolder.setText("..."); |
|
159 | 163 |
EmptyBorder emptyborder2 = new EmptyBorder(2,2,2,2); |
160 |
btnSelectFolder.setBorder(emptyborder2);
|
|
161 |
jpanel1.add(btnSelectFolder,cc.xy(6,4));
|
|
164 |
btnFolder.setBorder(emptyborder2); |
|
165 |
jpanel1.add(btnFolder,cc.xy(6,4)); |
|
162 | 166 |
|
163 | 167 |
lblStatusMessages.setName("lblStatusMessages"); |
164 |
jpanel1.add(lblStatusMessages,cc.xywh(2,10,4,1));
|
|
168 |
jpanel1.add(lblStatusMessages,cc.xywh(2,14,4,1));
|
|
165 | 169 |
|
166 |
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6,7 },new int[]{ 1,2,3,4,5,6,7,8,9,10,11 }); |
|
170 |
lblSelectEntities.setName("lblSelectEntities"); |
|
171 |
lblSelectEntities.setText("_Select_entities_to_restore"); |
|
172 |
jpanel1.add(lblSelectEntities,cc.xywh(2,6,3,1)); |
|
173 |
|
|
174 |
lstEntities.setName("lstEntities"); |
|
175 |
JScrollPane jscrollpane1 = new JScrollPane(); |
|
176 |
jscrollpane1.setViewportView(lstEntities); |
|
177 |
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
|
178 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
|
179 |
jpanel1.add(jscrollpane1,cc.xywh(2,8,3,1)); |
|
180 |
|
|
181 |
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6,7 },new int[]{ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }); |
|
167 | 182 |
return jpanel1; |
168 | 183 |
} |
169 | 184 |
|
Also available in: Unified diff