Révision 3039

tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesTableLabelProvider.java (revision 3039)
31 31
import org.eclipse.jface.viewers.LabelProvider;
32 32
import org.eclipse.swt.graphics.Image;
33 33
import org.txm.core.preferences.TXMPreferences;
34
import org.txm.searchengine.cqp.corpus.Subcorpus;
34 35
import org.txm.specificities.core.preferences.SpecificitiesPreferences;
35 36

  
36 37
/**
......
46 47
	
47 48
	private String format;
48 49
	
50
	private SpecificitiesEditor editor;
51
	
52
	private int separatorOffset;
53
	
49 54
	/**
50 55
	 * Instantiates a new specificites table label provider.
51 56
	 *
52 57
	 * @param partindexes the partindexes
53 58
	 */
54
	public SpecificitiesTableLabelProvider() {
59
	public SpecificitiesTableLabelProvider(SpecificitiesEditor editor) {
55 60
		// this.partindexes = partindexes;
56 61
		// showPValues = "true".equals(Toolbox.getParam(SpecificitiesPreferencePage.SPECIF_PVALUES)); //$NON-NLS-1$
62
		this.editor = editor;
57 63
		this.format = SpecificitiesPreferences.getInstance().getString(SpecificitiesPreferences.FORMAT);
58 64
		if (format == null || format.trim().length() == 0) {
59 65
			format = "%,.1f"; //$NON-NLS-1$
60 66
		}
67
		
68
		separatorOffset = 2;
69
		if (editor.getResult().getParent().getParent() instanceof Subcorpus) {
70
			separatorOffset = 1;
71
		}
61 72
	}
62 73
	
63 74
	/*
......
79 90
	public String getColumnText(Object element, int columnIndex) {
80 91
		
81 92
		Object[] line = (Object[]) element;
93
		
82 94
		int[] freqs = (int[]) line[2];// get the freqs
83 95
		// line content : {unit, freq, freqs[], scores[]}
84 96
		
......
89 101
		else if (columnIndex == 2) { // separator column
90 102
			return EMPTY;
91 103
		}
92
		else if (columnIndex == (freqs.length * 2) + 3) { // separator column
104
		else if (columnIndex == (freqs.length * separatorOffset) + 3) { // separator column
93 105
			return EMPTY;
94 106
		}
95 107
		else {
tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesEditor.java (revision 3039)
139 139
				availableProperties.addAll(CQPCorpus.getFirstParentCorpus(this.getResult()).getOrderedProperties());
140 140
				availableProperties.addAll(CQPCorpus.getFirstParentCorpus(this.getResult()).getVirtualProperties());
141 141
				this.unitPropertyComboViewer = new PropertiesComboViewer(mainParametersArea, this, false,
142
						availableProperties,
143
						this.getResult().getUnitProperty(), false);
142
						availableProperties, this.getResult().getUnitProperty(), false);
144 143
			}
145 144
			
146 145
			
......
161 160
			viewer.getTable().addKeyListener(new TableKeyListener(viewer));
162 161
			viewer.getTable().setLinesVisible(true);
163 162
			viewer.getTable().setHeaderVisible(true);
164
			viewer.setLabelProvider(new SpecificitiesTableLabelProvider());
163
			viewer.setLabelProvider(new SpecificitiesTableLabelProvider(this));
165 164
			viewer.setContentProvider(ArrayContentProvider.getInstance());
166 165
			specificitesTable = viewer.getTable();
167 166
			specificitesTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2));
......
251 250
			}
252 251
			
253 252
			int len = lexicalTableColumnNames.length;
254
			if (len == 2) {
253
			if (len == 2 && this.getResult().getParent().getParent() instanceof Subcorpus) {
255 254
				len--; // show only the first column specifs since they are the same (modulo signus)
256 255
			}
257 256
			if (!update

Formats disponibles : Unified diff