Révision 673

tmp/org.txm.analec.rcp/src/org/txm/analec/export/AnalecAnnotationTEIExporter.java (revision 673)
266 266
			writer.writeAttribute("who", "#"+System.getProperty("user.name"));
267 267
			writer.writeAttribute("when", BaseParameters.dateformat.format(Calendar.getInstance().getTime()));
268 268
			writer.writeCharacters("\n");
269
			writer.writeCharacters("Created with TXM "+BundleUtils.getBundleVersion("org.txm.rcpapplication")+" and Analec extension "+BundleUtils.getBundleVersion("AnalecRCP")+" with 'XML-TEI-URS Export....' export command on "+mainCorpus.getName()+" corpus");
269
			writer.writeCharacters("Created with TXM "+BundleUtils.getBundleVersion("org.txm.rcp")+" and Analec extension "+BundleUtils.getBundleVersion("AnalecRCP")+" with 'XML-TEI-URS Export....' export command on "+mainCorpus.getName()+" corpus");
270 270
			writer.writeEndElement(); // change
271 271
			writer.writeEndElement(); // revisionDesc
272 272
			writer.writeStartElement("encodingDesc");writer.writeCharacters("\n");
tmp/org.txm.analec.rcp/src/org/txm/analec/preferences/AnalecPreferences.java (revision 673)
19 19
		Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE);
20 20
		preferences.put(VERSION, "");
21 21
		preferences.put(COLOR_PALETTE, "green");
22
		preferences.putBoolean(ANALEC_LIMIT_CORRECTION_SCHEME, false);
22 23
		preferences.putBoolean(PREFIX_AUTOCOMPLETION, false);
23 24
	}
24 25
}
tmp/org.txm.analec.rcp/src/org/txm/analec/toolbar/UnitToolbar.java (revision 673)
173 173
			}
174 174
		});
175 175
		deleteButton = new Button(this, SWT.PUSH);
176
		deleteButton.setImage(IImageKeys.getImage("platform:/plugin/org.txm.rcpapplication/icons/cross.png")); //$NON-NLS-1$
176
		deleteButton.setImage(IImageKeys.getImage("platform:/plugin/org.txm.rcp/icons/cross.png")); //$NON-NLS-1$
177 177
		deleteButton.setToolTipText(Messages.UnitToolbar_10);
178 178
		deleteButton.addSelectionListener(new SelectionListener() {
179 179
			@Override
tmp/org.txm.analec.rcp/src/org/txm/analec/toolbar/SchemaToolbar.java (revision 673)
143 143
		});
144 144

  
145 145
		deleteSchemaButton = new Button(this, SWT.PUSH);
146
		deleteSchemaButton.setImage(IImageKeys.getImage("platform:/plugin/org.txm.rcpapplication/icons/cross.png")); //$NON-NLS-1$
146
		deleteSchemaButton.setImage(IImageKeys.getImage("platform:/plugin/org.txm.rcp/icons/cross.png")); //$NON-NLS-1$
147 147
		deleteSchemaButton.setToolTipText("Supprimer le schéma");
148 148
		deleteSchemaButton.setEnabled(false);
149 149
		deleteSchemaButton.addSelectionListener(new SelectionListener() {
......
168 168
		});
169 169

  
170 170
		deleteUniteButton = new Button(this, SWT.PUSH);
171
		deleteUniteButton.setImage(IImageKeys.getImage("platform:/plugin/org.txm.rcpapplication/icons/cross.png")); //$NON-NLS-1$
171
		deleteUniteButton.setImage(IImageKeys.getImage("platform:/plugin/org.txm.rcp/icons/cross.png")); //$NON-NLS-1$
172 172
		deleteUniteButton.setToolTipText("Supprimer l'unité de la chaîne");
173 173
		deleteUniteButton.setEnabled(false);
174 174
		deleteUniteButton.addSelectionListener(new SelectionListener() {
tmp/org.txm.analec.rcp/src/org/txm/analec/view/ElementSearchView.java (revision 673)
183 183
		});
184 184

  
185 185
		resetButton = new Button(buttons, SWT.PUSH);
186
		resetButton.setImage(IImageKeys.getImage("platform:/plugin/org.txm.rcpapplication/icons/cross.png"));
186
		resetButton.setImage(IImageKeys.getImage("platform:/plugin/org.txm.rcp/icons/cross.png"));
187 187
		resetButton.setToolTipText("Reset the search field values");
