Révision 3745

TXM/trunk/bundles/org.txm.treesearch.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 3745)
3 3

  
4 4
category.name = Annotations syntaxiques
5 5

  
6
command.label  = Envoyer vers l'arbre syntaxique
6
command.label  = Afficher l'arbre syntaxique
7 7
command.name   = Syntactic Tree
8
command.name.0 = Lien vers l'arbre syntaxique
8
command.name.0 = Afficher l'arbre syntaxique
9 9

  
10 10
editor.name = Arbre syntaxique
11 11

  
TXM/trunk/bundles/org.txm.treesearch.rcp/OSGI-INF/l10n/bundle.properties (revision 3745)
3 3

  
4 4
category.name = Syntactic annotations
5 5

  
6
command.label  = Send To Syntactic tree
6
command.label  = See the Syntactic Tree
7 7
command.name   = Syntactic Tree
8
command.name.0 = Syntactic Tree concordance link
8
command.name.0 = See the Syntactic Tree
9 9

  
10 10
editor.name = Syntactic Tree
11 11

  
TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/views/cmdparameters/TXMResultParametersView.java (revision 3745)
66 66
import org.txm.rcp.swt.widget.QueryWidget;
67 67
import org.txm.rcp.swt.widget.ReferencePatternSelector;
68 68
import org.txm.searchengine.core.IQuery;
69
import org.txm.searchengine.cqp.CQPSearchEngine;
69 70
import org.txm.searchengine.cqp.ReferencePattern;
70 71
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
71 72
import org.txm.searchengine.cqp.corpus.CQPCorpus;
......
281 282
				c = sp;
282 283
			}
283 284
			else if (clazz.equals(IQuery.class)) {
284
				final QueryWidget qw = new QueryWidget(panel, SWT.NONE, null, null);
285
				final QueryWidget qw = new QueryWidget(panel, SWT.NONE, result.getProject(), CQPSearchEngine.getEngine());
285 286
				if (value != null) {
286 287
					qw.setText(((IQuery) value).getQueryString());
287 288
				}
......
297 298
							}
298 299
						}
299 300
						catch (Exception e1) {
300
							// TODO Auto-generated catch block
301 301
							e1.printStackTrace();
302 302
						}
303 303
					}
......
320 320
							}
321 321
						}
322 322
						catch (Exception e1) {
323
							// TODO Auto-generated catch block
324 323
							e1.printStackTrace();
325 324
						}
326 325
					}
......
379 378
										activated.compute(false);
380 379
									}
381 380
								}
382
								catch (IllegalArgumentException e1) {
383
									// TODO Auto-generated catch block
381
								catch (Exception e1) {
384 382
									e1.printStackTrace();
385 383
								}
386
								catch (IllegalAccessException e1) {
387
									// TODO Auto-generated catch block
388
									e1.printStackTrace();
389
								}
390 384
							}
391 385
						}
392 386
					}
......
480 474
					try {
481 475
						f.set(result, p);
482 476
					}
483
					catch (IllegalArgumentException e1) {
484
						// TODO Auto-generated catch block
477
					catch (Exception e1) {
485 478
						e1.printStackTrace();
486 479
					}
487
					catch (IllegalAccessException e1) {
488
						// TODO Auto-generated catch block
489
						e1.printStackTrace();
490
					}
491 480
					activated.compute(false);
492 481
				}
493 482
			}
......
520 509
						f.set(result, selected);
521 510
					}
522 511
					catch (Exception e1) {
523
						// TODO Auto-generated catch block
524 512
						e1.printStackTrace();
525 513
					}
526 514
					activated.compute(false);
......
553 541
						f.set(result, selected);
554 542
					}
555 543
					catch (Exception e1) {
556
						// TODO Auto-generated catch block
557 544
						e1.printStackTrace();
558 545
					}
559 546
					activated.compute(false);
......
605 592
			updateEditorParameters();
606 593
		}
607 594
		catch (Exception e) {
608
			// TODO Auto-generated catch block
609 595
			e.printStackTrace();
610 596
		}
611 597
	}
......
616 602
		if (part == null)
617 603
			return;
618 604
		// System.out.println("partActivated: "+part);
619
		if (part instanceof TXMEditor)
605
		if (part instanceof TXMEditor) {
620 606
			activated = (TXMEditor) part;
621
		if (activated == null)
607
		}
608
		if (activated == null) {
622 609
			return;
610
		}
623 611
		activated.addPropertyListener(this);
624 612
		recompute.setEnabled(true);
625 613
		// activated.addPartPropertyListener(this);
......
627 615
			updateEditorParameters();
628 616
		}
629 617
		catch (Exception e) {
630
			// TODO Auto-generated catch block
631 618
			e.printStackTrace();
632 619
		}
633 620
	}
......
635 622
	@Override
636 623
	public void partBroughtToTop(IWorkbenchPart part) {
637 624
		
638
		if (part == null)
625
		if (part == null) {
639 626
			return;
627
		}
640 628
	}
641 629
	
642 630
	@Override
