Revision 601

tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/editors/PartitionDimensionsEditor.java (revision 601)
1
/**
2
 * 
3
 */
4 1
package org.txm.partition.rcp.editors;
5 2

  
6 3
import org.eclipse.swt.SWT;
7
import org.eclipse.swt.events.SelectionEvent;
8
import org.eclipse.swt.events.SelectionListener;
9 4
import org.eclipse.swt.widgets.Composite;
10 5
import org.eclipse.swt.widgets.ToolItem;
11 6
import org.txm.chartsengine.rcp.editors.ChartEditorPart;
......
14 9
import org.txm.partition.core.preferences.PartitionDimensionsPreferences;
15 10
import org.txm.partition.rcp.messages.PartitionUIMessages;
16 11
import org.txm.rcp.IImageKeys;
12
import org.txm.rcp.editors.listeners.ComputeSelectionListener;
17 13

  
18 14
/**
19 15
 * Partition dimensions chart editor.
......
40 36
		sortByPartSize = new ToolItem(this.getToolBar(), SWT.CHECK);
41 37
		sortByPartSize.setImage(IImageKeys.getImage(this.getClass(), "icons/silk_sort_by_size.png"));
42 38
		sortByPartSize.setToolTipText(PartitionUIMessages.PreferencesPage_DIMENSIONS_SORT_BY_PARTS_SIZE);
43
		//sortByPartSize.setSelection(this.getResultData().isSortingBySize());
44 39
		
45
		sortByPartSize.addSelectionListener(new SelectionListener() {
46
			
47
			@Override
48
			public void widgetSelected(SelectionEvent e) {
49
//				getResultData().setSortBySize(sortByPartSize.getSelection());
50
				compute(true);
51
			}
52
			
53
			@Override
54
			public void widgetDefaultSelected(SelectionEvent e) {
55
				// TODO Auto-generated method stub
56
				
57
			}
58
		});
40
		sortByPartSize.addSelectionListener(new ComputeSelectionListener(this));
59 41
	}
60 42
	
61 43
	
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/listeners/ComputeSelectionListener.java (revision 601)
1
/**
2
 * 
3
 */
4
package org.txm.rcp.editors.listeners;
5

  
6
import org.eclipse.swt.events.SelectionEvent;
7
import org.eclipse.swt.events.SelectionListener;
8
import org.txm.rcp.editors.TXMEditorPart;
9

  
10
/**
11
 * A selection listener that can be added to editors widgets and that call the TXMEditorPart.compute() method.
12
 * @author sjacquot
13
 *
14
 */
15
public class ComputeSelectionListener implements SelectionListener {
16

  
17

  
18
	/**
19
	 * Linked editor.
20
	 */
21
	protected TXMEditorPart editor;
22
	
23
	/**
24
	 * 
25
	 */
26
	public ComputeSelectionListener(TXMEditorPart editor) {
27
		this.editor = editor;
28
	}
29

  
30
	@Override
31
	public void widgetSelected(SelectionEvent e) {
32
		this.editor.compute(false);
33
	}
34

  
35
	@Override
36
	public void widgetDefaultSelected(SelectionEvent e) {
37
		// TODO Auto-generated method stub
38

  
39
	}
40

  
41
}
0 42

  
tmp/org.txm.rcp/META-INF/MANIFEST.MF (revision 601)
140 140
 org.txm.rcp.editors.imports,
141 141
 org.txm.rcp.editors.imports.sections,
142 142
 org.txm.rcp.editors.input,
143
 org.txm.rcp.editors.listeners,
143 144
 org.txm.rcp.handlers,
144 145
 org.txm.rcp.jface,
145 146
 org.txm.rcp.log,

Also available in: Unified diff