Revision 726

tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/messages/messages_ru.properties (revision 726)
1 1

  
2
error_unexpectedErrorInRStatisticsEngine = Неожиданная ошибка в статистической машине R : {0}
3

  
2 4
info_tryingToStartRWithRPath = 
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/messages/messages_fr.properties (revision 726)
3 3
error_connectionFailed                    = ** La connexion au moteur statistique a échoué.
4 4
error_errorDuringItemsListExtraction      = ** Erreur lors de l'extraction de la liste d'items : \	
5 5
error_errorWhileEvaluating                = ** Erreur R : "{0}"\nlors de l'évaluation de : {1}
6
error_evaluationError                     = ** Erreur d'évaluation : 
7
error_failedToConnectToTheRWorkspace      = ** Echec de connexion à l'espace de travail R 
6
error_evaluationError                     = ** Erreur d'évaluation : {0}\n{1}.
7
error_failedToConnectToTheRWorkspace      = ** Echec de connexion à l'espace de travail R.
8 8
error_failedToInitializeFileTransfert     = ** Echec de l'initialisation du transfert : {0}.
9
error_failedToKillRServe                  = Echec de la commande 'taskkill /IM Rserve.exe /F': 
10
error_failedToKillRServe2                 = Echec de la commande 'tskill Rserve.exe': 
11
error_failedToKillRServe3                 = Echec de la commande 'killall -9 Rserve-bin.so': 
12
error_failedToLoadLibrary                 = La librairie {0} n''a pu être chargée : {1}
13
error_failedToRunREG                      = ** Echec du lancement de REG pour localiser le programme R
14
error_failedToStartRServe                 = Impossible de démarrer RServe : 
9
error_failedToKillRServe                  = Echec de la commande 'taskkill /IM Rserve.exe /F'.
10
error_failedToKillRServe2                 = Echec de la commande 'tskill Rserve.exe'.
11
error_failedToKillRServe3                 = Echec de la commande 'killall -9 Rserve-bin.so'.
12
error_failedToLoadLibrary                 = La librairie {0} n'a pu être chargée : {1}.
13
error_failedToRunREG                      = ** Echec du lancement de REG pour localiser le programme R.
14
error_failedToStartRServe                 = Impossible de démarrer RServe.
15 15
error_failedToStartRServeWithCommand      = ** Echec du lancement de Rserve avec la commande : 
16
error_matrixIsEmpty                       = La matrice est vide
16
error_matrixIsEmpty                       = La matrice est vide.
17 17
error_requestedObjectNotFoundInR          = L'objet demandé ({0}) n'a pas été trouvé dans l'espace de travail R.
18
error_rserveIsAlreadyRunningOnPort        = Rserve déja démarré sur le port 
19
error_rservePathNotSet                    = ** Le chemin du programme du serveur statistique n'a pas été renseigné et sa recherche a échoué
18
error_rserveIsAlreadyRunningOnPort        = Rserve est déja démarré sur le port {0}.
19
error_rservePathNotSet                    = ** Le chemin du programme du serveur statistique n'a pas été renseigné et sa recherche a échoué.
20 20
error_statsEngineNotReadyCancelingCommand = Le moteur de statistiques n'est pas initialisé, annulation de la commande.
21
error_youNeedRSoftware                    = Vous avez besoin du logiciel 'R' et de configurer ses chemins via la fenêtre de préférences 'Outils/Préférences'
21
error_unexpectedErrorInRStatisticsEngine  = Erreur inattendue dans le moteur statistique R : {0}.
22
error_youNeedRSoftware                    = Vous avez besoin du logiciel 'R' et de configurer ses chemins via la fenêtre de préférences 'Outils/Préférences'.
22 23

  
23 24
info_connected                 = Connecté.
24
info_connectingToRAt           = Connexion à R à {0}:{1}
25
info_connectingToRAt           = Connexion à R à {0}:{1}.
25 26
info_connectingToRAtWithUser   = Connexion à R à {0}:{1} avec l'utilisateur {2}.
26 27
info_lastSafeEvalExpression    = Dernier 'safeeval' : {0}.
27 28
info_rPathNotSetTryingToFindIt = Chemin d'accès à R non fourni, tentative de résolution...
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/messages/RCoreMessages.java (revision 726)
46 46
	public static String info_tryingToStartRFrom;
47 47
	public static String info_tryingToStartRWithRPath;
48 48

  
49
	public static String error_unexpectedErrorInRStatisticsEngine;
50

  
49 51
	static {
50 52
		// initialize resource bundle
51 53
		Utf8NLS.initializeMessages(BUNDLE_NAME, RCoreMessages.class);
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/messages/messages.properties (revision 726)
2 2
error_cantFindRServeInPath                = ** The Statistics Engine program path is set but we couldn't find it in: {0}.
3 3
error_connectionFailed                    = ** Error while connecting to the stat engine.
4 4
error_errorDuringItemsListExtraction      = ** Error during items list extraction: 
5
error_errorWhileEvaluating                = ** R error: "{0}"\nwhile evaluating:{1} 
6
error_evaluationError                     = ** Evaluation error: 
7
error_failedToConnectToTheRWorkspace      = ** Failed to connect to the R Workspace 
5
error_errorWhileEvaluating                = ** R error: "{0}"\nwhile evaluating: {1} 
6
error_evaluationError                     = ** Evaluation error: {0}\n{1}.
7
error_failedToConnectToTheRWorkspace      = ** Failed to connect to the R Workspace.
8 8
error_failedToInitializeFileTransfert     = ** Failed to initialize file transfert: {0}.
9
error_failedToKillRServe                  = Failed to exec 'taskkill /IM Rserve.exe /F': 
10
error_failedToKillRServe2                 = Failed to exec 'tskill Rserve.exe': 
11
error_failedToKillRServe3                 = Failed to exec 'killall -9 Rserve-bin.so': 
12
error_failedToLoadLibrary                 = Failed to load the {0} library: {1}
13
error_failedToRunREG                      = ** Failed to run REG to find the location of R program: 
14
error_failedToStartRServe                 = Failed to start RServe : 
9
error_failedToKillRServe                  = Failed to exec 'taskkill /IM Rserve.exe /F'.
10
error_failedToKillRServe2                 = Failed to exec 'tskill Rserve.exe'.
11
error_failedToKillRServe3                 = Failed to exec 'killall -9 Rserve-bin.so'.
12
error_failedToLoadLibrary                 = Failed to load the {0} library: {1}.
13
error_failedToRunREG                      = ** Failed to run REG to find the location of R program.
14
error_failedToStartRServe                 = Failed to start RServe.
15 15
error_failedToStartRServeWithCommand      = ** Failed to start Rserve with command: 
16
error_matrixIsEmpty                       = Matrix is empty
16
error_matrixIsEmpty                       = Matrix is empty.
17 17
error_requestedObjectNotFoundInR          = The requested object ({0}) was not found in the R workspace.
18
error_rserveIsAlreadyRunningOnPort        = Rserve already running on port 
19
error_rservePathNotSet                    = ** The Statistics Engine program path is not set and we could not find it
18
error_rserveIsAlreadyRunningOnPort        = Rserve is already running on port {0}.
19
error_rservePathNotSet                    = ** The Statistics Engine program path is not set and we could not find it.
20 20
error_statsEngineNotReadyCancelingCommand = Statistics Engine is not ready, canceling command.
21
error_unexpectedErrorInRStatisticsEngine  = Unexpected error R statistics engine: {0}.
21 22
error_youNeedRSoftware                    = You need the 'R' software and you need to configure in the 'Tools/Preferences' window the correct path to it.
22 23

  
23 24
info_connected                 = Connected.
24
info_connectingToRAt           = Connecting to R at {0}:{1}
25
info_connectingToRAt           = Connecting to R at {0}:{1}.
25 26
info_connectingToRAtWithUser   = Connecting to R at {0}:{1} with user {2}.
26 27
info_lastSafeEvalExpression    = Last safeeval expression: {0}.
27 28
info_rPathNotSetTryingToFindIt = R path is not set, trying to find it...
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RWorkspace.java (revision 726)
479 479
			initRserve(pathToRExecutable, port, debug, rArgs, rServeArgs);
480 480
			return true;
481 481
		} catch (RWorkspaceException e) {
482
			System.out.println(RCoreMessages.error_failedToStartRServe+e);
482
			System.out.println(RCoreMessages.error_failedToStartRServe);
483 483
			org.txm.utils.logger.Log.printStackTrace(e);
484 484
		}
