Révision 948

tmp/org.txm.jodconverter.core/target/classes/document-formats.js (revision 948)
1
[
2
  {
3
    "name": "Portable Document Format",
4
    "extension": "pdf",
5
    "mediaType": "application/pdf",
6
    "storePropertiesByFamily": {
7
      "DRAWING": {"FilterName": "draw_pdf_Export"},
8
      "SPREADSHEET": {"FilterName": "calc_pdf_Export"},
9
      "PRESENTATION": {"FilterName": "impress_pdf_Export"},
10
      "TEXT": {"FilterName": "writer_pdf_Export"}
11
    }
12
  },
13
  {
14
    "name": "Macromedia Flash",
15
    "extension": "swf",
16
    "mediaType": "application/x-shockwave-flash",
17
    "storePropertiesByFamily": {
18
      "DRAWING": {"FilterName": "draw_flash_Export"},
19
      "PRESENTATION": {"FilterName": "impress_flash_Export"}
20
    }
21
  },
22
  {
23
    "name": "HTML",
24
    "extension": "html",
25
    "mediaType": "text/html",
26
    "inputFamily": "TEXT",
27
    "storePropertiesByFamily": {
28
      "SPREADSHEET": {"FilterName": "HTML (StarCalc)"},
29
      "PRESENTATION": {"FilterName": "impress_html_Export"},
30
      "TEXT": {"FilterName": "HTML (StarWriter)"}
31
    }
32
  },
33
  {
34
    "name": "OpenDocument Text",
35
    "extension": "odt",
36
    "mediaType": "application/vnd.oasis.opendocument.text",
37
    "inputFamily": "TEXT",
38
    "storePropertiesByFamily": {"TEXT": {"FilterName": "writer8"}}
39
  },
40
  {
41
    "name": "OpenOffice.org 1.0 Text Document",
42
    "extension": "sxw",
43
    "mediaType": "application/vnd.sun.xml.writer",
44
    "inputFamily": "TEXT",
45
    "storePropertiesByFamily": {"TEXT": {"FilterName": "StarOffice XML (Writer)"}}
46
  },
47
  {
48
    "name": "Microsoft Word",
49
    "extension": "doc",
50
    "mediaType": "application/msword",
51
    "inputFamily": "TEXT",
52
    "storePropertiesByFamily": {"TEXT": {"FilterName": "MS Word 97"}}
53
  },
54
  {
55
    "name": "Microsoft Word 2007 XML",
56
    "extension": "docx",
57
    "mediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
58
    "inputFamily": "TEXT"
59
  },
60
  {
61
    "name": "Rich Text Format",
62
    "extension": "rtf",
63
    "mediaType": "text/rtf",
64
    "inputFamily": "TEXT",
65
    "storePropertiesByFamily": {"TEXT": {"FilterName": "Rich Text Format"}}
66
  },
67
  {
68
    "name": "WordPerfect",
69
    "extension": "wpd",
70
    "mediaType": "application/wordperfect",
71
    "inputFamily": "TEXT"
72
  },
73
  {
74
    "name": "Plain Text",
75
    "extension": "txt",
76
    "mediaType": "text/plain",
77
    "inputFamily": "TEXT",
78
    "loadProperties": {
79
      "FilterName": "Text (encoded)",
80
      "FilterOptions": "utf8"
81
    },
82
    "storePropertiesByFamily": {"TEXT": {
83
      "FilterName": "Text (encoded)",
84
      "FilterOptions": "utf8"
85
    }}
86
  },
87
  {
88
    "name": "MediaWiki wikitext",
89
    "extension": "wiki",
90
    "mediaType": "text/x-wiki",
91
    "storePropertiesByFamily": {"TEXT": {"FilterName": "MediaWiki"}}
92
  },
93
  {
94
    "name": "OpenDocument Spreadsheet",
95
    "extension": "ods",
96
    "mediaType": "application/vnd.oasis.opendocument.spreadsheet",
97
    "inputFamily": "SPREADSHEET",
98
    "storePropertiesByFamily": {"SPREADSHEET": {"FilterName": "calc8"}}
99
  },
100
  {
101
    "name": "OpenOffice.org 1.0 Spreadsheet",
102
    "extension": "sxc",
103
    "mediaType": "application/vnd.sun.xml.calc",
104
    "inputFamily": "SPREADSHEET",
105
    "storePropertiesByFamily": {"SPREADSHEET": {"FilterName": "StarOffice XML (Calc)"}}
106
  },
107
  {
108
    "name": "Microsoft Excel",
109
    "extension": "xls",
110
    "mediaType": "application/vnd.ms-excel",
111
    "inputFamily": "SPREADSHEET",
112
    "storePropertiesByFamily": {"SPREADSHEET": {"FilterName": "MS Excel 97"}}
113
  },
114
  {
115
    "name": "Microsoft Excel 2007 XML",
116
    "extension": "xlsx",
117
    "mediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
118
    "inputFamily": "SPREADSHEET"
119
  },
120
  {
121
    "name": "Comma Separated Values",
122
    "extension": "csv",
123
    "mediaType": "text/csv",
124
    "inputFamily": "SPREADSHEET",
125
    "loadProperties": {
126
      "FilterName": "Text - txt - csv (StarCalc)",
127
      "FilterOptions": "44,34,0"
128
    },
129
    "storePropertiesByFamily": {"SPREADSHEET": {
130
      "FilterName": "Text - txt - csv (StarCalc)",
131
      "FilterOptions": "44,34,0"
132
    }}
133
  },
134
  {
135
    "name": "Tab Separated Values",
136
    "extension": "tsv",
137
    "mediaType": "text/tab-separated-values",
138
    "inputFamily": "SPREADSHEET",
139
    "loadProperties": {
140
      "FilterName": "Text - txt - csv (StarCalc)",
141
      "FilterOptions": "9,34,0"
142
    },
143
    "storePropertiesByFamily": {"SPREADSHEET": {
144
      "FilterName": "Text - txt - csv (StarCalc)",
145
      "FilterOptions": "9,34,0"
146
    }}
147
  },
148
  {
149
    "name": "OpenDocument Presentation",
150
    "extension": "odp",
151
    "mediaType": "application/vnd.oasis.opendocument.presentation",
152
    "inputFamily": "PRESENTATION",
153
    "storePropertiesByFamily": {"PRESENTATION": {"FilterName": "impress8"}}
154
  },
155
  {
156
    "name": "OpenOffice.org 1.0 Presentation",
157
    "extension": "sxi",
158
    "mediaType": "application/vnd.sun.xml.impress",
159
    "inputFamily": "PRESENTATION",
160
    "storePropertiesByFamily": {"PRESENTATION": {"FilterName": "StarOffice XML (Impress)"}}
161
  },
162
  {
163
    "name": "Microsoft PowerPoint",
164
    "extension": "ppt",
165
    "mediaType": "application/vnd.ms-powerpoint",
166
    "inputFamily": "PRESENTATION",
167
    "storePropertiesByFamily": {"PRESENTATION": {"FilterName": "MS PowerPoint 97"}}
168
  },
169
  {
170
    "name": "Microsoft PowerPoint 2007 XML",
171
    "extension": "pptx",
172
    "mediaType": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
173
    "inputFamily": "PRESENTATION"
174
  },
175
  {
176
    "name": "OpenDocument Drawing",
177
    "extension": "odg",
178
    "mediaType": "application/vnd.oasis.opendocument.graphics",
179
    "inputFamily": "DRAWING",
180
    "storePropertiesByFamily": {"DRAWING": {"FilterName": "draw8"}}
181
  },
182
  {
183
    "name": "Scalable Vector Graphics",
184
    "extension": "svg",
185
    "mediaType": "image/svg+xml",
186
    "storePropertiesByFamily": {"DRAWING": {"FilterName": "draw_svg_Export"}}
187
  }
188
]
tmp/org.txm.analec.rcp/src/org/txm/analec/toolbar/UnitToolbar.java (revision 948)
8 8
import org.apache.commons.lang.StringUtils;
9 9
import org.eclipse.jface.util.Util;
10 10
import org.eclipse.swt.SWT;
11
import org.eclipse.swt.browser.ProgressEvent;
12
import org.eclipse.swt.browser.ProgressListener;
11 13
import org.eclipse.swt.events.DragDetectListener;
12 14
import org.eclipse.swt.events.KeyEvent;
13 15
import org.eclipse.swt.events.KeyListener;
......
36 38
import org.txm.core.results.TXMResult;
37 39
import org.txm.edition.rcp.editors.EditionPanel;
38 40
import org.txm.edition.rcp.editors.RGBA;
39
import org.txm.edition.rcp.editors.SynopticEditionEditor;
40 41
import org.txm.objects.Edition;
41 42
import org.txm.objects.Page;
42 43
import org.txm.objects.Text;
43 44
import org.txm.rcp.IImageKeys;
44 45
import org.txm.rcp.editors.TXMEditor;
45
import org.txm.rcp.swt.GLComposite;
46 46
import org.txm.rcp.swt.dialog.ConfirmDialog;
47 47
import org.txm.searchengine.cqp.AbstractCqiClient;
48 48
import org.txm.searchengine.cqp.CQPSearchEngine;
......
55 55

  
56 56
import visuAnalec.Message;
57 57
import visuAnalec.Message.TypeMessage;
58
import visuAnalec.donnees.Corpus;
59 58
import visuAnalec.donnees.Structure;
60 59
import visuAnalec.elements.Element;
61 60
import visuAnalec.elements.Unite;
62
import visuAnalec.vue.Vue;
63 61

  
64 62
public class UnitToolbar extends URSAnnotationToolbar {
65 63

  
......
607 605
		return StringUtils.join(firstWords, " "); //$NON-NLS-1$
608 606
	}
609 607

  
608
	/**
609
	 * Highlight units of the current page
610
	 */
610 611
	protected void highlightType() {
611 612
		if (unites == null) return;
612 613

  
614
		try {
615
		Page page = editor.getEditionPanel(0).getCurrentPage();
616
		Edition e = page.getEdition();
617
		Page next = e.getNextPage(page);
618
		int first_ids[] = CQPSearchEngine.getCqiClient().str2Id(maincorpus.getProperty("id").getQualifiedName(), new String[] {page.getWordId()}); //$NON-NLS-1$
619
		
620
		int last_ids[] = null;
621
		if (next != null && next != page) {
622
			last_ids = CQPSearchEngine.getCqiClient().str2Id(maincorpus.getProperty("id").getQualifiedName(), new String[] {next.getWordId()}); //$NON-NLS-1$
623
		}
624
		
625
		int first_pos = CQPSearchEngine.getCqiClient().id2Cpos(maincorpus.getProperty("id").getQualifiedName(), first_ids[0])[0];
626
		int last_pos = Integer.MAX_VALUE;
627
		if (last_ids != null) {
628
			last_pos = CQPSearchEngine.getCqiClient().id2Cpos(maincorpus.getProperty("id").getQualifiedName(), last_ids[0])[0];
629
		}
630
		
613 631
		int n2 = 0;
614 632
		for (int i = 0 ; i < unites.length ; i++) {
615 633
			for (int p = unites[i].getDeb() ; p <= unites[i].getFin() ; p++) {
616
				n2++;
634
				if (p >= first_pos && p <= last_pos) {
635
					n2++;
636
				}
617 637
			}
618 638
		}
639
				
619 640
		int allpositions[] = new int[n2];
620 641
		n2 = 0;
621 642
		for (int i = 0 ; i < unites.length ; i++) {
622 643
			for (int p = unites[i].getDeb() ; p <= unites[i].getFin() ; p++) {
623
				allpositions[n2++] = p;
644
				if (p >= first_pos && p <= last_pos) {
645
					allpositions[n2++] = p;
646
				}
624 647
			}
625 648
		}
626 649

  
627
		try {
650
		
628 651
			if (previousSelectedTypeUnitIDS != null) {
629 652
				editor.removeHighlightWordsById(highlighted_unit_color, previousSelectedTypeUnitIDS);
630 653
				editor.removeFontWeightWordsById(previousSelectedTypeUnitIDS);
......
728 751

  
729 752
			reloadIdentifiants();
730 753
			selectUniteInIdentifants(unite);
731
			highlightUnite(unite, true, -1);
732
			int i = typeCombo.getSelectionIndex();
733
			if (i > 0) {
734
				highlightType();
735
			}
754
			//highlightUnite(unite, true, -1);
755

  
736 756
			deleteButton.setEnabled(true);
737 757
			editLeftButton.setEnabled(true);
738 758
			editButton.setEnabled(true);
......
1127 1147
		// TODO Auto-generated method stub
1128 1148

  
1129 1149
	}
1150

  
1151
	ProgressListener pageProgressListener = null;
1152
	@Override
1153
	protected ProgressListener getPageReloadListener() {
1154
		if (pageProgressListener != null) {
1155
			return pageProgressListener;
1156
		}
1157
		
1158
		pageProgressListener = new ProgressListener() {
1159
			
1160
			@Override
1161
			public void completed(ProgressEvent event) {
1162
				if (typeCombo.getSelectionIndex() >= 0) {
1163
					highlightType();
1164
				}
1165
			}
1166
			
1167
			@Override
1168
			public void changed(ProgressEvent event) { }
1169
		};
1170
		return pageProgressListener;
1171
	}
1130 1172
}
tmp/org.txm.analec.rcp/src/org/txm/analec/toolbar/SchemaToolbar.java (revision 948)
7 7

  
8 8
import org.eclipse.jface.util.Util;
9 9
import org.eclipse.swt.SWT;
10
import org.eclipse.swt.browser.ProgressEvent;
11
import org.eclipse.swt.browser.ProgressListener;
10 12
import org.eclipse.swt.events.KeyEvent;
11 13
import org.eclipse.swt.events.KeyListener;
12 14
import org.eclipse.swt.events.MenuEvent;
......
976 978
		// TODO Auto-generated method stub
977 979
		
978 980
	}
981
	
982
	ProgressListener pageProgressListener = null;
983
	@Override
984
	protected ProgressListener getPageReloadListener() {
985
		if (pageProgressListener != null) {
986
			return pageProgressListener;
987
		}
988
		
989
		pageProgressListener = new ProgressListener() {
990
			
991
			@Override
992
			public void completed(ProgressEvent event) {
993
				if (typeCombo.getSelectionIndex() >= 0) {
994
					highlightType();
995
				}
996
			}
997
			
998
			@Override
999
			public void changed(ProgressEvent event) { }
1000
		};
1001
		return pageProgressListener;
1002
	}
979 1003
}
tmp/org.txm.analec.rcp/src/org/txm/analec/toolbar/URSAnnotationToolbar.java (revision 948)
4 4

  
5 5
import org.apache.commons.lang.StringUtils;
6 6
import org.eclipse.swt.SWT;
7
import org.eclipse.swt.browser.ProgressListener;
7 8
import org.eclipse.swt.events.KeyListener;
8 9
import org.eclipse.swt.events.MenuListener;
9 10
import org.eclipse.swt.events.MouseListener;
......
80 81
			editor.getEditionPanel(0).getBrowser().getMenu().addMenuListener(getMenuListener());