188 188
		resetButton.addSelectionListener(new SelectionListener() {
189 189
			@Override
tmp/org.txm.analec.rcp/plugin.xml (revision 673)
56 56
         </menu>
57 57
      </menuContribution>
58 58
      <menuContribution
59
            locationURI="popup:org.txm.rcpapplication.views.CorporaView">
59
            locationURI="popup:org.txm.rcp.views.CorporaView">
60 60
         <menu
61 61
               id="corpora.menu.analec"
62 62
               label="%menu.label.0"
......
152 152
   <extension
153 153
         point="org.eclipse.ui.commands">
154 154
      <command
155
            categoryId="org.txm.rcpapplication.category.txm"
155
            categoryId="org.txm.rcp.category.txm"
156 156
            defaultHandler="org.txm.analec.commands.LoadStructure"
157 157
            id="org.txm.analec.commands.LoadStructure"
158 158
            name="%command.name">
159 159
      </command>
160 160
      <command
161
            categoryId="org.txm.rcpapplication.category.txm"
161
            categoryId="org.txm.rcp.category.txm"
162 162
            defaultHandler="org.txm.analec.commands.EditStructure"
163 163
            id="org.txm.analec.commands.EditAnnotationStructure"
164 164
            name="%command.name.0">
165 165
      </command>
166 166
      <command
167
            categoryId="org.txm.rcpapplication.category.txm"
167
            categoryId="org.txm.rcp.category.txm"
168 168
            defaultHandler="org.txm.analec.commands.SaveStructure"
169 169
            id="org.txm.analec.commands.SaveStructure"
170 170
            name="%command.name.1">
171 171
      </command>
172 172
      <command
173
            categoryId="org.txm.rcpapplication.category.txm"
173
            categoryId="org.txm.rcp.category.txm"
174 174
            defaultHandler="org.txm.analec.commands.LoadStructureFromGlozz"
175 175
            id="org.txm.analec.commands.LoadStructureFromGlozz"
176 176
            name="%command.name.2">
177 177
      </command>
178 178
      <command
179
            categoryId="org.txm.rcpapplication.category.txm"
179
            categoryId="org.txm.rcp.category.txm"
180 180
            defaultHandler="org.txm.analec.commands.LoadCorpus"
181 181
            id="org.txm.analec.commands.LoadCorpus"
182 182
            name="%command.name.3">
183 183
      </command>
184 184
      <command
185
            categoryId="org.txm.rcpapplication.category.txm"
185
            categoryId="org.txm.rcp.category.txm"
186 186
            defaultHandler="org.txm.analec.commands.SaveCorpus"
187 187
            id="org.txm.analec.commands.SaveCorpus"
188 188
            name="%command.name.4">
189 189
      </command>
190 190
      <command
191
            categoryId="org.txm.rcpapplication.category.txm"
191
            categoryId="org.txm.rcp.category.txm"
192 192
            defaultHandler="org.txm.analec.commands.LoadVue"
193 193
            id="org.txm.analec.commands.LoadVue"
194 194
            name="%command.name.5">
195 195
      </command>
196 196
      <command
197
            categoryId="org.txm.rcpapplication.category.txm"
197
            categoryId="org.txm.rcp.category.txm"
198 198
            defaultHandler="org.txm.analec.commands.SaveVue"
199 199
            id="org.txm.analec.commands.SaveVue"
200 200
            name="%command.name.6">
201 201
      </command>
202 202
      <command
203
            categoryId="org.txm.rcpapplication.category.txm"
203
            categoryId="org.txm.rcp.category.txm"
204 204
            defaultHandler="org.txm.analec.commands.SaveStructureAsGlozzModel"
205 205
            id="org.txm.analec.commands.SaveStructureAsGlozzModel"
206 206
            name="%command.name.7">
207 207
      </command>
208 208
      <command
209
            categoryId="org.txm.rcpapplication.category.txm"
209
            categoryId="org.txm.rcp.category.txm"
210 210
            defaultHandler="org.txm.analec.commands.ImportGlozzCorpus"
211 211
            id="org.txm.analec.commands.ImportGlozzCorpus"
212 212
            name="%command.name.8">
213 213
      </command>
214 214
      <command
215
            categoryId="org.txm.rcpapplication.category.txm"
215
            categoryId="org.txm.rcp.category.txm"
216 216
            defaultHandler="org.txm.analec.commands.ImportGlozzAnnotations"
217 217
            id="org.txm.analec.commands.ImportGlozzAnnotations"
218 218
            name="%command.name.9">
......
223 223
            name="%command.name.10">
224 224
      </command>
225 225
      <command
226
            categoryId="org.txm.rcpapplication.category.txm"
226
            categoryId="org.txm.rcp.category.txm"
227 227
            defaultHandler="org.txm.analec.commands.ExportGlozzCorpus"
228 228
            id="org.txm.analec.commands.ExportGlozzCorpus"
229 229
            name="%command.name.12">
230 230
      </command>
231 231
      <command
232
            categoryId="org.txm.rcpapplication.category.txm"
232
            categoryId="org.txm.rcp.category.txm"
233 233
            defaultHandler="org.txm.analec.commands.ExportTEICorpus"
234 234
            id="org.txm.analec.commands.ExportTEICorpus"
235 235
            name="%command.name.13">
236 236
      </command>
237 237
      <command
238
            categoryId="org.txm.rcpapplication.category.txm"
238
            categoryId="org.txm.rcp.category.txm"
239 239
            defaultHandler="org.txm.analec.commands.ImportTEICorpus"
240 240
            id="org.txm.analec.commands.ImportTEICorpus"
241 241
            name="%command.name.14">
242 242
      </command>
243 243
      <command
244
            categoryId="org.txm.rcpapplication.category.txm"
244
            categoryId="org.txm.rcp.category.txm"
245 245
            defaultHandler="org.txm.analec.commands.ImportTEIAnnotations"
246 246
            id="org.txm.analec.commands.ImportTEIAnnotations"
247 247
            name="%command.name.11">
......
256 256
         point="org.eclipse.ui.views">
257 257
      <view
258 258
            allowMultiple="false"
259
            category="org.txm.rcpapplication"
259
            category="org.txm.rcp"
260 260
            class="org.txm.analec.view.ElementPropertiesView"
261 261
            icon="icons/pencil.png"
262 262
            id="org.txm.analec.view.ElementPropertiesView"
......
265 265
      </view>
266 266
      <view
267 267
            allowMultiple="false"
268
            category="org.txm.rcpapplication"
268
            category="org.txm.rcp"
269 269
            class="org.txm.analec.view.ElementSearchView"
270
            icon="platform:/plugin/org.txm.rcpapplication/icons/functions/Search.png"
270
            icon="platform:/plugin/org.txm.rcp/icons/functions/Search.png"
271 271
            id="org.txm.analec.view.ElementSearchView"
272 272
            name="%view.name.0"
273 273
            restorable="true">
......
301 301
   <extension
302 302
         point="org.eclipse.ui.preferencePages">
303 303
      <page
304
            category="org.txm.rcpapplication.preferences.UserPreferencePage"
304
            category="org.txm.rcp.preferences.UserPreferencePage"
305 305
            class="org.txm.analec.preferences.AnalecPreferencePage"
306 306
            id="org.txm.analec.preferences.AnalecPreferencePage"
307 307
            name="Analec">
tmp/org.txm.tigersearch.rcp/plugin.xml (revision 673)
73 73
      <menuContribution
74 74
            locationURI="menu:menu.help.plugins">
75 75
         <command
76
               commandId="org.txm.rcpapplication.commands.OpenBrowser"
76
               commandId="org.txm.rcp.commands.OpenBrowser"
77 77
               label="TIGERSearch"
78 78
               style="push">
79 79
            <parameter
80
                  name="org.txm.rcpapplication.commands.commandParameter2"
80
                  name="org.txm.rcp.commands.commandParameter2"
81 81
                  value="https://groupes.renater.fr/wiki/txm-users/public/extensions#tigersearch">
82 82
            </parameter>
83 83
         </command>
......
120 120
      </menuContribution>
121 121
      <menuContribution
122 122
            allPopups="false"
123
            locationURI="popup:org.txm.rcpapplication.views.CorporaView">
123
            locationURI="popup:org.txm.rcp.views.CorporaView">
124 124
         <command
125 125
               commandId="org.txm.tigersearch.commands.ComputeTIGERSearch"
126 126
               icon="icons/functions/TS.png"
......
155 155
      </menuContribution>
156 156
      <menuContribution
157 157
            allPopups="false"
158
            locationURI="toolbar:org.txm.rcpapplication.toolbartools">
158
            locationURI="toolbar:org.txm.rcp.toolbartools">
159 159
         <command
160 160
               commandId="org.txm.tigersearch.commands.ComputeTIGERSearch"
161 161
               icon="icons/functions/TS.png"
tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/commands/ComputeRecette1.java (revision 673)
51 51
 */
52 52
public class ComputeRecette1 extends AbstractHandler {
53 53

  
54
	public static final String ID = "org.txm.rcpapplication.commands.function.ComputeTSIndex"; //$NON-NLS-1$
54
	public static final String ID = "org.txm.rcp.commands.function.ComputeTSIndex"; //$NON-NLS-1$
55 55

  
56 56
	/* (non-Javadoc)
57 57
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/commands/ComputeRecette2.java (revision 673)
56 56
 */
57 57
public class ComputeRecette2 extends AbstractHandler {
58 58

  
59
	public static final String ID = "org.txm.rcpapplication.commands.function.ComputeTSIndex"; //$NON-NLS-1$
59
	public static final String ID = "org.txm.rcp.commands.function.ComputeTSIndex"; //$NON-NLS-1$
60 60

  
61 61
	/* (non-Javadoc)
62 62
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/commands/ComputeTSIndex.java (revision 673)
51 51
 */
52 52
public class ComputeTSIndex extends AbstractHandler {
53 53

  
54
	public static final String ID = "org.txm.rcpapplication.commands.function.ComputeTSIndex"; //$NON-NLS-1$
54
	public static final String ID = "org.txm.rcp.commands.function.ComputeTSIndex"; //$NON-NLS-1$
55 55

  
56 56
	/* (non-Javadoc)
57 57
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/commands/ComputeTIGERSearch.java (revision 673)
49 49
public class ComputeTIGERSearch extends AbstractHandler {
50 50

  
51 51
	/** The ID. */
52
	public static String ID = "org.txm.rcpapplication.commands.function.ComputeTIGERSearch"; //$NON-NLS-1$
52
	public static String ID = "org.txm.rcp.commands.function.ComputeTIGERSearch"; //$NON-NLS-1$
53 53

  
54 54
	/** The selection. */
55 55
	private IStructuredSelection selection;
tmp/org.txm.cql2lsa.rcp/META-INF/MANIFEST.MF (revision 673)
17 17
Bundle-ActivationPolicy: lazy
18 18
Export-Package: cql2lsarcp,
19 19
 org.txm.functions.cql2lsa,
20
 org.txm.rcpapplication.commands.function
20
 org.txm.rcp.commands.function
21 21
Bundle-Vendor: Textometrie.org
tmp/org.txm.cql2lsa.rcp/src/org/txm/rcp/commands/function/ComputeExpI.java (revision 673)
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.rcp.commands.function;
29

  
30
import java.io.File;
31
import java.io.FileOutputStream;
32
import java.io.IOException;
33
import java.io.OutputStreamWriter;
34
import java.util.Collection;
35
import java.util.List;
36

  
37
import org.apache.commons.lang.StringUtils;
38
import org.eclipse.core.commands.AbstractHandler;
39
import org.eclipse.core.commands.ExecutionEvent;
40
import org.eclipse.core.commands.ExecutionException;
41
import org.eclipse.core.runtime.IProgressMonitor;
42
import org.eclipse.core.runtime.IStatus;
43
import org.eclipse.core.runtime.Status;
44
import org.eclipse.jface.viewers.IStructuredSelection;
45
import org.eclipse.swt.SWT;
46
import org.eclipse.swt.widgets.FileDialog;
47
import org.eclipse.ui.handlers.HandlerUtil;
48
import org.txm.core.preferences.TBXPreferences;
49
import org.txm.core.preferences.TXMPreferences;
50
import org.txm.functions.cql2lsa.ExpI;
51
import org.txm.functions.cql2lsa.QueryIndexLine;
52
import org.txm.rcp.JobsTimer;
53
import org.txm.rcp.swt.dialog.LastOpened;
54
import org.txm.rcp.utils.JobHandler;
55
import org.txm.searchengine.cqp.corpus.Corpus;
56
import org.txm.utils.logger.Log;
57
// TODO: Auto-generated Javadoc
58
/**
59
 * open the Index Editor 
60
 * @author mdecorde.
61
 */
62
public class ComputeExpI extends AbstractHandler {
63

  
64
	/** The ID. */
65
	public static String ID = "org.txm.rcp.commands.function.ComputeQueryIndexOfTexts"; //$NON-NLS-1$
66

  
67
	/** The selection. */
68
	private IStructuredSelection selection;
69

  
70
	/* (non-Javadoc)
71
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
72
	 */
73
	@Override
74
	public Object execute(ExecutionEvent event) throws ExecutionException {
75
		Log.info("Compute QueryIndexOfTexts: start");
76
		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
77

  
78
		Object s = selection.getFirstElement();
79
		if (s instanceof Corpus) {
80
			Corpus corpus = (Corpus) s;
81
			try {
82
				File propFile = null;
83
				if (LastOpened.getFile(ID) != null)
84
					propFile = new File(LastOpened.getFolder(ID));
85

  
86
				FileDialog dialog = new FileDialog(HandlerUtil.getActiveShell(event), SWT.OPEN);
87
				String[] exts = { "*.properties" }; //$NON-NLS
88
				dialog.setFilterExtensions(exts);
89
				if (propFile != null) {
90
					dialog.setFilterPath(propFile.getParent());
91
					dialog.setFileName(propFile.getName());
92
				}
93
				String path = dialog.open();
94
				if (path != null) {
95
					compute(corpus, new File(path));
96
				}
97
			} catch(Exception e) {
98
				e.printStackTrace();
99
			}
100
		} else {
101
			System.out.println ("Can not compute QueryIndexOfTexts with: "+s);
102
		}
103

  
104
		return null;
105
	}
106

  
107
	public static void compute(final Corpus corpus, final File propFile) {
108
		final String title = "Compute QueryIndexOfText with "+corpus +" corpus properties file: "+propFile;
109
		JobHandler jobhandler = new JobHandler(title) {
110
			@Override
111
			protected IStatus run(IProgressMonitor monitor) {
112
				JobsTimer.start();
113
				try {
114
					System.out.println(title);
115
					this.runInit(monitor);
116
					
117
					monitor.beginTask("Counting", 100);
118
					
119
					ExpI qiot = new ExpI(corpus);
120
					qiot.setCurrentMonitor(this);
121
					qiot.addLinesFromFile(propFile);
122

  
123
					//					qiot.addLine("je", new Query("[word=\"je\"]"));
124
					//					qiot.addLine("tu", new Query("[word=\"tu\"]"));
125
					//					qiot.addLine("il", new Query("[word=\"il\"]"));
126
					//					qiot.addLine("elle", new Query("[word=\"elle\"]"));
127
					//					qiot.addLine("on", new Query("[word=\"on\"]"));
128
					//					qiot.addLine("nous", new Query("[word=\"nous\"]"));
129
					//					qiot.addLine("vous", new Query("[word=\"vous\"]"));
130
					//					qiot.addLine("ils", new Query("[word=\"ils\"]"));
131
					//					qiot.addLine("elles", new Query("[word=\"elles\"]"));
132
					//					qiot.addLine("celui", new Query("[word=\"celui\"]"));
133
					//					qiot.addLine("celle", new Query("[word=\"celle\"]"));
134
					//					qiot.addLine("ceux", new Query("[word=\"ceux\"]"));
135
					//					qiot.addLine("celles", new Query("[word=\"celles\"]"));
136
					//					qiot.addLine("eux", new Query("[word=\"eux\"]"));
137
					// "je|tu|il|elle|on|nous|vous|ils|elles|celui|celle|ceux|celles|eux"
138

  
139
					File resultDir = new File(TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE), "results");
140
					
141
					writingLDAFiles(resultDir, qiot, monitor);
142
				} catch (Exception e) {
143
					System.out.println("Error while computing: "+e);
144
					Log.printStackTrace(e);
145
					return Status.CANCEL_STATUS;
146
				}
147
				JobsTimer.stopAndPrint();
148
				return Status.OK_STATUS;
149
			}
150
		};
151
		jobhandler.schedule();
152
	}
153

  
154
	public static void writingLDAFiles(File resultDir, ExpI qiot, IProgressMonitor monitor) throws IOException {
155
		File resultFile = new File(resultDir, "doc_word_freq.txt");
156
		File lexiqueFile = new File(resultDir, "lexique.txt");
157
		StringBuffer buffer = new StringBuffer();
158
		OutputStreamWriter output = new OutputStreamWriter(new FileOutputStream(resultFile) , "UTF-8"); //$NON-NLS-1$
159
		
160
		monitor.beginTask("Writing 'doc_word_freq.txt'", 100000);
161
		
162
		Collection<QueryIndexLine> lines = qiot.getLines();
163
		
164
		List<String> texts = qiot.getTextNames();
165
		//System.out.println("texts: "+texts.size());
166
		int delta = 100000 / texts.size();
167
		for (int i = 0 ; i < texts.size() ; i++) {
168
			int noDoc = i+1;
169
			int noLine = 1;
170
			for (QueryIndexLine line : lines) {
171
				int f = line.getFreqs()[i];
172
				if (f > 0)
173
					buffer.append(""+noDoc+"\t"+noLine+"\t"+f+"\n");
174
				noLine++;
175
			}
176
			
177
			monitor.worked(delta);
178
		}
179
		
180
		output.write(buffer.toString());
181
		output.flush();
182
		output.close();
183
		
184
		output = new OutputStreamWriter(new FileOutputStream(lexiqueFile) , "UTF-8"); //$NON-NLS-1$
185
		for (QueryIndexLine line : lines) {
186
			output.write(line.getName()+"\n");
187
		}
188
		output.close();
189
		System.out.println("Result saved in "+resultFile+" and "+lexiqueFile);
190
	}
191
	
192
	public static void writingMatrix(File resultDir, ExpI qiot, IProgressMonitor monitor) throws IOException {
193
		File resultFile = new File(resultDir, "counts.csv");
194
		OutputStreamWriter output = new OutputStreamWriter(new FileOutputStream(resultFile) , "UTF-8"); //$NON-NLS-1$
195
		
196
		monitor.beginTask("Writing Matrix", 100);
197
		
198
		Collection<QueryIndexLine> lines = qiot.getLines();
199
		int delta = 1000 / lines.size();
200
		//System.out.println("Number of lines: "+lines.size());
201
		
202
		output.write("Name\tQuery\tF\t"+StringUtils.join(qiot.getTextNames(), "\t")+"\n");
203
		for (QueryIndexLine line : lines) {
204
			String str = "";
205
			for (int f : line.getFreqs()) str+="\t"+f;
206

  
207
			output.write(line.getName()+"\t"+line.getQuery()+"\t"+line.getFrequency()+str+"\n");
208
			output.flush();
209
			monitor.worked(delta);
210
		}
211
		output.close();
212
		System.out.println("Result saved in "+resultFile);
213
	}
214
}
0 215

  
tmp/org.txm.cql2lsa.rcp/src/org/txm/rcp/commands/function/ComputeValuesOfQuery.java (revision 673)
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.rcp.commands.function;
29

  
30
import java.io.File;
31

  
32
import org.eclipse.core.commands.AbstractHandler;
33
import org.eclipse.core.commands.ExecutionEvent;
34
import org.eclipse.core.commands.ExecutionException;
35
import org.eclipse.core.runtime.IProgressMonitor;
36
import org.eclipse.core.runtime.IStatus;
37
import org.eclipse.core.runtime.Status;
38
import org.eclipse.jface.dialogs.Dialog;
39
import org.eclipse.jface.viewers.IStructuredSelection;
40
import org.eclipse.swt.SWT;
41
import org.eclipse.swt.layout.GridData;
42
import org.eclipse.swt.layout.GridLayout;
43
import org.eclipse.swt.widgets.Composite;
44
import org.eclipse.swt.widgets.Control;
45
import org.eclipse.swt.widgets.Label;
46
import org.eclipse.swt.widgets.Shell;
47
import org.eclipse.swt.widgets.Spinner;
48
import org.eclipse.swt.widgets.Text;
49
import org.eclipse.ui.handlers.HandlerUtil;
50
import org.txm.functions.cql2lsa.ValuesOfQuery;
51
import org.txm.rcp.JobsTimer;
52
import org.txm.rcp.swt.widget.AssistedQueryWidget;
53
import org.txm.rcp.utils.JobHandler;
54
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
55
import org.txm.searchengine.cqp.corpus.Corpus;
56
import org.txm.searchengine.cqp.corpus.Property;
57
import org.txm.searchengine.cqp.corpus.query.Query;
58
import org.txm.utils.logger.Log;
59

  
60
/**
61
 * write result in file
62
 * @author mdecorde.
63
 */
64
public class ComputeValuesOfQuery extends AbstractHandler {
65

  
66
	/** The ID. */
67
	public static String ID = "org.txm.rcp.commands.function.ComputeQueryIndex"; //$NON-NLS-1$
68

  
69
	/** The selection. */
70
	private IStructuredSelection selection;
71
	
72
	/* (non-Javadoc)
73
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
74
	 */
75
	@Override
76
	public Object execute(ExecutionEvent event) throws ExecutionException {
77
		Log.info("Compute QueryIndex: start");
78
		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
79

  
80
		Object s = selection.getFirstElement();
81
		if (!(s instanceof Corpus)) return null;
82

  
83
		final Corpus corpus = (Corpus) s;
84
		
85
		CustomDialog dialog = new CustomDialog(HandlerUtil.getActiveShell(event), corpus);
86
		if (dialog.open() == Dialog.CANCEL) return null;
87
		final String sprop = dialog.getLemmaProperty();
88
		final int fmin = dialog.getFMin();
89
		final Query query = dialog.getQuery();
90
		
91
		System.out.println("Query="+query);
92
		System.out.println("Fmin="+fmin);
93
		System.out.println("Lemma property="+sprop);
94
		
95
		JobHandler jobhandler = new JobHandler("Compute Values for query '"+query+"'") {
96
			@Override
97
			protected IStatus run(IProgressMonitor monitor) {
98
				JobsTimer.start();
99
				try {
100
					Property prop = corpus.getProperty(sprop);
101
					ValuesOfQuery result = new ValuesOfQuery(corpus, query, prop, fmin);
102
					result.setCurrentMonitor(this);
103
					result.compute(new File(System.getProperty("user.home"), "lemma_queries.properties"));
104
				} catch (Exception e) {
105
					e.printStackTrace();
106
				}
107
				JobsTimer.stopAndPrint();
108
				return Status.OK_STATUS;
109
			}
110
		};
111
		jobhandler.schedule();
112
		
113
		
114
		
115
		return null;
116
	}
117
	
118
	class CustomDialog extends Dialog {
119

  
120
		Corpus corpus;
121
		Text lemmaField;
122
		Spinner spinner;
123
		AssistedQueryWidget w;
124
		int fmin = 10;
125
		String lemmaproperty = "frlemma";
126
		String q = "[frpos=\"N.*|ADJ|V.*\"  & frlemma!=\"@card@|être|avoir|faire|pouvoir|devoir|vouloir|falloir|aller|dire|savoir|c'.+|s'.+\"]";
127
		
128
		protected CustomDialog(Shell parentShell, Corpus corpus) {
129
			super(parentShell);
130
			this.corpus = corpus;
131
		}
132
		
133
		/* (non-Javadoc)
134
		 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
135
		 */
136
		@Override
137
		protected Control createDialogArea(Composite parent) {
138
			parent.setLayout(new GridLayout(2, false));
139
//			Label l = new Label(parent, SWT.NONE);
140
//			l.setText("Lemma property");
141
//			l.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false));
142
//			lemmaField = new Text(parent, SWT.BORDER);
143
//			lemmaField.setText(lemmaproperty);
144
			
145
			Label l = new Label(parent, SWT.NONE);
146
			l.setText("Query");
147
			l.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false));
148
			w = new AssistedQueryWidget(parent, SWT.NONE, corpus);
149
			w.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
150
			w.setText(q);
151
			
152
			l = new Label(parent, SWT.NONE);
153
			l.setText("Fmin");
154
			l.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false));
155
			spinner = new Spinner(parent, SWT.BORDER);
156
			try {
157
				spinner.setMaximum(corpus.getSize());
158
			} catch (CqiClientException e) {
159
				// TODO Auto-generated catch block
160
				e.printStackTrace();
161
			}
162
			spinner.setMinimum(0);
163
			spinner.setSelection(fmin);
164

  
165
			return parent;
166
		}
167
		
168
		public void okPressed() {
169
			if (spinner != null)
170
				fmin = spinner.getSelection();
171
			if (w != null)
172
				q = w.getQueryString();
173
			if (lemmaField != null)
174
				lemmaproperty = lemmaField.getText();
175
			
176
			super.okPressed();
177
		}
178
		
179
		int getFMin() {
180
			return fmin;
181
		}
182
		
183
		String getLemmaProperty() {
184
			return lemmaproperty;
185
		}
186
		
187
		Query getQuery() {
188
			return new Query(q);
189
		}
190
	}
191
}
0 192

  
tmp/org.txm.cql2lsa.rcp/src/org/txm/rcp/commands/function/ComputeExpII.java (revision 673)
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.rcp.commands.function;
29

  
30
import java.io.File;
31

  
32
import org.eclipse.core.commands.AbstractHandler;
33
import org.eclipse.core.commands.ExecutionEvent;
34
import org.eclipse.core.commands.ExecutionException;
35
import org.eclipse.core.runtime.IProgressMonitor;
36
import org.eclipse.core.runtime.IStatus;
37
import org.eclipse.core.runtime.Status;
38
import org.eclipse.jface.viewers.IStructuredSelection;
39
import org.eclipse.swt.SWT;
40
import org.eclipse.swt.widgets.DirectoryDialog;
41
import org.eclipse.swt.widgets.FileDialog;
42
import org.eclipse.ui.handlers.HandlerUtil;
43
import org.txm.functions.cql2lsa.ExpII;
44
import org.txm.rcp.JobsTimer;
45
import org.txm.rcp.swt.dialog.LastOpened;
46
import org.txm.rcp.utils.JobHandler;
47
import org.txm.searchengine.cqp.corpus.Corpus;
48
import org.txm.utils.logger.Log;
49

  
50
/**
51
 * write result in file
52
 * @author mdecorde.
53
 */
