Révision 1221

tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java (revision 1221)
229 229
		
230 230
		// extended parameters
231 231
		
232
		// FIXME: old version
233 232
		// Filters
234
//		Composite filtercontrols = new Composite(extendedParametersComposite, SWT.NONE);
235
//		FormData filtersLayoutData = new FormData();
236
//		filtersLayoutData.top = new FormAttachment(queryArea, 0);
237
//		filtersLayoutData.bottom = new FormAttachment(100);
238
//		filtersLayoutData.left = new FormAttachment(0);
239
//		filtersLayoutData.right = new FormAttachment(100);
240
//		filtercontrols.setLayoutData(filtersLayoutData);
241
//
242
//		GridLayout gridLayout = new GridLayout();
243
//		gridLayout.numColumns = 9;
244
//		gridLayout.makeColumnsEqualWidth = false;
245
//		filtercontrols.setLayout(gridLayout);
246
//
247
//		Label thresholds = new Label(filtercontrols, SWT.NONE);
248
//		thresholds.setText(TXMCoreMessages.common_thresholds);
249
//		thresholds.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
250
//
251
//		Label lFmin = new Label(filtercontrols, SWT.NONE);
252
//		lFmin.setText(TXMCoreMessages.common_fMin);
253
//		lFmin.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
254
//
255
//		GridData fieldsGridData = new GridData(GridData.VERTICAL_ALIGN_END);
256
//		fieldsGridData.minimumWidth = 100;
257
//
258
//		fMinSpinner = new Spinner(filtercontrols, SWT.BORDER);
259
//		fMinSpinner.setMinimum(0);
260
//		fMinSpinner.setMaximum(9999999);
261
//		fMinSpinner.setIncrement(1);
262
//		fMinSpinner.setPageIncrement(100);
263
//		fMinSpinner.setLayoutData(fieldsGridData);
264
//		fMinSpinner.addKeyListener(computeKeyListener);
265
//		fMinSpinner.addSelectionListener(computeSelectionListener);
266
//
267
//		Label lFmax = new Label(filtercontrols, SWT.NONE);
268
//		lFmax.setText(TXMCoreMessages.common_fMax);
269
//		lFmax.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
270
//
271
//		fMaxSpinner = new Spinner(filtercontrols, SWT.BORDER);
272
//		fMaxSpinner.setMinimum(0);
273
//		fMaxSpinner.setMaximum(9999999);
274
//		fMaxSpinner.setIncrement(1);
275
//		fMaxSpinner.setPageIncrement(100);
276
//		fMaxSpinner.setLayoutData(fieldsGridData);
277
//		fMaxSpinner.addKeyListener(computeKeyListener);
278
//		fMaxSpinner.addSelectionListener(computeSelectionListener);
279
//
280
//		Label lVmax = new Label(filtercontrols, SWT.NONE);
281
//		lVmax.setText(TXMCoreMessages.VMAX_1);
282
//		lVmax.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
283
//
284
//		vMaxSpinner = new Spinner(filtercontrols, SWT.BORDER);
285
//		vMaxSpinner.setMinimum(0);
286
//		vMaxSpinner.setMaximum(9999999);
287
//		vMaxSpinner.setIncrement(1);
288
//		vMaxSpinner.setPageIncrement(100);
289
//		vMaxSpinner.setLayoutData(fieldsGridData);
290
//		vMaxSpinner.addKeyListener(computeKeyListener);
291
//		vMaxSpinner.addSelectionListener(computeSelectionListener);
292

  
293
		
294
		// FIXME: new version
295
		// Filters
296 233
		ThresholdsGroup thresholdsGroup = new ThresholdsGroup(this.getExtendedParametersGroup(), this);
297 234
		this.fMinSpinner = thresholdsGroup.getFMinSpinner();
298 235
		this.fMaxSpinner = thresholdsGroup.getFMaxSpinner();
299 236
		this.vMaxSpinner = thresholdsGroup.getVMaxSpinner();
300 237
		
301 238
		
302
		
303
		
304 239
		Label lNLigneppage = new Label(this.getExtendedParametersGroup(), SWT.NONE);
305 240
		lNLigneppage.setText(IndexUIMessages.IndexEditor_8);
306 241
		
......
505 440

  
506 441
		// Add double click, "Send to" command
507 442
		TXMEditor.addDoubleClickCommandListener(viewer.getTable(), 1, "org.txm.concordance.rcp.handlers.ComputeConcordance"); //$NON-NLS-1$
508
		TXMEditor.addDoubleClickCommandListener(viewer.getTable(), 2, "org.txm.progression.rcp.handlers.ComputeProgression"); //$NON-NLS-1$
443
		TXMEditor.addDoubleClickCommandListener(viewer.getTable(), 2, viewer.getTable().getColumnCount() - 1, "org.txm.progression.rcp.handlers.ComputeProgression"); //$NON-NLS-1$
509 444
		
510 445
		// Register the context menu
511 446
		TXMEditor.initContextMenu(this.viewer.getTable(), this.getSite(), this.viewer);
tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/PartitionIndexEditor.java (revision 1221)
530 530

  
531 531
		// Add double click, "Send to" command
532 532
		TXMEditor.addDoubleClickCommandListener(viewer.getTable(), 1, "org.txm.concordance.rcp.handlers.ComputeConcordance"); //$NON-NLS-1$
533
		TXMEditor.addDoubleClickCommandListener(viewer.getTable(), 2, "org.txm.progression.rcp.handlers.ComputeProgression"); //$NON-NLS-1$
533
		TXMEditor.addDoubleClickCommandListener(viewer.getTable(), 2, viewer.getTable().getColumnCount() - 1, "org.txm.progression.rcp.handlers.ComputeProgression"); //$NON-NLS-1$
534 534
		
535 535
		// Register the context menu
536 536
		TXMEditor.initContextMenu(this.viewer.getTable(), this.getSite(), this.viewer);
tmp/org.txm.index.rcp/plugin.xml (revision 1221)
288 288
               variable="activePart">
289 289
            <instanceof
290 290
                  value="org.txm.index.rcp.editors.IndexEditor">
291
       
292
      <definition
293
            id="PartitionIndexEditorActive">
294
         <with
295
               variable="activePart">
296
            <instanceof
297
                  value="org.txm.index.rcp.editors.IndexEditor">
298
            </instanceof>
291
        </instanceof>
299 292
         </with>
300 293
      </definition>
301 294
      <definition
302
            id="OnePartitionIndexSelected">
303
         <with
304
               variable="selection">
305
            <iterate
306
                  ifEmpty="false"
307
                  operator="and">
308
               <instanceof
309
                     value="org.txm.index.core.functions.PartitionIndex">
310
               </instanceof>
311
            </iterate>
312
         </with>
313
      </definition>     </instanceof>
314
         </with>
315
      </definition>
316
      <definition
317 295
            id="LexiconEditorActive">
318 296
         <with
319 297
               variable="activePart">
......
327 305
         <with
328 306
               variable="activePart">
329 307
            <instanceof
330
                  value="org.txm.index.rcp.editors.IndexEditor">
331
               <definition
332
                     id="PartitionIndexEditorActive">
333
                  <with
334
                        variable="activePart">
335
                     <instanceof
336
                           value="org.txm.index.rcp.editors.IndexEditor">
337
                     </instanceof>
338
                  </with>
339
               </definition>
340
               <definition
341
                     id="OnePartitionIndexSelected">
342
                  <with
343
                        variable="selection">
344
                     <iterate
345
                           ifEmpty="false"
346
                           operator="and">
347
                        <instanceof
348
                              value="org.txm.index.core.functions.Index">
349
                        </instanceof>
350
                     </iterate>
351
                  </with>
352
               </definition>
308
                  value="org.txm.index.rcp.editors.PartitionIndexEditor">
353 309
            </instanceof>
354 310
         </with>
355 311
      </definition>
......
394 350
           <reference
395 351
                 definitionId="LexiconEditorActive">
396 352
           </reference>
353
           <reference
354
                 definitionId="PartitionIndexEditorActive">
355
           </reference>
397 356
         
398 357
         </or>
399 358
         <reference
......
414 373
               <reference
415 374
                     definitionId="LexiconEditorActive">
416 375
               </reference>
376
               <reference
377
                     definitionId="PartitionIndexEditorActive">
378
               </reference>
417 379
            </or>
418 380
            
419 381
            
......
436 398
               <reference
437 399
                     definitionId="LexiconEditorActive">
438 400
               </reference>
401
               <reference
402
                     definitionId="PartitionIndexEditorActive">
403
               </reference>
439 404
            </or>
440 405
               <reference
441 406
                     definitionId="SendSelectionContextNotActive">
tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java (revision 1221)
451 451
		}
452 452
	}
453 453

  
454
	/**
455
	 * Gets the column names.
456
	 * @return
457
	 */
454 458
	public Vector getColNames() {
455 459
		try {
456 460
			return statsData.getColNames();
......
467 471

  
468 472
	@Override
469 473
	public String getDetails() {
474
		// FIXME: to do
470 475
		return "";
471 476
	}
472 477

  
478
	/**
479
	 * Gets the minimum frequency filter.
480
	 * @return
481
	 */
473 482
	public int getFMin() {
474 483
		return statsData.getFMin();
475 484
	}
476 485

  
477

  
486
	/**
487
	 * Gets the maximum frequency filter.
488
	 * @return
489
	 */
478 490
	public int getFMinFilter() {
479 491
		return this.fMinFilter;
480 492
	}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 1221)
1208 1208
	}
1209 1209

  
1210 1210
	/**
1211
	 * Adds a mouse adapter to the specified table column  that executes a command link specified by its id on double click event.
1211
	 * Adds a mouse adapter to the specified table column that executes a command link specified by its id on double click event.
1212 1212
	 * @param table
1213
	 * @param column column index >= 0; if == -1, the parameter is ignored
1213
	 * @param column
1214 1214
	 * @param commandId
1215 1215
	 */