81 82
		if (getEditorKeyListener() != null)
82 83
			editor.getEditionPanel(0).getBrowser().addKeyListener(getEditorKeyListener());
84
		if (getEditorKeyListener() != null)
85
			editor.getEditionPanel(0).getBeforeHighlighListeners().add(getPageReloadListener());
83 86

  
84 87
		if (analecCorpus.getStructure().isVide()) {
85 88
			analecCorpus.ajouterType(Unite.class, "Entity");
......
92 95
	}
93 96

  
94 97

  
98
	protected abstract ProgressListener getPageReloadListener();
99

  
95 100
	public Corpus getAnalecCorpus() {
96 101
		return analecCorpus;
97 102
	}
......
244 249
				editor.getEditionPanel(0).getBrowser().getMenu().removeMenuListener(this.getMenuListener());
245 250
			if (this.getEditorKeyListener() != null)
246 251
				editor.getEditionPanel(0).getBrowser().removeKeyListener(this.getEditorKeyListener());
252
			if (this.getPageReloadListener() != null)
253
				editor.getEditionPanel(0).getBeforeHighlighListeners().remove(this.getPageReloadListener());
247 254
		}
248 255
		if (annotationArea != null && annotationArea.isDisposed()) annotationArea.dispose();
249 256

  
tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java (revision 948)
233 233
					+"\n}"