485 485
		return false;
......
1520 1520
			System.out.println("REXPMismatchException: "+e);
1521 1521
			Log.printStackTrace(e);
1522 1522
		} catch (RserveException e) {
1523
			System.out.println(RCoreMessages.error_evaluationError + e.getMessage()+" : "+exp);  //$NON-NLS-1$
1523
			System.out.println(NLS.bind(RCoreMessages.error_evaluationError, e.getMessage(), exp));
1524 1524
			Log.printStackTrace(e);
1525 1525
		}
1526 1526

  
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/StartRserve.java (revision 726)
29 29

  
30 30
import java.io.File;
31 31

  
32
import org.eclipse.osgi.util.NLS;
32 33
import org.rosuda.REngine.Rserve.RConnection;
33 34
import org.txm.statsengine.r.core.messages.RCoreMessages;
34 35
import org.txm.utils.OSDetector;
......
192 193
	protected static boolean checkLocalRserve(int port, boolean debug, String rargs, String rServeArgs) {
193 194
		Log.info(RCoreMessages.info_rPathNotSetTryingToFindIt);
194 195
		if (isRserveRunning(port)) {
195
			Log.info(RCoreMessages.error_rserveIsAlreadyRunningOnPort+port);
196
			Log.info(NLS.bind(RCoreMessages.error_rserveIsAlreadyRunningOnPort, port));
196 197
			return true;
197 198
		}
198 199
		// Windows OS
tmp/org.txm.ahc.core/META-INF/MANIFEST.MF (revision 726)
3 3
Bundle-Name: AHC Core
4 4
Bundle-SymbolicName: org.txm.ahc.core;singleton:=true
5 5
Bundle-Version: 1.0.0.qualifier
6
Require-Bundle: org.txm.utils;bundle-version="1.0.0";visibility:=reexport,
6
Require-Bundle: org.txm.lexicaltable.core;bundle-version="1.0.0";visibility:=reexport,
7
 org.txm.utils;bundle-version="1.0.0";visibility:=reexport,
7 8
 org.eclipse.osgi;bundle-version="3.10.2";visibility:=reexport,
8 9
 org.eclipse.core.runtime;bundle-version="3.10.0";visibility:=reexport,
9 10
 org.txm.statsengine.r.core;bundle-version="1.0.0";visibility:=reexport,
......
11 12
 org.txm.ca.core;bundle-version="1.0.0";visibility:=reexport,
12 13
 org.txm.core;bundle-version="0.7.0";visibility:=reexport,
13 14
 org.txm.chartsengine.r.core;bundle-version="1.0.0";visibility:=reexport,
14
 org.txm.chartsengine.jfreechart.core;bundle-version="1.0.0";visibility:=reexport,
15
 org.txm.lexicaltable.core;bundle-version="1.0.0";visibility:=reexport
15
 org.txm.chartsengine.jfreechart.core;bundle-version="1.0.0";visibility:=reexport
16 16
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
17 17
Bundle-ActivationPolicy: lazy
18 18
Export-Package: org.txm.ahc.core.chartsengine.jfreechart,
tmp/org.txm.ahc.core/src/org/txm/ahc/core/functions/AHC.java (revision 726)
31 31
import java.util.Arrays;
32 32

  
33 33
import org.rosuda.REngine.REXP;
34
import org.txm.ca.core.functions.CA;
35 34
import org.txm.ahc.core.messages.AHCCoreMessages;
36 35
import org.txm.ahc.core.preferences.AHCPreferences;
36
import org.txm.ca.core.functions.CA;
37 37
import org.txm.chartsengine.core.results.ChartResult;
38 38
import org.txm.core.preferences.TXMPreferences;
39 39
import org.txm.core.results.Parameter;
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/handlers/ComputeProgression.java (revision 726)
34 34
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
35 35
import org.txm.chartsengine.rcp.editors.ChartEditor;
36 36
import org.txm.chartsengine.svgbatik.rcp.SVGSWTChartsComponentsProvider;
37
import org.txm.core.preferences.TXMPreferences;
38
import org.txm.core.results.TXMResult;
37 39
import org.txm.progression.core.functions.Progression;
38 40
import org.txm.progression.core.messages.ProgressionCoreMessages;
39 41
import org.txm.progression.core.preferences.ProgressionPreferences;
......
72 74
		Object selection = this.getSelection(event);
73 75
		Progression progression = null;
74 76
		
75
		
76
		// Compute a new progression
77
		if (selection instanceof Corpus)	{
77

  
78
		// Creating from UUID and preferences nodes
79
		if (!event.getParameters().isEmpty()) {
80
			progression = new Progression(event.getParameter(TXMPreferences.RESULT_UUID));
81
		}
82
		// Creating from Corpus
83
		else if (selection instanceof Corpus)	{
78 84
			Corpus corpus = (Corpus) selection;
79 85

  
80 86
			if (!Progression.canRunProgression(corpus)) {
......
84 90
			}
85 91
			progression = new Progression(corpus);
86 92
		}
87
		// Reopens a progression result with default preferences
88
		else if(selection instanceof Progression)	{
93
		// Reopening an existing result
94
		else if (selection instanceof Progression)	{
89 95
			progression = (Progression) selection;
90 96
		}
97

  
91 98
		
92
		
93 99
		// FIXME: temporary force R/SVG version because the Progression density chart is not yet implemented in JFC mode
94
		if(!progression.getBooleanParameterValue(ProgressionPreferences.CHART_CUMULATIVE))	{
95
			SVGSWTChartsComponentsProvider tmpSWTComponentsProvider = (SVGSWTChartsComponentsProvider) SWTChartsComponentsProvider.getComponentsProvider(SVGSWTChartsComponentsProvider.class);
96
			RChartsEngine tmpChartsEngine = (RChartsEngine) ChartsEngine.getChartsEngine(RChartsEngine.class);									
97
			tmpSWTComponentsProvider.setChartsEngine(tmpChartsEngine);
98
			
99
			// Create and open the chart editor
100
			//ChartEditor.compute(progression, tmpSWTComponentsProvider);
101
			
102
		}
103
		else	{
104
			// Create and open the chart editor
105
			//ChartEditor.compute(progression);
106
		}
100
//		if(!progression.getBooleanParameterValue(ProgressionPreferences.CHART_CUMULATIVE))	{
101
//			SVGSWTChartsComponentsProvider tmpSWTComponentsProvider = (SVGSWTChartsComponentsProvider) SWTChartsComponentsProvider.getComponentsProvider(SVGSWTChartsComponentsProvider.class);
102
//			RChartsEngine tmpChartsEngine = (RChartsEngine) ChartsEngine.getChartsEngine(RChartsEngine.class);									
103
//			tmpSWTComponentsProvider.setChartsEngine(tmpChartsEngine);
104
//			
105
//			// Create and open the chart editor
106
//			//ChartEditor.compute(progression, tmpSWTComponentsProvider);
107
//			
108
//		}
109
//		else	{
110
//			// Create and open the chart editor
111
//			//ChartEditor.compute(progression);
112
//		}
107 113

  
108 114
		ChartEditor.openEditor(progression);
109 115
		
tmp/org.txm.progression.rcp/plugin.xml (revision 726)
40 40
         </command>
41 41
      </menuContribution>
42 42
      <menuContribution
43
            allPopups="false"
44
            locationURI="popup:org.txm.synopticedition.rcp.views.corpora.CorporaView">
45
         <command
46
               commandId="org.txm.progression.rcp.handlers.ComputeProgression"
47
               icon="icons/functions/progression.png"
48
               style="push">
49
            <visibleWhen
50
                  checkEnabled="false">
51
               <or>
52
                  <reference
53
                        definitionId="OneCorpusSelected">
54
                  </reference>
55
               </or>
56
            </visibleWhen>
57
         </command>
58
      </menuContribution>
59
      <menuContribution
60 43
            locationURI="menu:menu.tools?after=org.txm.cooccurrence.rcp.handlers.ComputeCooccurrences">
61 44
         <command
62 45
               commandId="org.txm.progression.rcp.handlers.ComputeProgression"
tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java (revision 726)
366 366

  
367 367
	private void composeExtraAreas(Composite controlArea, Composite displayArea) {
368 368

  
369
		// FIXME: this code may be at TXMEditor level and shared by all editors
369 370
		for (final ConcordanceEditorExtension ext : extensions) {
370 371
			ISafeRunnable runnable = new ISafeRunnable() {
371 372
				@Override
......
934 935
			public void handleEvent(Event event) {
935 936
				concordance.setKeywordViewProperties(propsArea.getSelectedProperties());
936 937
				refreshViewProperties();
937
//				if (!TXMPreferences.getBoolean(RCPPreferences.AUTO_UPDATE_EDITOR, RCPPreferences.PREFERENCES_NODE)) {
938
//					try {
939
//						refreshViewProperties();
940
//					} catch (Exception e1) {
941
//						System.err.println(NLS.bind(
942
//								Messages.ERROR_WHILE_LOADING_CONCORDANCE_LINE,
943
//								e1));
944
//					}
945
//				}
946 938
			}
947 939
		});
948 940

  
tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/handlers/ComputeConcordance.java (revision 726)
33 33

  
34 34
import org.eclipse.core.commands.ExecutionEvent;
35 35
import org.eclipse.core.commands.ExecutionException;
36
import org.eclipse.osgi.util.NLS;
37 36
import org.eclipse.ui.IEditorPart;
38
import org.eclipse.ui.PartInitException;
39 37
import org.txm.concordance.core.functions.Concordance;
40 38
import org.txm.concordance.rcp.editors.ConcordanceEditor;
41 39
import org.txm.concordance.rcp.messages.ConcordanceUIMessages;
42 40
import org.txm.core.results.TXMParameters;
43 41
import org.txm.rcp.StatusLine;
44
import org.txm.rcp.TXMWindows;
45 42
import org.txm.rcp.editors.TXMEditor;
46
import org.txm.rcp.editors.TXMResultEditorInput;
47 43
import org.txm.rcp.handlers.BaseAbstractHandler;
48 44
import org.txm.rcp.views.corpora.CorporaView;
49 45
import org.txm.searchengine.cqp.CQPEngine;
tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/messages/messages.properties (revision 726)
7 7
SpecificitiesPreferencePage_7 = Banality
8 8
SpecificitiesPreferencePage_8 = Maximum score
9 9

  
10
SpecificitiesTableEditor_0  = Unable to compute the specificities
10
SpecificitiesTableEditor_0  = Failed to compute specificities.
11 11
SpecificitiesTableEditor_11 = \ T
12
SpecificitiesTableEditor_5  = Unexpected error in the statistical engine R {0}
tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/messages/messages_ru.properties (revision 726)
8 8

  
9 9
SpecificitiesTableEditor_0  = Не удалось подсчитать специфичность
10 10
SpecificitiesTableEditor_11 = T
11
SpecificitiesTableEditor_5  = Неожиданная ошибка в статистической машине R : {0}
tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/messages/SpecificitiesUIMessages.java (revision 726)
20 20
	public static String SpecificitiesTableEditor_0;
21 21
	public static String SpecificitiesTableEditor_11;
22 22

  
23
	public static String SpecificitiesTableEditor_5;
24 23
	
25 24
	static {
26 25
		// initialize resource bundle
tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/messages/messages_fr.properties (revision 726)
7 7
SpecificitiesPreferencePage_7 = Banalité
8 8
SpecificitiesPreferencePage_8 = Indice maximum
9 9

  
10
SpecificitiesTableEditor_0  = Le calcul des spécificités a échoué
10
SpecificitiesTableEditor_0  = Le calcul des spécificités a échoué.
11 11
SpecificitiesTableEditor_11 = T
12
SpecificitiesTableEditor_5  = Erreur inattendue dans le moteur statistique R : {0}
tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesEditor.java (revision 726)
49 49
import org.txm.rcp.editors.TXMEditor;
50 50
import org.txm.rcp.editors.TableKeyListener;
51 51
import org.txm.rcp.messages.TXMUIMessages;
52
import org.txm.rcp.swt.widget.structures.PropertiesComboViewer;
53
import org.txm.searchengine.cqp.corpus.Corpus;
52 54
import org.txm.specificities.core.functions.Specificities;
53 55
import org.txm.specificities.core.preferences.SpecificitiesPreferences;
54 56
import org.txm.specificities.rcp.messages.SpecificitiesUIMessages;
55 57
import org.txm.statsengine.core.StatException;
58
import org.txm.statsengine.r.core.messages.RCoreMessages;
56 59
import org.txm.utils.logger.Log;
57 60

  
58 61
/**
......
77 80
	protected SpecificitiesLinesViewerComparator viewerComparator;
78 81

  
79 82
	
83
	
80 84
	/**
85
	 * Unit property.
86
	 */
87
	@Parameter(key=SpecificitiesPreferences.UNIT_PROPERTY)
88
	protected PropertiesComboViewer unitPropertyComboViewer;
89
	
90
	/**
81 91
	 * Maximum score.
82 92
	 */
83 93
	@Parameter(key=SpecificitiesPreferences.MAX_SCORE)
......
88 98
	@Override
89 99
	public void _createPartControl(Composite parent) {
90 100

  
91
		// max score parameter
92
		Composite parametersArea = this.getCommandParametersGroup();
93
		new Label(parametersArea, SWT.NONE).setText("Maximum score");
94

  
95
		this.maxScore = new Spinner(parametersArea, SWT.BORDER);
96
		this.maxScore.setToolTipText("The maximum score to display");
97
		this.maxScore.setMinimum(0);
98
		
99
		// result area
100 101
		try {
101 102
			
103
			// max score
104
			Composite parametersArea = this.getCommandParametersGroup();
105
			new Label(parametersArea, SWT.NONE).setText("Maximum score");
106
			this.maxScore = new Spinner(parametersArea, SWT.BORDER);
107
			this.maxScore.setToolTipText("The maximum score to display");
108
			this.maxScore.setMinimum(0);
109

  
110
			// unit property
111
			new Label(parametersArea, SWT.NONE).setText(TXMCoreMessages.common_property);
112
			this.unitPropertyComboViewer = new PropertiesComboViewer(parametersArea, this, true,
113
					Corpus.getFirstParentCorpus(this.getResult()).getOrderedProperties(),
114
					this.getResult().getUnitProperty(), false);
115
			
116
			
117
			// result area
102 118
			Composite resultArea = this.getResultArea();
103 119
			
104 120
			GridLayout layout = new GridLayout(2, false);
......
144 160
			
145 161
			// create 2nd column
146 162
			TableColumn typeFrequencyColumn = new TableColumn(viewer.getTable(), SWT.NONE);
147
			typeFrequencyColumn.setText(TXMUIMessages.FrequencyListEditorInput_4 + " " + SpecificitiesUIMessages.SpecificitiesTableEditor_11 + " " + this.getResult().getCorpusSize()); //$NON-NLS-1$ //$NON-NLS-2$
148
			typeFrequencyColumn.setToolTipText(TXMUIMessages.FrequencyListEditorInput_4 + " " + SpecificitiesUIMessages.SpecificitiesTableEditor_11 + " " + this.getResult().getCorpusSize()); 
163
			typeFrequencyColumn.setText(TXMCoreMessages.common_frequency + " " + SpecificitiesUIMessages.SpecificitiesTableEditor_11 + " " + this.getResult().getCorpusSize()); //$NON-NLS-1$ //$NON-NLS-2$
164
			typeFrequencyColumn.setToolTipText(typeFrequencyColumn.getText()); 
149 165
			typeFrequencyColumn.setAlignment(SWT.RIGHT);
150 166
			typeFrequencyColumn.pack();
151 167
			
......
162 178
				partNames = this.getResult().getPartShortNames();
163 179
				partSize = this.getResult().getPartSizes();
164 180
			} catch (StatException e) {
165
				System.err.println(NLS.bind(SpecificitiesUIMessages.SpecificitiesTableEditor_5, e));
181
				System.err.println(NLS.bind(RCoreMessages.error_unexpectedErrorInRStatisticsEngine, e));
166 182
				Log.printStackTrace(e);
167 183
				return;
168 184
			}
......
204 220
			spacer.setVisible(false);
205 221

  
206 222
			// Register the context menu
207
			TXMEditor.initContextMenu(specificitesTable, "SpecificitiesEditorContextMenu", this.getSite(), this.viewer); // $NON-NLS-1$
223
			TXMEditor.initContextMenu(this.specificitesTable, this.getSite(), this.viewer);
208 224
			
209 225
			// adjust UI to the original sorting
210 226
			specificitesTable.setSortColumn(typeNameColumn);
211 227
			specificitesTable.setSortDirection(SWT.UP);
212 228
			
213
		} catch (StatException e) {
229
		} catch (Exception e) {
214 230
			System.err.println(NLS.bind(SpecificitiesUIMessages.SpecificitiesTableEditor_0, e.getMessage()));
215 231
			e.printStackTrace();
216 232
		}
tmp/org.txm.specificities.rcp/OSGI-INF/l10n/bundle_ru_utf-8.properties (revision 726)
1
command.name=Специфичность
2
editor.name=Специфичность
3
page.name=Специфичность
4
command.label=Специфичность
5
command.tooltip=Вычислить специфичные для каждой части слова
6
command.name.0 = Построить гистограмму выделенных строк
tmp/org.txm.specificities.rcp/OSGI-INF/l10n/bundle.properties (revision 726)
1

  
2
command.label = Specificities
3

  
4
command.name = Specificities
5

  
1 6
command.name.0 = Compute the histogram of the selected lines
2
command.name=Compute Specificities
3
editor.name=Specificities
4
page.name=Specificities
5
command.label=Specificities
6
command.tooltip=Compute the specific words of each part of the selected item
7

  
8
command.tooltip = Compute the specific words of each part of the selected item
9

  
10
editor.name = Specificities
11

  
12
page.name = Specificities
tmp/org.txm.specificities.rcp/OSGI-INF/l10n/bundle_ru.properties (revision 726)
1
command.name=\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0441\u0442\u044c
2
editor.name=\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0441\u0442\u044c
3
page.name=\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0441\u0442\u044c
4
command.label=\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0441\u0442\u044c
5
command.tooltip=\u0412\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u043b\u043e\u0432\u0430
1

  
2
command.label = Специфичность
3

  
4
command.name = Специфичность
5

  
6
command.name.0 = Построить гистограмму выделенных строк
7

  
8
command.tooltip = Вычислить специфичные для каждой части слова
9

  
10
editor.name = Специфичность
11

  
12
page.name = Специфичность
tmp/org.txm.specificities.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 726)
1
command.name.0=Calculer le diagramme en b?tons des lignes s?lectionn?es
2
command.name=Sp?cificit?s
3
editor.name=Sp?cificit?s
4
page.name=Sp?cificit?s
5
command.label=Sp?cificiti?s
6
command.tooltip=Calculer les mots sp?cifiques de chaque partie
1

  
2
command.label = Spécificitiés
3

  
4
command.name = Spécificités
5

  
6
command.name.0 = Calculer le diagramme en bâtons des lignes sélectionnées
7

  
8
command.tooltip = Calculer les mots spécifiques de chaque partie
9

  
10
editor.name = Spécificités
11

  
12
page.name = Spécificités
tmp/org.txm.specificities.rcp/plugin.xml (revision 726)
27 27
            name="%command.name">
28 28
      </command>
29 29
      <command
30
            categoryId="org.txm.rcp.category.txm"
30 31
            defaultHandler="org.txm.specificities.rcp.handlers.ComputeSpecifictiesSelectionChart"
31 32
            id="org.txm.specificities.rcp.handlers.ComputeSpecifictiesSelectionChart"
32 33
            name="%command.name.0">
......
118 119
         </command>
119 120
      </menuContribution>
120 121
      <menuContribution
121
            locationURI="popup:SpecificitiesEditorContextMenu">
122
            locationURI="popup:org.txm.specificities.rcp.editors.SpecificitiesEditor">
122 123
         <command
123 124
               commandId="org.txm.specificities.rcp.handlers.ComputeSpecifictiesSelectionChart"
124
               icon="icons/functions/specificities.png"
125
               icon="icons/functions/specificities_selection.png"
125 126
               style="push">
126 127
         </command>
127 128
      </menuContribution>
......
172 173
         <with
173 174
               variable="activePartId">
174 175
            <equals
175
                  value="SpecificitiesEditor">
176
                  value="org.txm.specificities.rcp.editors.SpecificitiesEditor">
176 177
            </equals>
177 178
         </with>
178 179
      </definition>
tmp/org.txm.specificities.rcp/.settings/org.eclipse.core.resources.prefs (revision 726)
1 1
eclipse.preferences.version=1
2
encoding//OSGI-INF/l10n/bundle_ru_utf-8.properties=UTF-8
3 2
encoding//src/org/txm/specificities/rcp/messages/messages.properties=UTF-8
4 3
encoding//src/org/txm/specificities/rcp/messages/messages_fr.properties=UTF-8
5 4
encoding//src/org/txm/specificities/rcp/messages/messages_ru.properties=UTF-8
tmp/org.txm.specificities.core/META-INF/MANIFEST.MF (revision 726)
9 9
 org.eclipse.core.runtime;bundle-version="3.10.0",
10 10
 org.txm.searchengine.cqp.core;bundle-version="1.1.0",
11 11
 org.txm.statsengine.r.core,
12
 org.txm.lexicon.core;bundle-version="1.0.0",
13 12
 org.txm.lexicaltable.core;bundle-version="1.0.0",
14 13
 org.txm.statsengine.core;bundle-version="1.0.0",
15 14
 org.txm.core;bundle-version="0.7.0",
tmp/org.txm.specificities.core/src/org/txm/specificities/core/preferences/SpecificitiesPreferences.java (revision 726)
9 9

  
10 10
/**
11 11
 * Default preferences initializer.
12
 * 
13
 * @author mdecorde
12 14
 * @author sjacquot
13 15
 *
14 16
 */
......
19 21
	public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(SpecificitiesPreferences.class).getSymbolicName();
20 22
	
21 23
	public static final String PREFERENCES_PREFIX = "specificities_"; //$NON-NLS-1$
24

  
22 25
	
23
	public static final String MAX_SCORE = PREFERENCES_PREFIX + "maxscore"; //$NON-NLS-1$
26
	/**
27
	 * Unit property.
28
	 */
29
	public static final String UNIT_PROPERTY = PREFERENCES_PREFIX + "unit_property"; //$NON-NLS-1$
30
	
31
	/**
32
	 * Maximum score.
33
	 */
34
	public static final String MAX_SCORE = PREFERENCES_PREFIX + "max_score"; //$NON-NLS-1$
35
	
36
	/**
37
	 * Display format.
38
	 */
24 39
	public static final String FORMAT = PREFERENCES_PREFIX + "format"; //$NON-NLS-1$
25 40
	
41
	
26 42
	// charts
27 43
	public static final String CHART_GROUP_BY_LINES = PREFERENCES_PREFIX + "chart_group_by_lines"; //$NON-NLS-1$
28 44
	public static final String CHART_DRAW_BARS = PREFERENCES_PREFIX + "chart_draw_bars"; //$NON-NLS-1$
29 45
	public static final String CHART_DRAW_LINES = PREFERENCES_PREFIX + "chart_draw_lines"; //$NON-NLS-1$
30 46
	public static final String CHART_BANALITY = PREFERENCES_PREFIX + "chart_banality"; //$NON-NLS-1$
31 47

  
48
	
49
	
50
	
32 51
	public SpecificitiesPreferences() {
33 52
		// TODO Auto-generated constructor stub
34 53
	}
......
37 56
	public void initializeDefaultPreferences() {
38 57
		Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE);
39 58
		
40
		preferences.put(FORMAT, "%,.1f");
59
		preferences.put(FORMAT, "%,.1f"); //$NON-NLS-1$
41 60
		preferences.putInt(MAX_SCORE, 10000);
42 61
		
43 62
		preferences.putBoolean(CHART_GROUP_BY_LINES, false);
tmp/org.txm.specificities.core/src/org/txm/specificities/core/statsengine/r/function/SpecificitiesR.java (revision 726)
31 31
import org.rosuda.REngine.REXPMismatchException;
32 32
import org.rosuda.REngine.Rserve.RserveException;
33 33
import org.txm.lexicaltable.core.statsengine.data.ILexicalTable;
34
import org.txm.lexicaltable.core.statsengine.r.data.LexicalTableImpl;
35 34
import org.txm.specificities.core.messages.SpecificitiesCoreMessages;
36 35
import org.txm.specificities.core.statsengine.data.ISpecificities;
37 36
import org.txm.statsengine.core.StatException;
tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/___SpecificitesException.java (revision 726)
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: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
25
// $LastChangedRevision: 2386 $
26
// $LastChangedBy: mdecorde $ 
27
//
28
package org.txm.specificities.core.functions;
29

  
30
// TODO: Auto-generated Javadoc
31
/**
32
 * The Class SpecificitesException.
33
 *
34
 * @author sloiseau
35
 */
36
//FIXME: not used?
37
public class ___SpecificitesException extends Exception {
38

  
39
	/** The Constant serialVersionUID. */
40
	private static final long serialVersionUID = 4206288552541531386L;
41

  
42
	/**
43
	 * Instantiates a new specificites exception.
44
	 */
45
	public ___SpecificitesException() {
46
		super();
47
		// TODO Auto-generated constructor stub
48
	}
49

  
50
	/**
51
	 * Instantiates a new specificites exception.
52
	 *
53
	 * @param arg0 the arg0
54
	 * @param arg1 the arg1
55
	 */
56
	public ___SpecificitesException(String arg0, Throwable arg1) {
57
		super(arg0, arg1);
58
		// TODO Auto-generated constructor stub
59
	}
60

  
61
	/**
62
	 * Instantiates a new specificites exception.
63
	 *
64
	 * @param arg0 the arg0
65
	 */
66
	public ___SpecificitesException(String arg0) {
67
		super(arg0);
68
		// TODO Auto-generated constructor stub
69
	}
70

  
71
	/**
72
	 * Instantiates a new specificites exception.
73
	 *
74
	 * @param arg0 the arg0
75
	 */
76
	public ___SpecificitesException(Throwable arg0) {
77
		super(arg0);
78
		// TODO Auto-generated constructor stub
79
	}
80
}
tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificities.java (revision 726)
41 41
import org.txm.core.results.Parameter;
42 42
import org.txm.core.results.TXMParameters;
43 43
import org.txm.core.results.TXMResult;
44
import org.txm.index.core.functions.Lexicon;
44 45
import org.txm.lexicaltable.core.functions.LexicalTable;
45
import org.txm.lexicon.core.functions.Lexicon;
46 46
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
47 47
import org.txm.searchengine.cqp.corpus.Corpus;
48
import org.txm.searchengine.cqp.corpus.Property;
48 49
import org.txm.specificities.core.messages.SpecificitiesCoreMessages;
49 50
import org.txm.specificities.core.preferences.SpecificitiesPreferences;
50 51
import org.txm.specificities.core.statsengine.r.function.SpecificitiesR;
......
71 72
	/** The indices. */
72 73
	private double[][] indices;
73 74

  
74
	/** The table. */
75
	private LexicalTable lexicalTable;
76

  
77 75
	/** The rowindex. */
78 76
	private int[] rowindex = null;
79 77

  
......
83 81
	/** The frequencies. */
84 82
	private int[][] frequencies = null;
85 83

  
86
	/** The lexicon. */
87
	private Lexicon lexicon;
88

  
89
	/** The sub lexicon. */
90
	private Lexicon subLexicon;
91

  
92 84
	/** The colnames. */
93 85
	private List<String> colnames = null;
94 86

  
95 87
	/** The rownames. */
96 88
	private List<String> rownames = null;
97 89

  
98
	/** The corpus. */
99
	private Corpus corpus = null;
100

  
101
	/** The sub corpus. */
102
	private Corpus subCorpus = null;
103

  
104 90
	/** The name. */
105 91
	private String name;
106 92

  
......
111 97
	@Deprecated
112 98
	private BufferedWriter writer;
113 99
	
100

  
101
	// FIXME: SJ: any way to simplify that? table, lexicon, subLexicon, corpus, subcorpus... 
102
	/** The table. */
103
	private LexicalTable lexicalTable;
104

  
105
	/** The lexicon. */
106
	private Lexicon lexicon;
107

  
108
	/** The sub lexicon. */
109
	private Lexicon subLexicon;
110

  
111
	/** The corpus. */
112
	private Corpus corpus = null;
113

  
114
	/** The sub corpus. */
115
	private Corpus subCorpus = null;
116

  
117

  
114 118
	
115 119
	
120
	/**
121
	 * Unit property.
122
	 */
123
	@Parameter(key=SpecificitiesPreferences.UNIT_PROPERTY)
124
	protected Property unitProperty;
125
	
126
	/**
127
	 * Maximum score.
128
	 */
116 129
	@Parameter(key=SpecificitiesPreferences.MAX_SCORE)
117 130
	protected int maxScore;
118 131
	
......
130 143
	public Specificities(LexicalTable lexicalTable)	throws CqiClientException, StatException {
131 144
		super(lexicalTable);
132 145
		this.lexicalTable = lexicalTable;
146
		this.unitProperty = this.lexicalTable.getProperty();
147
		this.lexicalTable.setVMax(Integer.MAX_VALUE);
133 148
	}
134 149
	
135 150
	/**
......
156 171
		return 0.0d;
157 172
	}
158 173
	
174
	
175
	/**
176
	 * Sets the unit property.
177
	 * @param unitProperty
178
	 */
179
	public void setUnitProperty(Property unitProperty)	{
180
		this.unitProperty = unitProperty;
181
	}
182
	
183

  
184
	
159 185
	@Override
160 186
	protected boolean _compute() throws Exception {
161 187
		
162
		SpecificitiesR si = new SpecificitiesR(lexicalTable.getData());
163 188

  
164
		double[][] specIndex = si.getScores();
189
		// recompute the lexical table
190
		if(this.hasParameterChanged(SpecificitiesPreferences.UNIT_PROPERTY))	{
191
			this.lexicalTable.setUnitProperty(this.unitProperty);
192
			this.lexicalTable.compute();
193
		}
165 194

  
195
		SpecificitiesR rSpecificities = new SpecificitiesR(this.lexicalTable.getData());
196
		double[][] specIndex = rSpecificities.getScores();
197

  
198
		
166 199
		if (lexicalTable.getPartition() != null) {
167
//			System.out.println("table="+table);
168
//			System.out.println("rows="+table.getRowNames());
169
//			System.out.println("cols="+table.getColNames());
170
//			System.out.println("prop="+table.getProperty());
171
			init(symbol, specIndex, lexicalTable.getProperty().getName()); 
200
			init(symbol, specIndex, this.unitProperty.getName()); 
172 201
		}
173 202
		else {
174
			init(si.getSymbol(), specIndex, "TLNONAME: " + lexicalTable.getProperty().getName()); //$NON-NLS-1$
203
			init(rSpecificities.getSymbol(), specIndex, "TLNONAME: " + this.unitProperty.getName()); //$NON-NLS-1$
175 204
		}
176 205
		return true;
177 206
	}
......
649 678
		return maxScore;
650 679
	}
651 680

  
681
	/**
682
	 * @return the unitProperty
683
	 */
684
	public Property getUnitProperty() {
685
		return unitProperty;
686
	}
687

  
652 688
	
653 689

  
654 690
	
tmp/org.txm.lexicaltable.rcp/META-INF/MANIFEST.MF (revision 726)
13 13
 org.txm.statsengine.r.rcp,
14 14
 org.txm.searchengine.cqp.core;bundle-version="1.1.0",
15 15
 org.txm.index.core;bundle-version="1.0.0",
16
 org.txm.lexicaltable.core;bundle-version="1.0.0",
16 17
 org.txm.ca.core;bundle-version="1.0.0",
17 18
 org.txm.core,
18
 org.txm.lexicaltable.core;bundle-version="1.0.0",
19 19
 org.txm.rcp,
20 20
 org.eclipse.core.expressions;bundle-version="3.4.600"
21 21
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/messages/messages_fr.properties (revision 726)
1 1

  
2
ComputeLexicalTable_0  = Calcul de la table lexicale avec {0}
3
ComputeLexicalTable_1  = Calcul de la table lexicale {0} avec la propriété {1}
4
ComputeLexicalTable_10 = Ouverture de la table lexicale
2
ComputeLexicalTable_0  = Calcul de la table lexicale avec {0}.
3
ComputeLexicalTable_1  = Calcul de la table lexicale {0} avec la propriété {1}.
4
ComputeLexicalTable_10 = Ouverture de la table lexicale.
5 5
ComputeLexicalTable_12 = Total toutes les occurrences recenses par l'index 
6 6
ComputeLexicalTable_13 = Sélectionnez les marges à utiliser
7 7
ComputeLexicalTable_16 = Total  toutes les occurrences du corpus 
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/messages/LexicalTableUIMessages.java (revision 726)
25 25
	public static String ComputeLexicalTable_13;
26 26
	public static String ComputeLexicalTable_16;
27 27
	public static String ComputeLexicalTable_3;
28
	public static String ComputeLexicalTable_5;
29
	public static String ComputeLexicalTable_6;
30
	public static String ComputeLexicalTable_7;
31
	
28 32

  
29 33

  
30 34
	static {
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/messages/messages.properties (revision 726)
1 1

  
2
ComputeLexicalTable_10 = Opening the lexical table
2
ComputeLexicalTable_0  = Computing the Lexical Table with {0}
3
ComputeLexicalTable_1  = Computing the Lexical Table {0} with the property {1}
4
ComputeLexicalTable_10 = Opening the lexical table.
3 5
ComputeLexicalTable_12 = User index occurrences
4 6
ComputeLexicalTable_13 = Select which margins you want to use
5 7
ComputeLexicalTable_16 = Use all occurrences
8
ComputeLexicalTable_2  = No property
6 9
ComputeLexicalTable_3  = Opening marge configuration dialog
10
ComputeLexicalTable_5  = Can not create a lexical table with an Index created on a Corpus
11
ComputeLexicalTable_6  = Vocabularies must share the same properties: {0}
12
ComputeLexicalTable_7  = Vocabularies must share the same partition: {0}
13
ComputeLexicalTable_9  = LexicalTable dialog, failed to get corpus size: {0}
7 14

  
8 15
LexicalTableEditor_1  = ** Error: different columns number: before
9 16
LexicalTableEditor_10 = Merge or Delete columns
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor.java (revision 726)
355 355
		formColumn.setLabelProvider(clp);
356 356
		
357 357
		freqColumn = new TableViewerColumn(viewer, SWT.LEFT);
358
		freqColumn.getColumn().setText(TXMUIMessages.FrequencyListEditorInput_4); 
358
		freqColumn.getColumn().setText(TXMCoreMessages.common_frequency); 
359 359
		freqColumn.getColumn().setWidth(200);
360 360
		freqColumn.getColumn().addSelectionListener(new ColumnSelectionListener(this, freqColumn, -1));
361 361
		freqColumn.setLabelProvider(clp);
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableDialog.java (revision 726)
158 158
			anaPropLabel.setText(mess);
159 159
		}
160 160
		else {
161
			anaPropLabel.setText(TXMUIMessages.Property);
161
			anaPropLabel.setText(TXMCoreMessages.common_properties);
162 162
		}
163 163
		anaPropLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER,
164 164
				false, false));
......
170 170
		int i = 0;
171 171
		for (Property p : properties) {
172 172
			anaPropCombo.add(p.getName());
173
			if (p.getName().equals("word")) { //$NON-NLS-1$
173
			if (p.getName().equals(TXMPreferences.DEFAULT_UNIT_PROPERTY)) {
174 174
				iword=i;
175 175
			}
176 176
			i++;
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/___LexicalTableEditorInput.java (revision 726)
38 38
import org.eclipse.swt.graphics.Image;
39 39
import org.eclipse.ui.IEditorInput;
40 40
import org.eclipse.ui.part.EditorPart;
41
import org.txm.core.messages.TXMCoreMessages;
41 42
import org.txm.lexicaltable.core.functions.LexicalTable;
43
import org.txm.rcp.editors.ITablableEditorInput;
42 44
import org.txm.rcp.editors.TXMResultEditorInput;
43
import org.txm.rcp.editors.ITablableEditorInput;
44 45
import org.txm.rcp.editors.input.AbstractTablableEditorInput;
45 46
import org.txm.rcp.messages.TXMUIMessages;
46 47
import org.txm.searchengine.cqp.corpus.Property;
......
95 96
			@Override
96 97
			public String[] getColumnTitles() {
97 98
				return new String[] { TXMUIMessages.FrequencyListEditorInput_3,
98
						TXMUIMessages.FrequencyListEditorInput_4 };
99
						TXMCoreMessages.common_frequency };
99 100
			}
100 101

  
101 102
			@Override
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ComputeLexicalTable.java (revision 726)
36 36
import org.eclipse.jface.viewers.ArrayContentProvider;
37 37
import org.eclipse.jface.viewers.IStructuredSelection;
38 38
import org.eclipse.jface.viewers.LabelProvider;
39
import org.eclipse.osgi.util.NLS;
39 40
import org.eclipse.ui.IWorkbenchWindow;
40 41
import org.eclipse.ui.dialogs.ListDialog;
41 42
import org.eclipse.ui.handlers.HandlerUtil;
......
45 46
import org.txm.lexicaltable.rcp.editors.LexicalTableDialog;
46 47
import org.txm.lexicaltable.rcp.editors.LexicalTableEditor;
47 48
import org.txm.lexicaltable.rcp.messages.LexicalTableUIMessages;
49
import org.txm.rcp.StatusLine;
50
import org.txm.rcp.TXMWindows;
48 51
import org.txm.rcp.editors.TXMEditor;
49 52
import org.txm.rcp.handlers.BaseAbstractHandler;
50
import org.txm.rcp.messages.TXMUIMessages;
51 53
import org.txm.rcp.views.corpora.CorporaView;
52 54
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
53 55
import org.txm.searchengine.cqp.corpus.Partition;
56
import org.txm.searchengine.cqp.corpus.Property;
57
import org.txm.utils.logger.Log;
54 58
// TODO: Auto-generated Javadoc
55 59
/**
56 60
 * if the selection is a Partition : creates a lexical table already filled if
......
66 70

  
67 71
	
68 72
	
69
	/** The window. */
70
	private IWorkbenchWindow window;
71 73

  
72
	/** The selection. */
73
	private IStructuredSelection selection;
74

  
75
	/** The table. */
76
	private LexicalTable table = null;
77

  
78 74
	/** The code. */
79 75
	int code;
80 76

  
......
96 92
		
97 93
		// Creating from Index
98 94
		if (selection instanceof Index) {
95
			
96
			IWorkbenchWindow window = TXMWindows.getActiveWindow();
99 97
			List<Index> vocabularies = ((IStructuredSelection) HandlerUtil.getCurrentSelection(event)).toList();
100 98
			
101 99
			System.out.println(LexicalTableUIMessages.ComputeLexicalTable_3);
......
125 123
				return false;
126 124
			}
127 125

  
126
			
128 127
			//computeWithVocabularies(vocabularies, useAllOccurrences);
128

  
129
			
130
			if (vocabularies.size() == 0) {
131
				return false;
132
			}
133

  
134
			vocabularies = vocabularies.subList(0, 1);
135
			for (Index voc : vocabularies) {
136
				if (!voc.isComputedWithPartition()) {
137
					System.out.println(LexicalTableUIMessages.ComputeLexicalTable_5);
138
					StatusLine.setMessage(LexicalTableUIMessages.ComputeLexicalTable_5);
139
					return false;
140
				}
141
			}
142
			
143
			List<Property> properties = vocabularies.get(0).getProperties();
144
			for (Index voc : vocabularies) {
145
				if (!properties.equals(voc.getProperties())) {
146
					Log.warning(NLS.bind(LexicalTableUIMessages.ComputeLexicalTable_6, properties));
147
					return false;
148
				}
149
			}
150
			
151
			final Index firstIndex = vocabularies.get(0);
152
			Partition firstPartition = firstIndex.getPartition();
153
			for (Index voc : vocabularies) {
154
				if (!firstPartition.equals(voc.getPartition())) {
155
					Log.warning(NLS.bind(LexicalTableUIMessages.ComputeLexicalTable_7, firstPartition));
156
					return false;
157
				}
158
			}
159
			
160
			final Property property = properties.get(0);
161

  
162
			lexicalTable = new LexicalTable(firstIndex);
163
			lexicalTable.setUseAllOccurrences(useAllOccurrences);
164
			lexicalTable.setUnitProperty(property);
165
			
166
			
167
			
168
			// FIXME: useless?
129 169
			//return null;
130 170
			//		} else if (s instanceof QueryIndex) {
131 171
			//			List<QueryIndex> qindexes = selection.toList();
......
134 174
		}
135 175
		// Creating from Partition
136 176
		else if (selection instanceof Partition) {
137
			try {
138
				lexicalTable = new LexicalTable((Partition) selection);
139
			}
140
			catch (CqiClientException e) {
141
				// TODO Auto-generated catch block
142
				e.printStackTrace();
143
			}
177
			lexicalTable = new LexicalTable((Partition) selection);
144 178
		}
145 179
		// Reopening from existing result
146 180
		else if (selection instanceof LexicalTable) {
147 181
			lexicalTable = (LexicalTable) selection;
148 182
		}
183
		// Error
184
		else	{
185
			this.logCanNotCompute(selection);
186
		}
149 187
		
150 188
		// FIXME: tests
151 189
//		try {
tmp/org.txm.rcp.feature/feature.xml (revision 726)
382 382
         unpack="false"/>
383 383

  
384 384
   <plugin
385
         id="org.txm.lexicon.core"
386
         download-size="0"
387
         install-size="0"
388
         version="1.0.0.qualifier"
389
         unpack="false"/>
390

  
391
   <plugin
392 385
         id="org.txm.libs.batik"
393 386
         download-size="0"
394 387
         install-size="0"
tmp/org.txm.rcp/plugin.xml (revision 726)
2052 2052
                  commandId="org.eclipse.ui.window.preferences"
2053 2053
                  icon="icons/functions/prefs.png"
2054 2054
                  label="%command.label.4"
2055
                  style="push"
2056
                  tooltip="%command.tooltip.0">
2055
                  style="push">
2057 2056
            </command>
2058 2057

  
2059 2058
      </menuContribution>
tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/BaseAbstractHandler.java (revision 726)
1 1
package org.txm.rcp.handlers;
2 2

  
3
import java.util.Collections;
4
import java.util.Map;
5

  
3 6
import org.eclipse.core.commands.AbstractHandler;
7
import org.eclipse.core.commands.Command;
4 8
import org.eclipse.core.commands.ExecutionEvent;
9
import org.eclipse.core.commands.IParameter;
10
import org.eclipse.core.commands.IParameterValues;
11
import org.eclipse.core.commands.ParameterValuesException;
12
import org.eclipse.core.commands.ParameterizedCommand;
13
import org.eclipse.core.commands.common.NotDefinedException;
14
import org.eclipse.ui.IWorkbenchWindow;
15
import org.eclipse.ui.PlatformUI;
16
import org.eclipse.ui.commands.ICommandService;
17
import org.eclipse.ui.handlers.IHandlerService;
5 18
import org.txm.rcp.views.corpora.CorporaView;
6 19
import org.txm.searchengine.cqp.CQPEngine;
7 20
import org.txm.statsengine.r.core.RStatsEngine;
......
82 95
		Log.severe("Can not execute command " + this.getClass() + " with the selection " + selection);
83 96
		return false;
84 97
	}
