Révision 600

tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java (revision 600)
47 47
 * @author sjacquot
48 48
 *
49 49
 */
50
public class ProgressionEditor extends ChartEditorPart {
50
public class ProgressionEditor extends ChartEditorPart<Progression> {
51 51

  
52 52
	
53 53
	/** The query widgets. */
......
484 484
	}
485 485

  
486 486
	
487
	@Override
488
	public Progression getResultData() {
489
		return (Progression) super.getResultData();
490
	}
491 487
	
492
	
493 488
	@Override
494 489
	public void updateResultFromEditor() {
495 490
		
tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java (revision 600)
1997 1997
		resetRightTableColumnWidths();
1998 1998
	}
1999 1999

  
2000
	@Override
2001
	public Concordance getResultData() {
2002
		return concordance;
2003
	}
2004 2000

  
2005 2001
	public Composite getExtensionButtonComposite() {
2006 2002
		// TODO Auto-generated method stub
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPPreferences.java (revision 600)
1 1
package org.txm.searchengine.cqp;
2 2

  
3
import java.io.File;
4

  
5 3
import org.eclipse.core.runtime.preferences.DefaultScope;
6 4
import org.osgi.framework.FrameworkUtil;
7 5
import org.osgi.service.prefs.Preferences;
tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/cmdparameters/ParametersView.java (revision 600)
90 90
			TXMEditorPart reditor = (TXMEditorPart)editor;
91 91
			StringBuffer buffer = new StringBuffer();
92 92
			TXMResult result = reditor.getResultData();
93
			buffer.append(""+result.toString()+"\n");
94
			buffer.append(""+result.getDetails()+"\n\n");
93
			buffer.append("Result: " + result.toString() + "\n");
94
			buffer.append("UUID: " + result.getUUID() + "\n");
95
			buffer.append("Simple name: " + result.getSimpleName() + "\n");
96
			buffer.append("Name: " + result.getName() + "\n");
97
			buffer.append("Valid filename: " + result.getValidFileName() + "\n");
98
			buffer.append("Details: " + result.getDetails() + "\n\n");
99
			
95 100

  
96

  
97 101
			try {
98 102
				// Command preferences
99 103
				buffer.append(result.dumpPreferences());
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorPart.java (revision 600)
3 3
 */
4 4
package org.txm.rcp.editors;
5 5

  
6
import java.lang.reflect.Field;
7
import java.util.ArrayList;
8
import java.util.Arrays;
9
import java.util.List;
10

  
6 11
import org.eclipse.core.runtime.IProgressMonitor;
7 12
import org.eclipse.core.runtime.IStatus;
8 13
import org.eclipse.core.runtime.Status;
......
18 23
import org.eclipse.swt.widgets.Menu;
19 24
import org.eclipse.swt.widgets.Spinner;
20 25
import org.eclipse.swt.widgets.TableColumn;
26
import org.eclipse.swt.widgets.Text;
27
import org.eclipse.swt.widgets.ToolItem;
21 28
import org.eclipse.ui.IEditorInput;
22 29
import org.eclipse.ui.IEditorSite;
23 30
import org.eclipse.ui.IWorkbenchPage;
......
27 34
import org.eclipse.ui.PlatformUI;
28 35
import org.eclipse.ui.menus.IMenuService;
29 36
import org.eclipse.ui.part.EditorPart;
37
import org.txm.core.results.Parameter;
30 38
import org.txm.core.results.TXMResult;
31 39
import org.txm.rcp.JobsTimer;
32 40
import org.txm.rcp.StatusLine;
......
368 376
						this.syncExec(new Runnable() {
369 377
							@Override
370 378
							public void run() {
371
								currentEditor.updateResultFromEditor();
379
								currentEditor.autoUpdateResultFromEditorParameters(); // auto update from Parameter annotations
380
								currentEditor.updateResultFromEditor(); // subclasses manual settings
372 381
							}
373 382
						});
374 383
		    		}
......
518 527
			this.setPartName(this.getResultData().getName());
519 528
			firePropertyChange(TXMEditorPart.PROP_DIRTY);
520 529
		}
521
		this.updateEditorFromResult(update);
530
		this.autoUpdateEditorFieldsFromResult(); // auto update from Parameter annotations
531
		this.updateEditorFromResult(update);  // subclasses manual settings
522 532
		CorporaView.refreshObject(this);
523 533
	}
524 534
	
......
534 544
	 */
535 545
	public abstract void updateEditorFromResult(boolean update);
536 546
	
547
	
548
	
537 549
	/**
550
	 * Updates the editor fields from result and declared parameters annotations.
551
	 * Manages these widgets at this moment: ToolItem, Spinner, Text.
552
	 */
553
	public void autoUpdateEditorFieldsFromResult()	{
554
		
555
		List<Field> fields = this.getAllParameterFields();
556

  
557
		for (Field f : fields) {
558
			Parameter parameter = f.getAnnotation(Parameter.class);
559
			if (parameter == null || parameter.key().isEmpty()) {
560
				continue;
561
			}
562
			
563
			try {
564
				f.setAccessible(true);
565
				Object object = f.get(this);
566
				Object value = this.getResultData().getParameter(parameter.key());
567
				if(object instanceof ToolItem)	{
568
					((ToolItem)object).setSelection((Boolean) value); 
569
				}
570
				else if(object instanceof Spinner)	{
571
					((Spinner)object).setSelection((Integer) value); 
572
				}
573
				else if(object instanceof Text)	{
574
					((Text)object).setText((String) value); 
575
				}
576
			}
577
			catch (IllegalArgumentException e) {
578
				// TODO Auto-generated catch block
579
				e.printStackTrace();
580
			}
581
			catch (IllegalAccessException e) {
582
				// TODO Auto-generated catch block
583
				e.printStackTrace();
584
			}
585
			catch (Exception e) {
586
				// TODO Auto-generated catch block
587
				e.printStackTrace();
588
			}
589
		}
590
	}
591

  
592
	
593
	/**
594
	 * Updates the result parameters from the editor declared parameters annotations.
595
	 * Manages these widgets at this moment: ToolItem, Spinner, Text.
596
	 */
597
	public void autoUpdateResultFromEditorParameters()	{
598
		
599
		List<Field> fields = this.getAllParameterFields();
600

  
601
		for (Field f : fields) {
602
			Parameter parameter = f.getAnnotation(Parameter.class);
603
			if (parameter == null || parameter.key().isEmpty()) {
604
				continue;
605
			}
606
			
607
			try {
608
				f.setAccessible(true);
609
				Object object = f.get(this);
610
				Object value = null;
611
				if(object instanceof ToolItem)	{
612
					value = ((ToolItem)object).getSelection(); 
613
				}
614
				else if(object instanceof Spinner)	{
615
					value = ((Spinner)object).getSelection(); 
616
				}
617
				else if(object instanceof Text)	{
618
					value = ((Text)object).getText(); 
619
				}
620
				
621
				this.getResultData().setParameter(parameter.key(), value);
622
			}
623
			catch (IllegalArgumentException e) {
624
				// TODO Auto-generated catch block
625
				e.printStackTrace();
626
			}
627
			catch (IllegalAccessException e) {
628
				// TODO Auto-generated catch block
629
				e.printStackTrace();
630
			}
631
			catch (Exception e) {
632
				// TODO Auto-generated catch block
633
				e.printStackTrace();
634
			}
635
		}
636
	}
637
	
638
	
639
	/**
640
	 * Returns all the member fields of the class instance.
641
	 * @return
642
	 */
643
	protected List<Field> getAllParameterFields()	{
644

  
645
		List<Field> fields = new ArrayList<Field>();
646
		Class<?> clazz = this.getClass();
647
		while (clazz != Object.class) {
648
			fields.addAll(Arrays.asList(clazz.getDeclaredFields()));
649
			clazz = clazz.getSuperclass();
650
		}
651

  
652
		return fields;
653

  
654
	}
655

  
656
	
657
	/**
538 658
	 * Deletes the linked TXM result.
539 659
	 * @return
540 660
	 */
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAFactorialMapChartEditor.java (revision 600)
1 1
package org.txm.ca.rcp.editors;
2 2

  
3
import java.awt.Component;
4
import java.awt.event.ComponentEvent;
5
import java.awt.event.ComponentListener;
6

  
7 3
import org.eclipse.swt.SWT;
8 4
import org.eclipse.swt.custom.CLabel;
9 5
import org.eclipse.swt.events.SelectionEvent;
......
16 12
import org.txm.ca.rcp.messages.CAUIMessages;
17 13
import org.txm.chartsengine.rcp.editors.ChartEditorInput;
18 14
import org.txm.chartsengine.rcp.editors.ChartEditorPart;
19
import org.txm.core.preferences.TXMPreferences;
20 15
import org.txm.rcp.IImageKeys;
21 16
import org.txm.utils.logger.Log;
22 17

  
......
25 20
 * @author sjacquot
26 21
 *
27 22
 */
28
public class CAFactorialMapChartEditor extends ChartEditorPart {
23
public class CAFactorialMapChartEditor extends ChartEditorPart<CA> {
29 24

  
30 25

  
31 26
	public CAFactorialMapChartEditor() {
......
219 214

  
220 215

  
221 216

  
222
	@Override
223
	public CA getResultData()	{
224
		return (CA) super.getResultData();
225
	}
226 217

  
227 218

  
228 219

  
229

  
230 220
}
tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/SpecificitiesSelection.java (revision 600)
117 117
		for (int i = 0; i < selectedTypeNames.length; i++) {
118 118
			name += selectedTypeNames[i] + " ";
119 119
		}
120
		if (name.length() > 20) name = name.substring(0, 19)+"...";
120
		if (name.length() > 20) name = name.substring(0, 19) + "...";
121 121
		return name;
122 122
	}
123 123

  
tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java (revision 600)
997 997
	 */
998 998
	public static String findNodeQualifier(String nodeQualifier, TXMResult result, String key)	{
999 999

  
1000
		if (result == null) return nodeQualifier;
1000
		//if (result == null) return nodeQualifier;
1001 1001
		
1002 1002
		boolean keyExists = (result != null && resultScopeKeyExists(result, key));
1003 1003

  
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 600)
221 221
	 * @param parameterType
222 222
	 * @return
223 223
	 */
224
	protected Object getParameter(String key) {
224
	public Object getParameter(String key) {
225 225

  
226 226
		List<Field> fields = this.getAllFields();
227 227

  
......
270 270
	}
271 271

  
272 272

  
273
	//
274
	//		
275
	//		
276
	//		
277
	//		if (key.isEmpty()) {
278
	//			return false;
279
	//		}
280
	//		Object lastValue = this.lastComputingParameters.get(key);
281
	//		Object newValue = getParameter(key);
282
	//		if (lastValue == null && newValue != null) {
283
	//			return true;
284
	//		}
285
	//		else {
286
	//			return !lastValue.equals(newValue);
287
	//		}
288
	//	}
289

  
290

  
273
	/**
274
	 * Dumps the command and default preferences of the result preferences node qualifier.
275
	 * @return
276
	 */
291 277
	public String dumpPreferences()	{
292 278

  
293 279
		StringBuilder str = new StringBuilder();
294 280

  
295
		str.append("Command preferences\n");
281
		str.append("Command preferences\n"); //$NON-NLS-1$
296 282
		str.append(TXMPreferences.getKeysAndValues(TXMPreferences.scope, this.preferencesNodeQualifier));
297
		str.append("\nDefault preferences\n");
283
		str.append("\nDefault preferences\n"); //$NON-NLS-1$
298 284
		str.append(TXMPreferences.getKeysAndValues(DefaultScope.INSTANCE, this.preferencesNodeQualifier));
299 285

  
300 286
		return str.toString();
301 287
	}
302 288

  
303

  
289
	/**
290
	 * Dumps the result computing parameters (Parameter annotation).
291
	 * @return
292
	 */
304 293
	public String dumpParameters()	{
305 294
		return this.dumpParameters(Parameter.COMPUTING);
306 295
	}
307 296

  
308

  
297
	
298
	/**
299
	 * Dumps the result parameters (Parameter annotation) of the specified type.
300
	 * @param parametersType
301
	 * @return
302
	 */
309 303
	public String dumpParameters(int parametersType)	{
310 304

  
311 305
		StringBuilder str = new StringBuilder();
312 306

  
313
		str.append("Parameters (type = " + parametersType + " / " + Parameter.types[parametersType] + ")\n");
307
		str.append("Parameters (type = " + parametersType + " / " + Parameter.types[parametersType] + ")\n"); //$NON-NLS-1$
314 308

  
315 309
		List<Field> fields = new ArrayList<Field>();
316 310
		Class<?> clazz = this.getClass();
......
335 329
			}
336 330

  
337 331
			try {
338
				str.append(name + " = " + f.get(this) + "\n");
332
				str.append(name + " = " + f.get(this) + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
339 333
			}
340 334
			catch (IllegalArgumentException e) {
341 335
				// TODO Auto-generated catch block
......
547 541
	 * 
548 542
	 * @return
549 543
	 */
550
	// FIXME: need to implement here a generic way to save @Parameter
551 544
	public boolean saveParameters() throws Exception {
552
		Class clazz = this.getClass();
553 545

  
554
		Field[] fields = clazz.getDeclaredFields();
546
		List<Field> fields = this.getAllFields();
547
		
555 548
		for (Field f : fields) {
556
			if (f.getClass().equals(Integer.class)) {
549
//			if (f.getClass().equals(Integer.class)) {
550
//
551
//			}
557 552

  
558
			}
559

  
560 553
			Parameter parameter = f.getAnnotation(Parameter.class);
561
			if (parameter == null || parameter.type() != Parameter.COMPUTING) {
554
			if (parameter == null) {
562 555
				continue;
563 556
			}
564 557
			String key = parameter.key();
565
			if ("".equals(key)) {
558
			if (key.isEmpty()) {
566 559
				continue; // no preference key defined
567 560
			}
568 561

  
......
675 668
	public abstract boolean loadParameters() throws Exception;
676 669

  
677 670
	/**
678
	 * Initialize the @Parameter class members objects
671
	 * Initializes the @Parameter class members objects
679 672
	 * 
680 673
	 * @param parameters
681 674
	 * @return
682 675
	 */
683 676
	public abstract boolean setParameters(TXMParameters parameters) throws Exception;
684 677

  
678
	
679

  
685 680
	/**
681
	 * Sets a parameters form its parameter annotation "key".
682
	 * @param key
683
	 * @param value
684
	 * @return
685
	 * @throws Exception
686
	 */
687
	public boolean setParameter(String key, Object value) throws Exception	{
688
		
689
		List<Field> fields = this.getAllFields();
690

  
691
		Field targetField = null;
692
		
693
		for (Field f : fields) {
694
			Parameter parameter = f.getAnnotation(Parameter.class);
695
			if (parameter == null) {
696
				continue;
697
			}
698
			if(!parameter.key().isEmpty() && parameter.key().equals(key))	{
699
				targetField = f;
700
				break;
701
			}
702
		}
703
		
704
		if(targetField != null)	{
705
			targetField.setAccessible(true);
706
			
707
			// FIXME: debug
708
			System.err.println("TXMResult.setParameter(); setting parameter " + key + " = " + value + " for " + this.getClass());
709
			
710
			targetField.set(this, value);
711
		}
712
		
713
		
714
		return true;
715
	}
716
	
717
	/**
686 718
	 * Deletes the object from its parent, also deletes the children. The <code>TXMResult.clean()</code> methods of this result and children results are applied before the deletion.
687 719
	 * 
688 720
	 * @return
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/AdvancedChartEditorToolBar.java (revision 600)
4 4
import java.awt.GraphicsEnvironment;
5 5
import java.util.ArrayList;
6 6

  
7
import org.eclipse.core.runtime.IConfigurationElement;
8
import org.eclipse.core.runtime.Platform;
9
import org.eclipse.jface.preference.ComboFieldEditor;
10 7
import org.eclipse.swt.SWT;
11 8
import org.eclipse.swt.events.SelectionEvent;
12 9
import org.eclipse.swt.events.SelectionListener;
......
20 17
import org.txm.chartsengine.core.results.ChartResult;
21 18
import org.txm.chartsengine.rcp.editors.ChartEditorPart;
22 19
import org.txm.chartsengine.rcp.messages.SWTComponentsProviderMessages;
23
import org.txm.core.preferences.TXMPreferences;
24 20
import org.txm.rcp.IImageKeys;
25 21

  
26 22
/**
......
39 35
	}
40 36
	
41 37
	@Override
42
	protected void checkSubclass() { } // if this method is not defined then te ToolBar cannot be subclassed
38
	protected void checkSubclass() { } // if this method is not defined then the ToolBar cannot be subclassed
43 39
	
44 40
	/**
45 41
	 *
46 42
	 * @param parent
47 43
	 * @param style
48 44
	 */
49
	public AdvancedChartEditorToolBar(Composite parent, int style, final ChartEditorPart chartEditorPart2) {
45
	public AdvancedChartEditorToolBar(Composite parent, int style, final ChartEditorPart chartEditorPart) {
50 46
		super(parent, style); //$NON-NLS-1$
51 47
		
52
		this.chartEditorPart = chartEditorPart2;
48
		this.chartEditorPart = chartEditorPart;
53 49
		
54 50
		final ToolItem showTitle = new ToolItem(this, SWT.CHECK);
55 51
		//showTitle.setText(SWTComponentsProviderMessages.SWTChartsComponentProvider_SHOW_HIDE_TITLE);
......
57 53
		showTitle.setDisabledImage(IImageKeys.getImage(getClass(), "icons/show_title_disabled.png"));
58 54
		showTitle.setToolTipText(SWTComponentsProviderMessages.SWTChartsComponentProvider_SHOW_HIDE_TITLE);
59 55

  
60
		if(!chartEditorPart2.getResultData().isEmptyPreference(ChartsEnginePreferences.SHOW_TITLE))	{
61
			showTitle.setSelection(chartEditorPart2.getResultData().isTitleVisible());
56
		if(!chartEditorPart.getResultData().isEmptyPreference(ChartsEnginePreferences.SHOW_TITLE))	{
57
			showTitle.setSelection(chartEditorPart.getResultData().isTitleVisible());
62 58
		}
63 59
		// disable if not managed by the command
64 60
		else	{
......
72 68
		showLegend.setDisabledImage(IImageKeys.getImage(getClass(), "icons/show_legend_disabled.png"));
73 69
		showLegend.setToolTipText(SWTComponentsProviderMessages.SWTChartsComponentProvider_SHOW_HIDE_LEGEND);
74 70

  
75
		if(!chartEditorPart2.getResultData().isEmptyPreference(ChartsEnginePreferences.SHOW_LEGEND))	{
76
			showLegend.setSelection(chartEditorPart2.getResultData().isLegendVisible());
71
		if(!chartEditorPart.getResultData().isEmptyPreference(ChartsEnginePreferences.SHOW_LEGEND))	{
72
			showLegend.setSelection(chartEditorPart.getResultData().isLegendVisible());
77 73
		}
78 74
		// disable if not managed by the command
79 75
		else	{
......
87 83
		showGrid.setDisabledImage(IImageKeys.getImage(getClass(), "icons/show_grid_disabled.png"));
88 84
		showGrid.setToolTipText(SWTComponentsProviderMessages.SWTChartsComponentProvider_SHOW_HIDE_GRID);
89 85
		
90
		if(!chartEditorPart2.getResultData().isEmptyPreference(ChartsEnginePreferences.SHOW_GRID))	{
91
			showGrid.setSelection(chartEditorPart2.getResultData().isGridVisible());
86
		if(!chartEditorPart.getResultData().isEmptyPreference(ChartsEnginePreferences.SHOW_GRID))	{
87
			showGrid.setSelection(chartEditorPart.getResultData().isGridVisible());
92 88
		}
93 89
		// disable if not managed by the command
94 90
		else	{
......
112 108
		renderingModeCombo.pack();
113 109
		renderingComboItem.setWidth(renderingModeCombo.getBounds().width);
114 110
		
115
		if(!chartEditorPart2.getResultData().isEmptyPreference(ChartsEnginePreferences.RENDERING_COLORS_MODE))	{
116
			renderingModeCombo.select(chartEditorPart2.getResultData().getRenderingColorsMode());
111
		if(!chartEditorPart.getResultData().isEmptyPreference(ChartsEnginePreferences.RENDERING_COLORS_MODE))	{
112
			renderingModeCombo.select(chartEditorPart.getResultData().getRenderingColorsMode());
117 113
		}
118 114
		// disable if not managed
119 115
		else	{
......
122 118
		
123 119
		
124 120
		// Font selection
125
		final Font currentFont = ChartsEngine.createFont(chartEditorPart2.getResultData().getFont());
121
		final Font currentFont = ChartsEngine.createFont(chartEditorPart.getResultData().getFont());
126 122
		
127 123
		final Combo fontCombo = new Combo(this, SWT.READ_ONLY);
128 124
		String fonts[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
......
211 207
				boolean update = true;
212 208
				
213 209
				if(e.getSource() == showTitle)	{
214
					chartEditorPart2.getResultData().setTitleVisible(showTitle.getSelection());
210
					chartEditorPart.getResultData().setTitleVisible(showTitle.getSelection());
215 211
				}
216 212
				else if(e.getSource() == showLegend)	{
217
					chartEditorPart2.getResultData().setLegendVisible(showLegend.getSelection());
213
					chartEditorPart.getResultData().setLegendVisible(showLegend.getSelection());
218 214
				}
219 215
				else if(e.getSource() == showGrid)	{
220
					chartEditorPart2.getResultData().setGridVisible(showGrid.getSelection());
216
					chartEditorPart.getResultData().setGridVisible(showGrid.getSelection());
221 217
				}
222 218
				else if(e.getSource() == renderingModeCombo)	{
223
					chartEditorPart2.getResultData().setRenderingColorsMode(renderingModeCombo.getSelectionIndex());
219
					chartEditorPart.getResultData().setRenderingColorsMode(renderingModeCombo.getSelectionIndex());
224 220
				}
225 221
				else if(e.getSource() == fontCombo || e.getSource() == fontSizeCombo)	{
226
					chartEditorPart2.getResultData().setFont("1|" + fontCombo.getItem(fontCombo.getSelectionIndex()) + "|" + fontSizeCombo.getItem(fontSizeCombo.getSelectionIndex()) + "|0");
222
					chartEditorPart.getResultData().setFont("1|" + fontCombo.getItem(fontCombo.getSelectionIndex()) + "|" + fontSizeCombo.getItem(fontSizeCombo.getSelectionIndex()) + "|0");
227 223
				}
228 224
				else if(e.getSource() == chartTypeCombo)	{
229
					chartEditorPart2.getResultData().setChartType(chartTypeCombo.getItem(chartTypeCombo.getSelectionIndex()));
225
					chartEditorPart.getResultData().setChartType(chartTypeCombo.getItem(chartTypeCombo.getSelectionIndex()));
230 226
					update = false;
231 227
				}
232 228

  
233
				chartEditorPart2.getResultData().setChartDirty();
229
				chartEditorPart.getResultData().setChartDirty();
234 230
				
235 231
				// updates or creates chart
236
				chartEditorPart2.compute(update);
232
				chartEditorPart.compute(update);
237 233
			}
238 234
			
239 235
			@Override
tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesSelectionEditor.java (revision 600)
20 20
 * @author sjacquot
21 21
 *
22 22
 */
23
public class SpecificitiesSelectionEditor extends ChartEditorPart {
23
public class SpecificitiesSelectionEditor extends ChartEditorPart<SpecificitiesSelection> {
24 24

  
25 25

  
26 26
	@Override
......
77 77
		
78 78
	}
79 79
	
80
	
81
	@Override
82
	public SpecificitiesSelection getResultData() {
83
		return (SpecificitiesSelection) super.getResultData();
84
	}
85 80
}
tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesEditor.java (revision 600)
62 62
 * @author sloiseau 
63 63
 * 
64 64
 */
65
public class SpecificitiesEditor extends TXMEditorPart {
65
public class SpecificitiesEditor extends TXMEditorPart<Specificities> {
66 66

  
67 67
	public final static String ID = SpecificitiesEditor.class.getName();
68 68

  
......
461 461
		return this.viewer.getSelection();
462 462
	}
463 463
	
464
	@Override
465
	public Specificities getResultData()	{
466
		return (Specificities) super.getResultData();
467
	}
468 464

  
469

  
470 465
	@Override
471 466
	public void updateResultFromEditor() {
472 467
		this.getResultData().setMaxScore(this.maxScore.getSelection());
tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/editors/PartitionDimensionsEditor.java (revision 600)
9 9
import org.eclipse.swt.widgets.Composite;
10 10
import org.eclipse.swt.widgets.ToolItem;
11 11
import org.txm.chartsengine.rcp.editors.ChartEditorPart;
12
import org.txm.core.results.Parameter;
12 13
import org.txm.partition.core.functions.PartitionDimensions;
14
import org.txm.partition.core.preferences.PartitionDimensionsPreferences;
13 15
import org.txm.partition.rcp.messages.PartitionUIMessages;
14 16
import org.txm.rcp.IImageKeys;
15 17

  
16 18
/**
17
 * 
18 19
 * Partition dimensions chart editor.
19 20
 * @author sjacquot
20 21
 *
21 22
 */
22 23
public class PartitionDimensionsEditor extends ChartEditorPart<PartitionDimensions> {
24

  
25

  
26
	@Parameter(key=PartitionDimensionsPreferences.CHART_DIMENSIONS_SORT_BY_SIZE)
27
	protected ToolItem sortByPartSize;
23 28
	
29
	
30
	
24 31
	@Override
25 32
	public void createPartControl(Composite parent) {
26 33

  
27 34
		this.createComputingParametersArea = false;
28 35
		
29 36
		super.createPartControl(parent);
30
		
37

  
31 38
		// extend the tool bar
32 39
		new ToolItem(this.getToolBar(), SWT.SEPARATOR);
33
		final ToolItem sortByPartSize = new ToolItem(this.getToolBar(), SWT.CHECK);
40
		sortByPartSize = new ToolItem(this.getToolBar(), SWT.CHECK);
34 41
		sortByPartSize.setImage(IImageKeys.getImage(this.getClass(), "icons/silk_sort_by_size.png"));
35 42
		sortByPartSize.setToolTipText(PartitionUIMessages.PreferencesPage_DIMENSIONS_SORT_BY_PARTS_SIZE);
36
		sortByPartSize.setSelection(this.getResultData().isSortingBySize());
43
		//sortByPartSize.setSelection(this.getResultData().isSortingBySize());
37 44
		
38 45
		sortByPartSize.addSelectionListener(new SelectionListener() {
39 46
			
40 47
			@Override
41 48
			public void widgetSelected(SelectionEvent e) {
42
				getResultData().setSortBySize(sortByPartSize.getSelection());
49
//				getResultData().setSortBySize(sortByPartSize.getSelection());
43 50
				compute(true);
44 51
			}
45 52
			
46 53
			@Override
47
			public void widgetDefaultSelected(SelectionEvent e) { }
54
			public void widgetDefaultSelected(SelectionEvent e) {
55
				// TODO Auto-generated method stub
56
				
57
			}
48 58
		});
49 59
	}
60
	
61
	
50 62
}
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor.java (revision 600)
57 57
import org.eclipse.swt.widgets.Spinner;
58 58
import org.eclipse.swt.widgets.TableColumn;
59 59
import org.txm.core.messages.TXMCoreMessages;
60
import org.txm.core.results.Parameter;
60 61
import org.txm.lexicaltable.core.functions.LexicalTable;
62
import org.txm.lexicaltable.core.preferences.LexicalTablePreferences;
61 63
import org.txm.lexicaltable.core.statsengine.data.ILexicalTable;
62 64
import org.txm.lexicaltable.rcp.handlers.MergeLines;
63 65
import org.txm.lexicaltable.rcp.messages.LexicalTableUIMessages;
......
97 99
	TableViewerColumn freqColumn;
98 100
	// org.eclipse.swt.widgets.List colCombo;
99 101

  
100
	/** The minfreqspinner. */
101
	Spinner minFreqSpinner;
102

  
103
	/** The top spinner. */
104
	Spinner nLinesSpinner;
105

  
106 102
	/** The cols. */
107 103
	private List<double[]> cols;
108 104

  
......
121 117
	boolean reverse = DEFAULTREVERSE;
122 118

  
123 119

  
120
	
121
	/** The minfreqspinner. */
122
//	@Parameter(key=LexicalTablePreferences.F_MIN)
123
	Spinner minFreqSpinner;
124

  
125
	/** The top spinner. */
126
//	@Parameter(key=LexicalTablePreferences.V_MAX)
127
	Spinner nLinesSpinner;
128

  
129

  
130
	
131
	
132
	
124 133
	/**
125 134
	 * Creates the part control.
126 135
	 *
......
623 632
		
624 633
		this.refreshTable();
625 634
		this.refreshInfos();
626
		//super.refresh(update);
627 635
		
628 636
		QueriesView.refresh();
629 637
		RVariablesView.refresh();

Formats disponibles : Unified diff