Révision 1858
| tmp/org.txm.utils/src/org/txm/utils/logger/Log.java (revision 1858) | ||
|---|---|---|
| 412 | 412 |
} |
| 413 | 413 |
return false; |
| 414 | 414 |
} |
| 415 |
|
|
| 416 |
public static void printStackTrace() {
|
|
| 417 |
StackTraceElement[] st = Thread.currentThread().getStackTrace(); |
|
| 418 |
int stL = 0; |
|
| 419 |
int maxClassNameLength = 0; |
|
| 420 |
int maxMethodNameLength = 0; |
|
| 421 |
|
|
| 422 |
for (StackTraceElement t : st) {
|
|
| 423 |
String cn = t.getClassName(); |
|
| 424 |
if (cn.startsWith("org.txm.") && !cn.startsWith(Log.class.getName())) {
|
|
| 425 |
int cns = cn.length(); |
|
| 426 |
if (cns > maxClassNameLength) maxClassNameLength = cns; |
|
| 427 |
int mns = t.getMethodName().length(); |
|
| 428 |
if (mns > maxMethodNameLength) maxMethodNameLength = mns; |
|
| 429 |
stL++; |
|
| 430 |
} |
|
| 431 |
} |
|
| 432 |
|
|
| 433 |
int stLs = (int)Math.log10(stL)+1; |
|
| 434 |
String format = String.format("[%%%dd] %%%ds.%%%ds %%s, %%s", stLs, maxClassNameLength, maxMethodNameLength);
|
|
| 435 |
|
|
| 436 |
System.out.println("Stacktrace: ");
|
|
| 437 |
int n = 1; |
|
| 438 |
for (StackTraceElement t : st) {
|
|
| 439 |
if (t.getClassName().startsWith("org.txm.") && !t.getClassName().startsWith(Log.class.getName())) {
|
|
| 440 |
System.out.println(String.format(format, n++, t.getClassName(), t.getMethodName(), t.getFileName(), t.getLineNumber())); |
|
| 441 |
} |
|
| 442 |
} |
|
| 443 |
} |
|
| 415 | 444 |
} |
| tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/SaveAnnotations.java (revision 1858) | ||
|---|---|---|
| 78 | 78 |
} |
| 79 | 79 |
} |
| 80 | 80 |
}); |
| 81 |
|
|
| 81 |
if (doit[0] == false) {
|
|
| 82 |
return null; |
|
| 83 |
} |
|
| 84 |
|
|
| 82 | 85 |
JobHandler jobhandler = new JobHandler("Saving annotations of "+corpus) { //$NON-NLS-1$
|
| 83 | 86 |
@Override |
| 84 | 87 |
protected IStatus run(IProgressMonitor monitor) {
|
| tmp/org.txm.annotation.kr.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 1858) | ||
|---|---|---|
| 1 | 1 |
#TXM OSGI messages generated by the PluginMessagesManager class |
| 2 | 2 |
#Tue Dec 18 10:24:08 CET 2018 |
| 3 | 3 |
command.label=Entrep?t de connaissances |
| 4 |
command.label.0=Exporter annotations
|
|
| 4 |
command.label.0=Annotations au format XML-TEI...
|
|
| 5 | 5 |
command.name=Recoder |
| 6 | 6 |
command.name.0=Enregistrer les annotations |
| 7 | 7 |
command.name.1=Ouvrir la vue d'entrep?ts de connaissance |
| tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/compiler.groovy (revision 1858) | ||
|---|---|---|
| 131 | 131 |
|
| 132 | 132 |
sectionAttrs = new HashSet<String>() // reset section attributs set |
| 133 | 133 |
|
| 134 |
Project project = module.getProject(); |
|
| 135 | 134 |
CorpusBuild corpus = project.getCorpusBuild(project.getName(), MainCorpus.class); |
| 136 | 135 |
if (corpus != null) {
|
| 137 | 136 |
if (project.getDoUpdate()) {
|
| tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/BackToText.java (revision 1858) | ||
|---|---|---|
| 333 | 333 |
|
| 334 | 334 |
// reload the page and styles |
| 335 | 335 |
attachedBrowserEditor.backToText(text, line_wordid);// open the page(S) containing the word with id=line_wordid |
| 336 |
attachedBrowserEditor.updateWordStyles(); // update styles if any new one |
|
| 336 |
|
|
| 337 | 337 |
IWorkbenchPage attachedPage = attachedBrowserEditor.getEditorSite().getPage(); |
| 338 | 338 |
attachedPage.activate(attachedBrowserEditor); |
| 339 | 339 |
|
| tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java (revision 1858) | ||
|---|---|---|
| 268 | 268 |
Object rez = evaluate("return typeof sheet"); //$NON-NLS-1$
|
| 269 | 269 |
if ("undefined".equals(rez)) {
|
| 270 | 270 |
if (!execute(functions)) { // build the sheet if not present in the HTML DOM //$NON-NLS-1$
|
| 271 |
Log.warning("JS execution (init) error with="+functions);
|
|
| 271 |
Log.fine("JS execution (init) error with="+functions);
|
|
| 272 | 272 |
} |
| 273 | 273 |
} |
| 274 | 274 |
|
| ... | ... | |
| 288 | 288 |
|
| 289 | 289 |
if (buffer.length() > 0) {
|
| 290 | 290 |
if (!execute(buffer.toString())) {
|
| 291 |
Log.warning("JS execution error (delete cssRules) with="+buffer);
|
|
| 291 |
Log.fine("JS execution error (delete cssRules) with="+buffer);
|
|
| 292 | 292 |
} |
| 293 | 293 |
} |
| 294 | 294 |
buffer = new StringBuilder(); |
| ... | ... | |
| 296 | 296 |
String firstWord = currentPage.getWordId(); |
| 297 | 297 |
Page nextPage = currentEdition.getNextPage(currentPage); |
| 298 | 298 |
String lastWord = "w_999999999"; //$NON-NLS-1$ |
| 299 |
if (nextPage != null && currentPage != nextPage) lastWord = nextPage.getWordId(); |
|
| 299 |
while (nextPage != null && currentPage != nextPage) {
|
|
| 300 |
lastWord = nextPage.getWordId(); |
|
| 301 |
if (!("w_0".equals(lastWord))) { // this is a word id
|
|
| 302 |
break; // ok |
|
| 303 |
} |
|
| 304 |
Page p = currentEdition.getNextPage(nextPage); |
|
| 305 |
if (p == nextPage) { // end of pages
|
|
| 306 |
lastWord = "w_999999999"; |
|
| 307 |
break; |
|
| 308 |
} |
|
| 309 |
nextPage = p; |
|
| 310 |
} |
|
| 300 | 311 |
//System.out.println("firstWord="+firstWord+" lastWord="+lastWord);
|
| 301 | 312 |
//int n = 0; |
| 302 | 313 |
//long start = System.currentTimeMillis(); |
| 303 |
//System.out.println(highlightedColorPerWordIDS); |
|
| 314 |
|
|
| 304 | 315 |
for (String wordid : highlightedColorPerWordIDS.keySet()) {
|
| 316 |
//Log.finest("words to highlight: "+highlightedColorPerWordIDS);
|
|
| 305 | 317 |
if (highlightedColorPerWordIDS.get(wordid).size() == 0) continue; // error |
| 306 | 318 |
|
| 307 | 319 |
//if (!slowWordHighLight) { //TODO: this code must be replaced with word position instead of word id comparaison
|
| ... | ... | |
| 344 | 356 |
|
| 345 | 357 |
if (buffer.length() > 0) {
|
| 346 | 358 |
if (!execute(buffer.toString())) {
|
| 347 |
Log.warning("JS execution (highlight) error with="+buffer);
|
|
| 359 |
Log.fine("JS execution (highlight) error with="+buffer);
|
|
| 348 | 360 |
} |
| 349 | 361 |
} |
| 350 | 362 |
buffer = new StringBuilder(); |
| ... | ... | |
| 390 | 402 |
|
| 391 | 403 |
if (buffer.length() > 0) {
|
| 392 | 404 |
if (!execute(buffer.toString())) {
|
| 393 |
Log.warning("JS execution (color) error with="+buffer);
|
|
| 405 |
Log.fine("JS execution (color) error with="+buffer);
|
|
| 394 | 406 |
} |
| 395 | 407 |
} |
| 396 | 408 |
buffer = new StringBuilder(); |
| ... | ... | |
| 432 | 444 |
|
| 433 | 445 |
if (buffer.length() > 0) {
|
| 434 | 446 |
if (!execute(buffer.toString())) {
|
| 435 |
Log.warning("JS execution (font) error with="+buffer);
|
|
| 447 |
Log.fine("JS execution (font) error with="+buffer);
|
|
| 436 | 448 |
} |
| 437 | 449 |
} |
| 438 | 450 |
buffer = new StringBuilder(); |
| ... | ... | |
| 447 | 459 |
if (execute(buffer.toString())) {
|
| 448 | 460 |
focusedWordID = null; // focus one time |
| 449 | 461 |
} else {
|
| 450 |
Log.warning("JS execution (focus) error with="+buffer);
|
|
| 462 |
Log.fine("JS execution (focus) error with="+buffer);
|
|
| 451 | 463 |
} |
| 452 | 464 |
} |
| 453 | 465 |
buffer = new StringBuilder(); |
| ... | ... | |
| 464 | 476 |
//System.out.println(buffer); |
| 465 | 477 |
if (buffer.length() > 0) {
|
| 466 | 478 |
if (!execute(buffer.toString())) {
|
| 467 |
Log.warning("JS execution (area focus) error with="+buffer);
|
|
| 479 |
Log.fine("JS execution (area focus) error with="+buffer);
|
|
| 468 | 480 |
} |
| 469 | 481 |
} |
| 470 | 482 |
//System.out.println("n="+n+" time="+(System.currentTimeMillis()-start));
|
| tmp/org.txm.core/src/java/org/txm/core/preferences/TBXPreferences.java (revision 1858) | ||
|---|---|---|
| 2 | 2 |
|
| 3 | 3 |
import java.util.Locale; |
| 4 | 4 |
|
| 5 |
import org.eclipse.core.runtime.Status; |
|
| 5 | 6 |
import org.osgi.service.prefs.Preferences; |
| 6 | 7 |
import org.txm.Toolbox; |
| 8 |
import org.txm.core.engines.Engine; |
|
| 9 |
import org.txm.core.engines.EngineType; |
|
| 10 |
import org.txm.utils.logger.Log; |
|
| 7 | 11 |
|
| 8 | 12 |
public class TBXPreferences extends TXMPreferences {
|
| 9 |
|
|
| 13 |
|
|
| 10 | 14 |
public static String VERSION = "version"; |
| 11 | 15 |
|
| 12 | 16 |
public static final String FETCH_UPDATES_AT_STARTUP = "fetch_updates_at_startup"; |
| 13 |
|
|
| 17 |
|
|
| 14 | 18 |
/** The Constants for Toolbox properties. */ |
| 15 | 19 |
public static final String LOG_LEVEL = "log_level"; //$NON-NLS-1$ |
| 16 | 20 |
public static final String ADD_TECH_LOGS = "log_in_console"; //$NON-NLS-1$ |
| ... | ... | |
| 38 | 42 |
public static final String METADATA_ENCODING = "metadata_encoding"; //$NON-NLS-1$ |
| 39 | 43 |
public static final String METADATA_COLSEPARATOR = "metadata_colseparator"; //$NON-NLS-1$ |
| 40 | 44 |
public static final String METADATA_TXTSEPARATOR = "metadata_txtseparator"; //$NON-NLS-1$ |
| 41 |
|
|
| 45 |
|
|
| 42 | 46 |
public static final String EMPTY_PROPERTY_VALUE_CODE = "empty_property_value_code"; |
| 43 |
|
|
| 47 |
|
|
| 44 | 48 |
public static final String IMPORT_DEFAULT_LANG = "import_default_lang"; |
| 45 |
|
|
| 49 |
|
|
| 46 | 50 |
/** The Constant EXPORT_SHOW. */ |
| 47 | 51 |
public static final String EXPORT_SHOW = "export_show"; //$NON-NLS-1$ |
| 48 | 52 |
/** The Constant EXPORT_ENCODING. */ |
| ... | ... | |
| 57 | 61 |
public static final String EDITION_DEFINITION_WORDS_PER_PAGE = "edition_definition_words_per_page"; //$NON-NLS-1$ |
| 58 | 62 |
public static final String EDITION_DEFINITION_PAGE_BREAK_ELEMENT = "edition_definition_page_break_element"; //$NON-NLS-1$ |
| 59 | 63 |
public static final String EDITION_DEFINITION_IMAGES_DIRECTORY = "edition_definition_images_directory"; //$NON-NLS-1$ |
| 60 |
|
|
| 64 |
|
|
| 61 | 65 |
/** |
| 62 | 66 |
* To show or not all nodes in some views, eg. in CorporaView tree. |
| 63 | 67 |
*/ |
| 64 | 68 |
public static final String SHOW_ALL_RESULT_NODES = "show_all_result_nodes"; //$NON-NLS-1$ |
| 65 | 69 |
public static final String UPDATESITE = "update_site"; //$NON-NLS-1$ |
| 66 |
|
|
| 67 |
|
|
| 70 |
|
|
| 71 |
|
|
| 68 | 72 |
/** |
| 69 | 73 |
* To enable/disable the results persistence (save after a computing and load at Toolbox start). |
| 70 | 74 |
*/ |
| ... | ... | |
| 111 | 115 |
public static final String CLEAN = "clean.directories"; |
| 112 | 116 |
public static final String TTMODEL = "annotate.model"; |
| 113 | 117 |
public static final String TTANNOTATE = "annotate.run"; |
| 114 |
|
|
| 118 |
|
|
| 115 | 119 |
public static final String MULTITHREAD = "multithread"; |
| 116 | 120 |
public static final String DEBUG = "debug"; |
| 117 | 121 |
public static final String UPDATECORPUS = "corpus.update"; |
| 118 |
|
|
| 122 |
|
|
| 119 | 123 |
public static final String NORMALISEANAVALUES = "normalize.ana.values"; |
| 120 | 124 |
public static final String NORMALISEATTRIBUTEVALUES = "normalize.attribute.values"; |
| 121 |
|
|
| 125 |
|
|
| 122 | 126 |
/** |
| 123 | 127 |
* Gets the instance. |
| 124 | 128 |
* @return the instance |
| ... | ... | |
| 130 | 134 |
return TXMPreferences.instances.get(TBXPreferences.class); |
| 131 | 135 |
} |
| 132 | 136 |
|
| 133 |
|
|
| 137 |
|
|
| 134 | 138 |
@Override |
| 135 | 139 |
public void initializeDefaultPreferences() {
|
| 136 | 140 |
super.initializeDefaultPreferences(); |
| 137 | 141 |
Preferences preferences = this.getDefaultPreferencesNode(); |
| 138 |
|
|
| 139 |
// //FIXME: USE osgi.instance.area later & done in ApplicationWorkbenchAdvisor |
|
| 140 |
// preferences.put(TBXPreferences.USER_TXM_HOME, System.getProperty("user.home")+"/TXM");
|
|
| 141 |
// preferences.put(TBXPreferences.USER_TXM_HOME, System.getProperty("user.home")); //$NON-NLS-1$
|
|
| 142 |
|
|
| 142 |
|
|
| 143 |
// //FIXME: USE osgi.instance.area later & done in ApplicationWorkbenchAdvisor
|
|
| 144 |
// preferences.put(TBXPreferences.USER_TXM_HOME, System.getProperty("user.home")+"/TXM");
|
|
| 145 |
// preferences.put(TBXPreferences.USER_TXM_HOME, System.getProperty("user.home")); //$NON-NLS-1$
|
|
| 146 |
|
|
| 143 | 147 |
preferences.putBoolean(TBXPreferences.EXPERT_USER, false); |
| 144 | 148 |
preferences.putBoolean(TBXPreferences.VISIBLE, true); |
| 145 |
|
|
| 149 |
|
|
| 146 | 150 |
// FIXME |
| 147 | 151 |
preferences.putBoolean(TBXPreferences.ADD_TECH_LOGS, true); |
| 148 | 152 |
preferences.putBoolean(TBXPreferences.LOG_STACKTRACE, true); |
| 149 | 153 |
preferences.putBoolean(TBXPreferences.LOG_IN_FILE, false); |
| 150 | 154 |
preferences.put(TBXPreferences.LOG_LEVEL, "INFO"); //$NON-NLS-1$ |
| 151 |
|
|
| 155 |
|
|
| 152 | 156 |
preferences.put(TBXPreferences.IMPORT_DEFAULT_LANG, Locale.getDefault().getLanguage().toLowerCase()); |
| 153 | 157 |
preferences.put(TBXPreferences.UI_LOCALE, "fr"); //$NON-NLS-1$ |
| 154 |
|
|
| 158 |
|
|
| 155 | 159 |
preferences.put(TBXPreferences.LANG, Locale.getDefault().getLanguage().toLowerCase()); //$NON-NLS-1$ |
| 156 | 160 |
preferences.put(TBXPreferences.ENCODING, DEFAULT_ENCODING); |
| 157 | 161 |
preferences.put(TBXPreferences.DEFAULT_EDITION, "default"); //$NON-NLS-1$ |
| 158 | 162 |
preferences.putBoolean(TBXPreferences.ANNOTATE, false); |
| 159 |
|
|
| 163 |
|
|
| 160 | 164 |
preferences.put(TBXPreferences.METADATA_ENCODING, "UTF-8"); //$NON-NLS-1$ |
| 161 | 165 |
preferences.put(TBXPreferences.METADATA_TXTSEPARATOR, "\""); //$NON-NLS-1$ |
| 162 | 166 |
preferences.put(TBXPreferences.METADATA_COLSEPARATOR, ","); //$NON-NLS-1$ |
| 163 | 167 |
preferences.put(TBXPreferences.EMPTY_PROPERTY_VALUE_CODE, "__UNDEF__"); //$NON-NLS-1$ |
| 164 |
|
|
| 168 |
|
|
| 165 | 169 |
preferences.put(EXPORT_COL_SEPARATOR, "\t"); //$NON-NLS-1$ |
| 166 | 170 |
preferences.put(EXPORT_ENCODING, System.getProperty("file.encoding")); //$NON-NLS-1$
|
| 167 | 171 |
preferences.put(EXPORT_TXT_SEPARATOR, ""); //$NON-NLS-1$ |
| 168 | 172 |
preferences.putBoolean(EXPORT_SHOW, false); |
| 169 |
|
|
| 173 |
|
|
| 170 | 174 |
preferences.putBoolean(SHOW_ALL_RESULT_NODES, false); |
| 171 | 175 |
preferences.putBoolean(AUTO_PERSISTENCE_ENABLED, false); |
| 172 |
|
|
| 176 |
|
|
| 173 | 177 |
if (Toolbox.getTxmHomePath().endsWith("-dev")) {
|
| 174 | 178 |
preferences.put(UPDATESITE, "file://"+System.getProperty("user.home")+"/workspace047/TXMReleasePlugins.site");
|
| 175 | 179 |
} else {
|
| tmp/org.txm.core/src/java/org/txm/objects/Edition.java (revision 1858) | ||
|---|---|---|
| 214 | 214 |
Log.fine("page found: "+lastpage);
|
| 215 | 215 |
return lastpage; |
| 216 | 216 |
} |
| 217 |
|
|
| 218 |
lastpage = p; |
|
| 217 |
if (!("w_0".equals(p.getWordId()))) { // ignore the w_0 pages
|
|
| 218 |
lastpage = p; |
|
| 219 |
} |
|
| 219 | 220 |
} |
| 220 | 221 |
return lastpage; |
| 221 | 222 |
} |
| tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java (revision 1858) | ||
|---|---|---|
| 271 | 271 |
private Label queryLabel; |
| 272 | 272 |
|
| 273 | 273 |
private Composite navigationArea; |
| 274 |
|
|
| 275 |
|
|
| 274 |
|
|
| 275 |
|
|
| 276 | 276 |
/** The query widget. */ |
| 277 | 277 |
@Parameter(key=ConcordancePreferences.QUERY) |
| 278 | 278 |
protected AssistedQueryWidget queryWidget; |
| ... | ... | |
| 299 | 299 |
private Spinner rightSizeSpinner; |
| 300 | 300 |
|
| 301 | 301 |
// private PropertiesSelector<Property> propsArea; |
| 302 |
|
|
| 303 |
|
|
| 304 |
|
|
| 305 |
|
|
| 306 |
|
|
| 302 |
|
|
| 303 |
|
|
| 304 |
|
|
| 305 |
|
|
| 306 |
|
|
| 307 | 307 |
@Override |
| 308 | 308 |
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
|
| 309 | 309 |
super.init(site, input); |
| ... | ... | |
| 603 | 603 |
|
| 604 | 604 |
// back to text mouse listener |
| 605 | 605 |
MouseListener ms = new MouseListener() {
|
| 606 |
int c = 0; |
|
| 606 | 607 |
@Override |
| 607 |
public void mouseDoubleClick(MouseEvent e) {
|
|
| 608 |
StatusLine.setMessage(ConcordanceUIMessages.openingCorpusEdition); |
|
| 609 |
backToText(); |
|
| 610 |
StatusLine.setMessage(""); //$NON-NLS-1$
|
|
| 608 |
public synchronized void mouseDoubleClick(MouseEvent e) {
|
|
| 609 |
if (e.count == 2 && c == 0) {
|
|
| 610 |
c++; |
|
| 611 |
|
|
| 612 |
StatusLine.setMessage(ConcordanceUIMessages.openingCorpusEdition); |
|
| 613 |
backToText(); |
|
| 614 |
StatusLine.setMessage(""); //$NON-NLS-1$
|
|
| 615 |
c--; |
|
| 616 |
} |
|
| 611 | 617 |
} |
| 612 | 618 |
|
| 613 | 619 |
@Override |
| ... | ... | |
| 702 | 708 |
data3.left = new FormAttachment(sash,0); |
| 703 | 709 |
data3.right = new FormAttachment(100); |
| 704 | 710 |
viewer.getTable().setLayoutData(data3); |
| 705 |
|
|
| 711 |
|
|
| 706 | 712 |
createContextMenu(); |
| 707 | 713 |
} |
| 708 | 714 |
|
| ... | ... | |
| 847 | 853 |
* @param controlArea the control area |
| 848 | 854 |
*/ |
| 849 | 855 |
private void composeControlArea(final Composite controlArea) {
|
| 850 |
|
|
| 851 |
|
|
| 856 |
|
|
| 857 |
|
|
| 852 | 858 |
// Computing listeners |
| 853 | 859 |
ComputeKeyListener computeKeyListener = new ComputeKeyListener(this); |
| 854 | 860 |
|
| 855 |
|
|
| 861 |
|
|
| 856 | 862 |
GridLayout controlLayout = new GridLayout(1, false); |
| 857 | 863 |
controlLayout.verticalSpacing = 0; |
| 858 | 864 |
controlLayout.marginWidth = 0; |
| ... | ... | |
| 892 | 898 |
queryWidget.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); |
| 893 | 899 |
queryWidget.addKeyListener(computeKeyListener); |
| 894 | 900 |
queryWidget.getQueryWidget().addModifyListener(computeKeyListener); |
| 895 |
|
|
| 901 |
|
|
| 896 | 902 |
// FIXME: SJ: for computing when changing the query from history combo box |
| 897 | 903 |
// FIXME: SJ: commented because it doesn't work, the computing is launched as soon as we click on the arrow of the combo box |
| 898 | 904 |
//queryWidget.getQueryWidget().addSelectionListener(new ComputeSelectionListener(this)); |
| ... | ... | |
| 1220 | 1226 |
StatusLine.setMessage(ConcordanceUIMessages.startComputingConcordance); |
| 1221 | 1227 |
|
| 1222 | 1228 |
try {
|
| 1223 |
|
|
| 1229 |
|
|
| 1224 | 1230 |
QueriesView.refresh(); |
| 1225 | 1231 |
|
| 1226 | 1232 |
this.fillDisplayArea(); |
| ... | ... | |
| 1438 | 1444 |
public int getPointedColumn() {
|
| 1439 | 1445 |
Point p = getMousePosition(); |
| 1440 | 1446 |
if (p == null) return 0; |
| 1441 |
|
|
| 1447 |
|
|
| 1442 | 1448 |
int x = p.x; // + lineTableViewer.getTable().get; |
| 1443 | 1449 |
int sumWidthColumn = 0; |
| 1444 | 1450 |
|
| ... | ... | |
| 1450 | 1456 |
if (x < sumWidthColumn) |
| 1451 | 1457 |
return 2; |
| 1452 | 1458 |
|
| 1453 |
// sumWidthColumn += this.rightContextColumn.getWidth(); |
|
| 1454 |
// if (x < sumWidthColumn) |
|
| 1455 |
return 3; // last column
|
|
| 1459 |
// sumWidthColumn += this.rightContextColumn.getWidth();
|
|
| 1460 |
// if (x < sumWidthColumn)
|
|
| 1461 |
return 3; // last column |
|
| 1456 | 1462 |
|
| 1457 |
// return 0; |
|
| 1463 |
// return 0;
|
|
| 1458 | 1464 |
} |
| 1459 | 1465 |
|
| 1460 | 1466 |
/** |
| ... | ... | |
| 1928 | 1934 |
|
| 1929 | 1935 |
StructuredSelection select = (StructuredSelection) viewer.getSelection(); |
| 1930 | 1936 |
if (select == null) return false; |
| 1931 |
|
|
| 1937 |
|
|
| 1932 | 1938 |
Line line = (Line) select.getFirstElement(); |
| 1933 | 1939 |
if (line == null) return false; |
| 1934 | 1940 |
|
| ... | ... | |
| 2052 | 2058 |
public void updateResultFromEditor() {
|
| 2053 | 2059 |
// TODO |
| 2054 | 2060 |
} |
| 2055 |
|
|
| 2056 |
|
|
| 2061 |
|
|
| 2062 |
|
|
| 2057 | 2063 |
/** |
| 2058 | 2064 |
* Sets the standard comparators. |
| 2059 | 2065 |
*/ |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/corpuswizard/ImportWizard.java (revision 1858) | ||
|---|---|---|
| 11 | 11 |
import org.eclipse.ui.INewWizard; |
| 12 | 12 |
import org.eclipse.ui.IWorkbench; |
| 13 | 13 |
import org.txm.Toolbox; |
| 14 |
import org.txm.core.engines.Engine; |
|
| 15 |
import org.txm.core.engines.EngineType; |
|
| 16 |
import org.txm.core.preferences.TBXPreferences; |
|
| 14 | 17 |
import org.txm.core.results.TXMResult; |
| 15 | 18 |
import org.txm.objects.EditionDefinition; |
| 16 | 19 |
import org.txm.objects.Project; |
| 17 | 20 |
import org.txm.rcp.messages.TXMUIMessages; |
| 21 |
import org.txm.utils.logger.Log; |
|
| 18 | 22 |
|
| 19 | 23 |
public class ImportWizard extends Wizard implements INewWizard {
|
| 20 | 24 |
|
| ... | ... | |
| 66 | 70 |
project.setSourceDirectory(path.getAbsolutePath()); |
| 67 | 71 |
project.setDescription(System.getProperty("user.name")+"\n"+TXMResult.PRETTY_LOCALIZED_TIME_FORMAT.format(Calendar.getInstance().getTime()));
|
| 68 | 72 |
project.setLang(Locale.getDefault().getLanguage().toLowerCase()); |
| 69 |
System.out.println(NLS.bind(TXMUIMessages.theP0CorpusWillBeCreatedFromTheP1Directory, project.getName(), project.getSrcdir())); |
|
| 73 |
|
|
| 74 |
Log.info(NLS.bind(TXMUIMessages.theP0CorpusWillBeCreatedFromTheP1Directory, project.getName(), project.getSrcdir())); |
|
| 75 |
|
|
| 76 |
Engine e = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine("TreeTagger");
|
|
| 77 |
if (e != null) {
|
|
| 78 |
System.out.println("set annotate if TT is ready: "+e.isRunning());
|
|
| 79 |
project.setAnnotate(e.isRunning()); |
|
| 80 |
} |
|
| 81 |
|
|
| 82 |
if (project.getAnnotate()) {
|
|
| 83 |
Log.info("The 'annotate' import parameter has been activated since TreeTagger is installed.");
|
|
| 84 |
} else {
|
|
| 85 |
Log.info("The 'annotate' import parameter was not activated since TreeTagger is not installed.");
|
|
| 86 |
} |
|
| 87 |
|
|
| 70 | 88 |
} else {
|
| 71 | 89 |
Date date = project.getLastComputingDate(); |
| 72 | 90 |
if (date == null) {
|
| 73 | 91 |
date = Calendar.getInstance().getTime(); // today |
| 74 | 92 |
} |
| 75 |
System.out.println(NLS.bind(TXMUIMessages.theP1P0CorpusWillBeReplaced, project, date));
|
|
| 93 |
Log.info(NLS.bind(TXMUIMessages.theP1P0CorpusWillBeReplaced, project, date));
|
|
| 76 | 94 |
} |
| 77 | 95 |
|
| 78 | 96 |
//project.compute(); // create/update files |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/LangSection.java (revision 1858) | ||
|---|---|---|
| 113 | 113 |
if (this.section.isDisposed()) return; |
| 114 | 114 |
if (project == null) return; |
| 115 | 115 |
|
| 116 |
String lang = project.getLang(); //$NON-NLS-1$;
|
|
| 117 |
boolean annotate = project.getAnnotate(); //$NON-NLS-1$
|
|
| 116 |
String lang = project.getLang(); |
|
| 117 |
boolean annotate = project.getAnnotate(); |
|
| 118 | 118 |
|
| 119 | 119 |
//fill combo and select default language |
| 120 | 120 |
String defaultLang = Locale.getDefault().getLanguage().toLowerCase(); |
| ... | ... | |
| 140 | 140 |
} |
| 141 | 141 |
|
| 142 | 142 |
langcombo.setText(defaultLang); |
| 143 |
btnSelectAnnotate.setSelection(annotate); //$NON-NLS-1$
|
|
| 143 |
btnSelectAnnotate.setSelection(annotate); |
|
| 144 | 144 |
} |
| 145 | 145 |
|
| 146 | 146 |
@Override |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/Load079BinaryCorpus.java (revision 1858) | ||
|---|---|---|
| 74 | 74 |
return null; |
| 75 | 75 |
} |
| 76 | 76 |
|
| 77 |
System.out.println(NLS.bind(TXMUIMessages.loadingTheP0BinaryCorpusAsATXM079Corpus, zipFile.getName())); |
|
| 78 |
|
|
| 77 | 79 |
String basedirname = Zip.getRoot(zipFile); |
| 78 | 80 |
|
| 79 | 81 |
Project p = Toolbox.workspace.getProject(basedirname.toUpperCase()); |
| ... | ... | |
| 84 | 86 |
System.out.println(NLS.bind(TXMUIMessages.abortingLoadingOfPOACorpusWithTheSameNameAlreadyExists, zipFile, basedirname.toUpperCase())); |
| 85 | 87 |
return null; |
| 86 | 88 |
} |
| 87 |
|
|
| 88 | 89 |
} |
| 89 | 90 |
|
| 90 | 91 |
File corpusDirectory = new File(corporaDir, basedirname); |
| ... | ... | |
| 96 | 97 |
return null; |
| 97 | 98 |
} |
| 98 | 99 |
} |
| 99 |
|
|
| 100 |
System.out.println(NLS.bind(TXMUIMessages.loadingTheP0BinaryCorpusAsATXM079Corpus, zipFile.getName())); |
|
| 101 | 100 |
|
| 102 | 101 |
//ZIPPED FILE |
| 103 | 102 |
monitor.beginTask(TXMUIMessages.loadingBinaryCorpus, 100); |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/Load080BinaryCorpus.java (revision 1858) | ||
|---|---|---|
| 72 | 72 |
return null; |
| 73 | 73 |
} |
| 74 | 74 |
|
| 75 |
Log.info(NLS.bind(TXMUIMessages.loadingTheP0BinaryCorpusAsATXM080Corpus, zipFile.getName())); |
|
| 76 |
|
|
| 75 | 77 |
String basedirname = Zip.getRoot(zipFile); |
| 76 | 78 |
|
| 77 | 79 |
Project p = Toolbox.workspace.getProject(basedirname.toUpperCase()); |
| ... | ... | |
| 92 | 94 |
System.out.println(NLS.bind(TXMUIMessages.abortingLoadingOfPOACorpusWithTheSameNameAlreadyExists, zipFile, corpusDirectory)); |
| 93 | 95 |
return null; |
| 94 | 96 |
} |
| 95 |
|
|
| 96 | 97 |
} |
| 97 | 98 |
|
| 98 |
Log.info(NLS.bind(TXMUIMessages.loadingTheP0BinaryCorpusAsATXM080Corpus, zipFile.getName())); |
|
| 99 |
|
|
| 100 | 99 |
try {
|
| 101 | 100 |
//System.out.println(NLS.bind(Messages.AddBase_29, zipFile, corporaDir)); |
| 102 | 101 |
Zip.decompress(zipFile, Toolbox.workspace.getLocation(), false, monitor); |
Formats disponibles : Unified diff