54
public class ComputeExpII extends AbstractHandler {
55

  
56
	/** The ID. */
57
	public static String ID = "org.txm.rcp.commands.function.ComputeQueryIndex"; //$NON-NLS-1$
58

  
59
	/** The selection. */
60
	private IStructuredSelection selection;
61
	
62
	/* (non-Javadoc)
63
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
64
	 */
65
	@Override
66
	public Object execute(ExecutionEvent event) throws ExecutionException {
67
		Log.info("Compute ExpIIA");
68
		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
69

  
70
		Object s = selection.getFirstElement();
71
		if (!(s instanceof Corpus)) return null;
72
		
73
		final Corpus corpus = (Corpus) s;
74
		System.out.println("Select lemma queries property file");
75
		final File queriesFiles = getPropFile(event);
76
		if (queriesFiles == null) return Status.CANCEL_STATUS;
77
		System.out.println("Select keyword queries property file");
78
		final File keywordFiles = getPropFile(event);
79
		if (keywordFiles == null) return Status.CANCEL_STATUS;
80
		final File resultDirectory = new File(System.getProperty("user.home"));
81
		
82
		JobHandler jobhandler = new JobHandler("Compute ExpII") {
83
			@Override
84
			protected IStatus run(IProgressMonitor monitor) {
85
				JobsTimer.start();
86
				try {
87
					this.runInit(monitor);
88
					
89
					ExpII result = new ExpII(corpus);
90
					result.setCurrentMonitor(this);	
91
					result.compute(queriesFiles, keywordFiles, resultDirectory);
92
				} catch(Exception e) {
93
					Log.printStackTrace(e);
94
					return Status.CANCEL_STATUS;
95
				}
96
				JobsTimer.stopAndPrint();
97
				return Status.OK_STATUS;
98
			}
99
		};
100
		jobhandler.schedule();
101
		
102
		return null;
103
	}
104
	
105
	private File getResultDirectory(ExecutionEvent event) {
106
		File dir = null;
107
		if (LastOpened.getFile(ID) != null)
108
			dir = new File(LastOpened.getFolder(ID));
109

  
110
		DirectoryDialog dialog = new DirectoryDialog(HandlerUtil.getActiveShell(event), SWT.OPEN);
111
		if (dir != null) {
112
			dialog.setFilterPath(dir.getParent());
113
		}
114
		String path = dialog.open();
115
		if (path == null) return null;
116
		return new File(path);
117
	}
118

  
119
	public static File getPropFile(ExecutionEvent event) {
120
		File propFile = null;
121
		if (LastOpened.getFile(ID) != null)
122
			propFile = new File(LastOpened.getFolder(ID));
123

  
124
		FileDialog dialog = new FileDialog(HandlerUtil.getActiveShell(event), SWT.OPEN);
125
		
126
		String[] exts = { "*.properties" }; //$NON-NLS
127
		dialog.setFilterExtensions(exts);
128
		if (propFile != null) {
129
			dialog.setFilterPath(propFile.getParent());
130
			dialog.setFileName(propFile.getName());
131
		}
132
		String path = dialog.open();
133
		if (path == null) return null;
134
		return new File(path);
135
	}
136
}
0 137

  
tmp/org.txm.cql2lsa.rcp/src/org/txm/rcp/commands/function/CreateContextSubcorpus.java (revision 673)
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.rcp.commands.function;
29

  
30
import java.io.File;
31

  
32
import org.eclipse.core.commands.AbstractHandler;
33
import org.eclipse.core.commands.ExecutionEvent;
34
import org.eclipse.core.commands.ExecutionException;
35
import org.eclipse.core.runtime.IProgressMonitor;
36
import org.eclipse.core.runtime.IStatus;
37
import org.eclipse.core.runtime.Status;
38
import org.eclipse.jface.dialogs.Dialog;
39
import org.eclipse.jface.dialogs.IInputValidator;
40
import org.eclipse.jface.dialogs.InputDialog;
41
import org.eclipse.jface.viewers.IStructuredSelection;
42
import org.eclipse.swt.SWT;
43
import org.eclipse.swt.widgets.FileDialog;
44
import org.eclipse.ui.handlers.HandlerUtil;
45
import org.txm.functions.cql2lsa.ContextSubcorpus;
46
import org.txm.functions.cql2lsa.ExpII;
47
import org.txm.rcp.JobsTimer;
48
import org.txm.rcp.commands.RestartTXM;
49
import org.txm.rcp.swt.dialog.LastOpened;
50
import org.txm.rcp.utils.JobHandler;
51
import org.txm.rcp.views.corpora.CorporaView;
52
import org.txm.searchengine.cqp.corpus.Corpus;
53
import org.txm.searchengine.cqp.corpus.Subcorpus;
54
import org.txm.utils.logger.Log;
55

  
56
/**
57
 * write result in file
58
 * @author mdecorde.
59
 */
60
public class CreateContextSubcorpus extends AbstractHandler {
61

  
62
	/** The ID. */
63
	public static String ID = "org.txm.rcp.commands.function.ComputeQueryIndex"; //$NON-NLS-1$
64

  
65
	/** The selection. */
66
	private IStructuredSelection selection;
67
	
68
	/* (non-Javadoc)
69
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
70
	 */
71
	@Override
72
	public Object execute(ExecutionEvent event) throws ExecutionException {
73
		Log.info("Compute QueryIndex: start");
74
		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
75

  
76
		Object s = selection.getFirstElement();
77
		if (!(s instanceof Corpus)) return null;
78

  
79
	
80
		final Corpus corpus = (Corpus) s;
81
		IInputValidator validator = new IInputValidator() {
82
			@Override
83
			public String isValid(String newText) {
84
				try {
85
					Integer.parseInt(newText);
86
				} catch (Exception e) {
87
					return "Input string is malformed: '"+newText+"'";
88
				}
89
				return null;
90
			}
91
		};
92

  
93
		
94
		final File keywordFile = getPropFile(event);
95
		if (keywordFile == null) return null;
96
		
97
		InputDialog dialog = new InputDialog(HandlerUtil.getActiveShell(event), "Context size", "Enter the context size", "10", validator);
98
		if (dialog.open() == Dialog.CANCEL) return null;
99
		final int size = Math.max(Integer.parseInt(dialog.getValue()), 1);
100
		
101
		JobHandler jobhandler = new JobHandler("Compute ExpIIA") {
102
			@Override
103
			protected IStatus run(IProgressMonitor monitor) {
104
				JobsTimer.start();
105
				try {
106
					final ContextSubcorpus sub = new ContextSubcorpus(corpus, keywordFile, size);
107
					sub.setCurrentMonitor(this);
108
					sub.compute(this);
109
					Subcorpus subcorpus = sub.getSubcorpus();
110
					if (subcorpus != null) {
111
						syncExec(new Runnable() {
112
							@Override
113
							public void run() {
114
								CorporaView.refresh();
115
								CorporaView.expand(corpus);
116
							}
117
						});
118
					}
119
				} catch (Exception e) {
120
					e.printStackTrace();
121
				}
122
				JobsTimer.stopAndPrint();
123
				return Status.OK_STATUS;
124
			}
125
		};
126
		jobhandler.schedule();
127
		
128
		return null;
129
	}
130
	
131
	public static File getPropFile(ExecutionEvent event) {
132
		File propFile = null;
133
		if (LastOpened.getFile(ID) != null)
134
			propFile = new File(LastOpened.getFolder(ID));
135

  
136
		FileDialog dialog = new FileDialog(HandlerUtil.getActiveShell(event), SWT.OPEN);
137
		
138
		String[] exts = { "*.properties" }; //$NON-NLS
139
		dialog.setFilterExtensions(exts);
140
		if (propFile != null) {
141
			dialog.setFilterPath(propFile.getParent());
142
			dialog.setFileName(propFile.getName());
143
		}
144
		String path = dialog.open();
145
		if (path == null) return null;
146
		return new File(path);
147
	}
148
}
0 149

  
tmp/org.txm.cql2lsa.rcp/plugin.xml (revision 673)
5 5
 <extension
