Révision 3023
tmp/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages_fr.properties (revision 3023) | ||
---|---|---|
1075 | 1075 |
zoomInAmpoutColonMouseWheelORShiftPlusRightMousePlusDrag = \ Zoom +/- : Roulette OU Maj + Clic Droit + Glisser\n |
1076 | 1076 |
|
1077 | 1077 |
zoomToSelectionColonCtrlPlusLeftMousePlusdrag = \ Zoomer sur la sélection : Ctrl + Clic Gauche + Glisser\n |
1078 |
|
|
1079 |
TRSSection_0=Transcription |
|
1080 |
TRSSection_1=Afficher le locuteur |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/messages/TXMUIMessages.java (revision 3023) | ||
---|---|---|
1084 | 1084 |
|
1085 | 1085 |
public static String seeTheQuoteSectionIn; |
1086 | 1086 |
|
1087 |
public static String TRSSection_0; |
|
1088 |
|
|
1089 |
public static String TRSSection_1; |
|
1090 |
|
|
1087 | 1091 |
public static String TXMCanNotFetchUpdatesP0; |
1088 | 1092 |
|
1089 | 1093 |
public static String TXMInitializationHasBeenCanceledByUserDotPleaseRestartTXM; |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages.properties (revision 3023) | ||
---|---|---|
35 | 35 |
SourceDirectoryPage_6 = Source directory to use |
36 | 36 |
SourceDirectoryPage_8 = Warning: corpus name normalization: no valid character available to build the corpus name (try to use some American English - ASCII - characters in the folder name) |
37 | 37 |
|
38 |
TRSSection_0=Transcription |
|
39 |
TRSSection_1=Display locutor names |
|
38 | 40 |
TXMCanNotFetchUpdatesP0 = TXM can not fetch updates ({0}). |
39 | 41 |
|
40 | 42 |
TXMInitializationHasBeenCanceledByUserDotPleaseRestartTXM = TXM initialization has been canceled by user. Please restart TXM. |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/EditionSection.java (revision 3023) | ||
---|---|---|
86 | 86 |
|
87 | 87 |
// build text edition or not button |
88 | 88 |
buildDefaultEditionButton = toolkit.createButton(sectionClient, TXMUIMessages.buildEdition, SWT.CHECK); |
89 |
buildDefaultEditionButton.setSelection(true); |
|
89 |
// buildDefaultEditionButton.setSelection(true);
|
|
90 | 90 |
TableWrapData gdata2 = getButtonLayoutData(); |
91 | 91 |
gdata2.colspan = 4; // one line |
92 | 92 |
buildDefaultEditionButton.setLayoutData(gdata2); |
93 | 93 |
|
94 | 94 |
paginateDefaultEditionButton = toolkit.createButton(sectionClient, "Paginate", SWT.CHECK); |
95 |
paginateDefaultEditionButton.setSelection(true); |
|
95 |
// paginateDefaultEditionButton.setSelection(true);
|
|
96 | 96 |
gdata2 = getButtonLayoutData(); |
97 | 97 |
gdata2.colspan = 4; // one line |
98 | 98 |
paginateDefaultEditionButton.setLayoutData(gdata2); |
99 | 99 |
|
100 | 100 |
collapsibleMetadataDefaultEditionButton = toolkit.createButton(sectionClient, "Enable collapsible metadata", SWT.CHECK); |
101 |
collapsibleMetadataDefaultEditionButton.setSelection(true); |
|
101 |
// collapsibleMetadataDefaultEditionButton.setSelection(true);
|
|
102 | 102 |
gdata2 = getButtonLayoutData(); |
103 | 103 |
gdata2.colspan = 4; // one line |
104 | 104 |
collapsibleMetadataDefaultEditionButton.setLayoutData(gdata2); |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/TRSSection.java (revision 3023) | ||
---|---|---|
1 |
package org.txm.rcp.editors.imports.sections; |
|
2 |
|
|
3 |
import java.util.HashMap; |
|
4 |
|
|
5 |
import org.eclipse.core.runtime.preferences.IEclipsePreferences; |
|
6 |
import org.eclipse.swt.SWT; |
|
7 |
import org.eclipse.swt.widgets.Button; |
|
8 |
import org.eclipse.swt.widgets.Composite; |
|
9 |
import org.eclipse.ui.forms.events.ExpansionAdapter; |
|
10 |
import org.eclipse.ui.forms.events.ExpansionEvent; |
|
11 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
|
12 |
import org.eclipse.ui.forms.widgets.ScrolledForm; |
|
13 |
import org.eclipse.ui.forms.widgets.TableWrapData; |
|
14 |
import org.eclipse.ui.forms.widgets.TableWrapLayout; |
|
15 |
import org.txm.objects.Project; |
|
16 |
import org.txm.rcp.messages.TXMUIMessages; |
|
17 |
|
|
18 |
public class TRSSection extends ImportEditorSection { |
|
19 |
|
|
20 |
String ID = TRSSection.class.getSimpleName(); |
|
21 |
|
|
22 |
private static final int SECTION_SIZE = 1; |
|
23 |
|
|
24 |
Button displayLocutorsButton; |
|
25 |
|
|
26 |
/** |
|
27 |
* |
|
28 |
* @param toolkit2 |
|
29 |
* @param form2 |
|
30 |
* @param parent |
|
31 |
* @param stylesave |
|
32 |
* |
|
33 |
* @param moduleParams |
|
34 |
* @param scriptName temporary parameter to detect if import module is xtzLoader.groovy |
|
35 |
*/ |
|
36 |
public TRSSection(FormToolkit toolkit2, ScrolledForm form2, Composite parent, int style) { |
|
37 |
|
|
38 |
super(toolkit2, form2, parent, style); |
|
39 |
|
|
40 |
this.section.setText(TXMUIMessages.TRSSection_0); |
|
41 |
TableWrapLayout layout = new TableWrapLayout(); |
|
42 |
layout.makeColumnsEqualWidth = true; |
|
43 |
layout.numColumns = 1; |
|
44 |
this.section.setLayout(layout); |
|
45 |
this.section.setLayoutData(getSectionGridData(SECTION_SIZE)); |
|
46 |
this.section.setEnabled(false); |
|
47 |
|
|
48 |
this.section.addExpansionListener(new ExpansionAdapter() { |
|
49 |
|
|
50 |
@Override |
|
51 |
public void expansionStateChanged(ExpansionEvent e) { |
|
52 |
form.layout(true); |
|
53 |
} |
|
54 |
}); |
|
55 |
|
|
56 |
// filesection.setDescription("Select how to find source files"); |
|
57 |
Composite sectionClient = toolkit.createComposite(this.section); |
|
58 |
TableWrapLayout slayout = new TableWrapLayout(); |
|
59 |
slayout.numColumns = 4; |
|
60 |
sectionClient.setLayout(slayout); |
|
61 |
this.section.setClient(sectionClient); |
|
62 |
|
|
63 |
// build text edition or not button |
|
64 |
displayLocutorsButton = toolkit.createButton(sectionClient, TXMUIMessages.TRSSection_1, SWT.CHECK); |
|
65 |
TableWrapData gdata2 = getButtonLayoutData(); |
|
66 |
gdata2.colspan = 4; // one line |
|
67 |
displayLocutorsButton.setLayoutData(gdata2); |
|
68 |
} |
|
69 |
|
|
70 |
@Override |
|
71 |
public void update(Project project) { |
|
72 |
if (this.section.isDisposed()) return; |
|
73 |
if (project == null) return; |
|
74 |
|
|
75 |
IEclipsePreferences customNode = project.getImportParameters(); |
|
76 |
displayLocutorsButton.setSelection(customNode.getBoolean("display_locutors", true)); //$NON-NLS-1$ |
|
77 |
} |
|
78 |
|
|
79 |
@Override |
|
80 |
public boolean save(Project project) { |
|
81 |
if (this.section != null && !this.section.isDisposed()) { |
|
82 |
|
|
83 |
IEclipsePreferences customNode = project.getImportParameters(); |
|
84 |
customNode.putBoolean("display_locutors", displayLocutorsButton.getSelection()); //$NON-NLS-1$ |
|
85 |
} |
|
86 |
return true; |
|
87 |
} |
|
88 |
|
|
89 |
@Override |
|
90 |
public boolean checkFields() { |
|
91 |
return true; |
|
92 |
} |
|
93 |
|
|
94 |
@Override |
|
95 |
public int getSectionSize() { |
|
96 |
return SECTION_SIZE; |
|
97 |
} |
|
98 |
} |
|
0 | 99 |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/CorpusPage.java (revision 3023) | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import java.io.File; |
31 | 31 |
import java.io.IOException; |
32 |
import java.lang.reflect.Constructor; |
|
33 |
import java.lang.reflect.InvocationTargetException; |
|
32 | 34 |
import java.util.Date; |
33 | 35 |
import java.util.HashMap; |
34 | 36 |
|
... | ... | |
130 | 132 |
|
131 | 133 |
ImportEditorSection optionsSection; |
132 | 134 |
|
135 |
/** |
|
136 |
* Import module custom import section, see ImportModuleCustomization.getAdditionalSection(name) |
|
137 |
*/ |
|
138 |
ImportEditorSection additionalSection; |
|
139 |
|
|
133 | 140 |
// old widgets to be moved/deleted |
134 | 141 |
TableViewer preBuildViewer; |
135 | 142 |
|
... | ... | |
241 | 248 |
N_SECTIONS += createOptionsSection(); |
242 | 249 |
} |
243 | 250 |
|
251 |
N_SECTIONS += createAdditionalSection(); |
|
252 |
|
|
244 | 253 |
// END OF SECTIONS CREATION, ENSURE THAT THE NUMBER OF CELL is %2 |
245 | 254 |
if (N_SECTIONS % 2 != 0) N_SECTIONS += createEmptyCell(); |
246 | 255 |
|
... | ... | |
269 | 278 |
return optionsSection.getSectionSize(); |
270 | 279 |
} |
271 | 280 |
|
281 |
private int createAdditionalSection() { |
|
282 |
String importName = editor.getGroovyscript().getName(); |
|
283 |
if (ImportModuleCustomization.getAdditionalSection(importName) != null) { |
|
284 |
Class<? extends ImportEditorSection> clazz = ImportModuleCustomization.getAdditionalSection(importName); |
|
285 |
|
|
286 |
try { |
|
287 |
Constructor<? extends ImportEditorSection> c = clazz.getConstructor(FormToolkit.class, ScrolledForm.class, Composite.class, int.class); |
|
288 |
additionalSection = c.newInstance(toolkit, form, form.getBody(), ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE); |
|
289 |
return additionalSection.getSectionSize(); |
|
290 |
} |
|
291 |
catch (Exception e) { |
|
292 |
Log.printStackTrace(e); |
|
293 |
} |
|
294 |
} |
|
295 |
return 0; |
|
296 |
} |
|
297 |
|
|
272 | 298 |
private int createInfosSection() { |
273 | 299 |
infosSection = new InfosSection(toolkit, form, form.getBody(), ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE); |
274 | 300 |
return infosSection.getSectionSize(); |
... | ... | |
864 | 890 |
optionsSection.update(project); |
865 | 891 |
} |
866 | 892 |
|
893 |
if (additionalSection != null && !additionalSection.isDisposed()) { |
|
894 |
additionalSection.setEnabled(true); |
|
895 |
additionalSection.update(project); |
|
896 |
} |
|
897 |
|
|
867 | 898 |
/* |
868 | 899 |
* if (sattrSection != null && !sattrSection.isDisposed()) { |
869 | 900 |
* sattrSection.setEnabled(true); |
... | ... | |
936 | 967 |
if (optionsSection != null && !optionsSection.isDisposed()) { |
937 | 968 |
doSave = doSave & optionsSection.checkFields(); |
938 | 969 |
} |
970 |
if (additionalSection != null && !additionalSection.isDisposed()) { |
|
971 |
doSave = doSave & additionalSection.checkFields(); |
|
972 |
} |
|
939 | 973 |
if (!doSave) { |
940 | 974 |
System.out.println("Some fields are not correctly filled."); |
941 | 975 |
return false; |
... | ... | |
973 | 1007 |
if (optionsSection != null && !optionsSection.isDisposed()) { |
974 | 1008 |
successfulSave = successfulSave & optionsSection.save(project); |
975 | 1009 |
} |
1010 |
if (additionalSection != null && !additionalSection.isDisposed()) { |
|
1011 |
successfulSave = successfulSave & additionalSection.save(project); |
|
1012 |
} |
|
976 | 1013 |
|
977 | 1014 |
if (successfulSave) { |
978 | 1015 |
try { |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/ImportModuleCustomization.java (revision 3023) | ||
---|---|---|
3 | 3 |
import java.util.HashMap; |
4 | 4 |
import java.util.LinkedHashMap; |
5 | 5 |
|
6 |
import org.txm.rcp.editors.imports.sections.ImportEditorSection; |
|
7 |
import org.txm.rcp.editors.imports.sections.TRSSection; |
|
8 |
|
|
6 | 9 |
/** |
7 | 10 |
* static class that defines what parameters are used by import modules |
8 | 11 |
* |
... | ... | |
45 | 48 |
|
46 | 49 |
static HashMap<String, HashMap<String, Boolean>> sectionsPerImportModule = new HashMap<>(); |
47 | 50 |
|
48 |
static HashMap<String, HashMap<String, String>> additionalFields = new HashMap<>();
|
|
51 |
static HashMap<String, Class<? extends ImportEditorSection>> additionalSections = new HashMap<>();
|
|
49 | 52 |
|
50 | 53 |
static HashMap<String, String> names = new HashMap<>(); |
51 | 54 |
|
... | ... | |
69 | 72 |
sectionsPerImportModule.put("discoursLoader.groovy", params); //$NON-NLS-1$ |
70 | 73 |
names.put("discoursLoader.groovy", "CNR + CSV"); //$NON-NLS-1$ //$NON-NLS-2$ |
71 | 74 |
|
75 |
|
|
72 | 76 |
params = new HashMap<>(); |
73 | 77 |
params.put(PARALLEL, false); |
74 | 78 |
params.put(ENCODING, true); |
... | ... | |
163 | 167 |
params.put(OPTIONS, true); |
164 | 168 |
sectionsPerImportModule.put("transcriberLoader.groovy", params); //$NON-NLS-1$ |
165 | 169 |
names.put("transcriberLoader.groovy", "XML-TRS + CSV"); //$NON-NLS-1$ //$NON-NLS-2$ |
166 |
LinkedHashMap<String, String> adds = new LinkedHashMap<>(); // name + type |
|
167 |
adds.put("String", "Boolean"); |
|
168 |
additionalFields.put("transcriberLoader.groovy", adds); |
|
170 |
additionalSections.put("transcriberLoader.groovy", TRSSection.class); |
|
169 | 171 |
|
170 | 172 |
params = new HashMap<>(); |
171 | 173 |
params.put(PARALLEL, false); |
... | ... | |
358 | 360 |
return importscript; |
359 | 361 |
} |
360 | 362 |
} |
363 |
|
|
364 |
/** |
|
365 |
* |
|
366 |
* @param importName |
|
367 |
* @return a ImportEditorSection class if any for a given import module name |
|
368 |
*/ |
|
369 |
public static Class<? extends ImportEditorSection> getAdditionalSection(String importName) { |
|
370 |
return additionalSections.get(importName); |
|
371 |
} |
|
361 | 372 |
} |
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/pager.groovy (revision 3023) | ||
---|---|---|
77 | 77 |
|
78 | 78 |
boolean paginate = true |
79 | 79 |
boolean enableCollapsibles = false; |
80 |
boolean displayLocutors = true; |
|
80 | 81 |
|
81 | 82 |
/** The wordvalue. */ |
82 | 83 |
String wordvalue; |
... | ... | |
173 | 174 |
this.wordmax = project.getEditionDefinition("default").getWordsPerPage(); |
174 | 175 |
this.paginate = project.getEditionDefinition("default").getPaginateEdition() |
175 | 176 |
this.enableCollapsibles = project.getEditionDefinition("default").getEnableCollapsibleMetadata(); |
177 |
this.displayLocutors = project.getImportParameters().getBoolean("display_locutors", true); |
|
176 | 178 |
|
177 | 179 |
inputData = url.openStream(); |
178 | 180 |
factory = XMLInputFactory.newInstance(); |
... | ... | |
919 | 921 |
if (overlapping) { |
920 | 922 |
writer.writeCharacters("// ") |
921 | 923 |
} |
922 |
writer.writeCharacters(spk+": ") |
|
924 |
if (displayLocutors) { |
|
925 |
writer.writeCharacters(spk+": ") |
|
926 |
} |
|
923 | 927 |
|
924 | 928 |
writer.writeEndElement(); // span@class=spk |
925 | 929 |
} |
tmp/org.txm.core/src/java/org/txm/objects/Project.java (revision 3023) | ||
---|---|---|
1358 | 1358 |
return l; |
1359 | 1359 |
} |
1360 | 1360 |
|
1361 |
public IEclipsePreferences getImportParameters() { |
|
1362 |
return this.getPreferencesScope().getNode("import"); |
|
1363 |
} |
|
1364 |
|
|
1361 | 1365 |
public boolean getDoUpdate() { |
1362 |
return this.getPreferencesScope().getNode("import").getBoolean(ImportKeys.UPDATECORPUS, false);
|
|
1366 |
return this.getImportParameters().getBoolean(ImportKeys.UPDATECORPUS, false);
|
|
1363 | 1367 |
} |
1364 | 1368 |
|
1365 | 1369 |
public void setDoUpdate(boolean update) { |
1366 |
this.getPreferencesScope().getNode("import").putBoolean(ImportKeys.UPDATECORPUS, update);
|
|
1370 |
this.getImportParameters().putBoolean(ImportKeys.UPDATECORPUS, update);
|
|
1367 | 1371 |
} |
1368 | 1372 |
|
1369 | 1373 |
public boolean getDoMultiThread() { |
1370 |
return this.getPreferencesScope().getNode("import").getBoolean(ImportKeys.MULTITHREAD, false);
|
|
1374 |
return this.getImportParameters().getBoolean(ImportKeys.MULTITHREAD, false);
|
|
1371 | 1375 |
} |
1372 | 1376 |
|
1373 | 1377 |
public void setDoMultiThread(boolean multithreaded) { |
1374 |
this.getPreferencesScope().getNode("import").putBoolean(ImportKeys.MULTITHREAD, multithreaded);
|
|
1378 |
this.getImportParameters().putBoolean(ImportKeys.MULTITHREAD, multithreaded);
|
|
1375 | 1379 |
} |
1376 | 1380 |
|
1377 | 1381 |
/** |
Formats disponibles : Unified diff