643 631
	public void partClosed(IWorkbenchPart part) {
644 632
		
645
		if (part == null)
633
		if (part == null) {
646 634
			return;
635
		}
647 636
		if (part == activated) {
648 637
			activated = null;
649 638
			try {
650 639
				updateEditorParameters();
651 640
			}
652 641
			catch (Exception e) {
653
				// TODO Auto-generated catch block
654 642
				e.printStackTrace();
655 643
			}
656 644
		}
TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreateSubcorpusDialog.java (revision 3745)
51 51
import org.txm.rcp.swt.widget.ComplexSubcorpusPanel;
52 52
import org.txm.rcp.swt.widget.QueryWidget;
53 53
import org.txm.rcp.swt.widget.structures.SimpleSubcorpusPanel;
54
import org.txm.searchengine.cqp.CQPSearchEngine;
54 55
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
55 56
import org.txm.searchengine.cqp.corpus.CQPCorpus;
56 57
import org.txm.searchengine.cqp.corpus.StructuralUnit;
......
196 197
		advancedPartLabel.setText(TXMUIMessages.ampQuery);
197 198
		advancedPartLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
198 199
		
199
		queryText = new QueryWidget(compositeForAdvanced, SWT.DROP_DOWN, corpus.getProject(), null);
200
		queryText = new QueryWidget(compositeForAdvanced, SWT.DROP_DOWN, corpus.getProject(), CQPSearchEngine.getEngine());
200 201
		queryText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
201 202
		GridData gridData = new GridData(GridData.FILL, GridData.CENTER, true, false);
202 203
		gridData.widthHint = convertHeightInCharsToPixels(20);
TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreatePartitionDialog.java (revision 3745)
65 65
import org.txm.rcp.messages.TXMUIMessages;
66 66
import org.txm.rcp.swt.widget.PartitionComposer;
67 67
import org.txm.rcp.swt.widget.QueryWidget;
68
import org.txm.searchengine.cqp.CQPSearchEngine;
68 69
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
69 70
import org.txm.searchengine.cqp.corpus.CQPCorpus;
70 71
import org.txm.searchengine.cqp.corpus.Partition;
......
524 525
		partNames.add(advancedPartLabel);
525 526
		
526 527
		final QueryWidget queryText;
527
		queryText = new QueryWidget(compositeForAdvanced, SWT.DROP_DOWN, corpus.getProject(), null);
528
		queryText = new QueryWidget(compositeForAdvanced, SWT.DROP_DOWN, corpus.getProject(), CQPSearchEngine.getEngine());
528 529
		queryText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
529 530
		GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, false);
530 531
		// gridData.widthHint = convertHeightInCharsToPixels(20);
TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/QueryOptionsDialog.java (revision 3745)
51 51
import org.eclipse.swt.widgets.Shell;
52 52
import org.txm.rcp.swt.provider.SimpleLabelProvider;
53 53
import org.txm.searchengine.core.SearchEngine;
54
import org.txm.searchengine.core.SearchEnginesManager;
54 55
import org.txm.searchengine.cqp.corpus.CQPCorpus;
55 56

  
56 57
/**
......
77 78
	private SearchEngine selectedEngine;
78 79
	
79 80
	/** The default value. */
80
	private String defaultValue;
81
	private SearchEngine defaultValue;
81 82
	
82 83
	/** The title. */
83 84
	private String title;
......
93 94

  
94 95
	private Group optionsGroup;
95 96
	