6 6
         point="org.eclipse.ui.commands">
7 7
          <command
8
                categoryId="org.txm.rcpapplication.category.txm"
9
                defaultHandler="org.txm.rcpapplication.commands.function.ComputeExpI"
10
                id="org.txm.rcpapplication.commands.function.ComputeQueryIndexOfTexts"
8
                categoryId="org.txm.rcp.category.txm"
9
                defaultHandler="org.txm.rcp.commands.function.ComputeExpI"
10
                id="org.txm.rcp.commands.function.ComputeQueryIndexOfTexts"
11 11
                name="QueryIndexOfTexts">
12 12
          </command>
13 13
          <command
14
                categoryId="org.txm.rcpapplication.category.txm"
15
                defaultHandler="org.txm.rcpapplication.commands.function.ComputeValuesOfQuery"
16
                id="org.txm.rcpapplication.commands.function.ComputeValuesOfQuery"
14
                categoryId="org.txm.rcp.category.txm"
15
                defaultHandler="org.txm.rcp.commands.function.ComputeValuesOfQuery"
16
                id="org.txm.rcp.commands.function.ComputeValuesOfQuery"
17 17
                name="ValuesOfQuery">
18 18
          </command>
19 19
          <command
20
                categoryId="org.txm.rcpapplication.category.txm"
