Révision 1853
tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java (revision 1853) | ||
---|---|---|
944 | 944 |
} |
945 | 945 |
} |
946 | 946 |
|
947 |
|
|
947 |
Display.getDefault().syncExec(new Runnable() { |
|
948 |
@Override |
|
949 |
public void run() { |
|
950 |
RestartTXM.reloadViews(); |
|
951 |
} |
|
952 |
}); |
|
948 | 953 |
} |
949 | 954 |
|
950 | 955 |
/** |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/corpuswizard/ImportWizard.java (revision 1853) | ||
---|---|---|
65 | 65 |
} |
66 | 66 |
project.setSourceDirectory(path.getAbsolutePath()); |
67 | 67 |
project.setDescription(System.getProperty("user.name")+"\n"+TXMResult.PRETTY_LOCALIZED_TIME_FORMAT.format(Calendar.getInstance().getTime())); |
68 |
project.setLang(Locale.getDefault().getCountry());
|
|
68 |
project.setLang(Locale.getDefault().getLanguage().toLowerCase());
|
|
69 | 69 |
System.out.println(NLS.bind(TXMUIMessages.theP0CorpusWillBeCreatedFromTheP1Directory, project.getName(), project.getSrcdir())); |
70 | 70 |
} else { |
71 | 71 |
Date date = project.getLastComputingDate(); |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/LangSection.java (revision 1853) | ||
---|---|---|
79 | 79 |
} |
80 | 80 |
}); |
81 | 81 |
|
82 |
String locale = Locale.getDefault().getCountry();
|
|
82 |
String locale = Locale.getDefault().getLanguage().toLowerCase();
|
|
83 | 83 |
int langToSelectIndex = -1; |
84 | 84 |
int added = 0; |
85 | 85 |
String modelsDir = TreeTaggerPreferences.getInstance().getString(TreeTaggerPreferences.MODELS_PATH); |
... | ... | |
117 | 117 |
boolean annotate = project.getAnnotate(); //$NON-NLS-1$ |
118 | 118 |
|
119 | 119 |
//fill combo and select default language |
120 |
String defaultLang = Locale.getDefault().getLanguage(); |
|
120 |
String defaultLang = Locale.getDefault().getLanguage().toLowerCase();
|
|
121 | 121 |
if ("??".equals(lang)) { //$NON-NLS-1$ |
122 | 122 |
btnSelectLang.setSelection(false); |
123 | 123 |
btnGuessLang.setSelection(true); |
tmp/org.txm.core/src/java/org/txm/core/preferences/TBXPreferences.java (revision 1853) | ||
---|---|---|
152 | 152 |
preferences.put(TBXPreferences.IMPORT_DEFAULT_LANG, Locale.getDefault().getLanguage().toLowerCase()); |
153 | 153 |
preferences.put(TBXPreferences.UI_LOCALE, "fr"); //$NON-NLS-1$ |
154 | 154 |
|
155 |
preferences.put(TBXPreferences.LANG, Locale.getDefault().getCountry().toLowerCase()); //$NON-NLS-1$
|
|
155 |
preferences.put(TBXPreferences.LANG, Locale.getDefault().getLanguage().toLowerCase()); //$NON-NLS-1$
|
|
156 | 156 |
preferences.put(TBXPreferences.ENCODING, DEFAULT_ENCODING); |
157 | 157 |
preferences.put(TBXPreferences.DEFAULT_EDITION, "default"); //$NON-NLS-1$ |
158 | 158 |
preferences.putBoolean(TBXPreferences.ANNOTATE, false); |
tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/ClipboardTableImportMacro.groovy (revision 1853) | ||
---|---|---|
1 |
package org.txm.macro.imports |
|
2 |
|
|
3 |
import org.kohsuke.args4j.* |
|
4 |
import groovy.transform.Field |
|
5 |
import org.txm.rcp.swt.widget.parameters.* |
|
6 |
import org.txm.rcp.commands.* |
|
7 |
import org.txm.objects.* |
|
8 |
import org.txm.utils.io.* |
|
9 |
|
|
10 |
@Field @Option(name="corpus_name", usage="Corpus name", widget="String", required=true, def="CLIPBOARD") |
|
11 |
String corpus_name |
|
12 |
|
|
13 |
if (!ParametersDialog.open(this)) return; |
|
14 |
|
|
15 |
monitor.syncExec(new Runnable() { |
|
16 |
public void run() { |
|
17 |
try { |
|
18 |
String result = "<text id=\"$corpus_name\">\n"+org.txm.rcp.utils.IOClipboard.read()+"</text>"; |
|
19 |
if (result == null || result.length() == 0) { |
|
20 |
System.out.println("No copied text. Aborting."); |
|
21 |
return; |
|
22 |
} |
|
23 |
|
|
24 |
def w = Toolbox.workspace |
|
25 |
def p = w.getProject(corpus_name) |
|
26 |
|
|
27 |
if (p != null) { |
|
28 |
println "** Corpus $corpus_name already exists. Aborting" |
|
29 |
return; |
|
30 |
} |
|
31 |
|
|
32 |
File tmp = new File(System.getProperty("java.io.tmpdir"), corpus_name) |
|
33 |
tmp.mkdirs() |
|
34 |
|
|
35 |
File tmp_text_file = new File(tmp, corpus_name+".cqp") |
|
36 |
println "tmp_text_file=$tmp_text_file" |
|
37 |
IOUtils.setText(tmp_text_file, result, "UTF-8") |
|
38 |
|
|
39 |
p = new Project(w, corpus_name, true) |
|
40 |
p.setLang("fr") |
|
41 |
p.setEncoding("UTF-8") |
|
42 |
p.setSourceDirectory(tmp.getAbsolutePath()) |
|
43 |
p.setAnnotate(true) |
|
44 |
p.setCleanAfterBuild(true) |
|
45 |
p.setDoMultiThread(true) |
|
46 |
p.setImportModuleName("cqp") |
|
47 |
|
|
48 |
|
|
49 |
p.compute() |
|
50 |
|
|
51 |
RestartTXM.reloadViews(); |
|
52 |
} catch (Exception e) { |
|
53 |
e.printStackTrace(); |
|
54 |
} |
|
55 |
} |
|
56 |
}); |
tmp/org.txm.annotation.rcp/src/org/txm/annotation/rcp/editor/AnnotationArea.java (revision 1853) | ||
---|---|---|
31 | 31 |
* @return |
32 | 32 |
*/ |
33 | 33 |
public String getLocale() { |
34 |
return Locale.getDefault().getCountry();
|
|
34 |
return Locale.getDefault().getLanguage();
|
|
35 | 35 |
} |
36 | 36 |
|
37 | 37 |
/** |
Formats disponibles : Unified diff