98
	
99
	
100
	/**
101
	 * Executes a command handler specified by its id.
102
	 * @param commandId
103
	 */
104
	public static void executeCommand(String commandId, String resultUUID) {
105
		System.err.println("BaseAbstractHandler.executeCommand(): calling command " + commandId);
106
		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
107
		ICommandService cmdService = (ICommandService)window.getService(ICommandService.class);
108
		Command cmd = cmdService.getCommand(commandId);
109
		IHandlerService handlerService = (IHandlerService)window.getService(IHandlerService.class);
110
		
111
		// Redefine the command supported parameters, otherwise each command must define the parameter "result_uuid" in each plugin.xml...
112
		try {
113
			IParameter[] parameters = new IParameter[]{ new IParameter() {
114
				
115
				@Override
116
				public boolean isOptional() {
117
					// TODO Auto-generated method stub
118
					return false;
119
				}
120
				
121
				@Override
122
				public IParameterValues getValues() throws ParameterValuesException {
123
					// TODO Auto-generated method stub
124
					return null;
125
				}
126
				
127
				@Override
128
				public String getName() {
129
					// TODO Auto-generated method stub
130
					return "result_uuid";
131
				}
132
				
133
				@Override
134
				public String getId() {
135
					// TODO Auto-generated method stub
136
					return "result_uuid";
137
				}
138
			}};
139
			cmd.define(cmd.getName(), cmd.getDescription(), cmd.getCategory(), parameters);
140
		}
141
		catch (NotDefinedException e) {
142
			// TODO Auto-generated catch block
143
			e.printStackTrace();
144
		}
145
		
146
		// pass the parameter value
147
		final Map<String,String> params = Collections.singletonMap("result_uuid", resultUUID); 
148
		
149
//		final Map<String,String> params=new HashMap<String,String>(1);
150
//         params.put("result_uuid", resultUUID);
151
		
152
		try {
153
			ParameterizedCommand pc = ParameterizedCommand.generateCommand(cmd, params);
154
//			ParameterizedCommand pc = new ParameterizedCommand(cmd, (Parameterization[]) params
155
//					.toArray(new Parameterization[params.size()]));
156
			
157
			
158
			handlerService.executeCommand(pc, null);
159

  
160
			
161
		} catch (Exception e) {
162
			e.printStackTrace();
163
		}
164
		
165
	}	
166
	
85 167
}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreateFrequencyListDialog.java (revision 726)
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.actions;
29

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

  
33
import org.eclipse.jface.dialogs.Dialog;
34
import org.eclipse.jface.dialogs.MessageDialog;
35
import org.eclipse.swt.SWT;
36
import org.eclipse.swt.layout.GridData;
37
import org.eclipse.swt.layout.GridLayout;
38
import org.eclipse.swt.widgets.Combo;
39
import org.eclipse.swt.widgets.Composite;
40
import org.eclipse.swt.widgets.Control;
41
import org.eclipse.swt.widgets.Label;
42
import org.eclipse.swt.widgets.Shell;
43
import org.txm.rcp.messages.TXMUIMessages;
44
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
45
import org.txm.searchengine.cqp.corpus.Corpus;
46
import org.txm.searchengine.cqp.corpus.Property;
47
// TODO: Auto-generated Javadoc
48
/**
49
 * Allow user to choose a lexical property.
50
 *
51
 * @author sloiseau
52
 */
53
public class CreateFrequencyListDialog extends Dialog {
54

  
55
	/** The property. */
56
	private Property property;
57
	
58
	/** The properties. */
59
	private List<Property> properties;
60
	
61
	/** The ana prop combo. */
62
	private Combo anaPropCombo;
63

  
64
	/**
65
	 * Instantiates a new creates the frequency list dialog.
66
	 *
67
	 * @param parentShell the parent shell
68
	 * @param corpus the corpus
69
	 */
70
	public CreateFrequencyListDialog(Shell parentShell, Corpus corpus) {
71
		super(parentShell);
72
		try {
73
			this.properties = new ArrayList<Property>(corpus.getOrderedProperties());
74
		} catch (CqiClientException e) {
75
			// TODO Auto-generated catch block
76
			org.txm.rcp.utils.Logger.printStackTrace(e);
77
		}
78
	}
79

  
80
	/* (non-Javadoc)
81
	 * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
82
	 */
83
	@Override
84
	protected void configureShell(Shell newShell) {
85
		super.configureShell(newShell);
86
		newShell.setText(TXMUIMessages.FrequencyListEditorInput_0);
87
	}
88

  
89
	/**
90
	 * Gets the property.
91
	 *
92
	 * @return the property
93
	 */
94
	public Property getProperty() {
95
		return property;
96
	}
97

  
98
	/* (non-Javadoc)
99
	 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
100
	 */
101
	@Override
102
	protected Control createDialogArea(Composite parent) {
103
		Composite composite = new Composite(parent, SWT.NONE);
104
		GridLayout layout = new GridLayout(2, false);
105
		composite.setLayout(layout);
106

  
107
		Label anaPropLabel = new Label(composite, SWT.NONE);
108
		anaPropLabel.setText(TXMUIMessages.CreatePartitionDialog_4);
109
		anaPropLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER,
110
				false, false));
111

  
112
		anaPropCombo = new Combo(composite, SWT.READ_ONLY);
113
		anaPropCombo.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
114
				true, false));
115
		for (Property property : properties) {
116
			anaPropCombo.add(property.getName());
117
		}
118
		if (anaPropCombo.indexOf("word") >= 0) //$NON-NLS-1$
119
			anaPropCombo.select(anaPropCombo.indexOf("word")); //$NON-NLS-1$
120

  
121
		return composite;
122
	}
123

  
124
	/* (non-Javadoc)
125
	 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
126
	 */
127
	@Override
128
	protected void okPressed() {
129
		int propIndex = anaPropCombo.getSelectionIndex();
130
		if (propIndex == -1) {
131
			MessageDialog.openError(getShell(),
132
					TXMUIMessages.Invalid_analysis_property,
133
					TXMUIMessages.Structure_field_not_empty);
134
			return;
135
		}
136
		property = properties.get(propIndex);
137
		super.okPressed();
138
	}
139

  
140
}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/actions/___CreateFrequencyListDialog.java (revision 726)
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.actions;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff