Révision 399

tmp/org.txm.partition.core/META-INF/MANIFEST.MF (revision 399)
3 3
Bundle-Name: Partition Core
4 4
Bundle-SymbolicName: org.txm.partition.core;singleton:=true
5 5
Bundle-Version: 1.0.0.qualifier
6
Require-Bundle: org.txm.core;bundle-version="0.7.0",
6
Require-Bundle: org.txm.chartsengine.core,
7
 org.txm.core;bundle-version="0.7.0",
7 8
 org.eclipse.core.runtime,
8
 org.txm.chartsengine.core,
9 9
 org.txm.chartsengine.jfreechart.core;bundle-version="1.0.0",
10 10
 org.txm.chartsengine.r.core;bundle-version="1.0.0",
11 11
 org.txm.lexicaltable.core;bundle-version="1.0.0"
tmp/org.txm.concordance.rcp/plugin.xml (revision 399)
1 1
<?xml version="1.0" encoding="UTF-8"?>
2 2
<?eclipse version="3.4"?>
3 3
<plugin>
4
  <extension-point id="org.txm.rcp.extensionpoint.backtotext" name="Back to text" schema="schema/org.txm.rcp.extensionpoint.backtotext.exsd"/>
5

  
4 6
   <extension
5 7
         point="org.eclipse.core.runtime.adapters">
6 8
      <factory
tmp/org.txm.concordance.rcp/META-INF/MANIFEST.MF (revision 399)
5 5
Bundle-Version: 1.0.0.qualifier
6 6
Bundle-Vendor: Textometrie.org
7 7
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
8
Require-Bundle: org.txm.concordance.core,
8
Require-Bundle: org.txm.searchengine.cqp.core;bundle-version="1.1.0",
9
 org.txm.concordance.core,
9 10
 org.txm.rcp,
10 11
 org.eclipse.ui;bundle-version="3.106.1",
11 12
 org.eclipse.core.runtime;bundle-version="3.10.0",
12 13
 org.eclipse.core.expressions;bundle-version="3.4.600",
13 14
 org.txm.core,
14
 org.txm.para.rcp
15
 org.txm.para.rcp,
16
 org.txm.searchengine.core;bundle-version="1.0.0"
15 17
Export-Package: org.txm.concordance.rcp.adapters,
16 18
 org.txm.concordance.rcp.editors,
17 19
 org.txm.concordance.rcp.handlers,
tmp/org.txm.concordance.rcp/schema/org.txm.rcp.extensionpoint.backtotext.exsd (revision 399)
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.txm.rcp" xmlns="http://www.w3.org/2001/XMLSchema">
4
<annotation>
5
      <appinfo>
6
         <meta.schema plugin="org.txm.rcp" id="org.txm.rcp.extensionpoint.backtotext" name="Back to text"/>
7
      </appinfo>
8
      <documentation>
9
         Called from the concordance editor to open an edition using the selected concordance line.
10
      </documentation>
11
   </annotation>
12

  
13
   <element name="extension">
14
      <annotation>
15
         <appinfo>
16
            <meta.element />
17
         </appinfo>
18
      </annotation>
19
      <complexType>
20
         <choice minOccurs="1" maxOccurs="unbounded">
21
            <element ref="command"/>
22
         </choice>
23
         <attribute name="point" type="string" use="required">
24
            <annotation>
25
               <documentation>
26
                  
27
               </documentation>
28
            </annotation>
29
         </attribute>
30
         <attribute name="id" type="string">
31
            <annotation>
32
               <documentation>
33
                  
34
               </documentation>
35
            </annotation>
36
         </attribute>
37
         <attribute name="name" type="string">
38
            <annotation>
39
               <documentation>
40
                  
41
               </documentation>
42
               <appinfo>
43
                  <meta.attribute translatable="true"/>
44
               </appinfo>
45
            </annotation>
46
         </attribute>
47
      </complexType>
48
   </element>
49

  
50
   <element name="command">
51
      <complexType>
52
         <attribute name="class" type="string">
53
            <annotation>
54
               <documentation>
55
                  
56
               </documentation>
57
               <appinfo>
58
                  <meta.attribute kind="java" basedOn="org.txm.concordance.rcp.handlers.BackToTextCommand:"/>
59
               </appinfo>
60
            </annotation>
61
         </attribute>
62
         <attribute name="name" type="string">
63
            <annotation>
64
               <documentation>
65
                  
66
               </documentation>
67
            </annotation>
68
         </attribute>
69
      </complexType>
70
   </element>
71

  
72
   <annotation>
73
      <appinfo>
74
         <meta.section type="since"/>
75
      </appinfo>
76
      <documentation>
77
         [Enter the first release in which this extension point appears.]
78
      </documentation>
79
   </annotation>
80

  
81
   <annotation>
82
      <appinfo>
83
         <meta.section type="examples"/>
84
      </appinfo>
85
      <documentation>
86
         [Enter extension point usage example here.]
87
      </documentation>
88
   </annotation>
89

  
90
   <annotation>
91
      <appinfo>
92
         <meta.section type="apiinfo"/>
93
      </appinfo>
94
      <documentation>
95
         [Enter API information here.]
96
      </documentation>
97
   </annotation>
98

  
99
   <annotation>
100
      <appinfo>
101
         <meta.section type="implementation"/>
102
      </appinfo>
103
      <documentation>
104
         [Enter information about supplied implementation of this extension point.]
105
      </documentation>
106
   </annotation>
107

  
108

  
109
</schema>
0 110

  
tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineViewReferencePattern.java (revision 399)
47 47
import org.eclipse.ui.IWorkbenchWindow;
48 48
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
49 49
import org.txm.concordance.rcp.editors.ConcordanceEditor;
50
import org.txm.functions.ReferencePattern;
51 50
import org.txm.para.rcp.editors.ParaBrowserEditor;
52 51
import org.txm.rcp.Messages;
52
import org.txm.searchengine.cqp.ReferencePattern;
53 53
import org.txm.searchengine.cqp.corpus.Property;
54 54
import org.txm.searchengine.cqp.corpus.StructuralUnit;
55 55
import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineSortReferencePattern.java (revision 399)
47 47
import org.eclipse.ui.IWorkbenchWindow;
48 48
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
49 49
import org.txm.concordance.rcp.editors.ConcordanceEditor;
50
import org.txm.functions.ReferencePattern;
51 50
import org.txm.para.rcp.editors.ParaBrowserEditor;
52 51
import org.txm.rcp.Messages;
52
import org.txm.searchengine.cqp.ReferencePattern;
53 53
import org.txm.searchengine.cqp.corpus.Property;
54 54
import org.txm.searchengine.cqp.corpus.StructuralUnit;
55 55
import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/handlers/ComputeConcordance.java (revision 399)
41 41
import org.eclipse.osgi.util.NLS;
42 42
import org.eclipse.ui.IEditorPart;
43 43
import org.eclipse.ui.PartInitException;
44
import org.txm.Toolbox;
45 44
import org.txm.concordance.core.functions.Concordance;
46 45
import org.txm.concordance.rcp.editors.ConcordanceEditorInput;
47
import org.txm.cooccurrence.rcp.editors.CooccurrenceEditorInput;
48 46
import org.txm.rcp.Messages;
49 47
import org.txm.rcp.StatusLine;
50 48
import org.txm.rcp.TXMWindows;
51 49
import org.txm.rcp.handlers.BaseAbstractHandler;
52 50
import org.txm.rcp.views.corpora.CorporaView;
51
import org.txm.searchengine.cqp.CQPEngine;
53 52
import org.txm.searchengine.cqp.corpus.Corpus;
54 53

  
55 54
/**
......
87 86

  
88 87
	@Inject
89 88
	public static boolean openEditor(Corpus corpus) {
90
		if (!Toolbox.isSearchEngineInitialized()) return false;
89
		if (!CQPEngine.isInitialized()) return false;
91 90
		
92 91
		ConcordanceEditorInput editorInput = new ConcordanceEditorInput(corpus, null);
93 92

  
tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java (revision 399)
129 129
import org.txm.cooccurrence.rcp.messages.CooccurrenceUIMessages;
130 130
import org.txm.core.messages.TXMCoreMessages;
131 131
import org.txm.core.preferences.TXMPreferences;
132
import org.txm.functions.ReferencePattern;
133 132
import org.txm.objects.Page;
134 133
import org.txm.rcp.IImageKeys;
135 134
import org.txm.rcp.JobsTimer;
......
156 155
import org.txm.rcp.views.QueriesView;
157 156
import org.txm.rcp.views.corpora.CorporaView;
158 157
import org.txm.rcp.views.knowledgerepositories.KRView;
158
import org.txm.searchengine.cqp.CQPEngine;
159
import org.txm.searchengine.cqp.ReferencePattern;
159 160
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
160 161
import org.txm.searchengine.cqp.corpus.Corpus;
161 162
import org.txm.searchengine.cqp.corpus.Property;
......
449 450
		} catch (CqiClientException e) {
450 451
			//System.err.println(Messages.CorporaView_3+" : "+Log.toString(e)); //$NON-NLS-1$
451 452
			try {
452
				System.out.println(Messages.ConcordancesEditor_0+Toolbox.getCqiClient().getLastCQPError());
453
				Log.severe(Messages.ConcordancesEditor_0+Toolbox.getCqiClient().getLastCQPError());
453
				System.out.println(Messages.ConcordancesEditor_0+CQPEngine.getCqiClient().getLastCQPError());
454
				Log.severe(Messages.ConcordancesEditor_0+CQPEngine.getCqiClient().getLastCQPError());
454 455
			} catch (Exception e1) {
455 456
				org.txm.rcp.utils.Logger.printStackTrace(e1);
456 457
				Log.severe("Error while computing concordance: "+e.getLocalizedMessage());
......
2034 2035
			//System.err.println(Messages.CorporaView_3);
2035 2036
			org.txm.rcp.utils.Logger.printStackTrace(e1);
2036 2037
			try {
2037
				System.out.println(Messages.LastCQPError+Toolbox.getCqiClient().getLastCQPError());
2038
				Log.severe(Messages.LastCQPError+Toolbox.getCqiClient().getLastCQPError());
2038
				System.out.println(Messages.LastCQPError+CQPEngine.getCqiClient().getLastCQPError());
2039
				Log.severe(Messages.LastCQPError+CQPEngine.getCqiClient().getLastCQPError());
2039 2040
			} catch (Exception e2) {
2040 2041
				System.out.println(Messages.ConcordancesEditor_7+e2);
2041 2042
				org.txm.rcp.utils.Logger.printStackTrace(e1);
tmp/org.txm.chartsengine.core/META-INF/MANIFEST.MF (revision 399)
3 3
Bundle-Name: Charts Engine Core
4 4
Bundle-SymbolicName: org.txm.chartsengine.core;singleton:=true
5 5
Bundle-Version: 1.0.0.qualifier
6
Require-Bundle: org.txm.utils,
7
 org.txm.core;bundle-version="0.7.0",
8
 org.eclipse.core.runtime
6
Require-Bundle: org.txm.utils;visibility:=reexport,
7
 org.txm.core;bundle-version="0.7.0";visibility:=reexport,
8
 org.eclipse.core.runtime;visibility:=reexport
9 9
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
10 10
Bundle-ActivationPolicy: lazy
11 11
Export-Package: org.txm.chartsengine.core,
tmp/org.txm.statsengine.r.rcp/META-INF/MANIFEST.MF (revision 399)
9 9
 org.txm.core;bundle-version="0.7.0",
10 10
 org.eclipse.core.runtime;bundle-version="3.10.0",
11 11
 org.eclipse.ui;bundle-version="3.106.1",
12
 org.txm.rcp;bundle-version="0.7.8"
12
 org.txm.rcp;bundle-version="0.7.8",
13
 org.txm.searchengine.core;bundle-version="1.0.0",
14
 org.txm.searchengine.cqp.core;bundle-version="1.1.0"
13 15
Export-Package: org.txm.statsengine.r.rcp.handlers,
14 16
 org.txm.statsengine.r.rcp.messages,
15 17
 org.txm.statsengine.r.rcp.perspectives,
tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RConsole.java (revision 399)
37 37
import org.eclipse.ui.IWorkbenchWindow;
38 38
import org.eclipse.ui.PlatformUI;
39 39
import org.eclipse.ui.part.ViewPart;
40
import org.txm.EngineType;
40 41
import org.txm.Toolbox;
42
import org.txm.Toolbox;
41 43
import org.txm.rcp.IImageKeys;
42 44
import org.txm.rcp.Messages;
43 45
import org.txm.statsengine.r.core.RWorkspace;
......
227 229
	}
228 230
	
229 231
	public void connectToRWorkspace() {
230
		if (!readyToDisplay && Toolbox.isStatEngineInitialized()) {
232
		if (!readyToDisplay && Toolbox.getEngineManager(EngineType.STAT).getEngine("R").getState()) {
231 233
			RWorkspace rw = null;
232 234
			Log.warning(Messages.RConsole_0);
233 235
			try {
tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/CheckRPackages.java (revision 399)
15 15
import org.rosuda.REngine.REXPInteger;
16 16
import org.rosuda.REngine.REXPMismatchException;
17 17
import org.rosuda.REngine.RList;
18
import org.txm.EngineType;
18 19
import org.txm.Toolbox;
20
import org.txm.Toolbox;
19 21
import org.txm.core.preferences.TBXPreferences;
20 22
import org.txm.core.preferences.TXMPreferences;
21 23
import org.txm.rcp.handlers.BaseAbstractHandler;
......
90 92
		else if (Util.isLinux()) method = "wget"; //$NON-NLS-1$
91 93
		
92 94
		boolean ret = true;
93
		if (Toolbox.isStatEngineInitialized()) {
95
		if (Toolbox.getEngineManager(EngineType.STAT).getEngine("R").getState()) {
94 96
			RWorkspace rw = null;
95 97
			try {
96 98
				rw = RWorkspace.getRWorkspaceInstance();
tmp/org.txm.para.core/src/org/txm/para/functions/ParallelContexts.java (revision 399)
11 11

  
12 12
import org.txm.Toolbox;
13 13
import org.txm.searchengine.cqp.AbstractCqiClient;
14
import org.txm.searchengine.cqp.CQPEngine;
14 15
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
15 16
import org.txm.searchengine.cqp.corpus.Corpus;
16 17
import org.txm.searchengine.cqp.corpus.CorpusManager;
......
68 69

  
69 70
				StructuralUnitProperty align_id = corpus.getStructuralUnit(struct).getProperty(structprop);
70 71
				System.out.println("struct: "+struct+" prop: "+structprop+" -> "+align_id);
71
				int[] struct_pos = Toolbox.getCqiClient().cpos2Struc(align_id.getQualifiedName(), positions);
72
				String[] struct_ids = Toolbox.getCqiClient().struc2Str(align_id.getQualifiedName(), struct_pos);
72
				int[] struct_pos = CQPEngine.getCqiClient().cpos2Struc(align_id.getQualifiedName(), positions);
73
				String[] struct_ids = CQPEngine.getCqiClient().struc2Str(align_id.getQualifiedName(), struct_pos);
73 74

  
74 75
				// fill allsegments
75 76
				for (int i = 0 ; i < struct_ids.length ; i++) {
......
164 165
				// get the seg that actually are in the corpus
165 166
				QueryResult resul2t = corpus.query(new Query(segquery), "TMP", true);
166 167
				int[] struct_starts = resul2t.getStarts();
167
				int[] struct_pos = Toolbox.getCqiClient().cpos2Struc(align_id.getQualifiedName(), struct_starts);
168
				String[] struct_ids = Toolbox.getCqiClient().struc2Str(align_id.getQualifiedName(), struct_pos);
168
				int[] struct_pos = CQPEngine.getCqiClient().cpos2Struc(align_id.getQualifiedName(), struct_starts);
169
				String[] struct_ids = CQPEngine.getCqiClient().struc2Str(align_id.getQualifiedName(), struct_pos);
169 170

  
170 171
				//System.out.println("segs: "+Arrays.toString(struct_ids));
171 172

  
172 173
				// get ref if asked
173 174
				String[] ref_values = null;
174 175
				if (ref != null) {
175
					int[] struct_pos2 = Toolbox.getCqiClient().cpos2Struc(ref.getQualifiedName(), struct_starts);
176
					ref_values = Toolbox.getCqiClient().struc2Str(ref.getQualifiedName(), struct_pos2);
176
					int[] struct_pos2 = CQPEngine.getCqiClient().cpos2Struc(ref.getQualifiedName(), struct_starts);
177
					ref_values = CQPEngine.getCqiClient().struc2Str(ref.getQualifiedName(), struct_pos2);
177 178
				}
178 179
				//System.out.println("ref values: "+Arrays.toString(ref_values));
179 180

  
tmp/org.txm.para.core/src/org/txm/para/functions/ParaBrowser.java (revision 399)
7 7
import java.util.Map;
8 8

  
9 9
import org.txm.core.results.TXMResult;
10
import org.txm.functions.ReferencePattern;
11 10
import org.txm.searchengine.cqp.CqpDataProxy;
11
import org.txm.searchengine.cqp.ReferencePattern;
12 12
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
13 13
import org.txm.searchengine.cqp.corpus.MainCorpus;
14 14
import org.txm.searchengine.cqp.corpus.Property;
tmp/org.txm.para.core/META-INF/MANIFEST.MF (revision 399)
4 4
Bundle-SymbolicName: org.txm.para.core
5 5
Bundle-Version: 1.0.0.qualifier
6 6
Bundle-Activator: org.txm.para.core.Activator
7
Require-Bundle: org.txm.core;bundle-version="0.7.0",
7
Require-Bundle: org.txm.searchengine.cqp.core;bundle-version="1.1.0",
8
 org.txm.core;bundle-version="0.7.0",
8 9
 org.eclipse.ui,
9
 org.eclipse.core.runtime
10
 org.eclipse.core.runtime,
11
 org.txm.searchengine.core;bundle-version="1.0.0"
10 12
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
11 13
Bundle-ActivationPolicy: lazy
12 14
Export-Package: org.txm.para.core,
tmp/org.txm.ca.core/META-INF/MANIFEST.MF (revision 399)
11 11
 org.txm.chartsengine.jfreechart.core;bundle-version="1.0.0",
12 12
 org.txm.lexicaltable.core,
13 13
 org.txm.statsengine.r.core;bundle-version="1.0.0",
14
 org.txm.statsengine.r.rcp;bundle-version="1.0.0"
14
 org.txm.searchengine.core;bundle-version="1.0.0",
15
 org.txm.searchengine.cqp.core;bundle-version="1.1.0"
15 16
Export-Package: org.txm.ca.core.chartsengine.base,
16 17
 org.txm.ca.core.chartsengine.jfreechart.datasets,
17 18
 org.txm.ca.core.chartsengine.jfreechart.themes.highcharts.chartcreators,
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RStatsEngine.java (revision 399)
3 3
import java.io.IOException;
4 4

  
5 5
import org.txm.core.preferences.TXMPreferences;
6
import org.txm.statsengine.core.StatEngine;
6 7
import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
7 8
import org.txm.statsengine.r.core.messages.RCoreMessages;
8 9
import org.txm.statsengine.r.core.preferences.RPreferences;
......
16 17
 * @author sjacquot
17 18
 *
18 19
 */
19
public class RStatsEngine {
20
public class RStatsEngine extends StatEngine {
20 21

  
21 22
	
22 23
	/** The state of the stats engine. */
......
26 27
	private static boolean mandatory = false;
27 28

  
28 29
	
29
	private RStatsEngine() {
30
	public RStatsEngine() {
30 31
		// no instantiation
31 32
	}
32 33

  
......
36 37
	 *
37 38
	 * @return true, if successful
38 39
	 */
39
	public static boolean start() {
40
	public boolean start() {
40 41
		try {
41 42
			
42 43
			if (TXMPreferences.getBoolean(RPreferences.PREFERENCES_NODE, RPreferences.DISABLE)) {
......
44 45
				return false;
45 46
			}
46 47
			
47
			Log.warning("Starting Statistics Engine.");
48

  
49 48
			// try launching R server and connecting to it
50 49
			int port = TXMPreferences.getInt(RPreferences.PREFERENCES_NODE, RPreferences.PORT);
51 50
			String user = TXMPreferences.getString(RPreferences.PREFERENCES_NODE, RPreferences.USER);
......
53 52
			boolean remote = TXMPreferences.getBoolean(RPreferences.PREFERENCES_NODE, RPreferences.REMOTE);
54 53
			boolean debug = TXMPreferences.getBoolean(RPreferences.PREFERENCES_NODE, RPreferences.DEBUG);
55 54
			mandatory = TXMPreferences.getBoolean(RPreferences.PREFERENCES_NODE, RPreferences.IS_MANDATORY);
56

  
57 55
			
58 56
			Log.info(RCoreMessages.log_startingStatsEngine + user + RCoreMessages.log_remote + remote + RCoreMessages.log_port + port + RCoreMessages.log_debug + debug);
59 57
			// System.out.println("test remote :" + R_PATH_TO_EXECUTABLE + ":" + properties.getProperty(R_PATH_TO_EXECUTABLE));
......
178 176
	public static boolean isMandatory() {
179 177
		return mandatory;
180 178
	}
179

  
180

  
181
	@Override
182
	public boolean getState() {
183
		return started;
184
	}
185

  
186

  
187
	@Override
188
	public boolean initialize() {
189
		return true;
190
	}
191

  
192

  
193
	@Override
194
	public boolean stop() {
195
		kill();
196
		return true;
197
	}
198

  
199

  
200
	@Override
201
	public String getName() {
202
		return "R";
203
	}
181 204
	
182 205
}
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RWorkspace.java (revision 399)
47 47
import org.rosuda.REngine.REngineException;
48 48
import org.rosuda.REngine.Rserve.RConnection;
49 49
import org.rosuda.REngine.Rserve.RserveException;
50
import org.txm.statsengine.core.StatEngine;
50 51
import org.txm.statsengine.core.StatException;
51 52
import org.txm.statsengine.core.data.QuantitativeDataStructure;
52 53
import org.txm.statsengine.core.messages.StatsEngineCoreMessages;
......
1526 1527

  
1527 1528
		if (exp.endsWith(";")) //$NON-NLS-1$
1528 1529
			exp = exp.substring(0, exp.length()-1);
1529

  
1530
		//		String trybegin = "try("; //$NON-NLS-1$
1531
		//		String tryend = ")"; //$NON-NLS-1$
1532

  
1530
		
1533 1531
		try {
1534 1532
			safeEval(exp);
1535 1533
		} catch (RserveException e) {
......
1550 1548
	public void loadPackage(String p) throws RWorkspaceException {
1551 1549
		this.eval("library(\""+p+"\")"); //$NON-NLS-1$ //$NON-NLS-2$
1552 1550
	}
1553

  
1554 1551
}
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/StartRserve.java (revision 399)
72 72
				&& new File(cmd).canExecute())
73 73
			return launchRserve(cmd,
74 74
					"--no-save --slave --encoding utf8 "+rArgs, "--RS-encoding utf8 --no-save --slave --encoding utf8 "+rServeArgs, port, debug); //$NON-NLS-1$ //$NON-NLS-2$
75
		return false;
75
		return checkLocalRserve(port, debug, rArgs, rServeArgs);
76 76
	}
77 77

  
78 78
	/**
......
225 225

  
226 226
		// R not in the PATH env, try with R common paths
227 227
		String[] paths = {
228
				"/usr/lib/TXM/R/bin/R", //$NON-NLS-1$
229
				"/Applications/TXM/R/bin/R", //$NON-NLS-1$
228 230
				"/Library/Frameworks/R.framework/Resources/bin/R", //$NON-NLS-1$
229 231
				"/usr/local/lib/R/bin/R", //$NON-NLS-1$
230 232
				"/usr/lib/R/bin/R", //$NON-NLS-1$
tmp/org.txm.statsengine.r.core/plugin.xml (revision 399)
7 7
            class="org.txm.statsengine.r.core.preferences.RPreferences">
8 8
      </initializer>
9 9
   </extension>
10
   <extension
11
         point="org.txm.statsengine.core.StatEngine">
12
      <StatEngine
13
            class="org.txm.statsengine.r.core.RStatsEngine"></StatEngine>
14
   </extension>
10 15

  
11 16
</plugin>
tmp/org.txm.cah.rcp/META-INF/MANIFEST.MF (revision 399)
18 18
 org.eclipse.core.runtime;bundle-version="3.10.0",
19 19
 org.txm.ca.core,
20 20
 org.txm.lexicaltable.rcp;bundle-version="1.0.0",
21
 org.eclipse.core.expressions;bundle-version="3.4.600"
21
 org.eclipse.core.expressions;bundle-version="3.4.600",
22
 org.txm.searchengine.core;bundle-version="1.0.0",
23
 org.txm.searchengine.cqp.core;bundle-version="1.1.0"
22 24
Bundle-Vendor: Textometrie.org
tmp/CQP.linux/META-INF/MANIFEST.MF (revision 399)
1 1
Manifest-Version: 1.0
2 2
Bundle-ManifestVersion: 2
3 3
Bundle-Name: CQP.linux
4
Bundle-SymbolicName: CQP.linux
4
Bundle-SymbolicName: org.txm.libs.cqp.linux
5 5
Bundle-Version: 1.1.0.qualifier
6
Fragment-Host: CQP;bundle-version="1.0.0"
6
Fragment-Host: org.txm.libs.cqp;bundle-version="1.0.0.qualifier"
7 7
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
8 8
Bundle-Vendor: Textometrie.org
9 9
Eclipse-PlatformFilter: (osgi.os=linux)
tmp/CQP.linux/.project (revision 399)
1 1
<?xml version="1.0" encoding="UTF-8"?>
2 2
<projectDescription>
3
	<name>CQP.linux</name>
3
	<name>org.txm.libs.cqp.linux</name>
4 4
	<comment></comment>
5 5
	<projects>
6 6
	</projects>
tmp/org.txm.rcp/plugin.xml (revision 399)
2 2
<?eclipse version="3.4"?>
3 3
<plugin>
4 4
   <extension-point id="org.txm.rcp.extentionpoint.command" name="%extension-point.name" schema="schema/org.txm.rcp.extentionpoint.command.exsd"/>
5
   <extension-point id="org.txm.rcp.extensionpoint.backtotext" name="Back to text" schema="schema/org.txm.rcp.extensionpoint.backtotext.exsd"/>
6

  
5
 
7 6
   <extension
8 7
         id="Application"
9 8
         point="org.eclipse.core.runtime.applications">
......
1163 1162
               id="menu.tools"
1164 1163
               label="%menu.label.6">
1165 1164
            
1166
            <command
1167
                  commandId="org.txm.rcp.commands.function.ComputeReferencer"
1168
                  icon="icons/functions/Referencer.png"
1169
                  label="%command.label.108"
1170
                  style="push"
1171
                  tooltip="%command.tooltip.62">
1172
               <visibleWhen
1173
                     checkEnabled="false">
1174
                  <reference
1175
                        definitionId="OneCorpusSelected">
1176
                  </reference>
1177
               </visibleWhen>
1178
            </command>
1179 1165
            <separator
1180 1166
                  name="menu.tools.stats"
1181 1167
                  visible="true">
......
1678 1664
         </separator>
1679 1665
         <toolbar
1680 1666
               id="org.txm.rcp.toolbartools">
1681
            <command
1682
                  commandId="org.txm.rcp.commands.function.ComputeReferencer"
1683
                  icon="icons/functions/Referencer.png"
1684
                  label="%command.label.108"
1685
                  style="push"
1686
                  tooltip="%command.tooltip.63">
1687
               <visibleWhen
1688
                     checkEnabled="false">
1689
                  <reference
1690
                        definitionId="OneCorpusSelected">
1691
                  </reference>
1692
               </visibleWhen>
1693
            </command>
1667

  
1694 1668
            <separator
1695 1669
                  name="org.txm.rcp.separator4"
1696 1670
                  visible="true">
......
2389 2363
               name="org.txm.rcp.separator53"
2390 2364
               visible="true">
2391 2365
         </separator>
2392
         <command
2393
               commandId="org.txm.rcp.commands.function.ComputeReferencer"
2394
               icon="icons/functions/Referencer.png"
2395
               label="%command.label.108"
2396
               style="push"
2397
               tooltip="%command.tooltip.62">
2398
            <visibleWhen
2399
                  checkEnabled="false">
2400
               <reference
2401
                     definitionId="OneCorpusSelected">
2402
               </reference>
2403
            </visibleWhen>
2404
         </command>
2366

  
2405 2367
         <separator
2406 2368
               name="org.txm.rcp.separator54"
2407 2369
               visible="true">
......
2550 2512
         </command>
2551 2513
      </menuContribution>
2552 2514
      <menuContribution
2553
            locationURI="popup:org.txm.rcp.editors.referencer.ReferencerEditor">
2554
         <command
2555
               commandId="org.txm.rcp.commands.link.ReferencerToConc"
2556
               label="%command.label.73"
2557
               style="push">
2558
         </command>
2559
      </menuContribution>
2560
      <menuContribution
2561 2515
            locationURI="popup:org.txm.rcp.views.QueriesView">
2562 2516
         <command
2563 2517
               commandId="org.txm.rcp.commands.queryview.Copy"
......
2891 2845
            id="org.txm.rcp.commands.changelanguage"
2892 2846
            name="%command.name.31">
2893 2847
      </command>
2894
      
2848
            
2895 2849
      <command
2896
            defaultHandler="org.txm.rcp.commands.editor.DeleteLines"
2897
            id="org.txm.rcp.commands.editor.DeleteLines"
2898
            name="%command.name.37">
2899
      </command>
2900
      
2901
      <command
2902 2850
            defaultHandler="org.txm.rcp.commands.CreateFile"
2903 2851
            id="org.txm.rcp.commands.CreateFile"
2904 2852
            name="%command.name.47">
......
2908 2856
            id="org.txm.rcp.commands.CreateFolder"
2909 2857
            name="%command.name.48">
2910 2858
      </command>
2911
      
2859

  
2912 2860
      <command
2913
            defaultHandler="org.txm.rcp.commands.OpenTXMUserPreferences"
2914
            id="org.txm.rcp.commands.OpenTXMUserPreferences"
2915
            name="%command.name.51">
2916
      </command>
2917
      <command
2918 2861
            defaultHandler="org.txm.rcp.commands.base.ExportCorpus"
2919 2862
            id="org.txm.rcp.commands.base.ExportCorpus"
2920 2863
            name="%command.name.52">
......
3158 3101
            name="%command.name.85">
3159 3102
      </command>
3160 3103
      <command
3161
            categoryId="org.txm.rcp.category.txm"
3162
            defaultHandler="org.txm.rcp.commands.function.ComputeReferencer"
3163
            id="org.txm.rcp.commands.function.ComputeReferencer"
3164
            name="%command.name.44">
3165
      </command>
3166
      <command
3167 3104
            defaultHandler="org.txm.rcp.commands.function.ExportResult"
3168 3105
            id="org.txm.rcp.commands.function.ExportResult"
3169 3106
            name="%command.name.24">
......
3207 3144
            name="%command.name.43">
3208 3145
      </command>
3209 3146
      <command
3210
            defaultHandler="org.txm.rcp.commands.link.ReferencerToConc"
3211
            id="org.txm.rcp.commands.link.ReferencerToConc"
3212
            name="%command.name.57">
3213
      </command>
3214
      <command
3215 3147
            defaultHandler="org.txm.rcp.commands.link.LexiconToIndex"
3216 3148
            id="org.txm.rcp.commands.link.LexiconToIndex"
3217 3149
            name="%command.label.128">
tmp/org.txm.rcp/schema/org.txm.rcp.extensionpoint.backtotext.exsd (revision 399)
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.txm.rcp" xmlns="http://www.w3.org/2001/XMLSchema">
4
<annotation>
5
      <appinfo>
6
         <meta.schema plugin="org.txm.rcp" id="org.txm.rcp.extensionpoint.backtotext" name="Back to text"/>
7
      </appinfo>
8
      <documentation>
9
         Called from the concordance editor to open an edition using the selected concordance line.
10
      </documentation>
11
   </annotation>
12

  
13
   <element name="extension">
14
      <annotation>
15
         <appinfo>
16
            <meta.element />
17
         </appinfo>
18
      </annotation>
19
      <complexType>
20
         <choice minOccurs="1" maxOccurs="unbounded">
21
            <element ref="command"/>
22
         </choice>
23
         <attribute name="point" type="string" use="required">
24
            <annotation>
25
               <documentation>
26
                  
27
               </documentation>
28
            </annotation>
29
         </attribute>
30
         <attribute name="id" type="string">
31
            <annotation>
32
               <documentation>
33
                  
34
               </documentation>
35
            </annotation>
36
         </attribute>
37
         <attribute name="name" type="string">
38
            <annotation>
39
               <documentation>
40
                  
41
               </documentation>
42
               <appinfo>
43
                  <meta.attribute translatable="true"/>
44
               </appinfo>
45
            </annotation>
46
         </attribute>
47
      </complexType>
48
   </element>
49

  
50
   <element name="command">
51
      <complexType>
52
         <attribute name="class" type="string">
53
            <annotation>
54
               <documentation>
55
                  
56
               </documentation>
57
               <appinfo>
58
                  <meta.attribute kind="java" basedOn="org.txm.rcp.commands.BackToTextCommand:"/>
59
               </appinfo>
60
            </annotation>
61
         </attribute>
62
         <attribute name="name" type="string">
63
            <annotation>
64
               <documentation>
65
                  
66
               </documentation>
67
            </annotation>
68
         </attribute>
69
      </complexType>
70
   </element>
71

  
72
   <annotation>
73
      <appinfo>
74
         <meta.section type="since"/>
75
      </appinfo>
76
      <documentation>
77
         [Enter the first release in which this extension point appears.]
78
      </documentation>
79
   </annotation>
80

  
81
   <annotation>
82
      <appinfo>
83
         <meta.section type="examples"/>
84
      </appinfo>
85
      <documentation>
86
         [Enter extension point usage example here.]
87
      </documentation>
88
   </annotation>
89

  
90
   <annotation>
91
      <appinfo>
92
         <meta.section type="apiinfo"/>
93
      </appinfo>
94
      <documentation>
95
         [Enter API information here.]
96
      </documentation>
97
   </annotation>
98

  
99
   <annotation>
100
      <appinfo>
101
         <meta.section type="implementation"/>
102
      </appinfo>
103
      <documentation>
104
         [Enter information about supplied implementation of this extension point.]
105
      </documentation>
106
   </annotation>
107

  
108

  
109
</schema>
tmp/org.txm.rcp/META-INF/MANIFEST.MF (revision 399)
92 92
 org.txm.partition.rcp;bundle-version="1.0.0",
93 93
 org.txm.groovy.core;bundle-version="1.0.0",
94 94
 org.txm.concordance.rcp,
95
 org.txm.referencer.rcp
95
 org.txm.referencer.rcp,
96
 org.txm.searchengine.cqp.core,
97
 org.txm.searchengine.core,
98
 org.txm.annotation.core;bundle-version="1.0.0",
99
 org.txm.chartsengine.jfreechart.rcp;bundle-version="1.0.0",
100
 org.txm.chartsengine.r.rcp;bundle-version="1.0.0",
101
 org.txm.chartsengine.raster.rcp;bundle-version="1.0.0",
102
 org.txm.libs.cqp;bundle-version="1.0.0",
103
 org.txm.links.rcp;bundle-version="1.0.0"
96 104
Bundle-ActivationPolicy: lazy
97 105
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
98 106
Export-Package: junit.extensions,
tmp/org.txm.rcp/src/main/java/org/txm/rcp/TXMCqpServerWatcher.java (revision 399)
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;
29

  
30
import org.eclipse.jface.dialogs.MessageDialog;
31
import org.eclipse.swt.widgets.Display;
32
import org.txm.CqpServerWatcher;
33
import org.txm.rcp.views.corpora.CorporaView;
34

  
35
// TODO: Auto-generated Javadoc
36
/**
37
 * Watch if CQP is running
38
 */
39
@Deprecated
40
public class TXMCqpServerWatcher extends CqpServerWatcher{
41
	
42
	/** The parent. */
43
	private Display parent;
44

  
45
	/**
46
	 * Instantiates a new tXM cqp server watcher.
47
	 *
48
	 * @param parent the parent
49
	 */
50
	TXMCqpServerWatcher(Display parent)
51
	{
52
		this.parent = parent;
53
	}
54
	
55
	/* (non-Javadoc)
56
	 * @see org.txm.CqpServerWatcher#restart()
57
	 */
58
	@Override
59
	public boolean restart()
60
	{
61
		parent.syncExec(new Runnable(){
62
		      @Override
63
			public void run(){
64
		    	  MessageDialog d =
65
					    new MessageDialog(
66
					      parent.getActiveShell(),
67
					      Messages.TXMCqpServerWatcher_0,
68
					      null,
69
					      Messages.TXMCqpServerWatcher_1,
70
					      MessageDialog.ERROR,
71
					      new String[] { Messages.TXMRServeWatcher_2 },
72
					      0);
73
					    d.open();
74
		      }
75
		    });
76
		
77
		boolean ret = super.restart();
78
		
79
		if (ret)
80
		{
81
			parent.syncExec(new Runnable(){
82
			      @Override
83
				public void run(){
84
			    	  CorporaView.reload();
85
			      }
86
			    });
87
		}
88
		
89
		return ret;
90
	}
91
}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/testers/ToolboxTester.java (revision 399)
1 1
package org.txm.rcp.testers;
2 2

  
3 3
import org.eclipse.core.expressions.PropertyTester;
4
import org.txm.EngineType;
4 5
import org.txm.Toolbox;
6
import org.txm.Toolbox;
7
import org.txm.searchengine.cqp.CQPEngine;
5 8

  
6 9
/**
7 10
 * PropertyTester to check Toolbox states
......
24 27
	public boolean test(Object receiver, String property, Object[] args,
25 28
			Object expectedValue) {
26 29
		if (PROPERTY_STATE_ENGINE_READY.equals(property)) {
27
			System.out.println("TEST: "+property+" = "+Toolbox.isStatEngineInitialized()); //$NON-NLS-1$ //$NON-NLS-2$
28
			return Toolbox.isStatEngineInitialized();
30
			//System.out.println("TEST: "+property+" = "+Toolbox.getEngineManager(EngineType.STAT).getEngine("R").getState()); //$NON-NLS-1$ //$NON-NLS-2$
31
			return Toolbox.getEngineManager(EngineType.STAT).getEngine("R").getState();
29 32
		} else if (PROPERTY_SEARCH_ENGINE_READY.equals(property)) {
30
			System.out.println("TEST: "+property+" = "+Toolbox.isSearchEngineInitialized()); //$NON-NLS-1$ //$NON-NLS-2$
31
			return Toolbox.isSearchEngineInitialized();
33
			System.out.println("TEST: "+property+" = "+CQPEngine.isInitialized()); //$NON-NLS-1$ //$NON-NLS-2$
34
			return CQPEngine.isInitialized();
32 35
		}
33 36
		
34 37
		return false;
tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/TXMResultContentProvider.java (revision 399)
37 37
import org.eclipse.jface.viewers.ITreeContentProvider;
38 38
import org.eclipse.jface.viewers.Viewer;
39 39
import org.eclipse.ui.model.IWorkbenchAdapter;
40
import org.txm.core.results.ITXMResult;
40 41
import org.txm.objects.Base;
41 42
import org.txm.objects.Project;
43
import org.txm.searchengine.cqp.corpus.Corpus;
42 44
import org.txm.searchengine.cqp.corpus.MainCorpus;
43 45

  
44 46
/**
......
100 102
			Project p = (Project) element;
101 103
			
102 104
			for (Base b : p.getBases()) {
103
				elements.addAll(b.getCorpora().values());
105
				for (ITXMResult o : b.getResults(MainCorpus.class)) {
106
					elements.add((MainCorpus)o);
107
				}
104 108
			}
105 109
			//System.out.println("get elements: "+elements);
106 110
			Collections.sort(elements, new Comparator<MainCorpus>() {
......
112 116
					return o1.getName().compareTo(o2.getName());
113 117
				}
114 118
			});
119
			//System.out.println("corpora view content: "+elements);
115 120
			return elements.toArray();
116 121
		}
117 122
		return new Object[0];
tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java (revision 399)
27 27
//
28 28
package org.txm.rcp.views.corpora;
29 29

  
30
import java.util.ArrayList;
30 31
import java.util.List;
31 32

  
32 33
import org.eclipse.core.runtime.IProgressMonitor;
......
51 52
import org.eclipse.swt.widgets.Display;
52 53
import org.eclipse.swt.widgets.Menu;
53 54
import org.eclipse.swt.widgets.TreeItem;
54
import org.eclipse.ui.IEditorInput;
55 55
import org.eclipse.ui.IEditorPart;
56 56
import org.eclipse.ui.IEditorReference;
57 57
import org.eclipse.ui.IWorkbenchPage;
......
62 62
import org.eclipse.ui.internal.Workbench;
63 63
import org.eclipse.ui.part.ViewPart;
64 64
import org.txm.Toolbox;
65
import org.txm.ca.core.functions.CA;
66
import org.txm.cah.core.functions.CAH;
67
import org.txm.concordance.core.functions.Concordance;
68
import org.txm.concordance.rcp.editors.ConcordanceEditorInput;
69
import org.txm.cooccurrence.core.functions.Cooccurrence;
70 65
import org.txm.core.results.ITXMResult;
71 66
import org.txm.core.results.TXMResult;
72 67
import org.txm.functions.Function;
73 68
import org.txm.functions.internal.InternalView;
74 69
//import org.txm.functions.queryindex.QueryIndex;
75 70
import org.txm.functions.referencer.Referencer;
76
import org.txm.index.core.functions.Index;
77
import org.txm.index.rcp.editors.IndexEditorInput;
78
import org.txm.lexicon.core.corpusengine.cqp.Lexicon;
79 71
import org.txm.objects.Project;
80 72
import org.txm.objects.Workspace;
81
import org.txm.rcp.editors.TXMEditorPart;
82 73
import org.txm.rcp.Messages;
83 74
import org.txm.rcp.StatusLine;
84 75
import org.txm.rcp.commands.base.DeleteObject;
85 76
import org.txm.rcp.commands.editor.CustomizableEditor;
77
import org.txm.rcp.editors.TXMEditorPart;
86 78
import org.txm.rcp.editors.input.InternalViewEditorInput;
87 79
import org.txm.rcp.editors.input.ReferencerEditorInput;
88 80
import org.txm.rcp.editors.internal.InternalViewEditor;
......
92 84
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
93 85
import org.txm.searchengine.cqp.corpus.Corpus;
94 86
import org.txm.searchengine.cqp.corpus.MainCorpus;
95
import org.txm.searchengine.cqp.corpus.Partition;
96
import org.txm.specificities.core.functions.SpecificitesResult;
97 87
import org.txm.utils.logger.Log;
98 88
// TODO: Auto-generated Javadoc
99 89
/**
......
148 138
	 * Reload.
149 139
	 */
150 140
	public static void reload() {
141
		//System.out.println("Reload corpora view");
151 142
		CorporaView corporaView = getInstance();
152 143
		if (corporaView != null)
153 144
			corporaView._reload();
......
158 149
	 */
159 150
	public void _reload() {
160 151
		if (Toolbox.isInitialized()) {
152
			//System.out.println("__Reload corpora view");
161 153
			treeViewer.setContentProvider(new TXMResultContentProvider());
162 154
			//treeViewer.setLabelProvider(new TextometrieLabelProvider());
163 155
			treeViewer.setLabelProvider(
......
482 474
	}
483 475

  
484 476

  
485
	public static void select(List<MainCorpus> values) {
477
	public static void select(ArrayList<?> arrayList) {
486 478
		CorporaView corporaView = openView();
487 479
		if (corporaView != null) {
488
			StructuredSelection selection = new StructuredSelection(values);
480
			StructuredSelection selection = new StructuredSelection(arrayList);
489 481
			corporaView.getTreeViewer().setSelection(selection, true);
490
			corporaView.getTreeViewer().reveal(values); // to be sure
482
			corporaView.getTreeViewer().reveal(arrayList); // to be sure
491 483
		}
492 484
	}
493 485

  
tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/BasesView.java (revision 399)
269 269
			} else if (element instanceof Project) {
270 270
				return ((Project) element).getBases().toArray();
271 271
			} else if (element instanceof Base) {
272
				return ((Base) element).getCorpora().values().toArray();
272
				return ((Base) element).getResults(MainCorpus.class).toArray();
273 273
			} else if (element instanceof MainCorpus) {
274 274
				return ((Corpus) element).getTexts().toArray();
275 275
			} else if (element instanceof Text) {
......
317 317
			} else if (element instanceof Project) {
318 318
				return !((Project) element).getBases().isEmpty();
319 319
			} else if (element instanceof Base) {
320
				return !((Base) element).getCorpora().values().isEmpty();
320
				return !((Base) element).getResults(MainCorpus.class).isEmpty();
321 321
			} else if (element instanceof Corpus) {
322 322
				return !((Corpus) element).getTexts().isEmpty();
323 323
			} else if (element instanceof Text) {
tmp/org.txm.rcp/src/main/java/org/txm/rcp/actions/GetConcordancesDialog.java (revision 399)
48 48
import org.eclipse.swt.widgets.Shell;
49 49
import org.eclipse.swt.widgets.Spinner;
50 50
import org.eclipse.swt.widgets.Text;
51
import org.txm.functions.ReferencePattern;
52 51
import org.txm.rcp.Messages;
52
import org.txm.searchengine.cqp.ReferencePattern;
53 53
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
54 54
import org.txm.searchengine.cqp.corpus.Corpus;
55 55
import org.txm.searchengine.cqp.corpus.Property;
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/base/CreateSubCorpus.java (revision 399)
45 45
import org.txm.rcp.actions.CreateSubcorpusDialog;
46 46
import org.txm.rcp.utils.JobHandler;
47 47
import org.txm.rcp.views.corpora.CorporaView;
48
import org.txm.searchengine.cqp.CQPEngine;
48 49
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
49 50
import org.txm.searchengine.cqp.corpus.Corpus;
50 51
import org.txm.searchengine.cqp.corpus.Subcorpus;
......
146 147
						Log.severe(e.toString());
147 148
						
148 149
						try {
149
							System.out.println(Messages.LastCQPError+Toolbox.getCqiClient().getLastCQPError());
150
							System.out.println(Messages.LastCQPError+CQPEngine.getCqiClient().getLastCQPError());
150 151
						} catch (Exception e1) {
151 152
							System.out.println(Messages.CreateSubCorpus_2+e1);
152 153
							org.txm.rcp.utils.Logger.printStackTrace(e1);
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/base/DeleteObject.java (revision 399)
49 49
import org.eclipse.ui.IWorkbenchWindow;
50 50
import org.eclipse.ui.handlers.HandlerUtil;
51 51
import org.eclipse.ui.internal.Workbench;
52
import org.txm.EngineType;
53
import org.txm.Toolbox;
52 54
import org.txm.concordance.core.functions.Concordance;
53 55
import org.txm.core.preferences.TXMPreferences;
54 56
import org.txm.core.results.ITXMResult;
......
178 180
			
179 181
			if (shouldRestartToolbox) {
180 182
				org.txm.Toolbox.restartWorkspace();
181
				org.txm.Toolbox.restartSearchEngine();
183
				Toolbox.getEngineManager(EngineType.SEARCH).restartEngines();
182 184
				
183 185
				System.err.println(Messages.AddBase_10);
184 186
				StatusLine.setMessage(Messages.AddBase_10);
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/function/ComputeReferencer.java (revision 399)
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 org.eclipse.core.commands.AbstractHandler;
31
import org.eclipse.core.commands.ExecutionEvent;
32
import org.eclipse.core.commands.ExecutionException;
33
import org.eclipse.jface.viewers.IStructuredSelection;
34
import org.eclipse.ui.IWorkbenchPage;
35
import org.eclipse.ui.IWorkbenchWindow;
36
import org.eclipse.ui.PartInitException;
37
import org.eclipse.ui.handlers.HandlerUtil;
38
import org.txm.Toolbox;
39
import org.txm.rcp.Messages;
40
import org.txm.rcp.StatusLine;
41
import org.txm.rcp.TXMWindows;
42
import org.txm.rcp.editors.input.ReferencerEditorInput;
43
import org.txm.searchengine.cqp.corpus.Corpus;
44

  
45
// TODO: Auto-generated Javadoc
46
/**
47
 * Open the concordance editor @ author mdecorde.
48
 */
49
public class ComputeReferencer extends AbstractHandler {
50

  
51
	/* (non-Javadoc)
52
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
53
	 */
54
	@Override
55
	public Object execute(ExecutionEvent event) throws ExecutionException {
56
		if (!Toolbox.isSearchEngineInitialized()) return false;
57
		
58
		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
59

  
60
		Object s = selection.getFirstElement();
61
		if (!(s instanceof Corpus))
62
			return null;
63
		
64
		final Corpus corpus = (Corpus) s;
65
		openEditor(corpus);
66
		return null;
67
	}
68

  
69
	public static boolean openEditor(Corpus corpus) {
70
		if (!Toolbox.isSearchEngineInitialized()) return false;
71
		
72
		ReferencerEditorInput editorInput = new ReferencerEditorInput(corpus, null);
73

  
74
		IWorkbenchWindow window = TXMWindows.getActiveWindow();
75
		IWorkbenchPage page = window.getActivePage();
76
		try {
77
			StatusLine.setMessage(Messages.ComputeReferencer_0);
78
			page.openEditor(editorInput,"org.txm.rcp.editors.referencer.ReferencerEditor"); //$NON-NLS-1$
79
			return true;
80
		} catch (PartInitException e) {
81
			System.err.println(Messages.CorporaView_6+ e);
82
		}
83
		return false;
84
	}
85
}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/function/ComputeDiagnostic.java (revision 399)
52 52
import org.txm.rcp.preferences.RCPPreferences;
53 53
import org.txm.rcp.utils.JobHandler;
54 54
import org.txm.searchengine.cqp.AbstractCqiClient;
55
import org.txm.searchengine.cqp.CQPEngine;
55 56
import org.txm.searchengine.cqp.NetCqiClient;
56 57
import org.txm.searchengine.cqp.corpus.Corpus;
57 58
import org.txm.searchengine.cqp.corpus.CorpusManager;
......
77 78
	 */
78 79
	@Override
79 80
	public Object execute(ExecutionEvent event) throws ExecutionException {
80
		if (!Toolbox.isSearchEngineInitialized()) return false;
81
		if (!CQPEngine.isInitialized()) return false;
81 82
		
82 83
		Object sel = HandlerUtil.getCurrentSelection(event);
83 84
		if (!(sel instanceof IStructuredSelection)) {
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/function/ComputeIntersection.java (revision 399)
13 13
import org.eclipse.ui.handlers.HandlerUtil;
14 14
import org.txm.Toolbox;
15 15
import org.txm.searchengine.cqp.AbstractCqiClient;
16
import org.txm.searchengine.cqp.CQPEngine;
16 17
import org.txm.searchengine.cqp.corpus.Corpus;
17 18
import org.txm.searchengine.cqp.corpus.CqpObject;
18 19
import org.txm.searchengine.cqp.corpus.MainCorpus;
......
57 58
		String id2 = subcorpora.get(1).getQualifiedCqpId();
58 59
		String cqpid = CqpObject.subcorpusNamePrefix + Corpus.getNextSubcorpusCounter();
59 60
		String command = "inter";
60
		AbstractCqiClient CQI = Toolbox.getCqiClient();
61
		AbstractCqiClient CQI = CQPEngine.getCqiClient();
61 62

  
62 63
		//TODO: finish the command
63 64
		
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/function/ComputeInternalView.java (revision 399)
9 9
import org.eclipse.ui.IWorkbenchWindow;
10 10
import org.eclipse.ui.PartInitException;
11 11
import org.eclipse.ui.handlers.HandlerUtil;
12
import org.txm.Toolbox;
13 12
import org.txm.rcp.Messages;
14 13
import org.txm.rcp.StatusLine;
15 14
import org.txm.rcp.editors.input.InternalViewEditorInput;
15
import org.txm.searchengine.cqp.CQPEngine;
16 16
import org.txm.searchengine.cqp.corpus.Corpus;
17 17
import org.txm.utils.logger.Log;
18 18

  
......
35 35
	@Override
36 36
	public Object execute(ExecutionEvent event) throws ExecutionException {
37 37
		
38
		if (!Toolbox.isSearchEngineInitialized()) return false;
38
		if (!CQPEngine.isInitialized()) return false;
39 39
		
40 40
		window = HandlerUtil.getActiveWorkbenchWindow(event);
41 41
		Object sel = HandlerUtil.getCurrentSelection(event);
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/TxmCommand.java (revision 399)
3 3
import org.eclipse.core.commands.AbstractHandler;
4 4
import org.eclipse.core.commands.ExecutionEvent;
5 5
import org.eclipse.core.commands.ExecutionException;
6
import org.txm.rcp.Messages;
7 6

  
8 7
public class TxmCommand extends AbstractHandler {
9 8

  
10
	protected String name = "noname"; //$NON-NLS-1$
11
	@Override
9
	protected String name = "noname"; //$NON-NLS-1$	@Override
12 10
	public Object execute(ExecutionEvent event) throws ExecutionException {
13
		// TODO Auto-generated method stub
14 11
		return null;
15 12
	}
16
	
17
	public void install()
18
	{
19
		System.out.println(Messages.TxmCommand_1+name);
20
	}
21
	
22
	public void preInstall()
23
	{
24
		System.out.println(Messages.TxmCommand_1+name);
25
	}
26 13
}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorpus.java (revision 399)
43 43
import org.eclipse.swt.widgets.FileDialog;
44 44
import org.eclipse.swt.widgets.Shell;
45 45
import org.eclipse.ui.handlers.HandlerUtil;
46
import org.txm.EngineType;
46 47
import org.txm.Toolbox;
48
import org.txm.Toolbox;
47 49
import org.txm.core.preferences.TBXPreferences;
48 50
import org.txm.objects.Base;
49 51
import org.txm.objects.Project;
......
54 56
import org.txm.rcp.swt.dialog.LastOpened;
55 57
import org.txm.rcp.utils.JobHandler;
56 58
import org.txm.rcp.views.corpora.CorporaView;
59
import org.txm.searchengine.cqp.corpus.Corpus;
57 60
import org.txm.searchengine.cqp.corpus.MainCorpus;
58 61
import org.txm.utils.DeleteDir;
59 62
import org.txm.utils.logger.Log;
......
115 118
				return;
116 119
			}
117 120
			org.txm.Toolbox.restartWorkspace();
118
			org.txm.Toolbox.restartSearchEngine();
119

  
121
			Toolbox.getEngineManager(EngineType.SEARCH).restartEngines();
120 122
		}
121 123
	}
122 124

  
......
207 209
					this.acquireSemaphore();
208 210
					//Toolbox.updateProperties(ApplicationWorkbenchAdvisor.getProperties());
209 211
					org.txm.Toolbox.restartWorkspace();
210
					org.txm.Toolbox.restartSearchEngine();
212
					Toolbox.getEngineManager(EngineType.SEARCH).restartEngines();
211 213
					this.releaseSemaphore();
212 214

  
213 215
					final Base base2 = Toolbox.workspace.getDefaultProject().getBase(base.getName()); //$NON-NLS-1$
......
247 249
						public void run() {
248 250
							RestartTXM.reloadViews();
249 251
							//System.out.println("Select newly loaded corpus: "+base2.getCorpora().values());
250
							CorporaView.select(new ArrayList<MainCorpus>(base2.getCorpora().values()));
252
							CorporaView.select(base2.getResults(MainCorpus.class));
251 253
							System.err.println(Messages.AddBase_10);
252 254
							StatusLine.setMessage(Messages.AddBase_10);
253 255
						}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/ConvertCorpus.java (revision 399)
12 12
import org.eclipse.swt.widgets.DirectoryDialog;
13 13
import org.eclipse.swt.widgets.Shell;
14 14
import org.eclipse.ui.handlers.HandlerUtil;
15
import org.txm.EngineType;
15 16
import org.txm.Toolbox;
17
import org.txm.Toolbox;
16 18
import org.txm.core.preferences.TBXPreferences;
17 19
import org.txm.importer.Convert5To6;
18 20
import org.txm.objects.Base;
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff