Révision 3510

TXM/trunk/org.txm.analec.rcp/src/org/txm/macro/urs/edit/ResetViewMacro.groovy (revision 3510)
1
// STANDARD DECLARATIONS
2
package org.txm.macro.urs.edit
3

  
4
import org.kohsuke.args4j.*
5
import groovy.transform.Field
6
import org.txm.rcp.swt.widget.parameters.*
7
import org.txm.annotation.urs.*
8
import org.txm.searchengine.cqp.corpus.*
9
import visuAnalec.elements.*
10

  
11
if (!(corpusViewSelection instanceof CQPCorpus)) {
12
	println "Corpora selection is not a Corpus"
13
	return;
14
}
15

  
16
def corpus = corpusViewSelection
17
if (!URSCorpora.isAnnotationStructureReady(corpus)) {
18
	println "** URS Annotation Structure of "+corpusViewSelection+" is not ready. Aborting."
19
	return
20
}
21

  
22
@Field @Option(name="CONFIRMATION", usage="select to confirm the annotations reset", widget="Boolean", required=false, def="false")
23
def CONFIRMATION
24

  
25
// Open the parameters input dialog box
26
if (!ParametersDialog.open(this)) return;
27

  
28
if (!CONFIRMATION) {
29
	println "Aborting: CONFIRMATION was no checked."
30
	return;
31
}
32

  
33
def analecCorpus = URSCorpora.getCorpus(corpus);
34
//def structure = analecCorpus.getStructure()
35
def vue = URSCorpora.getVue(corpus)
36

  
37
/*
38
Class[] classes = [Unite.class, Relation.class, Schema.class]
39
println "Removing unites..."
40
for (String type : vue.getTypes(Unite.class)) {
41
	for (Unite unite : analecCorpus.getUnites(type).toArray(new Unite[0])) {
42
		analecCorpus.supUnite(unite)
43
	}
44
}
45

  
46
println "Removing relations..."
47
for (String type : vue.getTypes(Relation.class)) {
48
	for (Relation relation : analecCorpus.getRelations(type).toArray(new Relation[0])) {
49
		analecCorpus.supRelation(relation)
50
	}
51
}
52

  
53
println "Removing schemas..."
54
for (String type : vue.getTypes(Schema.class)) {
55
	for (Schema schema : analecCorpus.getSchemas(type).toArray(new Schema[0])) {
56
		analecCorpus.supSchema(schema)
57
	}
58
}
59
*/
60

  
61
vue.retablirVueParDefaut();
62

  
63
println "Done. Save the corpus to finish the annotations reset."
64

  
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/view/ElementPropertiesView.java (revision 3510)
42 42
	public static final String ID = ElementPropertiesView.class.getName();
43 43
	
44 44
	private LinkedHashMap<String, PropertyField> textWidgets = new LinkedHashMap<String, PropertyField>();
45
	private String[][] properties;
45
	//private String[][] properties;
46 46
	
47 47
	Element element;
48 48
	URSAnnotationToolbar toolbar;
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/view/PropertyField.java (revision 3510)
131 131
		t.getCombo().setItems(items);
132 132
		KeyStroke keys = KeyStroke.getInstance(SWT.CONTROL, SWT.SPACE);
133 133
		new TXMAutoCompleteField(t.getCombo(), new ComboContentAdapter(), items, keys);
134
		
135
		t.setEnabled(view.getAnalecVue().isChampModifiable(newElement.getClass(), newElement.getType(), property));
134 136
	}
135 137
	
136 138
	public String getToolTipText() {

Formats disponibles : Unified diff