Revision 845

tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/editors/CooccurrencesEditor.java (revision 845)
156 156
	AssistedQueryWidget queryWidget;
157 157

  
158 158
	/** The props area. */
159
	@Parameter(key=CooccurrencePreferences.PROPERTIES)
159
	@Parameter(key=CooccurrencePreferences.UNIT_PROPERTIES)
160 160
	PropertiesSelector<WordProperty> propertiesSelector;
161 161

  
162 162
	
......
478 478
		
479 479
		
480 480
		// Add double click, "Send to" command
481
		TXMEditor.addDoubleClickCommandListener(viewer.getTable(), "org.txm.links.rcp.commands.SendToConcordance"); //$NON-NLS-1$
481
		TXMEditor.addDoubleClickCommandListener(viewer.getTable(), "org.txm.concordance.rcp.commands.SendToConcordance", "org.txm.concordance.rcp.handlers.ComputeConcordance"); //$NON-NLS-1$
482 482

  
483 483
		// TODO replace this with a command+menucontribution
484 484
		// viewer.getTable().addMouseListener(new MouseAdapter() {
......
562 562
	public TXMParameters getWidgetsParameters() {
563 563

  
564 564
		TXMParameters parameters = new TXMParameters();
565
		parameters.put(CooccurrencePreferences.PROPERTIES, new ArrayList<Property>(this.propertiesSelector.getSelectedProperties()));
565
		parameters.put(CooccurrencePreferences.UNIT_PROPERTIES, new ArrayList<Property>(this.propertiesSelector.getSelectedProperties()));
566 566
		parameters.put(CooccurrencePreferences.STRUCTURAL_UNIT_LIMIT, this.empantPanel.getStruct());
567 567
		parameters.put(CooccurrencePreferences.MAX_LEFT, this.empantPanel.getMaxLeft() + 1);
568 568
		parameters.put(CooccurrencePreferences.MIN_LEFT, this.empantPanel.getMinLeft() + 1);
tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/SendToConcordance.java (revision 845)
1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
// 
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
// 
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
// 
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
// 
22
// 
23
// 
24
// $LastChangedDate:$
25
// $LastChangedRevision:$
26
// $LastChangedBy:$ 
27
//
28
package org.txm.cooccurrence.rcp.handlers;
29

  
30
import org.eclipse.core.commands.ExecutionEvent;
31
import org.eclipse.core.commands.ExecutionException;
32
import org.eclipse.jface.viewers.IStructuredSelection;
33
import org.eclipse.ui.handlers.HandlerUtil;
34
import org.txm.cooccurrence.core.functions.Cooccurrence;
35
import org.txm.cooccurrence.core.functions.Cooccurrence.CLine;
36
import org.txm.core.preferences.TXMPreferences;
37
import org.txm.core.results.TXMResult;
38
import org.txm.rcp.editors.TXMEditor;
39
import org.txm.rcp.handlers.BaseAbstractHandler;
40

  
41
/**
42
 * Sends the selected lines of a cooccurrence to compute a concordance.
43
 * 
44
 * @author mdecorde
45
 * @author sjacquot
46
 * 
47
 */
48
public class SendToConcordance extends BaseAbstractHandler {
49

  
50

  
51
	@Override
52
	public Object execute(ExecutionEvent event) throws ExecutionException {
53
		
54
		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
55

  
56
		System.err.println("SendToConcordance.execute() class of line = " + selection.getFirstElement().getClass());
57
		
58
		if (selection != null && selection.getFirstElement() instanceof CLine) {
59
			
60
			String query = Cooccurrence.createQuery(selection.toList());
61

  
62
			TXMEditor editor = (TXMEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart();
63

  
64
			// create local result node, store it some parameters and call the linked command
65
			String uuid = TXMResult.createUUID();
66
			TXMPreferences.put(uuid, TXMPreferences.PARENT_UUID, editor.getResult().getParent().getUUID());
67
			TXMPreferences.put(uuid, TXMPreferences.QUERY, query);
68
			BaseAbstractHandler.executeCommand("org.txm.concordance.rcp.handlers.ComputeConcordance", uuid); //$NON-NLS-1$
69
		}
70
		else	{
71
			this.logCanNotCompute(selection);
72
		}
73
		return null;
74
	}
75

  
76
}
tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/SendCooccurrenceTo.java (revision 845)
1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
// 
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
// 
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
// 
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
// 
22
// 
23
// 
24
// $LastChangedDate:$
25
// $LastChangedRevision:$
26
// $LastChangedBy:$ 
27
//
28
package org.txm.cooccurrence.rcp.handlers;
29

  
30
import org.eclipse.core.commands.ExecutionEvent;
31
import org.eclipse.jface.viewers.IStructuredSelection;
32
import org.txm.cooccurrence.core.functions.Cooccurrence;
33
import org.txm.links.rcp.handlers.SendSelectionToQueryable;
34

  
35
/**
36
 * Sends the selected lines of a cooccurrence to compute another command.
37
 * 
38
 * @author sjacquot
39
 * 
40
 */
41
public class SendCooccurrenceTo extends SendSelectionToQueryable {
42

  
43

  
44
	@Override
45
	public String createQuery(ExecutionEvent event, IStructuredSelection selection) {
46
		return ((Cooccurrence) this.getActiveEditorResult(event)).createQuery(selection.toList());
47
	}
48

  
49

  
50

  
51
}
0 52

  
tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/ComputeCooccurrences.java (revision 845)
79 79
		// From view result node
80 80
		else {
81 81

  
82
			Object selection = this.getSelection(event);
82
			Object selection = this.getCorporaViewSelectedObject(event);
83 83

  
84 84
			// Creating from Concordance
85 85
			if (selection instanceof Concordance) {
tmp/org.txm.cooccurrence.rcp/OSGI-INF/l10n/bundle.properties (revision 845)
1 1

  
2
command.label.102 = Send to concordances
3

  
4 2
command.name = Cooccurrences
5 3

  
4
command.name.4 = Send to cooccurrence
5

  
6 6
command.tooltip = Cooccurrences
7 7

  
8 8
editor.name = Cooccurrences
tmp/org.txm.cooccurrence.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 845)
1 1

  
2
command.label.102 = Envoyer vers concordances
3

  
4 2
command.name = Cooccurrences
5 3

  
4
command.name.4 = Envoyer vers la cooccurrence
5

  
6 6
command.tooltip = Calculer les cooccurrents d'une requête
7 7

  
8 8
editor.name = Cooccurrences
tmp/org.txm.cooccurrence.rcp/plugin.xml (revision 845)
10 10
            name="%command.name"
11 11
            returnTypeId="org.txm.cooccurrence.core.functions.Cooccurrence">
12 12
      </command>
13
      <command
14
            id="org.txm.cooccurrence.rcp.commands.SendToCooccurrence"
15
            name="%command.name.4">
16
         <commandParameter
17
               id="sendToTargetCommandId"
18
               name="sendToTargetCommandId"
19
               optional="true">
20
         </commandParameter>
21
      </command>
13 22
   </extension>
14 23
   <extension
15 24
         point="org.eclipse.ui.preferencePages">
......
93 102
         </command>
94 103
      </menuContribution>
95 104
      <menuContribution
96
            locationURI="popup:org.txm.cooccurrence.rcp.editors.CooccurrencesEditor">
105
            locationURI="popup:org.txm.index.rcp.editors.IndexEditor">
97 106
         <command
98
               commandId="org.txm.links.rcp.commands.SendToConcordance"
107
               commandId="org.txm.cooccurrence.rcp.commands.SendToCooccurrence"
108
               icon="icons/cooccurrences.png"
109
               label="%command.name.4"
99 110
               style="push">
111
            <parameter
112
                  name="sendToTargetCommandId"
113
                  value="org.txm.cooccurrence.rcp.handlers.ComputeCooccurrences">
114
            </parameter>
100 115
         </command>
101 116
      </menuContribution>
102 117
   </extension>
......
138 153
   <extension
139 154
         point="org.eclipse.ui.handlers">
140 155
      <handler
141
            class="org.txm.cooccurrence.rcp.handlers.SendToConcordance"
142
            commandId="org.txm.links.rcp.commands.SendToConcordance">
156
            class="org.txm.cooccurrence.rcp.handlers.SendCooccurrenceTo"
157
            commandId="org.txm.concordance.rcp.commands.SendToConcordance">
143 158
         <activeWhen>
144
            <reference
145
                  definitionId="CooccurrenceEditorActive">
146
            </reference></activeWhen>
159
            <and>
160
               <reference
161
                     definitionId="CooccurrenceEditorActive">
162
               </reference>
163
               <reference
164
                     definitionId="OneOrMoreElementSelected">
165
               </reference>
166
            </and></activeWhen>
147 167
      </handler>
148 168
   </extension>
149 169

  
tmp/org.txm.cooccurrence.rcp/META-INF/MANIFEST.MF (revision 845)
13 13
 org.txm.core;visibility:=reexport,
14 14
 org.txm.rcp;visibility:=reexport,
15 15
 org.eclipse.core.expressions;bundle-version="3.4.600";visibility:=reexport,
16
 org.txm.searchengine.core;bundle-version="1.0.0";visibility:=reexport
16
 org.txm.searchengine.core;bundle-version="1.0.0";visibility:=reexport,
17
 org.txm.links.rcp;bundle-version="1.0.0"
17 18
Bundle-Vendor: Textometrie.org
18 19
Bundle-Version: 1.0.0.qualifier
19 20
Bundle-Name: Cooccurence RCP
tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/preferences/CooccurrencePreferences.java (revision 845)
68 68
		preferences.putInt(MIN_RIGHT, 1);
69 69
		preferences.putInt(MAX_RIGHT, 10);
70 70
		
71
		preferences.put(PROPERTIES, TXMPreferences.DEFAULT_UNIT_PROPERTY);
71
		preferences.put(UNIT_PROPERTIES, TXMPreferences.DEFAULT_UNIT_PROPERTY);
72 72
		
73 73
		
74 74
	}
tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java (revision 845)
210 210
	protected Integer pMinRightContextSize;
211 211
	
212 212
	/** The cooccurents properties to show. */
213
	@Parameter(key=CooccurrencePreferences.PROPERTIES)
213
	@Parameter(key=CooccurrencePreferences.UNIT_PROPERTIES)
214 214
	protected List<WordProperty> pProperties;
215 215
	
216 216
	/** The keyword query. */
......
822 822
			
823 823
			StructuralUnit limit = (StructuralUnit) parameters.get(CooccurrencePreferences.STRUCTURAL_UNIT_LIMIT);
824 824

  
825
			Object propsParam = parameters.get(CooccurrencePreferences.PROPERTIES);
825
			Object propsParam = parameters.get(CooccurrencePreferences.UNIT_PROPERTIES);
826 826
			List<WordProperty> properties = null;
827 827
			if (propsParam instanceof List) {
828 828
				properties = (List<WordProperty>)propsParam;
......
1421 1421
	
1422 1422
	@Override
1423 1423
	public boolean loadParameters() throws CqiClientException {
1424
		pProperties = (List<WordProperty>) Property.stringToProperties(getCorpus(), this.getStringParameterValue(CooccurrencePreferences.PROPERTIES));
1424
		pProperties = (List<WordProperty>) Property.stringToProperties(getCorpus(), this.getStringParameterValue(CooccurrencePreferences.UNIT_PROPERTIES));
1425 1425
		pQuery = new Query(this.getStringParameterValue(CooccurrencePreferences.QUERY));
1426 1426
		pStructuralUnitLimit = this.getCorpus().getStructuralUnit(this.getStringParameterValue(CooccurrencePreferences.STRUCTURAL_UNIT_LIMIT));
1427 1427
		return true;
......
1429 1429

  
1430 1430
	@Override
1431 1431
	public boolean saveParameters() {
1432
		this.saveParameter(CooccurrencePreferences.PROPERTIES, Property.propertiesToString(this.pProperties));
1432
		this.saveParameter(CooccurrencePreferences.UNIT_PROPERTIES, Property.propertiesToString(this.pProperties));
1433 1433

  
1434 1434
		if (pQuery != null) {
1435 1435
			this.saveParameter(CooccurrencePreferences.QUERY, pQuery.getQueryString());
......
1456 1456
	 * @param lines
1457 1457
	 * @return the query
1458 1458
	 */
1459
	public static String createQuery(List<CLine> lines) {
1459
	public String createQuery(List<CLine> lines) {
1460

  
1461
		if(this.getQuery().isEmpty())	{
1462
			return ""; //$NON-NLS-1$
1463
		}
1464

  
1460 1465
		
1461
		Cooccurrence cooc = lines.get(0).getCooc();
1462
		int nbProps = cooc.getProperties().size();
1463
		List<WordProperty> props = cooc.getProperties();
1466
		int nbProps = this.getProperties().size();
1467
		List<WordProperty> props = this.getProperties();
1464 1468

  
1465 1469
		String query = "["; //$NON-NLS-1$
1466 1470
		for (int p = 0; p < nbProps; p++) {
......
1477 1481
		query = query.substring(0, query.length() - 3);
1478 1482
		query += "] "; //$NON-NLS-1$
1479 1483
		
1480
		int maxempan = Math.max(cooc.getMaxLeft(), cooc.getMaxRight()); 
1481
		if (cooc.getIncludeXPivot() && maxempan == 0) maxempan = 1;  
1484
		int maxempan = Math.max(this.getMaxLeft(), this.getMaxRight()); 
1485
		if (this.getIncludeXPivot() && maxempan == 0) maxempan = 1;  
1482 1486
		
1483 1487
		String maxempanstr = "within " + maxempan + " "; //$NON-NLS-1$ //$NON-NLS-2$
1484
		if (cooc.getStructure() != null) maxempanstr += cooc.getStructure().getName(); 
1488
		if (this.getStructure() != null) maxempanstr += this.getStructure().getName(); 
1485 1489
		
1486
		query = "("+cooc.getQuery()+" []* "+query+") | ("+query+" []* "+cooc.getQuery()+") "+maxempanstr; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
1490
		query = "("+this.getQuery()+" []* "+query+") | ("+query+" []* "+this.getQuery()+") "+maxempanstr; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
1487 1491
		
1488 1492
		return query;
1489 1493
	}
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/handlers/ComputeCA.java (revision 845)
69 69
		}
70 70

  
71 71
		final IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
72
		final Object selection = this.getSelection(event);
72
		final Object selection = this.getCorporaViewSelectedObject(event);
73 73

  
74 74
		try {
75 75
			System.out.println(CAUIMessages.ComputeCorrespondanceAnalysis_15);
tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java (revision 845)
500 500
		paramArea.pack();
501 501

  
502 502
		// Add double click, "Send to" command
503
		TXMEditor.addDoubleClickCommandListener(viewer.getTable(), "org.txm.links.rcp.commands.SendToConcordance"); //$NON-NLS-1$
503
		TXMEditor.addDoubleClickCommandListener(viewer.getTable(), "org.txm.concordance.rcp.commands.SendToConcordance", "org.txm.concordance.rcp.handlers.ComputeConcordance"); //$NON-NLS-1$
504 504

  
505 505
		// Register the context menu
506 506
		TXMEditor.initContextMenu(this.viewer.getTable(), this.getSite(), this.viewer);
507

  
507 508
		
508
		
509 509
		if (queryWidget != null && !queryWidget.isDisposed()) {
510 510
			queryWidget.setFocus();
511 511
		}
tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendToIndex.java (revision 845)
1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
// 
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
// 
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
// 
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
// 
22
// 
23
// 
24
// $LastChangedDate:$
25
// $LastChangedRevision:$
26
// $LastChangedBy:$ 
27
//
28
package org.txm.index.rcp.handlers;
29

  
30
import org.eclipse.core.commands.ExecutionEvent;
31
import org.eclipse.core.commands.ExecutionException;
32
import org.eclipse.jface.viewers.IStructuredSelection;
33
import org.eclipse.ui.handlers.HandlerUtil;
34
import org.txm.core.preferences.TXMPreferences;
35
import org.txm.core.results.TXMResult;
36
import org.txm.index.core.functions.Index;
37
import org.txm.index.core.functions.Line;
38
import org.txm.rcp.editors.TXMEditor;
39
import org.txm.rcp.handlers.BaseAbstractHandler;
40

  
41
/**
42
 * Sends the selected lines of a lexicon to compute an index.
43
 * 
44
 * @author mdecorde
45
 * @author sjacquot
46
 * 
47
 */
48
public class SendToIndex extends BaseAbstractHandler {
49

  
50

  
51
	@Override
52
	public Object execute(ExecutionEvent event) throws ExecutionException {
53
		
54
		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
55

  
56
		if (selection != null && selection.getFirstElement() instanceof Line) {
57
			
58
			String query = Index.createQuery(selection.toList());
59

  
60
			TXMEditor editor = (TXMEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart();
61

  
62
			// create local result node, store it some parameters and call the linked command
63
			String uuid = TXMResult.createUUID();
64
			TXMPreferences.put(uuid, TXMPreferences.PARENT_UUID, editor.getResult().getParent().getUUID());
65
			TXMPreferences.put(uuid, TXMPreferences.QUERY, query);
66
			BaseAbstractHandler.executeCommand("org.txm.index.rcp.handlers.ComputeIndex", uuid); //$NON-NLS-1$
67
		}
68
		else	{
69
			this.logCanNotCompute(selection);
70
		}
71
		return null;
72
	}
73

  
74
	// FIXME: not used anymore?
75
//	/**
76
//	 * Link.
77
//	 *
78
//	 * @param voceditor the voceditor
79
//	 * @param selection the selection
80
//	 * @return the object
81
//	 */
82
//	public static Object link(IndexEditor voceditor,
83
//			IStructuredSelection selection) {
84
//		assert (selection.getFirstElement() instanceof Line);
85
//		String query = getQuery(selection);
86
//		if (query.length() == 0)
87
//			return null;
88
//		Corpus corpus = voceditor.getCorpus();
89
//		Concordance concordance = new Concordance(corpus);
90
//		concordance.setParameters(new Query(query), null, null, null, null, null, null, null, null, null, null);
91
//		TXMResultEditorInput editorInput = new TXMResultEditorInput(concordance);
92
////		try {
93
////			System.out.println("Compute indexResult query: "+voceditor.getQuery());
94
////			QueryResult indexResult = corpus.query(voceditor.getQuery(), "Index", false);
95
////			System.out.println("N result: "+indexResult.getNMatch());
96
////
97
////			System.out.println("Compute indexOccResult query: "+query);
98
////			QueryResult indexOccResult = corpus.query(new Query(query), "IndexOcc", false);
99
////			System.out.println("N result: "+indexOccResult.getNMatch());
100
////
101
////			String queryname = "Q"+Corpus.getNextQueryCounter();
102
////			String interQueryString = queryname+"=intersect "+indexResult.getQualifiedCqpId()+" "+indexOccResult.getQualifiedCqpId()+";"; 
103
////			System.out.println("Compute inter query: "+interQueryString);
104
////			((MemCqiClient)CQPSearchEngine.getCqiClient()).query(interQueryString);
105
////			
106
////			QueryResult inter = new QueryResult(queryname, queryname, corpus, new Query(interQueryString));
107
////			System.out.println("indexResult size: "+indexResult.getNMatch());
108
////			System.out.println("indexOccResult size: "+indexOccResult.getNMatch());
109
////			System.out.println("inter size: "+inter.getNMatch());
110
////			
111
////			QueryResult inter2 = corpus.query(new Query("intersect "+indexResult.getQualifiedCqpId()+" "+indexOccResult.getQualifiedCqpId()), "Q"+Corpus.getNextQueryCounter(),false);
112
////			System.out.println("inter2 size: "+inter2.getNMatch());
113
////		} catch (Exception e) {
114
////			e.printStackTrace();
115
////			try {
116
////				System.out.println("CQP error: "+CQPSearchEngine.getCqiClient().getLastError());
117
////			} catch (Exception e1) {
118
////				e1.printStackTrace();
119
////			}
120
////		}
121
////		
122
////		return null;
123
//
124
//		IWorkbenchPage page = voceditor.getEditorSite().getWorkbenchWindow()
125
//				.getActivePage();
126
//		try {
127
//			ConcordanceEditor conceditor = (ConcordanceEditor) page
128
//					.openEditor(editorInput, ConcordanceEditor.ID); //$NON-NLS-1$
129
//		} catch (PartInitException e) {
130
//			System.err.println("Error: "+e.getLocalizedMessage());
131
//		}
132
//
133
//		return null;
134
//	}
135

  
136

  
137
}
tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendToCooccurrence.java (revision 845)
1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
// 
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
// 
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
// 
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
// 
22
// 
23
// 
24
// $LastChangedDate:$
25
// $LastChangedRevision:$
26
// $LastChangedBy:$ 
27
//
28
package org.txm.index.rcp.handlers;
29

  
30
import org.eclipse.core.commands.ExecutionEvent;
31
import org.eclipse.core.commands.ExecutionException;
32
import org.eclipse.jface.viewers.IStructuredSelection;
33
import org.eclipse.ui.handlers.HandlerUtil;
34
import org.txm.core.preferences.TXMPreferences;
35
import org.txm.core.results.TXMResult;
36
import org.txm.index.core.functions.Index;
37
import org.txm.index.core.functions.Line;
38
import org.txm.rcp.editors.TXMEditor;
39
import org.txm.rcp.handlers.BaseAbstractHandler;
40
import org.txm.searchengine.cqp.corpus.Corpus;
41

  
42
/**
43
 * Sends the selected lines of an index to compute a cooccurrence.
44
 * 
45
 * @author mdecorde.
46
 */
47
public class SendToCooccurrence extends BaseAbstractHandler {
48

  
49
	@Override
50
	public Object execute(ExecutionEvent event) throws ExecutionException {
51
		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
52

  
53
		if (selection != null && selection.getFirstElement() instanceof Line) {
54
			
55
			String query = Index.createQuery(selection.toList());
56

  
57
			TXMEditor editor = (TXMEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart();
58

  
59
			// create local result node, store it some parameters and call the linked command
60
			String uuid = TXMResult.createUUID();
61
			TXMResult parentCorpus = Corpus.getFirstParentCorpus(editor.getResult());
62
			TXMPreferences.put(uuid, TXMPreferences.PARENT_UUID, parentCorpus.getUUID());
63
			TXMPreferences.put(uuid, TXMPreferences.QUERY, query);
64
			BaseAbstractHandler.executeCommand("org.txm.cooccurrence.rcp.handlers.ComputeCooccurrences", uuid); //$NON-NLS-1$
65
		}
66
		else	{
67
			this.logCanNotCompute(selection);
68
		}
69
		return null;
70
	}
71

  
72

  
73
}
tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendToProgression.java (revision 845)
1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
// 
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
// 
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
// 
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
// 
22
// 
23
// 
24
// $LastChangedDate:$
25
// $LastChangedRevision:$
26
// $LastChangedBy:$ 
27
//
28
package org.txm.index.rcp.handlers;
29

  
30
import java.util.List;
31

  
32
import org.eclipse.core.commands.ExecutionEvent;
33
import org.eclipse.core.commands.ExecutionException;
34
import org.eclipse.jface.viewers.IStructuredSelection;
35
import org.eclipse.ui.handlers.HandlerUtil;
36
import org.txm.core.preferences.TXMPreferences;
37
import org.txm.core.results.TXMResult;
38
import org.txm.index.core.functions.Index;
39
import org.txm.index.core.functions.Line;
40
import org.txm.rcp.editors.TXMEditor;
41
import org.txm.rcp.handlers.BaseAbstractHandler;
42
import org.txm.searchengine.cqp.corpus.Corpus;
43
import org.txm.searchengine.cqp.corpus.query.Query;
44

  
45
/**
46
 * Sends the selected lines of an index to compute a progression.
47
 * 
48
 * @author mdecorde
49
 * @author sjacquot
50
 * 
51
 */
52
public class SendToProgression extends BaseAbstractHandler {
53

  
54
	@Override
55
	public Object execute(ExecutionEvent event) throws ExecutionException {
56

  
57
		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
58

  
59
		if (selection != null && selection.getFirstElement() instanceof Line) {
60

  
61
			List<Query> queries = Index.createQueries(selection.toList());
62

  
63
			TXMEditor editor = (TXMEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart();
64

  
65
			// create local result node, store it some parameters and call the linked command
66
			String uuid = TXMResult.createUUID();
67
			TXMResult parentCorpus = Corpus.getFirstParentCorpus(editor.getResult());
68
			TXMPreferences.put(uuid, TXMPreferences.PARENT_UUID, parentCorpus.getUUID());
69
			TXMPreferences.put(uuid, TXMPreferences.QUERIES, Query.queriesToString(queries));
70
			BaseAbstractHandler.executeCommand("org.txm.progression.rcp.handlers.ComputeProgression", uuid); //$NON-NLS-1$
71
		}
72
		else	{
73
			this.logCanNotCompute(selection);
74
		}
75
		return null;
76
	}
77

  
78

  
79
	
80
	
81
}
tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendToConcordance.java (revision 845)
1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
// 
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
// 
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
// 
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
// 
22
// 
23
// 
24
// $LastChangedDate:$
25
// $LastChangedRevision:$
26
// $LastChangedBy:$ 
27
//
28
package org.txm.index.rcp.handlers;
29

  
30
import org.eclipse.core.commands.ExecutionEvent;
31
import org.eclipse.core.commands.ExecutionException;
32
import org.eclipse.jface.viewers.IStructuredSelection;
33
import org.eclipse.ui.handlers.HandlerUtil;
34
import org.txm.core.preferences.TXMPreferences;
35
import org.txm.core.results.TXMResult;
36
import org.txm.index.core.functions.Index;
37
import org.txm.index.core.functions.Line;
38
import org.txm.rcp.editors.TXMEditor;
39
import org.txm.rcp.handlers.BaseAbstractHandler;
40
import org.txm.searchengine.cqp.corpus.Corpus;
41

  
42
/**
43
 * Sends the selected lines of an index to compute a concordance.
44
 * 
45
 * @author mdecorde
46
 * @author sjacquot
47
 * 
48
 */
49
public class SendToConcordance extends BaseAbstractHandler {
50

  
51

  
52
	@Override
53
	public Object execute(ExecutionEvent event) throws ExecutionException {
54
		
55
		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
56

  
57
		if (selection != null && selection.getFirstElement() instanceof Line) {
58
			
59
			String query = Index.createQuery(selection.toList());
60

  
61
			TXMEditor editor = (TXMEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart();
62

  
63
			// create local result node, store it some parameters and call the linked command
64
			String uuid = TXMResult.createUUID();
65
			TXMResult parentCorpus = Corpus.getFirstParentCorpus(editor.getResult());
66
			TXMPreferences.put(uuid, TXMPreferences.PARENT_UUID, parentCorpus.getUUID());
67
			TXMPreferences.put(uuid, TXMPreferences.QUERY, query);
68
			BaseAbstractHandler.executeCommand("org.txm.concordance.rcp.handlers.ComputeConcordance", uuid); //$NON-NLS-1$
69
		}
70
		else	{
71
			this.logCanNotCompute(selection);
72
		}
73
		return null;
74
	}
75

  
76
	// FIXME: not used anymore?
77
//	/**
78
//	 * Link.
79
//	 *
80
//	 * @param voceditor the voceditor
81
//	 * @param selection the selection
82
//	 * @return the object
83
//	 */
84
//	public static Object link(IndexEditor voceditor,
85
//			IStructuredSelection selection) {
86
//		assert (selection.getFirstElement() instanceof Line);
87
//		String query = getQuery(selection);
88
//		if (query.length() == 0)
89
//			return null;
90
//		Corpus corpus = voceditor.getCorpus();
91
//		Concordance concordance = new Concordance(corpus);
92
//		concordance.setParameters(new Query(query), null, null, null, null, null, null, null, null, null, null);
93
//		TXMResultEditorInput editorInput = new TXMResultEditorInput(concordance);
94
////		try {
95
////			System.out.println("Compute indexResult query: "+voceditor.getQuery());
96
////			QueryResult indexResult = corpus.query(voceditor.getQuery(), "Index", false);
97
////			System.out.println("N result: "+indexResult.getNMatch());
98
////
99
////			System.out.println("Compute indexOccResult query: "+query);
100
////			QueryResult indexOccResult = corpus.query(new Query(query), "IndexOcc", false);
101
////			System.out.println("N result: "+indexOccResult.getNMatch());
102
////
103
////			String queryname = "Q"+Corpus.getNextQueryCounter();
104
////			String interQueryString = queryname+"=intersect "+indexResult.getQualifiedCqpId()+" "+indexOccResult.getQualifiedCqpId()+";"; 
105
////			System.out.println("Compute inter query: "+interQueryString);
106
////			((MemCqiClient)CQPSearchEngine.getCqiClient()).query(interQueryString);
107
////			
108
////			QueryResult inter = new QueryResult(queryname, queryname, corpus, new Query(interQueryString));
109
////			System.out.println("indexResult size: "+indexResult.getNMatch());
110
////			System.out.println("indexOccResult size: "+indexOccResult.getNMatch());
111
////			System.out.println("inter size: "+inter.getNMatch());
112
////			
113
////			QueryResult inter2 = corpus.query(new Query("intersect "+indexResult.getQualifiedCqpId()+" "+indexOccResult.getQualifiedCqpId()), "Q"+Corpus.getNextQueryCounter(),false);
114
////			System.out.println("inter2 size: "+inter2.getNMatch());
115
////		} catch (Exception e) {
116
////			e.printStackTrace();
117
////			try {
118
////				System.out.println("CQP error: "+CQPSearchEngine.getCqiClient().getLastError());
119
////			} catch (Exception e1) {
120
////				e1.printStackTrace();
121
////			}
122
////		}
123
////		
124
////		return null;
125
//
126
//		IWorkbenchPage page = voceditor.getEditorSite().getWorkbenchWindow()
127
//				.getActivePage();
128
//		try {
129
//			ConcordanceEditor conceditor = (ConcordanceEditor) page
130
//					.openEditor(editorInput, ConcordanceEditor.ID); //$NON-NLS-1$
131
//		} catch (PartInitException e) {
132
//			System.err.println("Error: "+e.getLocalizedMessage());
133
//		}
134
//
135
//		return null;
136
//	}
137

  
138

  
139
}
tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeIndex.java (revision 845)
62 62
		}
63 63
		// From view result node
64 64
		else	{
65
			Object selection = this.getSelection(event);
65
			Object selection = this.getCorporaViewSelectedObject(event);
66 66
			
67 67
			// New editor from corpus
68 68
			if (selection instanceof Corpus) {
tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/IndexToLexicalTable.java (revision 845)
1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
// 
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
// 
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
// 
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
// 
22
// 
23
// 
24
// $LastChangedDate:$
25
// $LastChangedRevision:$
26
// $LastChangedBy:$ 
27
//
28
package org.txm.index.rcp.handlers;
29

  
30
import java.util.ArrayList;
31

  
32
import org.apache.batik.util.gui.CSSMediaPanel.Dialog;
33
import org.eclipse.core.commands.ExecutionEvent;
34
import org.eclipse.core.commands.ExecutionException;
35
import org.eclipse.jface.viewers.ArrayContentProvider;
36
import org.eclipse.jface.viewers.IStructuredSelection;
37
import org.eclipse.jface.viewers.LabelProvider;
38
import org.eclipse.swt.widgets.Shell;
39
import org.eclipse.ui.IWorkbenchPage;
40
import org.eclipse.ui.IWorkbenchWindow;
41
import org.eclipse.ui.PartInitException;
42
import org.eclipse.ui.PlatformUI;
43
import org.eclipse.ui.dialogs.ListSelectionDialog;
44
import org.eclipse.ui.handlers.HandlerUtil;
45
import org.txm.index.core.functions.Index;
46
import org.txm.lexicaltable.core.functions.LexicalTable;
47
import org.txm.lexicaltable.rcp.editors.___LexicalTableEditorInput;
48
import org.txm.lexicaltable.rcp.messages.LexicalTableUIMessages;
49
import org.txm.rcp.StatusLine;
50
import org.txm.rcp.handlers.BaseAbstractHandler;
51
import org.txm.rcp.messages.TXMUIMessages;
52
// TODO: Auto-generated Javadoc
53
/**
54
 * The Class IndexToLexicalTable.
55
 */
56
public class IndexToLexicalTable extends BaseAbstractHandler {
57

  
58
	/** The window. */
59
	private IWorkbenchWindow window;
60
	
61
	/** The selection. */
62
	private IStructuredSelection selection;
63
	private static Shell shell;
64
	/* (non-Javadoc)
65
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
66
	 */
67
	@Override
68
	public Object execute(ExecutionEvent event) throws ExecutionException {
69
		
70
		if(!this.checkStatsEngine()) {
71
			return null;
72
		}
73

  
74
		
75
		// TODO Auto-generated method stub
76
		window = HandlerUtil.getActiveWorkbenchWindow(event);
77
		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
78
		shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
79
		return null;
80
	}
81

  
82
	/**
83
	 * Builds the lexical table.
84
	 *
85
	 * @param voc the voc
86
	 * @param from the from
87
	 * @param to the to
88
	 * @return true, if successful
89
	 */
90
	public boolean buildLexicalTable(Index voc, int from, int to) {
91
		LexicalTable table;
92

  
93
		if (!voc.isComputedWithPartition()) {
94
			
95
			System.out.println(TXMUIMessages.IndexToLexicalTable_0);
96
			StatusLine.setMessage(TXMUIMessages.IndexToLexicalTable_0);
97
			return false;
98
		}
99

  
100
		System.out.println(LexicalTableUIMessages.ComputeLexicalTable_3);
101
		ArrayList<String> choices = new ArrayList<String>();
102
		choices.add(LexicalTableUIMessages.ComputeLexicalTable_16);
103
		choices.add(LexicalTableUIMessages.ComputeLexicalTable_12);
104
		ListSelectionDialog dialog = new ListSelectionDialog(shell, 
105
				choices, new ArrayContentProvider(), new LabelProvider(), 
106
				LexicalTableUIMessages.ComputeLexicalTable_13);
107
		
108
		int ret = dialog.open();
109
		//System.out.println("ret= "+ret);
110
		if (ret == Dialog.OK_OPTION) {
111
			
112
		} else {
113
			return false;
114
		}
115
		
116
		try {
117
			table = new LexicalTable(voc);
118
		} catch (Exception e) {
119
			// TODO Auto-generated catch block
120
			org.txm.rcp.utils.Logger.printStackTrace(e);
121
			return false;
122
		}
123

  
124
		try {
125
			IWorkbenchWindow window = PlatformUI.getWorkbench()
126
					.getActiveWorkbenchWindow();
127
			IWorkbenchPage page = window.getActivePage();
128
			___LexicalTableEditorInput editorInput = new ___LexicalTableEditorInput(table);
129
			StatusLine.setMessage(LexicalTableUIMessages.ComputeLexicalTable_10);
130
			page.openEditor(editorInput, "org.txm.rcp.editors.lexicaltable.LexicalTableEditor"); //$NON-NLS-1$
131
		} catch (PartInitException e) {
132
			org.txm.rcp.utils.Logger.printStackTrace(e);
133
		} 
134

  
135
		return true;
136
	}
137

  
138
}
0 139

  
tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java (revision 845)
1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
// 
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
// 
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
// 
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
// 
22
// 
23
// 
24
// $LastChangedDate:$
25
// $LastChangedRevision:$
26
// $LastChangedBy:$ 
27
//
28
package org.txm.index.rcp.handlers;
29

  
30
import org.eclipse.core.commands.ExecutionEvent;
31
import org.eclipse.jface.viewers.IStructuredSelection;
32
import org.eclipse.ui.handlers.HandlerUtil;
33
import org.txm.core.results.TXMResult;
34
import org.txm.index.core.functions.Index;
35
import org.txm.links.rcp.handlers.SendSelectionToQueryable;
36
import org.txm.rcp.editors.TXMEditor;
37
import org.txm.searchengine.cqp.corpus.Corpus;
38
import org.txm.searchengine.cqp.corpus.query.Query;
39

  
40
/**
41
 * Sends the selected lines of an index or lexicon to compute another command.
42
 * 
43
 * @author sjacquot
44
 * 
45
 */
46
public class SendIndexTo extends SendSelectionToQueryable {
47

  
48

  
49
	@Override
50
	public String createQuery(ExecutionEvent event, IStructuredSelection selection) {
51
		return Index.createQuery(selection.toList());
52
	}
53

  
54
	@Override
55
	public String createQueries(ExecutionEvent event, IStructuredSelection selection) {
56
		return Query.queriesToString(Index.createQueries(selection.toList()));
57
	}
58

  
59
	
60

  
61
	@Override
62
	public TXMResult getResultParent(ExecutionEvent event) {
63
		TXMEditor editor = (TXMEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart();
64
		return Corpus.getFirstParentCorpus(editor.getResult());
65
	}
66

  
67

  
68

  
69
}
0 70

  
tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeLexicon.java (revision 845)
28 28
			return false;
29 29
		}
30 30
		
31
		Object selection = this.getSelection(event);
31
		Object selection = this.getCorporaViewSelectedObject(event);
32 32
		
33 33
		Index index = null;
34 34
		
tmp/org.txm.index.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 845)
3 3

  
4 4
command.name.0 = Lexique
5 5

  
6
command.name.2 = Envoyer vers l'index
7

  
6 8
command.tooltip = Calculer le lexique d'une requ\u00EAte
7 9

  
8 10
editor.name = Index
tmp/org.txm.index.rcp/OSGI-INF/l10n/bundle.properties (revision 845)
1 1

  
2 2
command.name = Index
3 3

  
4
command.name.0 = Lexicon
5

  
6
command.name.2 = Send to index
7

  
4 8
command.tooltip = Process the lexicon of a query
5 9

  
6 10
editor.name = Index
7 11

  
8 12
editor.name.0 = Lexicon
9
command.name.0 = Lexicon
10
page.name = Index
13

  
14
page.name = Index
tmp/org.txm.index.rcp/plugin.xml (revision 845)
113 113
         </command>
114 114
      </menuContribution>
115 115
               <menuContribution
116
            locationURI="popup:org.txm.index.rcp.editors.IndexEditor">
117
         <command
118
               commandId="org.txm.links.rcp.commands.SendToConcordance"
119
               style="push">
120
         </command>
121
         <command
122
               commandId="org.txm.links.rcp.commands.SendToCooccurrence"
123
               style="push">
124
         </command>
125
         <command
126
               commandId="org.txm.links.rcp.commands.SendToProgression"
127
               style="push">
128
         </command>
129
      </menuContribution>
130
               <menuContribution
131 116
                     locationURI="popup:org.txm.index.rcp.editors.DictionnaryEditor">
132 117
                  <command
133
                        commandId="org.txm.links.rcp.commands.SendToConcordance"
118
                        commandId="org.txm.index.rcp.commands.SendToIndex"
119
                        icon="icons/index.png"
120
                        label="%command.name.2"
134 121
                        style="push">
122
                     <parameter
123
                           name="sendToTargetCommandId"
124
                           value="org.txm.cooccurrence.rcp.handlers.ComputeCooccurrences">
125
                     </parameter>
135 126
                  </command>
127
               </menuContribution>
128
               <menuContribution
129
                     locationURI="popup:org.txm.internalview.rcp.editors.InternalViewEditor">
136 130
                  <command
137
                        commandId="org.txm.links.rcp.commands.SendToIndex"
131
                        commandId="org.txm.index.rcp.commands.SendToIndex"
132
                        icon="icons/index.png"
133
                        label="%command.name.2"
138 134
                        style="push">
135
                     <parameter
136
                           name="sendToTargetCommandId"
137
                           value="org.txm.cooccurrence.rcp.handlers.ComputeCooccurrences">
138
                     </parameter>
139 139
                  </command>
140
                  <command
141
                        commandId="org.txm.links.rcp.commands.SendToProgression"
142
                        style="push">
143
                  </command>
144 140
               </menuContribution>
145 141
      
146 142
   </extension>
......
194 190
            id="org.txm.index.rcp.handlers.ComputeLexicon"
195 191
            name="%command.name.0">
196 192
      </command>
193
      <command
194
            id="org.txm.index.rcp.commands.SendToIndex"
195
            name="%command.name.2">
196
         <commandParameter
197
               id="sendToTargetCommandId"
198
               name="sendToTargetCommandId"
199
               optional="true">
200
         </commandParameter>
201
      </command>
197 202

  
198 203
      <command
199 204
            defaultHandler="org.txm.synopticedition.rcp.commands.link.IndexToLexicalTable"
......
266 271
   <extension
267 272
         point="org.eclipse.ui.handlers">
268 273
      <handler
269
            class="org.txm.index.rcp.handlers.SendToProgression"
270
            commandId="org.txm.links.rcp.commands.SendToProgression">
274
            class="org.txm.index.rcp.handlers.SendIndexTo"
275
            commandId="org.txm.progression.rcp.commands.SendToProgression">
271 276
         <activeWhen>
277
         <and>
272 278
         <or>
273 279
           <reference
274 280
                 definitionId="IndexEditorActive">
......
278 284
           </reference>
279 285
         
280 286
         </or>
281
         
287
         <reference
288
               definitionId="OneOrMoreElementSelected">
289
         </reference>
290
         </and>
282 291
         </activeWhen>
283 292
      </handler>
284 293
      <handler
285
            class="org.txm.index.rcp.handlers.SendToConcordance"
286
            commandId="org.txm.links.rcp.commands.SendToConcordance">
294
            class="org.txm.index.rcp.handlers.SendIndexTo"
295
            commandId="org.txm.concordance.rcp.commands.SendToConcordance">
287 296
         <activeWhen>
297
         <and>
288 298
            <or>
289 299
               <reference
290 300
                     definitionId="IndexEditorActive">
......
293 303
                     definitionId="LexiconEditorActive">
294 304
               </reference>
295 305
            </or>
306
            <reference
307
                  definitionId="OneOrMoreElementSelected">
308
            </reference>
309
            </and>
296 310
         </activeWhen>
297 311
      </handler>
298 312
      <handler
299
            class="org.txm.index.rcp.handlers.SendToCooccurrence"
300
            commandId="org.txm.links.rcp.commands.SendToCooccurrence">
313
            class="org.txm.index.rcp.handlers.SendIndexTo"
314
            commandId="org.txm.cooccurrence.rcp.commands.SendToCooccurrence">
301 315
         <activeWhen>
316
         <and>
302 317
               <reference
303 318
                     definitionId="IndexEditorActive">
304 319
               </reference>
320
               <reference
321
                     definitionId="OneOrMoreElementSelected">
322
               </reference>
323
               </and>
305 324
         </activeWhen>
306 325
      </handler>
307 326
      <handler
308
            class="org.txm.index.rcp.handlers.SendToIndex"
309
            commandId="org.txm.links.rcp.commands.SendToIndex">
327
            class="org.txm.index.rcp.handlers.SendIndexTo"
328
            commandId="org.txm.index.rcp.commands.SendToIndex">
310 329
         <activeWhen>
330
         <and>
311 331
               <reference
312 332
                     definitionId="LexiconEditorActive">
313 333
               </reference>
334
               <reference
335
                     definitionId="OneOrMoreElementSelected">
336
               </reference>
337
               </and>
314 338
         </activeWhen>
315 339
      </handler>
316 340
   </extension>
tmp/org.txm.index.rcp/META-INF/MANIFEST.MF (revision 845)
11 11
 org.eclipse.ui;bundle-version="3.106.1";visibility:=reexport,
12 12
 org.txm.rcp;visibility:=reexport,
13 13
 org.eclipse.core.expressions;bundle-version="3.4.600";visibility:=reexport,
14
 org.txm.searchengine.core;bundle-version="1.0.0";visibility:=reexport
14
 org.txm.searchengine.core;bundle-version="1.0.0";visibility:=reexport,
15
 org.txm.links.rcp;bundle-version="1.0.0"
15 16
Export-Package: org.txm.index.rcp.adapters,org.txm.index.rcp.editors,o
16 17
 rg.txm.index.rcp.handlers,org.txm.index.rcp.messages
17 18
Bundle-Vendor: Textometrie.org
tmp/org.txm.progression.rcp/OSGI-INF/l10n/bundle.properties (revision 845)
1

  
1 2
Bundle-Name = Progression RCP
3

  
4
command.name = Progression
5

  
6
command.name.3 = Send to progression
7

  
8
command.tooltip = Compute the progression chart of a query
9

  
2 10
page.name = Progression
3
command.name = Progression
4
command.tooltip = Compute the progression chart of a query
tmp/org.txm.progression.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 845)
3 3

  
4 4
command.name = Progression
5 5

  
6
command.tooltip = Calculer le graphique de progression d'une ou plusieurs requ\u00EAtes
6
command.name.3 = Envoyer vers la progression
7 7

  
8
command.tooltip = Calculer le graphique de progression d'une ou plusieurs requêtes
9

  
8 10
page.name = Progression
tmp/org.txm.progression.rcp/plugin.xml (revision 845)
19 19
            name="%command.name"
20 20
            returnTypeId="org.txm.progression.core.functions.Progression">
21 21
      </command>
22
      <command
23
            id="org.txm.progression.rcp.commands.SendToProgression"
24
            name="%command.name.3">
25
         <commandParameter
26
               id="sendToTargetCommandId"
27
               name="sendToTargetCommandId"
28
               optional="true">
29
         </commandParameter>
30
      </command>
22 31
   </extension>
23 32
   <extension
24 33
         point="org.eclipse.ui.menus">
......
74 83
            </visibleWhen>
75 84
         </command>
76 85
      </menuContribution>
86
      <menuContribution
87
            locationURI="popup:org.txm.index.rcp.editors.IndexEditor">
88
         <command
89
               commandId="org.txm.progression.rcp.commands.SendToProgression"
90
               icon="icons/functions/progression.png"
91
               label="%command.name.3"
92
               style="push">
93
            <parameter
94
                  name="sendToTargetCommandId"
95
                  value="org.txm.progression.rcp.handlers.ComputeProgression">
96
            </parameter>
97
         </command>
98
      </menuContribution>
99
      <menuContribution
100
            locationURI="popup:org.txm.index.rcp.editors.DictionnaryEditor">
101
         <command
102
               commandId="org.txm.progression.rcp.commands.SendToProgression"
103
               icon="icons/functions/progression.png"
104
               label="%command.name.3"
105
               style="push">
106
            <parameter
107
                  name="sendToTargetCommandId"
108
                  value="org.txm.progression.rcp.handlers.ComputeProgression">
109
            </parameter>
110
         </command>
111
      </menuContribution>
112
      <menuContribution
113
            locationURI="popup:org.txm.internalview.rcp.editors.InternalViewEditor">
114
         <command
115
               commandId="org.txm.progression.rcp.commands.SendToProgression"
116
               icon="icons/functions/progression.png"
117
               label="%command.name.3"
118
               style="push">
119
            <parameter
120
                  name="sendToTargetCommandId"
121
                  value="org.txm.progression.rcp.handlers.ComputeProgression">
122
            </parameter>
123
         </command>
124
      </menuContribution>
77 125
   </extension>
78 126
   <extension
79 127
         point="org.txm.chartsengine.eventcallback">
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/handlers/ComputeProgression.java (revision 845)
62 62
		}
63 63
		// From view result node
64 64
		else	{
65
			Object selection = this.getSelection(event);
65
			Object selection = this.getCorporaViewSelectedObject(event);
66 66

  
67 67
			// Creating from Corpus
68 68
			if (selection instanceof Corpus)	{
tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/handlers/ComputeTextsBalance.java (revision 845)
48 48
	@Override
49 49
	public Object execute(ExecutionEvent event) throws ExecutionException {
50 50

  
51
		Object selection = this.getSelection();
51
		Object selection = this.getCorporaViewSelectedObject(event);
52 52
		TextsBalance textsBalance = null;
53 53
		
54 54
		// creates new result
tmp/org.txm.concordance.rcp/OSGI-INF/l10n/bundle.properties (revision 845)
1 1

  
2
command.label.11 = Concordance
3

  
2 4
command.name = Concordances
3 5

  
6
command.name.1 = Send to concordance
7

  
4 8
command.name.37 = Delete line
5 9

  
6 10
command.tooltip = Concordances
7 11

  
8 12
editor.name = Concordances
9
editor.name.2=Concordance
10 13

  
14
editor.name.2 = Concordance
15

  
11 16
page.name = Concordances
12

  
13
command.label.11=Concordance
tmp/org.txm.concordance.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 845)
1 1

  
2
command.label.11 = Concordances
3

  
2 4
command.name = Concordances
3
command.name.5=Concordances
5

  
6
command.name.1 = Envoyer vers la concordance
7

  
4 8
command.name.37 = Supprimer la ligne
5 9

  
10
command.name.5 = Concordances
11

  
6 12
command.tooltip = Concordances
7
command.tooltip.7=Calculer une concordance
8 13

  
14
command.tooltip.7 = Calculer une concordance
15

  
9 16
editor.name = Concordances
10
editor.name.2=Concordances
11 17

  
18
editor.name.2 = Concordances
19

  
12 20
page.name = Concordances
13
page.name.1=Concordances
14 21

  
15
command.label.11=Concordances
22
page.name.1 = Concordances
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff