Révision 3139
tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/toolbar/UnitConcordanceToolbar.java (revision 3139) | ||
---|---|---|
595 | 595 |
} |
596 | 596 |
} |
597 | 597 |
|
598 |
|
|
598 | 599 |
@Override |
599 | 600 |
public boolean save() { |
600 |
try { |
|
601 |
return URSCorpora.saveCorpus(corpus); |
|
602 |
} |
|
603 |
catch (Exception ex) { |
|
604 |
ex.printStackTrace(); |
|
601 |
// System.out.println(); |
|
602 |
Log.info("Saving URS annotation..."); |
|
603 |
if (URSCorpora.saveCorpus(corpus)) { |
|
604 |
Log.info("Done: URS annotations saved."); |
|
605 |
return true; |
|
606 |
} else { |
|
607 |
Log.warning("Error: URS annotation not saved."); |
|
605 | 608 |
return false; |
606 | 609 |
} |
607 | 610 |
} |
tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/toolbar/UnitToolbar.java (revision 3139) | ||
---|---|---|
1195 | 1195 |
} |
1196 | 1196 |
|
1197 | 1197 |
@Override |
1198 |
public boolean save() { |
|
1199 |
// System.out.println("Saving Analec annotation..."); |
|
1200 |
if (URSCorpora.saveCorpus(analecCorpus)) { |
|
1201 |
this.extension.getSaveButton().setEnabled(false); |
|
1202 |
return true; |
|
1203 |
} |
|
1204 |
return false; |
|
1205 |
} |
|
1206 |
|
|
1207 |
@Override |
|
1208 | 1198 |
public String getName() { |
1209 | 1199 |
return "Unit"; |
1210 | 1200 |
} |
tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/toolbar/SchemaToolbar.java (revision 3139) | ||
---|---|---|
939 | 939 |
} |
940 | 940 |
|
941 | 941 |
@Override |
942 |
public boolean save() { |
|
943 |
return URSCorpora.saveCorpus(analecCorpus); |
|
944 |
} |
|
945 |
|
|
946 |
@Override |
|
947 | 942 |
public String getName() { |
948 | 943 |
return "Schema annotation"; |
949 | 944 |
} |
tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/toolbar/URSAnnotationToolbar.java (revision 3139) | ||
---|---|---|
86 | 86 |
public abstract void select(Element currentElement); |
87 | 87 |
|
88 | 88 |
@Override |
89 |
public boolean save() { |
|
90 |
// System.out.println(); |
|
91 |
Log.info("Saving URS annotation..."); |
|
92 |
if (URSCorpora.saveCorpus(analecCorpus)) { |
|
93 |
Log.info("Done: URS annotations saved."); |
|
94 |
return true; |
|
95 |
} else { |
|
96 |
Log.warning("Error: URS annotation not saved."); |
|
97 |
return false; |
|
98 |
} |
|
99 |
} |
|
100 |
|
|
101 |
@Override |
|
89 | 102 |
public boolean install(TXMEditor<? extends TXMResult> txmeditor, AnnotationExtension extension, Composite parent, int position) throws Exception { |
90 | 103 |
|
91 | 104 |
this.extension = extension; |
tmp/org.txm.annotation.rcp/src/org/txm/annotation/rcp/editor/AnnotationExtension.java (revision 3139) | ||
---|---|---|
294 | 294 |
try { |
295 | 295 |
monitor.setTaskName("Updating corpus XML-TXM files"); |
296 | 296 |
|
297 |
Log.info("Saving annotations..."); |
|
297 | 298 |
boolean needToUpdateIndexes = false; |
298 | 299 |
// System.out.println("Saving annotations..."); |
299 | 300 |
if (annotationAreas != null && annotationAreas.size() > 0) { |
300 | 301 |
for (AnnotationArea aa : annotationAreas) { |
301 |
needToUpdateIndexes = needToUpdateIndexes || (aa.needToUpdateIndexes() && aa.isDirty() && aa.save()); |
|
302 |
needToUpdateIndexes = needToUpdateIndexes |
|
303 |
|| (aa.isDirty() |
|
304 |
&& aa.save() |
|
305 |
&& aa.needToUpdateIndexes()); |
|
302 | 306 |
} |
303 | 307 |
} |
304 |
|
|
308 |
|
|
305 | 309 |
if (needToUpdateIndexes) { |
306 | 310 |
final MainCorpus corpus = editor.getResult().getFirstParent(MainCorpus.class); |
307 | 311 |
monitor.setTaskName("Updating corpus indexes and editions"); |
... | ... | |
311 | 315 |
|
312 | 316 |
@Override |
313 | 317 |
public void run() { |
318 |
Log.info("Done."); |
|
314 | 319 |
CorporaView.refreshObject(corpus); |
320 |
saveButton.setEnabled(false); |
|
315 | 321 |
} |
316 | 322 |
}); |
317 | 323 |
return Status.OK_STATUS; |
... | ... | |
322 | 328 |
System.out.println("Fix XML-TXM files and call command 'UpdateCorpus'"); |
323 | 329 |
return Status.CANCEL_STATUS; |
324 | 330 |
} |
331 |
} else { |
|
332 |
this.syncExec(new Runnable() { |
|
333 |
|
|
334 |
@Override |
|
335 |
public void run() { |
|
336 |
Log.info("Done."); |
|
337 |
saveButton.setEnabled(false); |
|
338 |
} |
|
339 |
}); |
|
340 |
return Status.OK_STATUS; |
|
325 | 341 |
} |
326 | 342 |
} catch(ThreadDeath ex) { |
327 | 343 |
Log.info(TXMUIMessages.executionCanceled); |
328 | 344 |
return Status.CANCEL_STATUS; |
329 | 345 |
} |
330 |
return Status.OK_STATUS; |
|
331 | 346 |
} |
332 | 347 |
}; |
333 | 348 |
job.schedule(); |
Formats disponibles : Unified diff