234 234
					+"\n} catch(e) {Element.prototype.scrollIntoViewIfNeeded = Element.prototype.scrollIntoView}";
235 235
	protected boolean fastWordHighLight = TXMPreferences.getBoolean(SynopticEditionPreferences.FAST_HIGHLIGHT, SynopticEditionPreferences.PREFERENCES_NODE);
236

  
236
	private ArrayList<ProgressListener> beforeHighlighListeners;
237
	public ArrayList<ProgressListener> getBeforeHighlighListeners() {
238
		return beforeHighlighListeners;
239
	}
240
	private ArrayList<ProgressListener> afterHighlighListeners;
241
	public ArrayList<ProgressListener> getAfterHighlighListeners() {
242
		return beforeHighlighListeners;
243
	}
237 244
	public Object evaluate(String code) {
238 245
		if (Log.getLevel().intValue() <= Level.FINEST.intValue()) System.out.println(code);
239 246
		return getBrowser().evaluate(code);
......
262 269
			Log.printStackTrace(e);
263 270
		}
264 271

  
272
		beforeHighlighListeners = new ArrayList<ProgressListener>();
273
		afterHighlighListeners = new ArrayList<ProgressListener>();
274
		
265 275
		progresslistener = new ProgressListener() {
266 276

  
267 277
			@Override
......
269 279

  
270 280
			@Override
271 281
			public void completed(ProgressEvent event) {
282
				
272 283
				//				System.out.println("EditionPanel "+currentEdition.getName()+" reload "+getCurrentPage().getName());
273 284
				Object rez = evaluate("return typeof sheet");
274 285
				if ("undefined".equals(rez)) execute(functions); // build the sheet if not present in the HTML DOM
286
				
287
				// do something before the highlight is done
288
				for (ProgressListener pl : beforeHighlighListeners) { pl.completed(event);}
275 289

  
276 290
				//System.out.println("highlight: "+highlightedColorPerWordIDS);
277 291
				StringBuilder buffer = new StringBuilder();
......
441 455
				//System.out.println(buffer);
442 456
				if (buffer.length() > 0) execute(buffer.toString());
443 457
				//System.out.println("n="+n+" time="+(System.currentTimeMillis()-start));
458
				
459
				// do something after the highlight is done
460
				for (ProgressListener pl : afterHighlighListeners) { pl.completed(event);}
444 461
			}
445 462
		};