96
	public QueryOptionsDialog(Shell parentShell, CQPCorpus corpus, List<SearchEngine> engines2, String defaultValue) {
97
	public QueryOptionsDialog(Shell parentShell, CQPCorpus corpus, List<SearchEngine> engines2, SearchEngine defaultValue) {
97 98
		super(parentShell);
98 99
		
99 100
		this.corpus = corpus;
......
126 127
	protected void configureShell(Shell newShell) {
127 128
		super.configureShell(newShell);
128 129
		newShell.setText(title);
130
		newShell.setSize(400, 400);
129 131
	}
132
	
133
	@Override
134
	protected boolean isResizable() {
135
	    return true;
136
	}
130 137

  
131 138
	/* (non-Javadoc)
132 139
	 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
......
145 152
		l.setText("Select between the following engines");
146 153
		l.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 1, 1));
147 154
		combo = new ComboViewer(new Combo(p, SWT.READ_ONLY | SWT.SINGLE));
148
		combo.getCombo().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 1, 1));
155
		combo.getCombo().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 1, 1));
149 156
		//combo.setItems(values.toArray(new String[] {}));
150 157
		combo.getCombo().addSelectionListener(new SelectionListener() {
151 158
			
......
185 192
			selectValue(defaultValue);
186 193
		}
187 194
		
195
		
188 196
		updateOptions();
189 197
		
190 198
		return p;
......
213 221
			for (final SearchEngine se : options.get(selectedEngine.getName())) {
214 222
				Button option = new Button(optionsGroup, SWT.RADIO);
215 223
				option.setText(se.getOptionNameForSearchengine()+ " : " + se.getOptionDescriptionForSearchengine());
216
				if (se.getName().equals(defaultValue)) {
224
				if (se.equals(defaultValue)) {
217 225
					option.setSelection(true);
218
					option.addSelectionListener(new SelectionListener() {
219
						
220
						@Override
221
						public void widgetSelected(SelectionEvent e) {
222
							selectedEngine = se;
223
						}
224
						
225
						@Override
226
						public void widgetDefaultSelected(SelectionEvent e) { }
227
					});
228 226
					noneOption.setSelection(false);
227
					selectedEngine = defaultValue;
229 228
				}
229
				
230
				option.addSelectionListener(new SelectionListener() {
231
					
232
					@Override
233
					public void widgetSelected(SelectionEvent e) {
234
						selectedEngine = se;
235
					}
236
					
237
					@Override
238
					public void widgetDefaultSelected(SelectionEvent e) { }
239
				});
240
				
230 241
			}
231 242
		}
232 243
		optionsGroup.layout();
......
246 257
	 *
247 258
	 * @param string the string
248 259
	 */
249
	public void selectValue(String string) {
250
		for (int i = 0; i < values.size(); i++)
251
			if (values.get(i).getName().equals(string)) {
252
				combo.setSelection(new StructuredSelection(values.get(i)));
253
				break;
260
	public void selectValue(SearchEngine e) {
261
		
262
		if (values.contains(e)) {
263
			combo.setSelection(new StructuredSelection(e));
264
		} else {
265
			SearchEngine optionedengine = SearchEnginesManager.getSearchEngine(e.getOptionForSearchengine());
266
			if (optionedengine != null) {
267
				combo.setSelection(new StructuredSelection(optionedengine));
268
			} else {
269
				System.out.println("ERROR: engine not found: "+e.getOptionForSearchengine());
254 270
			}
271
		}
255 272
	}
256 273
}
TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/QueryWidget.java (revision 3745)
69 69
		
70 70
		super(parent, style);
71 71
		this.se = se;
72
		if (se == null) {
73
			System.out.println("WARNING");
74
		}
72 75
		this.project = project;
73 76

  
74 77
		loadHistory();
TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/NamedAssistedQueryWidget.java (revision 3745)
42 42
import org.txm.rcp.IImageKeys;
43 43
import org.txm.rcp.messages.TXMUIMessages;
44 44
import org.txm.rcp.swt.dialog.QueryAssistDialog;
45
import org.txm.searchengine.cqp.CQPSearchEngine;
45 46
import org.txm.searchengine.cqp.corpus.CQPCorpus;
46 47

  
47 48

  
......
92 93
				if (d.open() == Window.OK) {
93 94
					querywidget.setText(d.getQuery());
94 95
				}
95

  
96 96
			}
97 97

  
98 98
			@Override
99
			public void widgetDefaultSelected(SelectionEvent e) {
100
			}
99
			public void widgetDefaultSelected(SelectionEvent e) { }
101 100
		});
102 101
		
103
		querywidget = new QueryWidget(this, style, corpus.getProject(), null);
102
		querywidget = new QueryWidget(this, style, corpus.getProject(), CQPSearchEngine.getEngine());
104 103
		querywidget.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, true));
105 104
	}
106 105

  
TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/QueryField.java (revision 3745)
8 8
import org.kohsuke.args4j.NamedOptionDef;
9 9
import org.txm.rcp.swt.widget.QueryWidget;
10 10
import org.txm.searchengine.core.IQuery;
11
import org.txm.searchengine.cqp.CQPSearchEngine;
11 12

  
12 13
public class QueryField extends ParameterField {
13 14
	QueryWidget w;
14 15
	
15 16
	public QueryField(Composite parent, int style, NamedOptionDef parameter) {
16 17
		super(parent, style, parameter);
18
		
17 19
		this.setLayout(new GridLayout(2, false));
18 20
		this.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
19 21

  
......
25 27
		gd.widthHint = 100;
26 28
		l.setLayoutData(gd);
27 29

  
28
		w = new QueryWidget(this, SWT.BORDER, null, null);
30
		w = new QueryWidget(this, SWT.BORDER, null, CQPSearchEngine.getEngine());
29 31
		w.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, false));
30 32
		resetToDefault();
31 33
	}
TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/AssistedChoiceQueryWidget.java (revision 3745)
133 133
				@Override
134 134
				public void widgetSelected(SelectionEvent e) {
135 135

  
136
					QueryOptionsDialog dialog = new QueryOptionsDialog(e.display.getActiveShell(), corpus, engines, querywidget.getSearchEngine().getName()); //$NON-NLS-1$
136
					QueryOptionsDialog dialog = new QueryOptionsDialog(e.display.getActiveShell(), corpus, engines, querywidget.getSearchEngine()); //$NON-NLS-1$
137 137
					if (dialog.open() == ComboDialog.OK) {
138 138
						SearchEngine se = dialog.getSelectedEngine();
139 139
						if (se != null && !se.getName().equals(querywidget.getSearchEngine().getName())) {

Formats disponibles : Unified diff