1216 1216
	public static void addDoubleClickCommandListener(final Table table, final int column, final String commandId)	{
1217
		addDoubleClickCommandListener(table, column, column, commandId);
1218
	}
1217 1219

  
1220
	/**
1221
	 * Adds a mouse adapter to the specified table columns range that executes a command link specified by its id on double click event.
1222
	 * @param table
1223
	 * @param startingColumn
1224
	 * @param endingColumn
1225
	 * @param commandId
1226
	 */
1227
	public static void addDoubleClickCommandListener(final Table table, final int startingColumn, final int endingColumn, final String commandId)	{
1218 1228
		table.addMouseListener(new MouseAdapter() {
1219 1229
			@Override
1220 1230
			public void mouseDoubleClick(MouseEvent e) {
1221
				Point mouseposition = new Point(e.x + table.getHorizontalBar().getSelection(), e.y);
1222
				if (column > 0 && column != getPointedColumn(table, mouseposition)) {
1223
					return;
1231
				Point mousePosition = new Point(e.x + table.getHorizontalBar().getSelection(), e.y);
1232
				int pointedColumn = getPointedColumn(table, mousePosition);
1233
				if (pointedColumn >= startingColumn && pointedColumn <= endingColumn) {
1234
					BaseAbstractHandler.executeCommand(commandId);	
1224 1235
				}
1225
				BaseAbstractHandler.executeCommand(commandId);
1236
				return;
1226 1237
			}
1227 1238
		});
1228 1239
	}
1240
	
1229 1241

  
1230

  
1231 1242
	/**
1232 1243
	 * Adds a mouse adapter to the specified composite that executes a command link specified by its id on double click event.
1233 1244
	 * @param table
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java (revision 1221)
538 538
	
539 539
	@Override
540 540
	public void setFocus() {
541
		// TODO Auto-generated method stub
542
		if (queryWidget != null && !queryWidget.isDisposed()) {
543
			queryWidget.setFocus();
544
		}
541
		// FIXME: this code break the synchronized link with concordance and edition => the arrow navigation doesn't work since the focus of the chart composite is lost
542
//		if (queryWidget != null && !queryWidget.isDisposed()) {
543
//			queryWidget.setFocus();
544
//		}
545 545
	}
546 546

  
547 547
	/**
tmp/org.txm.progression.rcp/plugin.xml (revision 1221)
93 93
         </command>
94 94
      </menuContribution>
95 95
      <menuContribution
96
            locationURI="popup:org.txm.index.rcp.editors.PartitionIndexEditor">
97
         <command
98
               commandId="org.txm.progression.rcp.handlers.ComputeProgression"
99
               icon="icons/functions/progression.png"
100
               label="%command.name.3"
101
               style="push">
102
         </command>
103
      </menuContribution>
104
      <menuContribution
96 105
            locationURI="popup:org.txm.index.rcp.editors.DictionnaryEditor">
97 106
         <command
98 107
               commandId="org.txm.progression.rcp.handlers.ComputeProgression"
tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/handlers/ComputeConcordance.java (revision 1221)
54 54
			return false;
55 55
		}
56 56

  
57
		Object selection = this.getCorporaViewSelectedObject(event);
58
		
59 57
		Concordance concordance = null;
60 58

  
61 59
		// From link: creating from parameter node
......
65 63
		}
66 64
		// From view result node
67 65
		else	{
66
			Object selection = this.getCorporaViewSelectedObject(event);
67
			
68 68
			// Creating from Corpus
69 69
			if (selection instanceof CQPCorpus) {
70 70
				CQPCorpus corpus = (CQPCorpus) selection;
tmp/org.txm.concordance.rcp/plugin.xml (revision 1221)
112 112
         </command>
113 113
      </menuContribution>
114 114
      <menuContribution
115
            locationURI="popup:org.txm.index.rcp.editors.PartitionIndexEditor">
116
         <command
117
               commandId="org.txm.concordance.rcp.handlers.ComputeConcordance"
118
               icon="icons/concordance.png"
119
               label="%command.name.1"
120
               style="push">
121
         </command>
122
      </menuContribution>
123
      <menuContribution
115 124
            locationURI="popup:org.txm.index.rcp.editors.DictionnaryEditor">
116 125
         <command
117 126
               commandId="org.txm.concordance.rcp.handlers.ComputeConcordance"
tmp/org.txm.cooccurrence.rcp/plugin.xml (revision 1221)
105 105
         </command>
106 106
      </menuContribution>
107 107
      <menuContribution
108
            locationURI="popup:org.txm.index.rcp.editors.PartitionIndexEditor">
109
         <command
110
               commandId="org.txm.cooccurrence.rcp.handlers.ComputeCooccurrences"
111
               icon="icons/cooccurrences.png"
112
               label="%command.name.4"
113
               style="push">
114
         </command>
115
      </menuContribution>
116
      <menuContribution
108 117
            locationURI="popup:org.txm.index.rcp.editors.DictionnaryEditor">
109 118
         <command
110 119
               commandId="org.txm.cooccurrence.rcp.handlers.ComputeCooccurrences"

Formats disponibles : Unified diff