446 463
		getBrowser().addProgressListener(progresslistener);
tmp/org.txm.rcp/plugin.xml (revision 948)
1387 1387
                  visible="false">
1388 1388
            </separator>
1389 1389
            <command
1390
                  commandId="org.txm.rcp.handlers.results.DeleteObject?after=org.txm.information.rcp.handlers.ComputeInformation"
1390
                  commandId="org.txm.rcp.handlers.results.DeleteObject"
1391 1391
                  icon="icons/functions/Delete.png"
1392 1392
                  style="push"
1393 1393
                  tooltip="%command.tooltip.33">
......
1395 1395
                     checkEnabled="false">
1396 1396
                  <or>
1397 1397
                     <reference
1398
                           definitionId="OneBaseSelected">
1399
                     </reference>
1400
                     <reference
1401
                           definitionId="OneConcordanceSelected">
1402
                     </reference>
1403
                     <reference
1404
                           definitionId="OneCorpusSelected">
1405
                     </reference>
1406
                     <reference
1407
                           definitionId="OneLexicalTableSelected">
1408
                     </reference>
1409
                     <reference
1410
                           definitionId="OneLexiconSelected">
1411
                     </reference>
1412
                     <reference
1413
                           definitionId="OnePartitionSelected">
1414
                     </reference>
1415
                     <reference
1416
                           definitionId="OneTxmObjectSelected">
1417
                     </reference>
1418
                     <reference
1419 1398
                           definitionId="OneTXMResultSelected">
1420 1399
                     </reference>
1421 1400
                  </or>

Formats disponibles : Unified diff