Révision 3292

TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/commands/ExportTEICorpus.java (revision 3292)
32 32

  
33 33
	@Option(name="outputDirectory",usage="zip the result", widget="Folder", required=true, def="outputdir")
34 34
	File outputDirectory;
35
	
35 36
	@Option(name="createArchive",usage="zip the result", widget="Boolean", required=true, def="true")
36 37
	boolean createArchive;
38
	
39
	@Option(name="copyXMLTXMFiles",usage="Copy the XML Files in the 'texts' directory", widget="Boolean", required=true, def="false")
40
	boolean copyXMLTXMFiles;
41
	
37 42
	/* (non-Javadoc)
38 43
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
39 44
	 */
......
59 64
				protected IStatus run(IProgressMonitor monitor) {
60 65
					try {
61 66
						this.runInit(monitor);
62
						if (!export(true, outputDirectory, createArchive, monitor, mainCorpus, analecCorpus, vue)) {
67
						if (!export(true, outputDirectory, createArchive, monitor, mainCorpus, analecCorpus, vue, copyXMLTXMFiles)) {
63 68
							System.out.println(Messages.ExportTEICorpus_2);
64 69
							return Status.CANCEL_STATUS;
65 70
						} else {
......
81 86
		return null;
82 87
	}
83 88
	
84
	public static boolean export(boolean standoffAnnotations, File outputDirectory, boolean createArchive, IProgressMonitor monitor, MainCorpus mainCorpus, Corpus analecCorpus, Vue vue) throws Exception {
89
	public static boolean export(boolean standoffAnnotations, File outputDirectory, boolean createArchive, IProgressMonitor monitor, MainCorpus mainCorpus, Corpus analecCorpus, Vue vue, boolean copyXMLTXMFiles) throws Exception {
85 90
		String name = mainCorpus.getID();
86 91
		File finalOutputDirectory = new File(outputDirectory, name);
87 92
		int n = 2;
......
90 95
			n++;
91 96
		}
92 97
		finalOutputDirectory.mkdirs();
93
		URSAnnotationTEIExporter exporter = new URSAnnotationTEIExporter(monitor, finalOutputDirectory, mainCorpus, analecCorpus, vue);
98
		URSAnnotationTEIExporter exporter = new URSAnnotationTEIExporter(monitor, finalOutputDirectory, mainCorpus, analecCorpus, vue, copyXMLTXMFiles);
94 99
		boolean ret = exporter.process(standoffAnnotations, createArchive);
95 100
		
96 101
		return ret;
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/export/URSAnnotationTEIExporter.java (revision 3292)
15 15

  
16 16
import org.apache.commons.lang.StringUtils;
17 17
import org.eclipse.core.runtime.IProgressMonitor;
18
import org.txm.Toolbox;
18
import org.txm.importer.PersonalNamespaceContext;
19 19
import org.txm.importer.StaxIdentityParser;
20
import org.txm.importer.PersonalNamespaceContext;
21
import org.txm.rcp.Application;
22
import org.txm.rcp.TxmPreferences;
23 20
import org.txm.scripts.importer.StaxStackWriter;
24 21
import org.txm.searchengine.cqp.CQPSearchEngine;
25 22
import org.txm.searchengine.cqp.corpus.MainCorpus;
......
55 52
	protected Corpus analecCorpus;
56 53
	protected Vue analecVue;
57 54
	protected IProgressMonitor monitor;
55
	protected boolean copyXMLTXMFiles = true;
58 56

  
59 57
	/**
60 58
	 * 
......
64 62
	 * @param analecCorpus
65 63
	 * @param analecVue
66 64
	 */
67
	public URSAnnotationTEIExporter(IProgressMonitor monitor, File outputDirectory, MainCorpus mainCorpus, Corpus analecCorpus, Vue analecVue) {
65
	public URSAnnotationTEIExporter(IProgressMonitor monitor, File outputDirectory, MainCorpus mainCorpus, Corpus analecCorpus, Vue analecVue, boolean copyXMLTXMFiles) {
68 66
		this.outputDirectory = outputDirectory;
69 67
		this.mainCorpus = mainCorpus;
70 68
		this.analecCorpus = analecCorpus;
71 69
		this.analecVue = analecVue;
72 70
		this.monitor = monitor;
71
		this.copyXMLTXMFiles = copyXMLTXMFiles;
73 72
	}
74 73

  
75 74
	/**
......
81 80
	 * @throws Exception
82 81
	 */
83 82
	public boolean process(boolean standoff, boolean createArchive) throws Exception {
83
		
84 84
		if (!standoff) {
85 85
			System.out.println("Inligned annotations not implemented yet. Aborting");
86 86
			return false;
......
182 182
			return false;
183 183
		}
184 184

  
185
		if (!FileCopy.copy(xmltxmFileFromBin, xmltxmFile)) {
186
			System.out.println("Error: could not copy the XML-TXM reference file: "+xmltxmFileFromBin);
187
			return false;
185
		if (copyXMLTXMFiles) {
186
			if (!FileCopy.copy(xmltxmFileFromBin, xmltxmFile)) {
187
				System.out.println("Error: could not copy the XML-TXM reference file: "+xmltxmFileFromBin);
188
				return false;
189
			}
188 190
		}
189 191

  
190 192
		XMLStreamWriter writer = null;
TXM/trunk/org.txm.rcp.feature/feature.xml (revision 3292)
6 6
      provider-name="Textometrie.org"
7 7
      plugin="org.txm.rcp">
8 8

  
9
   <description url="https://gitlab.huma-num.fr/txm/textometrie/files/software/TXM/0.8.2">
9
   <description url="https://txm.gitpages.huma-num.fr/textometrie/files/software/TXM/0.8.2/welcome/">
10 10
      %description
11 11
   </description>
12 12

  
13 13
   <copyright url="http://www.example.com/copyright">
14 14
      TXM 0.8.2
15
Copyright © 2013-2020 ENS de Lyon, University of Franche-Comté.
15
Copyright © 2013-2021 ENS de Lyon, University of Franche-Comté.
16 16
Copyright © 2010-2013 ENS de Lyon.
17 17
Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
18 18
Lyon 2, University of Franche-Comté, University of Nice
TXM/trunk/org.txm.core/src/java/org/txm/scripts/importer/MileStoneProjection.groovy (revision 3292)
1 1
package org.txm.scripts.importer
2 2

  
3
import java.io.File;
4
import javax.xml.stream.XMLStreamConstants;
5
import javax.xml.stream.XMLOutputFactory;
6
import javax.xml.stream.XMLStreamWriter;
7
import java.net.URL;
8 3
import javax.xml.stream.*;
9
import org.txm.importer.filters.*;
10
import org.txm.importer.PersonalNamespaceContext;
11 4
import org.txm.importer.StaxIdentityParser
12 5

  
13 6
/**
......
41 34
		this.mileStoneTag = mileStoneTag
42 35
		mileStoneID = mileStoneTag+"_0"
43 36
		this.startTag = startTag
44
		this.start = false;
37
		this.start = (startTag == null);
45 38
		
46 39
		msIdAttributeName = mileStoneTag+"id";
47 40
		msStartAttributeName = mileStoneTag+"start";
48 41
		msEndAttributeName = mileStoneTag+"end";
49 42
		
50 43
		fetchMilestoneLengths();
51
		start = false // reset
44
		this.start = (startTag == null);
52 45
	}
53 46
	
54 47
	public void fetchMilestoneLengths() {
......
85 78
		super.processStartElement();
86 79
		
87 80
		if (start && localname.equals(mileStoneTag)) {
81
			//println "START MILESTONE"
88 82
			mileStoneDistance = 0
83
			//println parser
89 84
			mileStoneID = parser.getAttributeValue(null, "id")
90 85
			if (mileStoneID == null) mileStoneID = parser.getAttributeValue("xml", "id");
91 86
			if (mileStoneID == null) mileStoneID = "0";
92 87
			
93 88
			milestonesCounter++;
94 89
		} else if (start && localname.equals(wordTag)) {
90
			//println "START W"
95 91
			// println "end of $milestonesCounter len="+milestonesLength[milestonesCounter]+" dist="+mileStoneDistance
96 92
			writer.writeAttribute(msEndAttributeName, Integer.toString((milestonesLength[milestonesCounter] - mileStoneDistance - 1)))
97 93
			writer.writeAttribute(msStartAttributeName, Integer.toString(mileStoneDistance))
......
104 100
	}
105 101
	
106 102
	public static void main(String[] args) {
107
		File inputFile = new File(System.getProperty("user.home"), "TXM-0.8.2/corpora/XTZMILESTONES/tokenized/test.xml")
108
		File outputFile = new File(System.getProperty("user.home"), "TXM-0.8.2/corpora/XTZMILESTONES/tokenized/result.xml")
103
		File inputFile = new File(System.getProperty("user.home"), "runtime-rcpapplication.product/corpora/XTZMILESTONES2/tokenized/test.xml")
104
		File outputFile = new File(System.getProperty("user.home"), "runtime-rcpapplication.product/corpora/XTZMILESTONES2/tokenized/result.xml")
109 105
		
110
		MileStoneProjection msp = new MileStoneProjection(inputFile, "text", "w", "lb");
106
		MileStoneProjection msp = new MileStoneProjection(inputFile, null, "w", "lb");
111 107
		println "Sucess: "+msp.process(outputFile)
112 108
	}
113 109
}
TXM/trunk/org.txm.core/src/java/org/txm/xml/xmltxm/XMLTXMWordPropertiesInjection.java (revision 3292)
73 73
	 * 
74 74
	 */
75 75
	public void addProperty(String id, HashMap<String, String> properties) throws IOException, XMLStreamException {
76
		if (rules != null) {
76
		if (rules == null) {
77 77
			setProperties(new HashMap<String, HashMap<String, String>>());
78 78
		}
79
		
80
		rules.put(id,  properties);
79 81
	}
80 82
	
81 83
	public HashSet<String> getNonActivatedRules() {
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/TrimTranscriptionMacro.groovy (revision 3292)
153 153
	switch(node.name()) {
154 154
		case "Turn":
155 155
		case "Section":
156
			node.@startTime = ""+value
156
			node.@startTime = String.format("%0,.2f", value)
157 157
			break;
158 158

  
159 159
		case "Sync":
160
			return node.@time = ""+value
160
			return node.@time = String.format("%0,.2f", value)
161 161
		default: break;
162 162
	}
163 163
}
......
186 186
	switch(node.name()) {
187 187
		case "Turn":
188 188
		case "Section":
189
			node.@endTime = ""+value
189
			node.@endTime = String.format("%0,.2f", value)
190 190
			break;
191 191

  
192 192
		case "Sync":
193
			return node.@time = ""+value
193
			return node.@time = String.format("%0,.2f", value)
194 194
		default: break;
195 195
	}
196 196
}
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZImporter.groovy (revision 3292)
237 237
			for (File inputFile : filesToProcess) {
238 238
				File outputFile = new File(inputFile.getParentFile(), "tmp"+inputFile.getName());
239 239
				println "$inputFile, 'text', $wordTag, $milestone, $outputFile"
240
				MileStoneProjection msp = new MileStoneProjection(inputFile, "text", wordTag, milestone)
240
				MileStoneProjection msp = new MileStoneProjection(inputFile, null, wordTag, milestone)
241 241
				if (!msp.process(outputFile)) {
242 242
					println "** Fail to encode $milestone in $inputFile"
243 243
					return false
TXM/trunk/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/OpenEdition.java (revision 3292)
45 45
import org.txm.edition.rcp.messages.EditionUIMessages;
46 46
import org.txm.objects.Project;
47 47
import org.txm.objects.Text;
48
import org.txm.rcp.editors.TXMEditor;
49 48
import org.txm.searchengine.cqp.corpus.CQPCorpus;
50
import org.txm.searchengine.cqp.corpus.MainCorpus;
51
import org.txm.searchengine.cqp.corpus.Property;
52
import org.txm.searchengine.cqp.corpus.StructuralUnit;
53
import org.txm.searchengine.cqp.corpus.Subcorpus;
54
import org.txm.searchengine.cqp.corpus.query.Match;
55 49
import org.txm.utils.logger.Log;
56 50

  
57
// TODO: Auto-generated Javadoc
58 51
/**
59 52
 * Open a text edition from: a main corpus : the first text of the maincorpus a
60 53
 * sub-corpus : the first text of the subcorpus a partition : the user must
TXM/trunk/org.txm.internalview.rcp/src/org/txm/internalview/rcp/editors/InternalViewEditor.java (revision 3292)
14 14
import org.eclipse.jface.viewers.Viewer;
15 15
import org.eclipse.osgi.util.NLS;
16 16
import org.eclipse.swt.SWT;
17
import org.eclipse.swt.events.KeyEvent;
18
import org.eclipse.swt.events.KeyListener;
17 19
import org.eclipse.swt.layout.GridData;
18 20
import org.eclipse.swt.layout.GridLayout;
19 21
import org.eclipse.swt.widgets.Composite;
20 22
import org.eclipse.swt.widgets.Label;
23
import org.eclipse.swt.widgets.Spinner;
21 24
import org.eclipse.swt.widgets.Table;
22 25
import org.eclipse.swt.widgets.TableColumn;
23 26
import org.eclipse.swt.widgets.TableItem;
......
30 33
import org.txm.rcp.editors.TableKeyListener;
31 34
import org.txm.rcp.editors.listeners.ComputeKeyListener;
32 35
import org.txm.rcp.editors.listeners.ComputeSelectionListener;
36
import org.txm.rcp.messages.TXMUIMessages;
33 37
import org.txm.rcp.swt.widget.NewNavigationWidget;
34 38
import org.txm.rcp.swt.widget.PropertiesSelector;
35 39
import org.txm.rcp.swt.widget.structures.StructuralUnitsComboViewer;
......
92 96
	@Parameter(key = InternalViewPreferences.STRUCTURAL_UNIT_PROPERTIES)
93 97
	protected PropertiesSelector<StructuralUnitProperty> structuralUnitPropertiesSelector;
94 98
	
99
	/**
100
	 * Number of lines to display.
101
	 */
102
	@Parameter(key = InternalViewPreferences.N_LINES_PER_PAGE)
103
	protected Spinner nLinesPerPagesSpinner;
95 104
	
96 105
	@Override
97 106
	public void _createPartControl() {
......
104 113
		
105 114
		
106 115
		Composite parametersArea = getExtendedParametersGroup();
107
		parametersArea.setLayout(new GridLayout(5, false));
116
		parametersArea.setLayout(new GridLayout(6, false));
108 117
		parametersArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
109 118
		
110 119
		Composite resultPanel = getResultArea();
......
144 153
		structuralUnitPropertiesSelector.setTitle(InternalViewUIMessages.structuralProperties);
145 154
		structuralUnitPropertiesSelector.addSelectionListener(computeSelectionListener);
146 155
		
156
		new Label(parametersArea, SWT.NONE).setText(TXMUIMessages.numberOfLines);
157
		nLinesPerPagesSpinner = new Spinner(parametersArea, SWT.NONE);
158
		nLinesPerPagesSpinner.setMinimum(1);
159
		nLinesPerPagesSpinner.setMaximum(Integer.MAX_VALUE);
160
		nLinesPerPagesSpinner.addSelectionListener(computeSelectionListener);
161
		nLinesPerPagesSpinner.addKeyListener(computeKeyListener);
147 162
		
148 163
		navigationPanel = getBottomToolbar().installGLComposite(InternalViewUIMessages.navigation, 4, false);
149 164
		navigationPanel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
......
186 201
			@Override
187 202
			public Object[] getElements(Object inputElement) {
188 203
				int nlines = internalView.getSegmentLength();
204
				nlines = Math.min(nlines, internalView.getNLinesPerPage());
189 205
				List<WordProperty> props = internalView.getProperties();
190 206
				
191 207
				ArrayList<Object[]> lines = new ArrayList<>();
......
360 376
		
361 377
		navigation.refresh();
362 378
		navigationPanel.layout();
379
		
380
		if (internalView.getSegmentLength() > internalView.getNLinesPerPage()) {
381
			Log.info(NLS.bind("Warning: the navigator table content has been cut to {0} (was {1}).", internalView.getNLinesPerPage(), internalView.getSegmentLength()));
382
		}
363 383
	}
364 384
	
365 385
	@Override
TXM/trunk/org.txm.rcp/VERSION (revision 3292)
1
0.8.2
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/AbstractSplashHandler2.java (revision 3292)
1
// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
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.resource.ImageDescriptor;
31
import org.eclipse.swt.events.PaintEvent;
32
import org.eclipse.swt.events.PaintListener;
33
import org.eclipse.swt.graphics.Image;
34
import org.eclipse.swt.widgets.Shell;
35
import org.eclipse.ui.internal.splash.EclipseSplashHandler;
36
import org.eclipse.ui.plugin.AbstractUIPlugin;
37

  
38
//// TODO: Auto-generated Javadoc
39
///**
40
// * SplashScreen for TXM: not used yet
41
// */
42
//public class AbstractSplashHandler2 extends BasicSplashHandler {
43
//
44
//	/**
45
//	 * Instantiates a new abstract splash handler2.
46
//	 */
47
//	public AbstractSplashHandler2() {
48
//		Composite c = this.getContent();
49
//		new Label(c, SWT.BORDER).setText(Messages.AbstractSplashHandler2_0);
50
//		IProgressMonitor bundle = this.getBundleProgressMonitor();
51
//		// .subTask("HELLLOOOOO");
52
//		this.getBundleProgressMonitor().setTaskName(Messages.AbstractSplashHandler2_1);
53
//		System.out.println(Messages.AbstractSplashHandler2_2);
54
//	}
55
//
56
//	/**
57
//	 * Hurler.
58
//	 *
59
//	 * @param message the message
60
//	 */
61
//	public static void hurler(String message) {
62
//
63
//	}
64
//}
65

  
66
public class AbstractSplashHandler2 extends EclipseSplashHandler {
67
	
68
	private static final int BORDER = 10;
69
	
70
	private Image image;
71
	
72
	@Override
73
	public void init(Shell splash) {
74
		super.init(splash);
75
		
76
		// here you could check some condition on which decoration to show
77
		
78
		ImageDescriptor descriptor = IImageKeys.getImageDescriptor(IImageKeys.TXM);
79
		if (descriptor != null) {
80
			image = descriptor.createImage();
81
		}
82
		if (image != null) {
83
			final int xposition = splash.getSize().x - image.getImageData().width - BORDER;
84
			final int yposition = BORDER;
85
			getContent().addPaintListener(new PaintListener() {
86
				
87
				@Override
88
				public void paintControl(PaintEvent e) {
89
					e.gc.drawImage(image, xposition, yposition);
90
				}
91
			});
92
		}
93
	}
94
	
95
	@Override
96
	public void dispose() {
97
		super.dispose();
98
		if (image != null) {
99
			image.dispose();
100
		}
101
	}
102
	
103
}
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/CGUMessageDialog.java (revision 3292)
23 23
import org.eclipse.swt.widgets.Label;
24 24
import org.eclipse.swt.widgets.Shell;
25 25
import org.eclipse.ui.internal.ide.ChooseWorkspaceData;
26
import org.txm.rcp.ApplicationWorkbenchAdvisor;
26 27
import org.txm.rcp.IImageKeys;
27 28
import org.txm.rcp.messages.TXMUIMessages;
28 29
import org.txm.rcp.swt.SelectDirectoryWidget;
......
43 44

  
44 45
	protected void configureShell(Shell newShell) {
45 46
		super.configureShell(newShell);
46
		newShell.setText(TXMUIMessages.firstLaunchOfTXM);
47
		newShell.setText(TXMUIMessages.bind(TXMUIMessages.firstLaunchOfTXMP0, ApplicationWorkbenchAdvisor.getTXMVersionPrettyString()));
47 48
	}
48 49

  
49 50
	@Override
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java (revision 3292)
33 33
import java.io.PrintStream;
34 34
import java.lang.reflect.InvocationTargetException;
35 35
import java.net.URL;
36
import java.text.DateFormat;
37 36
import java.util.ArrayList;
38 37
import java.util.Arrays;
39
import java.util.Date;
40 38
import java.util.HashMap;
41
import java.util.Iterator;
42 39
import java.util.List;
43 40
import java.util.logging.Handler;
44 41
import java.util.logging.Level;
......
54 51
import org.eclipse.core.runtime.preferences.DefaultScope;
55 52
import org.eclipse.e4.ui.css.swt.theme.IThemeEngine;
56 53
import org.eclipse.e4.ui.css.swt.theme.IThemeManager;
57
import org.eclipse.equinox.internal.p2.engine.Profile;
58
import org.eclipse.equinox.p2.core.IProvisioningAgent;
59
import org.eclipse.equinox.p2.engine.IProfile;
60
import org.eclipse.equinox.p2.engine.IProfileRegistry;
61
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
62
import org.eclipse.equinox.p2.ui.ProvisioningUI;
63 54
import org.eclipse.jface.dialogs.MessageDialog;
64 55
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
65 56
import org.eclipse.jface.operation.IRunnableWithProgress;
......
109 100
import org.txm.rcp.commands.OpenWelcomePage;
110 101
import org.txm.rcp.commands.RestartTXM;
111 102
import org.txm.rcp.commands.workspace.LoadBinaryCorporaDirectory;
112
import org.txm.rcp.handlers.results.DeleteObject;
113 103
import org.txm.rcp.handlers.scripts.ExecuteGroovyScript;
114 104
import org.txm.rcp.messages.TXMUIMessages;
115 105
import org.txm.rcp.p2.plugins.TXMUpdateHandler;
......
294 284
		}
295 285
	}
296 286
	
297
	public static void printTXMVersion() {
287
	public static String getTXMStartMessage() {
298 288
		
289
		String pretty_version =  getTXMVersionPrettyString();
290
			return NLS.bind(TXMUIMessages.startingUpP0, pretty_version);
291
		
292
	}
293
	
294
	public static String getTXMVersion() {
295
		Version version = Activator.getDefault().getBundle().getVersion();
296
		return version.getMajor() + "." + version.getMinor() + "." + version.getMicro();
297
	}
298
	
299
	public static String getTXMVersionPrettyString() {
300
				
301
		Version version = getBuildVersion();
302
		String build_date =  getBuildDate(version);
303
		
304
		String txm_date = getUpdateDate();
305
		version = Activator.getDefault().getBundle().getVersion();
306
		
307
		if (txm_date.equals(build_date)) {
308
			return (NLS.bind(TXMUIMessages.prettyVersionP0P1,
309
					version.getMajor() + "." + version.getMinor() + "." + version.getMicro(), build_date));
310
		}
311
		else {
312
			return (NLS.bind(TXMUIMessages.prettyVersionP0P1,
313
					version.getMajor() + "." + version.getMinor() + "." + version.getMicro(), "update " + txm_date + " - build " + build_date));
314
		}
315
	}
316
	
317
	public static Version getBuildVersion() {
299 318
		String version = null;
300 319
		
301 320
		// try finding build date from the p2 artifacts file in installation directory
......
338 357
		}
339 358
		
340 359
		Version v2 = new Version(version);
341
		String build_date = v2.getQualifier().replaceAll("(....)(..)(..)(..)(..)", "$1-$2-$3 $4h$5"); //$NON-NLS-1$ //$NON-NLS-2$
342
		
343
		Version v = Activator.getDefault().getBundle().getVersion();
344
		String txm_date = v.getQualifier().replaceAll("(....)(..)(..)(..)(..)", "$1-$2-$3 $4h$5");
345
		
346
		if (txm_date.equals(build_date)) {
347
			System.out.println(NLS.bind(TXMUIMessages.startingUpP0,
348
					v.getMajor() + "." + v.getMinor() + "." + v.getMicro(), build_date));
349
		}
350
		else {
351
			System.out.println(NLS.bind(TXMUIMessages.startingUpP0,
352
					v.getMajor() + "." + v.getMinor() + "." + v.getMicro(), "update " + txm_date + " - build " + build_date));
353
		}
360
		return v2;
354 361
	}
355 362
	
363
	public static String getBuildDate(Version version) {
364
		return version.getQualifier().replaceAll("(....)(..)(..)(..)(..)", "$1-$2-$3 $4h$5"); //$NON-NLS-1$ //$NON-NLS-2$
365
	}
366
	
367
	public static String getUpdateDate() {
368
		Version version = Activator.getDefault().getBundle().getVersion();
369
		return version.getQualifier().replaceAll("(....)(..)(..)(..)(..)", "$1-$2-$3 $4h$5");
370
	}
371
	
356 372
	private void setPreferencesConfiguration() {
357 373
		PreferenceManager pm = PlatformUI.getWorkbench().getPreferenceManager();
358 374
		
......
1069 1085
			@Override
1070 1086
			public void run() {
1071 1087
				try {
1072
					printTXMVersion();
1088
					System.out.println(getTXMStartMessage());
1073 1089
					
1074 1090
					// ensure some preferences are set
1075 1091
					DefaultScope.INSTANCE.getNode("org.eclipse.ui.workbench").putBoolean(IPreferenceConstants.RUN_IN_BACKGROUND, false); //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$
......
1161 1177
		// TxmPreferences.dump();
1162 1178
		return initializeUIPMD != null && !initializeUIPMD.getProgressMonitor().isCanceled();
1163 1179
	}
1180

  
1181
	public static String getVersionLevel() {
1182
		try {
1183
			URL url = Activator.getDefault().getBundle().getResource("SUBVERSION");
1184
			String subversion = IOUtils.getText(url, "UTF-8");
1185
			return subversion;
1186
		}
1187
		catch (IOException e) {
1188
			// TODO Auto-generated catch block
1189
			e.printStackTrace();
1190
		}
1191
		return "STABLE";
1192
	}
1164 1193
}
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/messages/TXMUIMessages.java (revision 3292)
922 922
	
923 923
	public static String startingUpP0;
924 924
	
925
	public static String prettyVersionP0P1;
926
	
925 927
	public static String startingUpdateFetch;
926 928
	
927 929
	public static String startsWith;
......
1118 1120
	
1119 1121
	public static String selectWorkingDirectory;
1120 1122
	
1121
	public static String firstLaunchOfTXM;
1123
	public static String firstLaunchOfTXMP0;
1122 1124
	
1123 1125
	public static String LoadBinaryCorporaDirectory_aCorpusNamedP0alreadyExistsLoadingOfP1Canceled;
1124 1126
	
......
1177 1179
	public static String performWordSegmentationWithinWord;
1178 1180

  
1179 1181
	public static String xmlTagNameThatEncodesWords;
1182

  
1183
	public static String numberOfLines;
1180 1184
	
1181 1185
	static {
1182 1186
		// initialize resource bundle
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages.properties (revision 3292)
528 528

  
529 529
fileExplorerColonIncorrectPattern = ** File Explorer: Incorrect Regular Expression
530 530

  
531
firstLaunchOfTXM = First launch of TXM
531
firstLaunchOfTXMP0 = First launch of TXM {0}
532 532

  
533 533
folderP0ShouldNotBeDeleted = Folder {0} should not be deleted
534 534

  
......
760 760

  
761 761
numberOfEdgesColon = Number of edges: {0}.
762 762

  
763
numberOfLinesColon = Number of lines: {0}.
763
numberOfLinesColon = Number of lines: {0}.
764

  
765
numberOfLines = Number of lines
764 766

  
765 767
numberOfNodesColon = Number of nodes: {0}.
766 768

  
......
984 986

  
985 987
startingTxm = Starting TXM
986 988

  
987
startingUpP0 = Starting TXM {0} ({1})…
989
startingUpP0 = Starting TXM {0}…
990

  
991
prettyVersionP0P1 = {0} ({1})
988 992

  
989 993
startingUpdateFetch = Starting updates retrieval
990 994

  
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages_fr.properties (revision 3292)
496 496

  
497 497
fileExplorerColonIncorrectPattern = ** Explorateur de fichiers : expression régulière incorrecte
498 498

  
499
firstLaunchOfTXM = Premier lancement de TXM
499
firstLaunchOfTXMP0 = Premier lancement de TXM {0}
500 500

  
501 501
folderP0ShouldNotBeDeleted = Le dossier {0} ne devrait pas être supprimé
502 502

  
......
722 722

  
723 723
numberOfLinesColon = Nombre de lignes : {0}.
724 724

  
725
numberOfLines = Nombre de lignes
726

  
725 727
numberOfNodesColon = Nombre de noeuds : {0}.
726 728

  
727 729
objColon = Objet : 
......
940 942

  
941 943
startJobColonLoadInstallPreferences = Démarrage : chargement des préférences d'installation
942 944

  
943
startingUpP0 = Démarrage de TXM {0} ({1})
945
startingUpP0 = Démarrage de TXM {0}
944 946

  
947
prettyVersionP0P1 = {0} ({1})
948

  
945 949
startingUpdateFetch = Démarrage de la récupération des mises à jour
946 950

  
947 951
startsWith = commence par
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/Activator.java (revision 3292)
31 31
import java.io.File;
32 32

  
33 33
import org.eclipse.core.runtime.Platform;
34
import org.eclipse.swt.widgets.Display;
35
import org.eclipse.swt.widgets.Shell;
36
import org.eclipse.ui.internal.Workbench;
37
import org.eclipse.ui.internal.WorkbenchPlugin;
34 38
import org.eclipse.ui.plugin.AbstractUIPlugin;
35 39
import org.osgi.framework.BundleContext;
36 40
import org.txm.utils.io.IOUtils;
......
63 67
	@Override
64 68
	public void start(BundleContext context) throws Exception {
65 69
		super.start(context);
66

  
70
		
67 71
		System.out.println("TXM ACTIVATED. ALL SYSTEMS GO!");
68 72
//		try {
69 73
//			preventBrokenTXMINI();
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 3292)
1048 1048
	 * @param result
1049 1049
	 * @param editorPartId
1050 1050
	 */
1051
	public static TXMEditor<? extends TXMResult> openEditor(TXMResult result, String editorPartId) {
1052
		return openEditor(new TXMResultEditorInput<>(result), editorPartId);
1051
	public static <T extends TXMResult> TXMEditor<T> openEditor(T result, String editorPartId) {
1052
		return openEditor(new TXMResultEditorInput<T>(result), editorPartId);
1053 1053
	}
1054 1054
	
1055 1055
	/**
......
1061 1061
	 * @return
1062 1062
	 */
1063 1063
	@SuppressWarnings("unchecked")
1064
	public static TXMEditor<? extends TXMResult> openEditor(TXMResultEditorInput<? extends TXMResult> editorInput, String editorId) {
1064
	public static <T extends TXMResult> TXMEditor<T> openEditor(TXMResultEditorInput<T> editorInput, String editorId) {
1065 1065
		
1066
		TXMEditor<? extends TXMResult> editor = null;
1066
		TXMEditor<T> editor = null;
1067 1067
		IWorkbenchWindow window = TXMWindows.getActiveWindow();
1068 1068
		IWorkbenchPage page = window.getActivePage();
1069 1069
		try {
......
1099 1099
			// opening the editor
1100 1100
			IEditorPart tmpEditor = page.openEditor(editorInput, editorId, true, IWorkbenchPage.MATCH_INPUT | IWorkbenchPage.MATCH_ID);
1101 1101
			if (tmpEditor instanceof TXMEditor) {
1102
				editor = (TXMEditor<? extends TXMResult>) tmpEditor;
1102
				editor = (TXMEditor<T>) tmpEditor;
1103 1103
			}
1104 1104
			else if (tmpEditor instanceof TXMMultiPageEditor) {
1105
				editor = (TXMEditor<? extends TXMResult>) ((TXMMultiPageEditor) tmpEditor).getMainEditorPart();
1105
				editor = (TXMEditor<T>) ((TXMMultiPageEditor) tmpEditor).getMainEditorPart();
1106 1106
				
1107 1107
				// If result specify a opening Area use it
1108 1108
				
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/splashHandlers/TXMSplashHandler.java (revision 3292)
1
// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
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.splashHandlers;
29

  
30
import org.eclipse.jface.resource.ImageDescriptor;
31
import org.eclipse.osgi.util.NLS;
32
import org.eclipse.swt.SWT;
33
import org.eclipse.swt.events.PaintEvent;
34
import org.eclipse.swt.events.PaintListener;
35
import org.eclipse.swt.graphics.Color;
36
import org.eclipse.swt.graphics.Font;
37
import org.eclipse.swt.graphics.FontMetrics;
38
import org.eclipse.swt.graphics.Image;
39
import org.eclipse.swt.graphics.Point;
40
import org.eclipse.swt.layout.GridLayout;
41
import org.eclipse.swt.widgets.Label;
42
import org.eclipse.swt.widgets.Shell;
43
import org.eclipse.ui.internal.splash.EclipseSplashHandler;
44
import org.eclipse.ui.plugin.AbstractUIPlugin;
45
import org.osgi.framework.Version;
46
import org.txm.rcp.Activator;
47
import org.txm.rcp.ApplicationWorkbenchAdvisor;
48
import org.txm.rcp.IImageKeys;
49
import org.txm.rcp.messages.TXMUIMessages;
50

  
51
//// TODO: Auto-generated Javadoc
52
///**
53
// * SplashScreen for TXM: not used yet
54
// */
55
//public class AbstractSplashHandler2 extends BasicSplashHandler {
56
//
57
//	/**
58
//	 * Instantiates a new abstract splash handler2.
59
//	 */
60
//	public AbstractSplashHandler2() {
61
//		Composite c = this.getContent();
62
//		new Label(c, SWT.BORDER).setText(Messages.AbstractSplashHandler2_0);
63
//		IProgressMonitor bundle = this.getBundleProgressMonitor();
64
//		// .subTask("HELLLOOOOO");
65
//		this.getBundleProgressMonitor().setTaskName(Messages.AbstractSplashHandler2_1);
66
//		System.out.println(Messages.AbstractSplashHandler2_2);
67
//	}
68
//
69
//	/**
70
//	 * Hurler.
71
//	 *
72
//	 * @param message the message
73
//	 */
74
//	public static void hurler(String message) {
75
//
76
//	}
77
//}
78

  
79
public class TXMSplashHandler extends EclipseSplashHandler {
80
	
81
	private static final int BORDER = 10;
82
	
83
	Font font;
84
	Color greenTXM, redTXM;
85
	
86
	String version, infos, level;
87
	@Override
88
	public void init(Shell splash) {
89
		super.init(splash);
90
		
91
		
92
		
93
		// here you could check some condition on which decoration to show
94
		
95
		version = "TXM "+ApplicationWorkbenchAdvisor.getTXMVersion();
96
		
97
		String build_date =  ApplicationWorkbenchAdvisor.getBuildDate(ApplicationWorkbenchAdvisor.getBuildVersion());
98
		
99
		String txm_date = ApplicationWorkbenchAdvisor.getUpdateDate();
100
		
101
		level = ApplicationWorkbenchAdvisor.getVersionLevel().toUpperCase();
102
		
103
		greenTXM = new Color(splash.getDisplay(), 109,139,0);
104
		redTXM = new Color(splash.getDisplay(), 255,0,0);
105
		font = new Font(splash.getDisplay(), "Arial", 17, SWT.BOLD);
106
		
107
		if (txm_date.equals(build_date)) {
108
			infos = build_date;
109
		}
110
		else {
111
			infos = "update " + txm_date + " - build " + build_date;
112
		}
113
		
114
		if ("STABLE".equals(level)) {
115
			level = null;
116
		}
117
		
118
		getContent().addPaintListener(new PaintListener() {
119
			
120
			@Override
121
			public void paintControl(PaintEvent e) {
122
				e.gc.setFont(font);
123
				e.gc.setForeground(greenTXM);
124
				Point textSize2 = e.gc.textExtent(version);
125
				e.gc.drawString(version, (int) (316 - textSize2.x - (BORDER*1.5)), 230, true);
126
				
127
				Point textSize = e.gc.textExtent(infos);
128
				e.gc.drawString(infos, (int) (316 - textSize.x - (BORDER*1.5)), 233 + textSize2.y, true);
129
				
130
				if (level != null) {
131
					e.gc.setForeground(redTXM);
132
					textSize = e.gc.textExtent(level);
133
					e.gc.drawString(level, (int) (316 - textSize.x - (BORDER*1.5)), 2*BORDER, true);
134
				}
135
			}
136
		});
137
	}
138
	
139
	@Override
140
	public void dispose() {
141
		super.dispose();
142
	}
143
	
144
}
0 145

  
TXM/trunk/org.txm.rcp/rcpapplication.product (revision 3292)
1 1
<?xml version="1.0" encoding="UTF-8"?>
2 2
<?pde version="3.5"?>
3 3

  
4
<product name="TXM" uid="org.txm.rcp.app" id="org.txm.rcp.product" application="org.txm.rcp.Application" version="0.8.1.qualifier" useFeatures="true" includeLaunchers="true">
4
<product name="TXM" uid="org.txm.rcp.app" id="org.txm.rcp.product" application="org.txm.rcp.Application" version="0.8.2.qualifier" useFeatures="true" includeLaunchers="true">
5 5

  
6 6
   <aboutInfo>
7 7
      <image path="/org.txm.rcp/icons/logo/about TXM.png"/>
8 8
      <text>
9 9
         [Contrat d&apos;utilisation du logiciel TXM]
10 10

  
11
TXM 0.8.1 Copyright © 2010-2021 ENS de Lyon, University of Franche-Comté, CNRS
11
TXM 0.8.2 Copyright © 2010-2021 ENS de Lyon, University of Franche-Comté, CNRS
12 12

  
13 13
&lt;English version below&gt;
14 14

  
TXM/trunk/org.txm.rcp/build.properties (revision 3292)
17 17
               TXM.sh,\
18 18
               icons/,\
19 19
               OSGI-INF/,\
20
               OSGI-INF/l10n/bundle.properties
20
               OSGI-INF/l10n/bundle.properties,\
21
               SUBVERSION,\
22
               VERSION
21 23
source..=src/main/java/
22 24
bin.excludes = lib/batik/
23 25
#qualifier=svn
TXM/trunk/org.txm.rcp/plugin.xml (revision 3292)
52 52
         </property>
53 53
         <property
54 54
               name="aboutText"
55
               value="[Contrat d&apos;utilisation du logiciel TXM]&#x0A;&#x0A;TXM 0.8.1 Copyright © 2010-2021 ENS de Lyon, University of Franche-Comté, CNRS&#x0A;&#x0A;&lt;English version below&gt;&#x0A;&#x0A;EN ACCEPTANT CETTE INSTALLATION OU MISE À JOUR ET EN UTILISANT TXM, VOUS VOUS ENGAGEZ À CITER L&apos;ARTICLE DE RÉFÉRENCE DE LA PLATEFORME* DANS VOS PUBLICATIONS DE RÉSULTATS OBTENUS À PARTIR D&apos;ELLE. CELA EST ESSENTIEL POUR NOUS PERMETTRE DE JUSTIFIER LE BESOIN DE PÉRENNISATION DE CET INSTRUMENT DE TRAVAIL POUR LA COMMUNAUTÉ SCIENTIFIQUE.&#x0A;&#x0A;Le logiciel TXM est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier suivant les termes de la Licence publique générale GNU telle que publiée par la Free Software Foundation, soit la version 2 de cette License, soit une version ultérieure.&#x0A;&#x0A;Le logiciel TXM est distribué dans l&apos;espoir qu&apos;il sera utile, mais sans aucune garantie, y compris mais non de façon limitative les garanties implicites de qualité marchande et de convenance à un usage particulier. Consultez la version 2 et la version 3 de la Licence publique générale GNU pour plus de détails.&#x0A;&#x0A;Vous devriez avoir reçu une copie de la Licence publique générale GNU en accompagnement du logiciel TXM ; si ce n&apos;est pas le cas, veuillez consulter la page http://www.gnu.org/licenses/gpl-2.0.html&#x0A;_______________&#x0A;* Serge Heiden, Jean-Philippe Magué, Bénédicte Pincemin.&#x0A;TXM : Une plateforme logicielle open-source pour la textométrie - conception et développement. Sergio Bolasco, Isabella Chiari, Luca Giuliano. 10th International Conference on the Statistical Analysis of Textual Data - JADT 2010, Jun 2010, Rome, Italie.&#x0A;Edizioni Universitarie di Lettere Economia Diritto, 2 (3), pp.1021-1032, 2010. &lt;halshs-00549779&gt;&#x0A;&#x0A;&#x0A;ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH&#x0A;&#x0A;[TXM Software User Agreement]&#x0A;&#x0A;By accepting this update and by using TXM, you agree to cite the TXM platform reference article** in your publications of results obtained from it. That is essential for us to justify the need for sustainability of this instrument for the scientific community.&#x0A;&#x0A;The TXM platform is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.&#x0A;&#x0A;The TXM platform is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.&#x0A;&#x0A;You should have received a copy of the GNU General Public License along with the TXM platform. If not, see http://www.gnu.org/licenses/gpl-2.0.html&#x0A;_______________&#x0A;** Serge Heiden. The TXM Platform: Building Open-Source Textual&#x0A;Analysis Software Compatible with the TEI Encoding Scheme. Ryo Otoguro, Kiyoshi Ishikawa, Hiroshi Umemoto, Kei Yoshimoto and Yasunari Harada. 24th Pacific Asia Conference on Language, Information and Computation, Nov 2010, Sendai, Japan. Institute for Digital Enhancement of Cognitive Development, Waseda University, pp.389-398, 2010. &lt;halshs-00549764&gt;">
55
               value="[Contrat d&apos;utilisation du logiciel TXM]&#x0A;&#x0A;TXM 0.8.2 Copyright © 2010-2021 ENS de Lyon, University of Franche-Comté, CNRS&#x0A;&#x0A;&lt;English version below&gt;&#x0A;&#x0A;EN ACCEPTANT CETTE INSTALLATION OU MISE À JOUR ET EN UTILISANT TXM, VOUS VOUS ENGAGEZ À CITER L&apos;ARTICLE DE RÉFÉRENCE DE LA PLATEFORME* DANS VOS PUBLICATIONS DE RÉSULTATS OBTENUS À PARTIR D&apos;ELLE. CELA EST ESSENTIEL POUR NOUS PERMETTRE DE JUSTIFIER LE BESOIN DE PÉRENNISATION DE CET INSTRUMENT DE TRAVAIL POUR LA COMMUNAUTÉ SCIENTIFIQUE.&#x0A;&#x0A;Le logiciel TXM est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier suivant les termes de la Licence publique générale GNU telle que publiée par la Free Software Foundation, soit la version 2 de cette License, soit une version ultérieure.&#x0A;&#x0A;Le logiciel TXM est distribué dans l&apos;espoir qu&apos;il sera utile, mais sans aucune garantie, y compris mais non de façon limitative les garanties implicites de qualité marchande et de convenance à un usage particulier. Consultez la version 2 et la version 3 de la Licence publique générale GNU pour plus de détails.&#x0A;&#x0A;Vous devriez avoir reçu une copie de la Licence publique générale GNU en accompagnement du logiciel TXM ; si ce n&apos;est pas le cas, veuillez consulter la page http://www.gnu.org/licenses/gpl-2.0.html&#x0A;_______________&#x0A;* Serge Heiden, Jean-Philippe Magué, Bénédicte Pincemin.&#x0A;TXM : Une plateforme logicielle open-source pour la textométrie - conception et développement. Sergio Bolasco, Isabella Chiari, Luca Giuliano. 10th International Conference on the Statistical Analysis of Textual Data - JADT 2010, Jun 2010, Rome, Italie.&#x0A;Edizioni Universitarie di Lettere Economia Diritto, 2 (3), pp.1021-1032, 2010. &lt;halshs-00549779&gt;&#x0A;&#x0A;&#x0A;ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH&#x0A;&#x0A;[TXM Software User Agreement]&#x0A;&#x0A;By accepting this update and by using TXM, you agree to cite the TXM platform reference article** in your publications of results obtained from it. That is essential for us to justify the need for sustainability of this instrument for the scientific community.&#x0A;&#x0A;The TXM platform is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.&#x0A;&#x0A;The TXM platform is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.&#x0A;&#x0A;You should have received a copy of the GNU General Public License along with the TXM platform. If not, see http://www.gnu.org/licenses/gpl-2.0.html&#x0A;_______________&#x0A;** Serge Heiden. The TXM Platform: Building Open-Source Textual&#x0A;Analysis Software Compatible with the TEI Encoding Scheme. Ryo Otoguro, Kiyoshi Ishikawa, Hiroshi Umemoto, Kei Yoshimoto and Yasunari Harada. 24th Pacific Asia Conference on Language, Information and Computation, Nov 2010, Sendai, Japan. Institute for Digital Enhancement of Cognitive Development, Waseda University, pp.389-398, 2010. &lt;halshs-00549764&gt;">
56 56
         </property>
57 57
         <property
58 58
               name="startupProgressRect"
......
3136 3136
   <extension
3137 3137
         point="org.eclipse.ui.splashHandlers">
3138 3138
      <splashHandler
3139
            class="org.txm.rcp.AbstractSplashHandler2"
3140
            id="org.txm.rcp.AbstractSplashHandler2">
3139
            class="org.txm.rcp.splashHandlers.TXMSplashHandler"
3140
            id="org.txm.rcp.splashHandlers.TXMSplashHandler">
3141 3141
      </splashHandler>
3142 3142
      <splashHandlerProductBinding
3143
            productId="org.txm.rcp.app"
3144
            splashId="org.txm.rcp.AbstractSplashHandler2">
3143
            productId="org.txm.rcp.product"
3144
            splashId="org.txm.rcp.splashHandlers.TXMSplashHandler">
3145 3145
      </splashHandlerProductBinding>
3146 3146
   </extension>
3147 3147
   <extension
TXM/trunk/org.txm.rcp/SUBVERSION (revision 3292)
1
beta
TXM/trunk/org.txm.internalview.core/src/org/txm/internalview/core/preferences/InternalViewPreferences.java (revision 3292)
41 41
		preferences.put(UNIT_PROPERTIES, TBXPreferences.DEFAULT_UNIT_PROPERTY);
42 42
		preferences.put(STRUCTURAL_UNIT_PROPERTIES, "");
43 43
		preferences.putInt(CURRENT_PAGE, 0);
44
		preferences.putInt(N_LINES_PER_PAGE, 100);
44 45
	}
45 46
}
TXM/trunk/org.txm.internalview.core/src/org/txm/internalview/core/functions/InternalView.java (revision 3292)
64 64
	protected List<WordProperty> pWordProperties;
65 65
	
66 66
	/**
67
	 * Word properties to display.
68
	 */
69
	@Parameter(key = TXMPreferences.N_LINES_PER_PAGE)
70
	protected Integer pNumberOfLines;
71
	
72
	/**
67 73
	 * Structural units to display.
68 74
	 */
69 75
	@Parameter(key = TXMPreferences.STRUCTURAL_UNIT_PROPERTIES)
......
151 157
	@Override
152 158
	protected boolean _compute(TXMProgressMonitor monitor) throws Exception {
153 159
		
154
		if (this.hasParameterChanged(InternalViewPreferences.STRUCTURAL_UNIT)) {
160
		if (this.hasParameterChanged(InternalViewPreferences.STRUCTURAL_UNIT) || this.hasParameterChanged(InternalViewPreferences.N_LINES_PER_PAGE)) {
155 161
			
156 162
			// reset the current page (only if the result has been computed at least once otherwise it breaks the deserialization)
157 163
			if (this.hasBeenComputedOnce()) {
......
183 189
				pWordProperties != null &&
184 190
				pWordProperties.size() > 0 &&
185 191
				pStructuralUnitsProperties != null &&
186
				pStructuralUnitsProperties.size() > 0;
192
				pStructuralUnitsProperties.size() > 0  &&
193
				pNumberOfLines != null &&
194
				pNumberOfLines > 0;
187 195
	}
188 196
	
189 197
	/**
......
199 207
		if (i >= 0 && i < nmatches) {
200 208
			Match m = matches.get(i);
201 209
			Collection<? extends Integer> positions = m.getRange();
202
			int[] p = new int[positions.size()];
210
			int max = Math.min(positions.size(), pNumberOfLines);
211
			int[] p = new int[max];
203 212
			int c = 0;
204 213
			for (int v : positions) {
205 214
				p[c++] = v;
215
				if (c == max) break;
206 216
			}
207 217
			for (Property prop : pWordProperties) {
208 218
				rez.put(prop, Match.getValuesForProperty(prop, p));
......
469 479
		return InternalViewCoreMessages.RESULT_TYPE;
470 480
	}
471 481
	
482
/**
483
 * its not exactly the number per page since there is no page :D 
484
 * @return
485
 */
486
	public int getNLinesPerPage() {
487
		return pNumberOfLines;
488
	}
489
	
472 490
}

Formats disponibles : Unified diff