Révision 846

tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificities.java (revision 846)
38 38
import java.util.List;
39 39

  
40 40
import org.rosuda.REngine.REXP;
41
import org.txm.core.preferences.TBXPreferences;
41 42
import org.txm.core.results.Parameter;
42 43
import org.txm.core.results.TXMParameters;
43 44
import org.txm.core.results.TXMResult;
......
187 188
	protected boolean _compute() throws Exception {
188 189
		
189 190
		// recompute the lexical table
190
		if(this.hasParameterChanged(SpecificitiesPreferences.UNIT_PROPERTY))	{
191
		if(this.hasParameterChanged(TBXPreferences.UNIT_PROPERTY))	{
191 192
			this.lexicalTable.setUnitProperty(this.unitProperty);
192 193
			this.lexicalTable.compute(this, false);
193 194
		}
tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java (revision 846)
111 111
	 */
112 112
	public static final String STRUCTURAL_UNIT_PROPERTIES = "structural_unit_properties"; //$NON-NLS-1$
113 113
	
114

  
115
	/**
116
	 * Unit property.
117
	 */
118
	public static final String UNIT_PROPERTY =  "unit_property"; //$NON-NLS-1$
119

  
114 120
	
115 121
	/**
116
	 * Properties.
122
	 * Unit properties.
117 123
	 */
118 124
	public static final String UNIT_PROPERTIES =  "unit_properties"; //$NON-NLS-1$
119 125

  
tmp/org.txm.links.rcp/src/org/txm/package.html (revision 846)
1
<html>
2
<body>
3
	<p>Commands which create link between 2 textometry function</p>
4
</body>
5
</html>
0 6

  
tmp/org.txm.links.rcp/src/org/txm/links/rcp/___LinkCommands.java (revision 846)
1
package org.txm.links.rcp;
2

  
3
/**
4
 * Associations between link command types and RCP command ids.
5
 * @author sjacquot
6
 *
7
 */
8
public enum ___LinkCommands {
9

  
10
	SEND_TO_CONCORDANCE("org.txm.links.rcp.commands.SendToConcordance"),
11
	SEND_TO_INDEX("org.txm.links.rcp.commands.SendToIndex"),
12
	SEND_TO_COOCCURRENCE("org.txm.links.rcp.commands.SendToProgression"),
13
	SEND_TO_PROGRESSIONE("org.txm.links.rcp.commands.SendToCooccurrence");
14

  
15
	/**
16
	 * Command id.
17
	 */
18
	final private String id;
19

  
20
	/**
21
	 * 
22
	 * @param commandId
23
	 */
24
	private ___LinkCommands(String id) {
25
		this.id = id;
26
	}
27

  
28
	@Override
29
	public String toString(){
30
	    return this.id;
31
	 }
32
}
tmp/org.txm.links.rcp/src/org/txm/links/rcp/___ComputeIndexFromLines.java (revision 846)
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.links.rcp;
29

  
30
import org.eclipse.jface.action.Action;
31
import org.eclipse.jface.viewers.IStructuredSelection;
32
import org.eclipse.jface.viewers.TableViewer;
33
import org.eclipse.ui.IWorkbenchWindow;
34
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
35
import org.txm.concordance.rcp.editors.ConcordanceEditor;
36
import org.txm.rcp.commands.link.___ConcordanceToIndex;
37
import org.txm.rcp.messages.TXMUIMessages;
38

  
39
// TODO: Auto-generated Javadoc
40
/**
41
 * use the line selection to compute an index.
42
 */
43
public class ___ComputeIndexFromLines extends Action implements IWorkbenchAction {
44

  
45
	/** The Constant ID. */
46
	private static final String ID = "org.txm.rcp.editors.concordances.computecoocfromconclines"; //$NON-NLS-1$
47
	
48
	/** The window. */
49
	private IWorkbenchWindow window;
50
	
51
	/** The concordance editor. */
52
	private ConcordanceEditor concordanceEditor;
53

  
54
	/**
55
	 * Instantiates a new compute index from lines.
56
	 *
57
	 * @param window the window
58
	 * @param concordanceEditor the concordance editor
59
	 */
60
	public ___ComputeIndexFromLines(IWorkbenchWindow window,
61
			ConcordanceEditor concordanceEditor) {
62
		this.window = window;
63
		this.concordanceEditor = concordanceEditor;
64
		setId(ID);
65
		setText(TXMUIMessages.ComputeIndexFromLines_0);
66
		setToolTipText(TXMUIMessages.ComputeIndexFromLines_0);
67
	}
68

  
69
	/* (non-Javadoc)
70
	 * @see org.eclipse.ui.actions.ActionFactory.IWorkbenchAction#dispose()
71
	 */
72
	@Override
73
	public void dispose() {
74
	}
75

  
76
	/* (non-Javadoc)
77
	 * @see org.eclipse.jface.action.Action#run()
78
	 */
79
	@Override
80
	public void run() {
81
		TableViewer table = concordanceEditor.getLineTableViewer();
82
		___ConcordanceToIndex.link(concordanceEditor,
83
				(IStructuredSelection) table.getSelection());
84
	}
85
}
tmp/org.txm.links.rcp/plugin.xml (revision 846)
2 2
<?eclipse version="3.4"?>
3 3
<plugin>
4 4
   <extension
5
         id="links"
6
         point="org.eclipse.ui.commands">
7
           <command
8
            categoryId="org.txm.synopticedition.rcp.category.txm"
9
            defaultHandler="org.txm.synopticedition.rcp.commands.link.CooccurrencesToConcordances"
10
            id="org.txm.synopticedition.rcp.commands.link.CooccurrencesToConcordances"
11
            name="%command.label.102">
12
      </command>
13
      <command
14
            defaultHandler="org.txm.synopticedition.rcp.commands.link.LexiconToIndex"
15
            id="org.txm.synopticedition.rcp.commands.link.LexiconToIndex"
16
            name="%command.label.128">
17
      </command>
18
            <command
19
            defaultHandler="org.txm.synopticedition.rcp.commands.link.TextToConcordance"
20
            id="org.txm.synopticedition.rcp.commands.link.TextToConcordance"
21
            name="%command.name.96">
22
      </command>
23
   </extension>
24
   <extension
25 5
         point="org.eclipse.ui.menus">
26 6
               <menuContribution
27 7
            locationURI="popup:org.txm.rcp.editors.TXMBrowser">
tmp/org.txm.links.rcp/META-INF/MANIFEST.MF (revision 846)
1 1
Manifest-Version: 1.0
2
Require-Bundle: org.eclipse.ui;bundle-version="3.106.1";visibility:=re
3
 export,org.txm.ca.core;bundle-version="1.0.0";visibility:=reexport,or
4
 g.txm.ahc.core;bundle-version="1.0.0";visibility:=reexport,org.txm.ch
5
 artsengine.core;bundle-version="1.0.0";visibility:=reexport,org.txm.c
6
 hartsengine.jfreechart.core;bundle-version="1.0.0";visibility:=reexpo
7
 rt,org.txm.chartsengine.r.core;bundle-version="1.0.0";visibility:=ree
8
 xport,org.txm.concordance.core;bundle-version="1.0.0";visibility:=ree
9
 xport,org.txm.cooccurrence.core;bundle-version="1.0.0";visibility:=re
10
 export,org.txm.groovy.core;bundle-version="1.0.0";visibility:=reexpor
11
 t,org.txm.index.core;bundle-version="1.0.0";visibility:=reexport,org.
12
 txm.lexicaltable.core;bundle-version="1.0.0";visibility:=reexport,org
13
 .txm.partition.core;bundle-version="1.0.0";visibility:=reexport,org.t
14
 xm.progression.core;bundle-version="1.0.0";visibility:=reexport,org.t
15
 xm.referencer.core;bundle-version="1.0.0";visibility:=reexport,org.tx
16
 m.searchengine.core;bundle-version="1.0.0";visibility:=reexport,org.t
17
 xm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport,
18
 org.txm.specificities.core;bundle-version="1.0.0";visibility:=reexpor
19
 t,org.txm.statsengine.core;bundle-version="1.0.0";visibility:=reexpor
20
 t,org.txm.statsengine.r.core;bundle-version="1.0.0";visibility:=reexp
21
 ort,org.txm.concordance.rcp;bundle-version="1.0.0";visibility:=reexpo
22
 rt,org.txm.cooccurrence.rcp;bundle-version="1.0.0";visibility:=reexpo
23
 rt,org.txm.internalview.rcp;bundle-version="1.0.0";visibility:=reexpo
24
 rt,org.txm.statsengine.r.rcp;bundle-version="1.0.0";visibility:=reexp
25
 ort,org.txm.index.rcp;visibility:=reexport,org.txm.progression.rcp;vi
26
 sibility:=reexport,org.txm.lexicaltable.rcp;visibility:=reexport,org.
27
 txm.libs.batik;visibility:=reexport,org.txm.edition.rcp;bundle
28
 -version="1.0.0";visibility:=reexport
29
Export-Package: org.txm.links.rcp,
30
 org.txm.links.rcp.handlers,
31
 org.txm.rcp.commands.link
2
Require-Bundle: org.eclipse.ui;bundle-version="3.106.1";visibility:=reexport,
3
 org.txm.rcp;bundle-version="0.8.0"
4
Export-Package: org.txm.links.rcp.handlers
32 5
Bundle-Vendor: Textometrie.org
33 6
Bundle-Version: 1.0.0.qualifier
34 7
Bundle-Name: Links RCP
tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/handlers/DeleteLines.java (revision 846)
53 53
	 */
54 54
	@Override
55 55
	public Object execute(ExecutionEvent event) throws ExecutionException {
56
		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event)
57
				.getShell();
56
		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
58 57
		// ISelection selection =
59 58
		// HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection();
60 59

  
tmp/org.txm.progression.core/src/org/txm/progression/core/preferences/ProgressionPreferences.java (revision 846)
20 20
	// auto populate the preference node qualifier from the current bundle id
21 21
	public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(ProgressionPreferences.class).getSymbolicName();
22 22

  
23
	// FIXME: prefix becomes useless since the preferences files are split for each plug-in? that's also simplify the local preference node filling in "Send to" command 
24
	// 
25
	//public static final String PREFERENCES_PREFIX = "progression_"; //$NON-NLS-1$
26
	public static final String PREFERENCES_PREFIX = ""; //$NON-NLS-1$
27 23

  
28
//	/**
29
//	 * Queries.
30
//	 */
31
//	public static final String QUERIES = PREFERENCES_PREFIX + "queries"; //$NON-NLS-1$
32
//	
33
//	/**
34
//	 * Structural unit.
35
//	 */
36
//	public static final String STRUCTURAL_UNIT = PREFERENCES_PREFIX + "structural_unit"; //$NON-NLS-1$
37
//	
38
//	/***
39
//	 * Structural unit property.
40
//	 */
41
//	public static final String STRUCTURAL_UNIT_PROPERTY = PREFERENCES_PREFIX + "structural_unit_property"; //$NON-NLS-1$
42

  
43
	
44 24
	/** The Constant REPEAT_VALUES. */
45
	public static final String REPEAT_SAME_VALUES = PREFERENCES_PREFIX + "repeat_same_values"; //$NON-NLS-1$
25
	public static final String REPEAT_SAME_VALUES = "repeat_same_values"; //$NON-NLS-1$
46 26

  
47 27
	/** The Constant REPEAT_VALUES. */
48
	public static final String PROPERTY_REGEX = PREFERENCES_PREFIX + "property_regex"; //$NON-NLS-1$
28
	public static final String PROPERTY_REGEX = "property_regex"; //$NON-NLS-1$
49 29
	
50

  
51
	
52
	
53 30
	/** The Constant BANDE_MULTIPLIER. */
54
	public static final String BANDE_MULTIPLIER = PREFERENCES_PREFIX + "bande_multiplier"; //$NON-NLS-1$
31
	public static final String BANDE_MULTIPLIER = "bande_multiplier"; //$NON-NLS-1$
55 32
	
56

  
57
	
58 33
	/** The Constant CUMULATIVE. */
59
	public static final String CHART_CUMULATIVE = PREFERENCES_PREFIX + "cumulative_chart"; //$NON-NLS-1$
34
	public static final String CHART_CUMULATIVE = "cumulative_chart"; //$NON-NLS-1$
60 35
	
61 36
	
62
	
63 37
	/**
64 38
	 * 
65 39
	 */
tmp/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java (revision 846)
42 42
import org.txm.chartsengine.core.preferences.ChartsEnginePreferences;
43 43
import org.txm.chartsengine.core.results.ChartResult;
44 44
import org.txm.chartsengine.r.core.themes.DefaultTheme;
45
import org.txm.core.preferences.TBXPreferences;
45 46
import org.txm.core.results.Parameter;
46 47
import org.txm.core.results.TXMParameters;
47 48
import org.txm.progression.core.messages.ProgressionCoreMessages;
......
117 118
	/**
118 119
	 * Queries.
119 120
	 */
120
	@Parameter(key=ProgressionPreferences.QUERIES)
121
	@Parameter(key=TBXPreferences.QUERIES)
121 122
	protected List<Query> queries;
122 123

  
123 124
	/**
124 125
	 * Structural unit.
125 126
	 */
126
	@Parameter(key=ProgressionPreferences.STRUCTURAL_UNIT)
127
	@Parameter(key=TBXPreferences.STRUCTURAL_UNIT)
127 128
	protected StructuralUnit structuralUnit;
128 129

  
129 130
	/**
130 131
	 * Structural unit property.
131 132
	 */
132
	@Parameter(key=ProgressionPreferences.STRUCTURAL_UNIT_PROPERTY)
133
	@Parameter(key=TBXPreferences.STRUCTURAL_UNIT_PROPERTY)
133 134
	protected StructuralUnitProperty structuralUnitProperty;
134 135

  
135 136
	/**
......
166 167
	
167 168
	@Override
168 169
	public boolean loadParameters() {
169
		if(!this.getStringParameterValue(ProgressionPreferences.QUERIES).isEmpty())	{
170
			this.queries = Query.stringToQueries(this.getStringParameterValue(ProgressionPreferences.QUERIES));
170
		if(!this.getStringParameterValue(TBXPreferences.QUERIES).isEmpty())	{
171
			this.queries = Query.stringToQueries(this.getStringParameterValue(TBXPreferences.QUERIES));
171 172
		}
172 173
		
173
		if(!this.getStringParameterValue(ProgressionPreferences.STRUCTURAL_UNIT).isEmpty())	{
174
		if(!this.getStringParameterValue(TBXPreferences.STRUCTURAL_UNIT).isEmpty())	{
174 175
			try {
175
				this.structuralUnit = this.getCorpus().getStructuralUnit(this.getStringParameterValue(ProgressionPreferences.STRUCTURAL_UNIT));
176
				if(!this.getStringParameterValue(ProgressionPreferences.STRUCTURAL_UNIT_PROPERTY).isEmpty())	{
177
					this.structuralUnitProperty = this.structuralUnit.getProperty(this.getStringParameterValue(ProgressionPreferences.STRUCTURAL_UNIT_PROPERTY));
176
				this.structuralUnit = this.getCorpus().getStructuralUnit(this.getStringParameterValue(TBXPreferences.STRUCTURAL_UNIT));
177
				if(!this.getStringParameterValue(TBXPreferences.STRUCTURAL_UNIT_PROPERTY).isEmpty())	{
178
					this.structuralUnitProperty = this.structuralUnit.getProperty(this.getStringParameterValue(TBXPreferences.STRUCTURAL_UNIT_PROPERTY));
178 179
				}
179 180
			}
180 181
			catch (CqiClientException e) {
tmp/org.txm.synopticeditor.rcp/src/org/txm/edition/rcp/handlers/SendEditionTo.java (revision 846)
47 47
	public String createQuery(ExecutionEvent event, IStructuredSelection selection) {
48 48
		IEditionEditor editor = (IEditionEditor) this.getActiveEditor(event);
49 49
		String query = ((IEditionEditor)editor).getTextSelection();
50
		query = "\""+query.replaceAll("\"", "\\\"");//.replaceAll("("+TokenizerClasses.regPunct+")", " $1 ");
51
		query = query.replaceAll(" +", "\" \"")+"\"";
50
		query = "\"" + query.replaceAll("\"", "\\\"");//.replaceAll("("+TokenizerClasses.regPunct+")", " $1 ");
51
		query = query.replaceAll(" +", "\" \"") + "\"";
52 52
		return query;
53 53
	}
54 54
	
tmp/org.txm.synopticeditor.rcp/src/org/txm/edition/rcp/handlers/___TextToConcordance.java (revision 846)
50 50
 * 
51 51
 * @author mdecorde.
52 52
 */
53
@Deprecated
53 54
public class ___TextToConcordance extends AbstractHandler {
54 55

  
55 56
	/* (non-Javadoc)
tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/preferences/LexicalTablePreferences.java (revision 846)
19 19
	// auto populate the preference node qualifier from the current bundle id
20 20
	public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(LexicalTablePreferences.class).getSymbolicName();
21 21

  
22
	public static final String PREFERENCES_PREFIX = "lexical_table_"; //$NON-NLS-1$
23

  
24 22
	/**
25
	 * Minimum occurrence frequency to display in table.
26
	 */
27
	public static final String F_MIN = PREFERENCES_PREFIX + "f_min"; //$NON-NLS-1$
28
	
29
	/**
30
	 * Maximum number of lines to display in table.
31
	 */
32
	public static final String V_MAX = PREFERENCES_PREFIX + "v_max"; //$NON-NLS-1$
33
	
34
	/**
35
	 * Unit property to count.
36
	 */
37
	public static final String UNIT_PROPERTY = PREFERENCES_PREFIX + "unit_property"; //$NON-NLS-1$
38
	
39
	/**
40 23
	 * If true, the table computed from an Index will use all the occurrences from the corpus to add the #RESTE# line composed of the others words
41 24
	 */
42
	public static final String USE_ALL_OCCURRENCES = PREFERENCES_PREFIX + "use_all_occurrences"; //$NON-NLS-1$
25
	public static final String USE_ALL_OCCURRENCES = "use_all_occurrences"; //$NON-NLS-1$
43 26
	
44 27
	@Override
45 28
	public void initializeDefaultPreferences() {
tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java (revision 846)
8 8
import java.util.List;
9 9
import java.util.Map;
10 10

  
11
import org.txm.core.preferences.TBXPreferences;
11 12
import org.txm.core.results.Parameter;
12 13
import org.txm.core.results.TXMParameters;
13 14
import org.txm.core.results.TXMResult;
......
181 182
	
182 183
	@Override
183 184
	public boolean saveParameters() {
184
		// TODO Auto-generated method stub
185
		System.err.println("LexicalTable.saveParameters(): not yet implemented.");
185
		if(this.property != null)	{
186
			this.saveParameter(TBXPreferences.UNIT_PROPERTY, this.property.getName());
187
		}
186 188
		return true;
187 189
	}
188 190

  

Formats disponibles : Unified diff