Révision 3360

TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java (revision 3360)
56 56
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
57 57
import org.txm.searchengine.cqp.clientExceptions.UnexpectedAnswerException;
58 58
import org.txm.searchengine.cqp.corpus.CQPCorpus;
59
import org.txm.searchengine.cqp.corpus.CorpusManager;
59 60
import org.txm.searchengine.cqp.corpus.Property;
60 61
import org.txm.searchengine.cqp.corpus.QueryResult;
61 62
import org.txm.searchengine.cqp.corpus.StructuralUnit;
......
79 80
 */
80 81
public class Cooccurrence extends TXMResult {
81 82

  
83
	boolean debug = false;
84
	
82 85
	/**
83 86
	 * The Class CLine.
84 87
	 */
......
1305 1308
		// HashMap<Property, String[]> propsValues = new HashMap<Property, String[]>();
1306 1309
		for (WordProperty property : pProperties) {
1307 1310
			int[] indices = property.cpos2Id(allpositionsarray);
1308
			// String[] values =
1309
			// CorpusManager.getCorpusManager().getCqiClient().cpos2Str(property.getQualifiedName(),allpositionsarray);
1311
			//String[] values = CorpusManager.getCorpusManager().getCqiClient().cpos2Str(property.getQualifiedName(), allpositionsarray);
1310 1312
			propsId.put(property, indices);
1311
			// propsValues.put(property, values);
1312
			// System.out.println("all "+property+" indices: "+propsId.get(property).length);
1313 1313
		}
1314 1314

  
1315 1315
		// System.out.println("T values + ids: "+(System.currentTimeMillis()- time)); //$NON-NLS-1$
......
1327 1327
			pcount++;
1328 1328

  
1329 1329
		}
1330
		if (debug) System.out.println(allsignaturesstr);
1330 1331
		return true;
1331 1332
	}
1332 1333

  
......
1343 1344
		// time = System.currentTimeMillis();
1344 1345

  
1345 1346
		HashMap<Integer, Integer> positionsDistances = new HashMap<>();
1346

  
1347
		//int[] positionsDistances = new ArrayList()
1347 1348
		for (Match m : m1) { // for each match = for each focus
1348 1349

  
1350
			if (debug) System.out.println("m="+m);
1349 1351
			if (m.getTarget() >= 0) { // if target is set focus on target position
1350 1352
				m.setStart(m.getTarget());
1351 1353
				m.setEnd(m.getTarget());
......
1356 1358
			boolean matchFound = false;
1357 1359
			for (int i = startsearchM2; i < m2.size(); i++) { // find n
1358 1360
				n = m2.get(i);
1359
				if (n.getStart() <= m.getStart() && m.getEnd() <= n.getEnd()) {
1361
				if (n.getTarget() == m.getStart()) {
1360 1362
					startsearchM2 = i;
1361 1363
					matchFound = true;
1362 1364
					break;
......
1368 1370
			for (int i = startsearchM3; i < m3.size(); i++) { // find next match m3 contained by m2
1369 1371

  
1370 1372
				o = m3.get(i);
1371
				if (o.getStart() <= m.getStart() && m.getEnd() <= o.getEnd()) {
1373
				if (o.getTarget() == m.getStart()) {
1372 1374
					startsearchM3 = i;
1373 1375
					matchFound = matchFound && true;
1374 1376
					break;
......
1380 1382
				continue;
1381 1383
			}
1382 1384

  
1385
			if (debug) System.out.println("n="+n);
1386
			if (debug) System.out.println("o="+o);
1383 1387
			int start = n.getStart();
1384 1388
			int size = n.getEnd() - start + 1;
1385 1389
			// if (size > 0)
......
1398 1402
					continue;
1399 1403
				}
1400 1404

  
1405
				if (allsignaturesstr.get(position).equals("[succès]")) {
1406
					int a = 1+1;
1407
				}
1408
				
1401 1409
				int dist;
1402 1410
				if (position < m.getStart()) {
1403 1411
					dist = m.getStart() - position - 1;
......
1409 1417
					System.out.println("Warning: the n match is in the m match ? " + n + " " + m);
1410 1418
					dist = 0;
1411 1419
				}
1412
				if (!positionsDistances.containsKey(position) || positionsDistances.get(position) > dist) {
1420
				
1421
				if (debug) System.out.println(" p="+position+" sign="+allsignaturesstr.get(position)+" dist="+dist);
1422
				if (positionsDistances.containsKey(position) && positionsDistances.get(position) < dist) {
1413 1423
					positionsDistances.put(position, dist);
1424
					if (debug) System.out.println(" using the higher distance");
1425
				} else {
1426
					positionsDistances.put(position, dist);
1427
					if (debug) System.out.println(" add");
1414 1428
				}
1429
				
1415 1430
			}
1416 1431

  
1417 1432
			// System.out.println("nb Occ ignored: "+ignore);
......
1424 1439
			// String signature = allsignatures.get(position);
1425 1440
			String signaturestr = allsignaturesstr.get(position);
1426 1441

  
1427
			int dist = positionsDistances.get(position);
1442
			Integer dist = positionsDistances.get(position);
1428 1443
			if (distances.containsKey(signaturestr)) {
1429 1444
				distances.put(signaturestr, (distances.get(signaturestr)) + dist);
1430 1445
			}
......
1432 1447
				distances.put(signaturestr, 0.0);
1433 1448
			}
1434 1449

  
1450
			Integer count = (counts.get(signaturestr));
1435 1451
			if (counts.containsKey(signaturestr)) {
1436
				counts.put(signaturestr, (counts.get(signaturestr)) + 1);
1452
				counts.put(signaturestr, count + 1);
1437 1453
			}
1438 1454
			else {
1439 1455
				counts.put(signaturestr, 1);
1440 1456
			}
1457
			
1458
			if (allsignaturesstr.get(position).equals("[succès]")) {
1459
				int b = 1+1;
1460
			}
1441 1461

  
1442 1462
			// if ("[1599]".equals(signaturestr)) {
1443 1463
			// System.out.println("p=" + position + " d=" + dist + " total(d)=" + distances.get(signaturestr) + " c=" + counts.get(signaturestr));
......
1485 1505
		numberOfKeyword = m1.size();
1486 1506
		m2 = r2.getMatches();
1487 1507
		m3 = r3.getMatches();
1508
		
1509
		if (debug) System.out.println(pQuery);
1510
		if (debug) System.out.println(m1);
1511
		if (debug) System.out.println(contextQuery);
1512
		if (debug) System.out.println(m2);
1513
		if (debug) System.out.println(anticontextquery);
1514
		if (debug) System.out.println(m3);
1488 1515

  
1489 1516
		Log.finest("R1 size=" + m1.size());
1490 1517
		Log.finest("R2 size=" + m2.size());
......
1553 1580
						indexfreqs.get(specifrownames[ii]), scores[ii][1], // freq
1554 1581
						((float) (distances.get(signaturestr) / counts.get(signaturestr))), // mean distance
1555 1582
						-1);
1556

  
1583
				if (debug) System.out.println("Line: "+specifrownames[ii]+" dists="+distances.get(signaturestr)+" counts="+counts.get(signaturestr)+" mean="+((float) (distances.get(signaturestr) / counts.get(signaturestr))));
1557 1584
				// select the line
1558
				if (cline.freq >= this.pFminFilter && cline.nbocc >= this.pFCoocFilter && cline.score >= 0 && cline.score >= this.pScoreMinFilter) {
1585
				if (cline.freq >= this.pFminFilter && cline.nbocc >= this.pFCoocFilter && cline.score >= this.pScoreMinFilter) {
1559 1586
					if (cline.score >= Integer.MAX_VALUE - 5) {
1560 1587
						cline.score = Float.MAX_EXPONENT;
1561 1588
					}
......
1577 1604
		// structural context
1578 1605

  
1579 1606
		String fixedQuery = CQLQuery.fixQuery(pQuery.getQueryString(), this.getCorpus().getLang());
1607
		if (fixedQuery.contains("@[") || fixedQuery.contains("@\"")) {
1608
			
1609
		} else {
1610
			fixedQuery = "@"+fixedQuery;
1611
		}
1580 1612

  
1581 1613
		if (pStructuralUnitLimit != null) {
1582 1614
			String tempquery = ""; //$NON-NLS-1$
TXM/trunk/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java (revision 3360)
464 464
			StringBuffer buf = new StringBuffer();
465 465
			buf.append("Concordance:\n"); //$NON-NLS-1$
466 466
			buf.append("\tCorpus: " + this.getCorpus() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
467
			buf
468
			.append("\tQuery: " + this.getQuery() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
469
			buf
470
			.append("\tLeft Context View property: " + this.getLeftViewProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
471
			buf
472
			.append("\tKeyword View property: " + this.getKeywordViewProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
473
			buf
474
			.append("\tRight Context View property: " + this.getRightViewProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
475
			buf
476
			.append("\tLeft Context Sort property: " + this.getLeftAnalysisProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
477
			buf
478
			.append("\tKeyword Sort property: " + this.getKeywordAnalysisProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
479
			buf
480
			.append("\tRight Context Sort property: " + this.getRightAnalysisProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
467
			buf.append("\tQuery: " + this.getQuery() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
468
			buf.append("\tLeft Context View property: " + this.getLeftViewProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
469
			buf.append("\tKeyword View property: " + this.getKeywordViewProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
470
			buf.append("\tRight Context View property: " + this.getRightViewProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
471
			buf.append("\tLeft Context Sort property: " + this.getLeftAnalysisProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
472
			buf.append("\tKeyword Sort property: " + this.getKeywordAnalysisProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
473
			buf.append("\tRight Context Sort property: " + this.getRightAnalysisProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
481 474
			buf.append("\tReference View Pattern: " + this.getRefViewPattern() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
482 475
			buf.append("\tReference Sort Pattern: " + this.getRefAnalysePattern() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
483 476
			return buf.toString();
TXM/trunk/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java (revision 3360)
194 194
		// parts lexicons
195 195
		List<CQPLexicon> partsLexicons = new ArrayList<>();
196 196
		for (int i = 0; i < partition.getPartsCount(); i++) {
197
			partsLexicons.add(CQPLexicon.getLexicon(partition.getParts().get(i), partition.getParts().get(i).getProperty(property.getName()), monitor.createNewMonitor(1), false));
197
			partsLexicons.add(CQPLexicon.getLexicon(partition.getParts().get(i), partition.getParts().get(i).getProperty(property.getFullName()), monitor.createNewMonitor(1), false));
198 198
		}
199 199
		
200 200
		// Corpus global lexicon
......
479 479
	
480 480
	@Override
481 481
	public String getDetails() {
482
		// FIXME: to do
483
		return "";
482
		if (hasBeenComputedOnce()) {
483
			try {
484
				return "fMin="+this.getFMin()+" V="+this.getNRows();
485
			}
486
			catch (Exception e) {
487
				// TODO Auto-generated catch block
488
				e.printStackTrace();
489
				return "";
490
			}
491
		} else {
492
			return "fMinFilter="+this.fMinFilter+(Integer.MAX_VALUE == fMaxFilter?" fMaxFilter="+fMaxFilter:"")+" vMaxFilter="+vMaxFilter;
493
		}
484 494
	}
485 495
	
486 496
	/**
TXM/trunk/org.txm.internalview.rcp/src/org/txm/internalview/rcp/editors/InternalViewEditor.java (revision 3360)
138 138
		propertiesSelector.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, true));
139 139
		propertiesSelector.setLayout(new GridLayout(3, false));
140 140
		try {
141
			propertiesSelector.setProperties(internalView.getCorpus().getOrderedProperties());
141
			List<WordProperty> l = internalView.getCorpus().getOrderedProperties();
142
			l.addAll(internalView.getCorpus().getVirtualProperties());
143
			propertiesSelector.setProperties(l);
142 144
		}
143 145
		catch (CqiClientException e) {
144 146
			Log.printStackTrace(e);
TXM/trunk/org.txm.searchengine.core/src/org/txm/searchengine/core/Query.java (revision 3360)
253 253
			}
254 254
			Query q = queries.get(i);
255 255
			str.append(q.getQueryString());
256
			str.append(TXMPreferences.LIST_SEPARATOR + q.getSearchEngine().getName());
256
			//str.append(TXMPreferences.LIST_SEPARATOR + q.getSearchEngine().getName());
257 257
		}
258 258
		return str.toString();
259 259
	}
TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPLexicon.java (revision 3360)
673 673
	public static CQPLexicon getLexicon(CQPCorpus corpus, WordProperty property, TXMProgressMonitor monitor, boolean visible) throws Exception {
674 674
		CQPLexicon lexicon = null;
675 675

  
676
		property = corpus.getProperty(property.getName()); // ensure to use the subcorpus property
676
		property = corpus.getProperty(property.getFullName()); // ensure to use the subcorpus property
677 677
		
678 678
		// recycling Lexicon if exists
679 679
		ArrayList<CQPLexicon> cachedLexicons = (ArrayList<CQPLexicon>) corpus.getObjectCacheForClass(CQPLexicon.class);
TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java (revision 3360)
752 752
	@Override
753 753
	public String getDetails() {
754 754
		try {
755
			return "T " + this.getSize();
755
			if (hasBeenComputedOnce()) {
756
				return "T " + this.getSize();
757
			} else {
758
				return this.getName();
759
			}
756 760
		}
757 761
		catch (CqiClientException e) {
758 762
			return this.getName() + " (" + this.getQualifiedCqpId() + ")";
TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/Match.java (revision 3360)
36 36
import org.txm.searchengine.cqp.corpus.CorpusManager;
37 37
import org.txm.searchengine.cqp.corpus.Property;
38 38
import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
39
import org.txm.searchengine.cqp.corpus.WordProperty;
39 40

  
40 41
/**
41 42
 * A Match of a query on a corpus = [start -> end]
......
204 205
	 * @throws CqiClientException
205 206
	 *             the cqi client exception
206 207
	 */
207
	public static List<String> getValuesForProperty(Property property,
208
			int[] positions) throws CqiClientException {
208
	public static List<String> getValuesForProperty(Property property, int[] positions) throws CqiClientException {
209
		
209 210
		AbstractCqiClient cqiClient = CorpusManager.getCorpusManager().getCqiClient();
210 211
		try {
211 212
			if (property instanceof StructuralUnitProperty) {
212
				int[] struc = cqiClient.cpos2Struc(property.getQualifiedName(),
213
						positions);
214
				return Arrays.asList(cqiClient.struc2Str(property
215
						.getQualifiedName(), struc));
213
				int[] struc = cqiClient.cpos2Struc(property.getQualifiedName(), positions);
214
				return Arrays.asList(cqiClient.struc2Str(property.getQualifiedName(), struc));
216 215
			}
217 216
			else {
218
				return Arrays.asList(cqiClient.cpos2Str(property
219
						.getQualifiedName(), positions));
217
				return Arrays.asList(property.id2Str(property.cpos2Id(positions)));
220 218
			}
221 219
		}
222 220
		catch (Exception e) {
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java (revision 3360)
354 354
					}
355 355
					
356 356
					// Status bar
357
					if (!result.hasBeenComputedOnce() && !(result instanceof Partition)) { // FIXME: SJ: tmp fix for showing Partition parts
358
						StatusLine.setMessage("");
357
					//					if (!result.hasBeenComputedOnce() && !(result instanceof Partition)) { // FIXME: SJ: tmp fix for showing Partition parts
358
					//						StatusLine.setMessage("");
359
					//					}
360
					//					else {
361
					//						// TODO uncomment when status line will be restored
362
					//						// StatusLine.setMessage(((TXMResult) selectedItem).getDetails());
363
					//					}
364
					
365
					// FIXME : MD re-enable status line on corpora view selection
366
					if (selectedItem instanceof TXMResult) {
367
						
368
						TXMResult r = ((TXMResult)selectedItem);
369
						String mess = null;
370
						try {mess = r.getSimpleDetails();}
371
						catch(Exception e2) {Log.info("Error while getting result informations: "+e2); Log.printStackTrace(e2);}
372
						
373
						if (mess == null) mess = r.getName();
374
						StatusLine.setMessage(mess);
359 375
					}
360
					else {
361
						// TODO uncomment when status line will be restored
362
						// StatusLine.setMessage(((TXMResult) selectedItem).getDetails());
363
					}
364 376
				}
365 377
			}
366 378
			
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchWindowAdvisor.java (revision 3360)
39 39
import org.eclipse.jface.action.IContributionItem;
40 40
import org.eclipse.jface.action.IMenuManager;
41 41
import org.eclipse.swt.graphics.Point;
42
import org.eclipse.swt.widgets.Shell;
42 43
import org.eclipse.ui.IWorkbenchPage;
43 44
import org.eclipse.ui.IWorkbenchWindow;
44 45
import org.eclipse.ui.PlatformUI;
......
119 120
	 */
120 121
	@Override
121 122
	public void postWindowOpen() {
123
		
124
		//getWindowConfigurer().getWindow().getShell().setMaximized( true );
125
		
122 126
		Log.fine(TXMUIMessages.settingStatusLineAndConfiguringActionSets);
123 127
		StatusLine.set(getWindowConfigurer().getActionBarConfigurer().getStatusLineManager());
124 128
		IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/StatusLine.java (revision 3360)
69 69
	 * @param message the new message
70 70
	 */
71 71
	public static void setMessage(final String message) {
72
		return;
72
		// return;
73
		
73 74
		// FIXME: define messages, how and when show them then uncomment message methods
74
		// Display.getDefault().syncExec(new Runnable() {
75
		// @Override
76
		// public void run() {
77
		// if (statusLine != null) {
78
		// if (message != null && message.length() > MAX) {
79
		// statusLine.setMessage(null, message.substring(0, MAX)+"...");
80
		// } else {
81
		// statusLine.setMessage(null, message);
82
		// }
83
		// }
84
		// }
85
		// });
75
		Display.getDefault().syncExec(new Runnable() {
76
			@Override
77
			public void run() {
78
				if (statusLine != null) {
79
					if (message != null && message.length() > MAX) {
80
						statusLine.setMessage(null, message.substring(0, MAX)+"...");
81
					} else {
82
						statusLine.setMessage(null, message);
83
					}
84
				}
85
			}
86
		});
86 87
		
87
		// cancelTimer();
88
		// scheduleTimer();
88
		cancelTimer();
89
		scheduleTimer();
89 90
	}
90 91
	
91 92
	/**
......
94 95
	 * @param message the new message
95 96
	 */
96 97
	public static void setMessage(final String message, boolean keep) {
97
		return;
98
		//return;
98 99
		// FIXME: define messages, how and when show them then uncomment message methods
99
		// if (!keep) {
100
		// setMessage(message);
101
		// return;
102
		// }
103
		// Display.getDefault().syncExec(new Runnable() {
104
		// @Override
105
		// public void run() {
106
		// statusLine.setMessage(null, message);
107
		// }
108
		// });
109
		// cancelTimer();
100
		if (!keep) {
101
			setMessage(message);
102
			return;
103
		}
104
		Display.getDefault().syncExec(new Runnable() {
105
			@Override
106
			public void run() {
107
				statusLine.setMessage(null, message);
108
			}
109
		});
110
		cancelTimer();
110 111
	}
111 112
	
112 113
	/**
......
115 116
	 * @param string the string
116 117
	 */
117 118
	public static void error(final String message) {
118
		return;
119
		//return;
119 120
		// FIXME: define messages, how and when show them then uncomment message methods
120
		// Display.getDefault().syncExec(new Runnable() {
121
		// @Override
122
		// public void run() {
123
		// statusLine.setErrorMessage(null, message);
124
		// }
125
		// });
126
		// cancelTimer();
127
		// scheduleTimer();
121
		Display.getDefault().syncExec(new Runnable() {
122
			@Override
123
			public void run() {
124
				statusLine.setErrorMessage(null, message);
125
			}
126
		});
127
		cancelTimer();
128
		scheduleTimer();
128 129
	}
129 130
	
130 131
	/**
......
133 134
	 * @param string the string
134 135
	 */
135 136
	public static void error(final String message, boolean keep) {
136
		return;
137
		//return;
137 138
		// FIXME: define messages, how and when show them then uncomment message methods
138
		// if (!keep) {
139
		// setMessage(message);
140
		// return;
141
		// }
142
		// Display.getDefault().syncExec(new Runnable() {
143
		// @Override
144
		// public void run() {
145
		// statusLine.setErrorMessage(null, message);
146
		// }
147
		// });
148
		// cancelTimer();
139
		if (!keep) {
140
			setMessage(message);
141
			return;
142
		}
143
		Display.getDefault().syncExec(new Runnable() {
144
			@Override
145
			public void run() {
146
				statusLine.setErrorMessage(null, message);
147
			}
148
		});
149
		cancelTimer();
149 150
	}
150 151
	
151 152
	/**
152 153
	 * Stops the timer
153 154
	 */
154 155
	private static void cancelTimer() {
155
		// if (!timerScheduled)
156
		// return;
157
		// timerScheduled = false;
158
		// timer.cancel();
156
		if (!timerScheduled)
157
			return;
158
		timerScheduled = false;
159
		timer.cancel();
159 160
	}
160 161
	
161 162
	/**
162 163
	 * Starts the timer
163 164
	 */
164 165
	private static void scheduleTimer() {
165
		// if (timerScheduled)
166
		// return;
167
		// timerScheduled = true;
168
		// timer = new Timer();
169
		// TimerTask timerTask = new TimerTask() {
170
		// @Override
171
		// public void run() {
172
		// Runnable r = new Runnable() {
173
		// @Override
174
		// public void run() {
175
		// StatusLine.setMessage(""); //$NON-NLS-1$
176
		// }
177
		// };
178
		// Display.getDefault().syncExec(r);
179
		// }
180
		// };
181
		// timer.schedule(timerTask, time);
166
		if (timerScheduled)
167
			return;
168
		timerScheduled = true;
169
		timer = new Timer();
170
		TimerTask timerTask = new TimerTask() {
171
			@Override
172
			public void run() {
173
				Runnable r = new Runnable() {
174
					@Override
175
					public void run() {
176
						StatusLine.setMessage(""); //$NON-NLS-1$
177
					}
178
				};
179
				Display.getDefault().syncExec(r);
180
			}
181
		};
182
		timer.schedule(timerTask, time);
182 183
	}
183 184
}
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/PropertiesSelector.java (revision 3360)
168 168
				buffer.append(propSeparator);
169 169
			}
170 170
			
171
			if (p instanceof StructuralUnitProperty || p instanceof VirtualProperty) {
171
			if (p instanceof StructuralUnitProperty) {
172 172
				buffer.append(((StructuralUnitProperty)p).getFullName());
173 173
			} else if (p instanceof VirtualProperty) {
174 174
				buffer.append(((VirtualProperty)p).getFullName());
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java (revision 3360)
56 56
import org.eclipse.jface.operation.IRunnableWithProgress;
57 57
import org.eclipse.jface.preference.IPreferenceNode;
58 58
import org.eclipse.jface.preference.PreferenceManager;
59
import org.eclipse.jface.resource.JFaceResources;
59 60
import org.eclipse.jface.util.Util;
60 61
import org.eclipse.jface.viewers.ArrayContentProvider;
61 62
import org.eclipse.jface.viewers.LabelProvider;
62 63
import org.eclipse.osgi.util.NLS;
64
import org.eclipse.swt.SWT;
63 65
import org.eclipse.swt.graphics.Color;
64 66
import org.eclipse.swt.widgets.DirectoryDialog;
65 67
import org.eclipse.swt.widgets.Display;
......
630 632
					});
631 633
				}
632 634
				catch (Exception e2) {
635
					try {
636
						OpenWelcomePage.openWelcomePage();
637
					} catch (Exception e3) { }
633 638
				}
634 639
				
635 640
				// set the install directory preference
......
874 879
		Version v = Activator.getDefault().getBundle().getVersion();
875 880
		String vv = v.getMajor() + "." + v.getMinor() + "." + v.getMicro(); //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$
876 881
		String SAMPLES = "1. " + TXMUIMessages.bind(TXMUIMessages.sampleCorporaOfCurrentTXMP0, vv);
882
		int n = 2;
877 883
		String vCURRENT = "2. " + TXMUIMessages.bind(TXMUIMessages.corporaOfPreviousTXMP0, vv);
878 884
		
879
		int n = 3;
885
		
880 886
		final ArrayList<Object> selectedCorporaDirs = new ArrayList<>();
881 887
		selectedCorporaDirs.add(SAMPLES);
882 888
		
883
		if (corporaDir.exists() && corporaDir.listFiles(IOUtils.HIDDENFILE_FILTER).length > 0) selectedCorporaDirs.add(vCURRENT);
889
		if (corporaDir.exists() && corporaDir.listFiles(IOUtils.HIDDENFILE_FILTER).length > 0) {
890
			selectedCorporaDirs.add(vCURRENT);
891
			n++;
892
		}
884 893
		
885 894
		for (int i = 0; i < previousVersions.length; i++) {
886 895
			if (previousVersionCorporaDirectories[i].exists()
......
892 901
		String OTHER = "" + (n++) + ". " + TXMUIMessages.selectAnotherTXMCorporaToRestore;
893 902
		selectedCorporaDirs.add(OTHER);
894 903
		
895
		final ArrayList<Object> initialCorporaDirs = new ArrayList<>();
896
		initialCorporaDirs.add(SAMPLES);
897
		initialCorporaDirs.add(vCURRENT);
904
		final ArrayList<Object> initialSelectionCorporaDirs = new ArrayList<>();
905
		initialSelectionCorporaDirs.add(SAMPLES);
906
		initialSelectionCorporaDirs.add(vCURRENT);
898 907
		
899 908
		Display.getDefault().syncExec(new Runnable() {
900 909
			
......
905 914
				ListSelectionDialog dialog = new ListSelectionDialog(shell, selectedCorporaDirs,
906 915
						new ArrayContentProvider(), new LabelProvider(), TXMUIMessages.corporaWillBeRestoredInTheFollowingOrderCorporaAlreadyRestoredWillNotBeReplaced);
907 916
				dialog.setTitle(TXMUIMessages.selectThecorporaSetsToRestore);
908
				dialog.setInitialElementSelections(initialCorporaDirs);
917
				dialog.setInitialElementSelections(initialSelectionCorporaDirs);
909 918
				if (dialog.open() == ListSelectionDialog.OK) {
910 919
					selectedCorporaDirs.clear();
911 920
					List<Object> selection = Arrays.asList(dialog.getResult());
......
1108 1117
					// remove some preference pages
1109 1118
					setPreferencesConfiguration();
1110 1119
					
1111
					initializeUIPMD = new ProgressMonitorDialog(Display.getDefault().getActiveShell());
1120
					initializeUIPMD = new ProgressMonitorDialog(Display.getDefault().getActiveShell()) {
1121
						@Override
1122
						protected void configureShell(final Shell shell) {
1123
							super.configureShell(shell);
1124
							shell.setText(getTXMStartMessage());
1125
						}
1126
					};
1127
					
1112 1128
					initializeUIPMD.run(true, true, new IRunnableWithProgress() {
1113 1129
						
1114 1130
						@Override

Formats disponibles : Unified diff