21
                defaultHandler="org.txm.rcpapplication.commands.function.ComputeExpII"
22
                id="org.txm.rcpapplication.commands.function.ComputeExpIIA"
20
                categoryId="org.txm.rcp.category.txm"
21
                defaultHandler="org.txm.rcp.commands.function.ComputeExpII"
22
                id="org.txm.rcp.commands.function.ComputeExpIIA"
23 23
                name="ExpIIA">
24 24
          </command>
25 25
          <command
26
                categoryId="org.txm.rcpapplication.category.txm"
27
                defaultHandler="org.txm.rcpapplication.commands.function.CreateContextSubcorpus"
28
                id="org.txm.rcpapplication.commands.function.CreateQueriesContextSubcorpus"
26
                categoryId="org.txm.rcp.category.txm"
27
                defaultHandler="org.txm.rcp.commands.function.CreateContextSubcorpus"
28
                id="org.txm.rcp.commands.function.CreateQueriesContextSubcorpus"
29 29
                name="ContextSubcorpus">
30 30
          </command>
31 31
        </extension>
......
34 34
         point="org.eclipse.ui.menus">
35 35
      <menuContribution
36 36
            allPopups="false"
37
            locationURI="toolbar:org.txm.rcpapplication.toolbartools?before=org.txm.rcpapplication.separator1">
37
            locationURI="toolbar:org.txm.rcp.toolbartools?before=org.txm.rcp.separator1">
38 38
         <command
39
               commandId="org.txm.rcpapplication.commands.function.ComputeQueryIndexOfTexts"
39
               commandId="org.txm.rcp.commands.function.ComputeQueryIndexOfTexts"
40 40
               label="Exp I"
41 41
               style="push">
42 42
            <visibleWhen
......
49 49
            </visibleWhen>
50 50
         </command>
51 51
         <command
52
               commandId="org.txm.rcpapplication.commands.function.ComputeValuesOfQuery"
52
               commandId="org.txm.rcp.commands.function.ComputeValuesOfQuery"
53 53
               label="ValuesOfQuery"
54 54
               style="push">
55 55
            <visibleWhen
......
62 62
            </visibleWhen>
63 63
         </command>
64 64
         <command
65
               commandId="org.txm.rcpapplication.commands.function.CreateQueriesContextSubcorpus"
65
               commandId="org.txm.rcp.commands.function.CreateQueriesContextSubcorpus"
66 66
               label="ContextSubcorpus"
67 67
               style="push">
68 68
            <visibleWhen
......
75 75
            </visibleWhen>
76 76
         </command>
77 77
         <command
78
               commandId="org.txm.rcpapplication.commands.function.ComputeExpIIA"
78
               commandId="org.txm.rcp.commands.function.ComputeExpIIA"
79 79
               label="Exp II"
80 80
               style="push">
81 81
            <visibleWhen
......
90 90
      </menuContribution>
91 91
      <menuContribution
92 92
            allPopups="false"
93
            locationURI="popup:org.txm.rcpapplication.views.CorporaView">
93
            locationURI="popup:org.txm.rcp.views.CorporaView">
94 94
         <command
95
               commandId="org.txm.rcpapplication.commands.function.ComputeQueryIndexOfTexts"
95
               commandId="org.txm.rcp.commands.function.ComputeQueryIndexOfTexts"
96 96
               icon="icons/functions/QueryIndexOfTexts.png"
97 97
               style="push">
98 98
            <visibleWhen
......
108 108
      <menuContribution
109 109
            locationURI="menu:menu.tools">
110 110
         <command
111
               commandId="org.txm.rcpapplication.commands.function.ComputeQueryIndexOfTexts"
111
               commandId="org.txm.rcp.commands.function.ComputeQueryIndexOfTexts"
112 112
               icon="icons/functions/QueryIndexOfTexts.png"
113 113
               style="push">
114 114
            <visibleWhen
......
124 124
      <menuContribution
125 125
            locationURI="menu:menu.help.plugins">
126 126
         <command
127
               commandId="org.txm.rcpapplication.commands.OpenBrowser"
127
               commandId="org.txm.rcp.commands.OpenBrowser"
128 128
               label="CQL2LSA"
129 129
               style="push">
130 130
            <parameter
131
                  name="org.txm.rcpapplication.commands.commandParameter2"
131
                  name="org.txm.rcp.commands.commandParameter2"
132 132
                  value="https://groupes.renater.fr/wiki/txm-users/public/extensions#CQL2LSA">
133 133
            </parameter>
134 134
         </command>
tmp/org.txm.groovy.rcp/plugin.xml (revision 673)
16 16
            id="org.txm.groovy.rcp.views.SampleView">
17 17
      </view>
18 18
   </extension>
19
   <extension point="org.eclipse.ui.activities">  
20
   <activity
21
         description="should hide the groovy project button"
22
         id="myActivity"
23
         name="MenuHidingActivity">  
24
      <enabledWhen>  
25
         <with variable="activePartId">    
26
            <equals value="nonExistentPartId"></equals>      
27
         </with>
28
      </enabledWhen>
29
   </activity>
30
   <activityPatternBinding
31
         activityId="myActivity"
32
         isEqualityPattern="true"
33
         pattern="opengroovyprojectwizard">  
34
   </activityPatternBinding>
35
</extension>  
19 36
   <extension
20 37
         point="org.eclipse.ui.perspectiveExtensions">
21 38
      <perspectiveExtension
tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/BrowserVersionMacro.groovy (revision 673)
6 6
import org.eclipse.ui.browser.*
7 7
import org.eclipse.ui.internal.browser.*
8 8
import org.eclipse.ui.internal.browser.browsers.MozillaBrowser.*
9
import org.txm.rcpapplication.commands.*
9
import org.txm.rcp.commands.*
10 10

  
11 11
b = PlatformUI.getWorkbench().getBrowserSupport().createBrowser(IWorkbenchBrowserSupport.LOCATION_BAR | IWorkbenchBrowserSupport.NAVIGATION_BAR | IWorkbenchBrowserSupport.STATUS, 'iname', 'name', 'longName')
12 12

  
tmp/org.txm.groovy.core/src/groovy/org/txm/macro/office/SetOfficeMacro.groovy (revision 673)
3 3

  
4 4
import org.kohsuke.args4j.*
5 5
import groovy.transform.Field
6
import org.txm.rcpapplication.swt.widget.parameters.*
6
import org.txm.rcp.swt.widget.parameters.*
7 7

  
8 8
// BEGINNING OF PARAMETERS
9 9

  
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/i18n/ExternalizerUI.groovy (revision 673)
22 22
		super(new FlowLayout());
23 23
		File userDir = new File(System.getProperty("user.home"))
24 24
		File srcDir = new File(userDir, "workspace43/org.txm.rcp/src/main/java")
25
		File propFile = new File(srcDir, "org/txm/rcpapplication/messages.properties")
26
		File messageFile = new File(srcDir, "org/txm/rcpapplication/Messages.java")
25
		File propFile = new File(srcDir, "org/txm/rcp/messages.properties")
26
		File messageFile = new File(srcDir, "org/txm/rcp/Messages.java")
27 27

  
28 28
		println userDir
29 29
		println srcDir
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/i18n/FixExternalizedDuplicatedStrings.groovy (revision 673)
10 10
class FixExternalizedDuplicatedStrings {
11 11
	
12 12
	static main(args) {
13
//		File propertyFile = new File("/home/mdecorde/Bureau/Experiences/rcpapplication/messages.properties");
14
//		File messageClass = new File("/home/mdecorde/Bureau/Experiences/rcpapplication/Messages.java");
15
//		File srcdirectory = new File("/home/mdecorde/Bureau/Experiences/rcpapplication");
16
		File propertyFile = new File("/home/mdecorde/workspace37/org.txm.rcp/src/main/java/org/txm/rcpapplication/messages.properties");
17
		File messageClass = new File("/home/mdecorde/workspace37/org.txm.rcp/src/main/java/org/txm/rcpapplication/Messages.java");
18
		File srcdirectory = new File("/home/mdecorde/workspace37/org.txm.rcp/src/main/java/org/txm/rcpapplication");
13
//		File propertyFile = new File("/home/mdecorde/Bureau/Experiences/rcp/messages.properties");
14
//		File messageClass = new File("/home/mdecorde/Bureau/Experiences/rcp/Messages.java");
15
//		File srcdirectory = new File("/home/mdecorde/Bureau/Experiences/rcp");
16
		File propertyFile = new File("/home/mdecorde/workspace37/org.txm.rcp/src/main/java/org/txm/rcp/messages.properties");
17
		File messageClass = new File("/home/mdecorde/workspace37/org.txm.rcp/src/main/java/org/txm/rcp/Messages.java");
18
		File srcdirectory = new File("/home/mdecorde/workspace37/org.txm.rcp/src/main/java/org/txm/rcp");
19 19
		if (!(propertyFile.exists() && propertyFile.canRead() && propertyFile.canWrite() && propertyFile.isFile())) {
20 20
			println "error file : "+propertyFile
21 21
			return
tmp/org.txm.groovy.core/src/groovy/org/txm/setup/FixFeaturePluginDeclaration.groovy (revision 673)
7 7

  
8 8
String home = System.getProperty("user.home")
9 9
File rcpSrc = new File(home, "workspace441/org.txm.rcp")
10
File productFile = new File(rcpSrc, "rcpapplication.product")
10
File productFile = new File(rcpSrc, "rcp.product")
11 11

  
12 12
//File dir = new File("/home/mdecorde/ECLIPSE/babel/babel-kepler/features/org.eclipse.babel.nls_eclipse_ru_4.3.0.v20131123020001")
13 13
File dir = new File("/home/matthieu/ECLIPSE/eclipse_babel/features/org.eclipse.babel.nls_eclipse_ru_4.4.0.v20150804100819")
tmp/org.txm.groovy.core/src/groovy/org/txm/setup/BuildFeatureFromProduct.groovy (revision 673)
5 5
String home = System.getProperty("user.home")
6 6
File rcpSrc = new File(home, "workspace43/org.txm.rcp")
7 7
File rcpFeatureSrc = new File(home, "workspace43/org.txm.rcp.feature")
8
File productFile = new File(rcpSrc, "rcpapplication.product")
8
File productFile = new File(rcpSrc, "rcp.product")
9 9
File featureFile = new File(rcpFeatureSrc, "feature.xml")
10 10
//File featureFileBackUp = new File(rcpFeatureSrc, "feature_back.xml")
11 11

  
tmp/org.txm.groovy.core/src/groovy/org/txm/setup/BuildSplashVersion.groovy (revision 673)
14 14
int img_width = 316;
15 15

  
16 16
File rcpDir = new File(System.getProperty("user.home"), "workspace442/org.txm.rcp")
17
File product = new File(rcpDir, "rcpapplication.product");
17
File product = new File(rcpDir, "rcp.product");
18 18
File imgFile = new File(rcpDir, "splash_sansversion.bmp");
19 19
File imgFile2 = new File(rcpDir,"splash.bmp");
20 20

  
tmp/org.txm.dictionary.rcp/src/org/txm/macro/frolex/LGerm2CLDMFTSVMacro.groovy (revision 673)
18 18

  
19 19
import org.kohsuke.args4j.*
20 20
import groovy.transform.Field
21
import org.txm.rcpapplication.swt.widget.parameters.*
21
import org.txm.rcp.swt.widget.parameters.*
22 22

  
23 23
// PARAMETERS
24 24
@Field @Option(name="workingDirectory", usage="workingDirectory containing all files needed", widget="Folder", required=true, def="dir")
tmp/org.txm.dictionary.rcp/src/org/txm/macro/frolex/DMFSite2CLDMFTSVMacro.groovy (revision 673)
14 14

  
15 15
import org.kohsuke.args4j.*
16 16
import groovy.transform.Field
17
import org.txm.rcpapplication.swt.widget.parameters.*
17
import org.txm.rcp.swt.widget.parameters.*
18 18

  
19 19
// PARAMETERS
20 20
@Field @Option(name="workingDirectory", usage="workingDirectory containing all files needed", widget="Folder", required=true, def="dir")
tmp/org.txm.dictionary.rcp/src/org/txm/macro/frolex/MergeCLDMFLEXSMacro.groovy (revision 673)
13 13

  
14 14
import org.kohsuke.args4j.*
15 15
import groovy.transform.Field
16
import org.txm.rcpapplication.swt.widget.parameters.*
16
import org.txm.rcp.swt.widget.parameters.*
17 17

  
18 18
// PARAMETERS
19 19
@Field @Option(name="workingDirectory", usage="workingDirectory containing all files needed", widget="Folder", required=true, def="dir")
tmp/org.txm.dictionary.rcp/src/org/txm/macro/frolex/CreateFrolexMacro.groovy (revision 673)
11 11

  
12 12
import org.kohsuke.args4j.*
13 13
import groovy.transform.Field
14
import org.txm.rcpapplication.swt.widget.parameters.*
14
import org.txm.rcp.swt.widget.parameters.*
15 15

  
16 16
import org.txm.Toolbox
17 17
import org.txm.dictionary.functions.sql.Dictionary
tmp/org.txm.dictionary.rcp/plugin.xml (revision 673)
4 4
   <extension
5 5
         point="org.eclipse.ui.commands">
6 6
      <command
7
            categoryId="org.txm.rcpapplication.category.txm"
7
            categoryId="org.txm.rcp.category.txm"
8 8
            defaultHandler="org.txm.dictionary.commands.ExportDictionary"
9 9
            id="org.txm.dictionary.commands.ExportDictionary"
10 10
            name="Export">
11 11
      </command>
12 12
      <command
13
            categoryId="org.txm.rcpapplication.category.txm"
13
            categoryId="org.txm.rcp.category.txm"
14 14
            defaultHandler="org.txm.dictionary.commands.ImportDictionary"
15 15
            id="org.txm.dictionary.commands.ImportDictionary"
16 16
            name="Import from a TSV file">
17 17
      </command>
18 18
      <command
19
            categoryId="org.txm.rcpapplication.category.txm"
19
            categoryId="org.txm.rcp.category.txm"
20 20
            defaultHandler="org.txm.dictionary.commands.CreateDictionaryFromIndex"
21 21
            id="org.txm.dictionary.commands.CreateDictionaryFromIndex"
22 22
            name="Import from Index">
23 23
      </command>
24 24
      <command
25
            categoryId="org.txm.rcpapplication.category.txm"
25
            categoryId="org.txm.rcp.category.txm"
26 26
            defaultHandler="org.txm.dictionary.commands.PrintDictionary"
27 27
            id="org.txm.dictionary.commands.PrintDictionary"
28 28
            name="Print">
29 29
      </command>
30 30
      <command
31
            categoryId="org.txm.rcpapplication.category.txm"
31
            categoryId="org.txm.rcp.category.txm"
32 32
            defaultHandler="org.txm.dictionary.commands.ListDictionaries"
33 33
            id="org.txm.dictionary.commands.ListDictionaries"
34 34
            name="List">
35 35
      </command>
36 36
      <command
37
            categoryId="org.txm.rcpapplication.category.txm"
37
            categoryId="org.txm.rcp.category.txm"
38 38
            defaultHandler="org.txm.dictionary.commands.RenameColumnDictionary"
39 39
            id="org.txm.dictionary.commands.RenameColumnDictionary"
40 40
            name="Rename column">
41 41
      </command>
42 42
      <command
43
            categoryId="org.txm.rcpapplication.category.txm"
43
            categoryId="org.txm.rcp.category.txm"
44 44
            defaultHandler="org.txm.dictionary.commands.RecodeColumnDictionary"
45 45
            id="org.txm.dictionary.commands.RecodeColumnDictionary"
46 46
            name="Recode column">
47 47
      </command>
48 48
      <command
49
            categoryId="org.txm.rcpapplication.category.txm"
49
            categoryId="org.txm.rcp.category.txm"
50 50
            defaultHandler="org.txm.dictionary.commands.ExportToTreeTagger"
51 51
            id="org.txm.dictionary.commands.MergeLinesDictionary"
52 52
            name="Merge lines">
53 53
      </command>
54 54
      <command
55
            categoryId="org.txm.rcpapplication.category.txm"
55
            categoryId="org.txm.rcp.category.txm"
56 56
            defaultHandler="org.txm.dictionary.commands.RemoveEntriesDictionary"
57 57
            id="org.txm.dictionary.commands.RemoveEntriesDictionary"
58 58
            name="RemoveEntries">
59 59
      </command>
60 60
      <command
61
            categoryId="org.txm.rcpapplication.category.txm"
61
            categoryId="org.txm.rcp.category.txm"
62 62
            defaultHandler="org.txm.dictionary.commands.MergeDictionaries"
63 63
            id="org.txm.dictionary.commands.MergeDictionaries"
64 64
            name="Merge">
65 65
      </command>
66 66
      <command
67
            categoryId="org.txm.rcpapplication.category.txm"
67
            categoryId="org.txm.rcp.category.txm"
68 68
            defaultHandler="org.txm.dictionary.commands.CopyDictionaries"
69 69
            id="org.txm.dictionary.commands.CopyDictionaries"
70 70
            name="Copy">
71 71
      </command>
72 72
      <command
73
            categoryId="org.txm.rcpapplication.category.txm"
73
            categoryId="org.txm.rcp.category.txm"
74 74
            defaultHandler="org.txm.macro.frolex.CreateFrolexMacro"
75 75
            id="org.txm.dictionary.commands.recettes.CreateFrolex"
76 76
            name="CreateFroLex">
77 77
      </command>
78 78
      <command
79
            categoryId="org.txm.rcpapplication.category.txm"
79
            categoryId="org.txm.rcp.category.txm"
80 80
            defaultHandler="org.txm.dictionary.commands.UniqSortDictionary"
81 81
            id="org.txm.dictionary.commands.UniqSortDictionary"
82 82
            name="UniqSort">
83 83
      </command>
84 84
      <command
85
            categoryId="org.txm.rcpapplication.category.txm"
85
            categoryId="org.txm.rcp.category.txm"
86 86
            defaultHandler="org.txm.dictionary.commands.QueryDictionary"
87 87
            id="org.txm.dictionary.commands.QueryDictionary"
88 88
            name="Query">
89 89
      </command>
90 90
      <command
91
            categoryId="org.txm.rcpapplication.category.txm"
91
            categoryId="org.txm.rcp.category.txm"
92 92
            defaultHandler="org.txm.dictionary.commands.GrepDictionary"
93 93
            id="org.txm.dictionary.commands.GrepDictionary"
94 94
            name="Grep">
95 95
      </command>
96 96
      <command
97
            categoryId="org.txm.rcpapplication.category.txm"
97
            categoryId="org.txm.rcp.category.txm"
98 98
            defaultHandler="org.txm.dictionary.commands.AddColumnDictionary"
99 99
            id="org.txm.dictionary.commands.AddColumnDictionary"
100 100
            name="Add column">
101 101
      </command>
102 102
      <command
103
            categoryId="org.txm.rcpapplication.category.txm"
103
            categoryId="org.txm.rcp.category.txm"
104 104
            defaultHandler="org.txm.dictionary.commands.DeleteDictionary"
105 105
            id="org.txm.dictionary.commands.DeleteDictionary"
106 106
            name="Delete">
tmp/org.txm.svn.rcp/plugin.xml (revision 673)
6 6
      <menuContribution
7 7
            locationURI="menu:menu.help.plugins">
8 8
         <command
9
               commandId="org.txm.rcpapplication.commands.OpenBrowser"
9
               commandId="org.txm.rcp.commands.OpenBrowser"
10 10
               label="%command.label"
11 11
               style="push">
12 12
            <parameter
13
                  name="org.txm.rcpapplication.commands.commandParameter2"
13
                  name="org.txm.rcp.commands.commandParameter2"
14 14
                  value="https://groupes.renater.fr/wiki/txm-users/public/extensions#environnement_svn">
15 15
            </parameter>
16 16
         </command>
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff