Révision 2255

tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMMultiPageEditor.java (revision 2255)
48 48
 */
49 49
//FIXME: SJ: this class leads to a lot of problem : focus, activation, etc. find a way to stop to use it. It actually used only for the CA at this moment.
50 50
@Deprecated
51
public abstract class TXMMultiPageEditor<T extends TXMResult> extends MultiPageEditorPart implements ITXMResultEditor<T>{
51
public abstract class TXMMultiPageEditor<T extends TXMResult> extends MultiPageEditorPart {
52 52

  
53 53
	/** The Constant ID. */
54 54
	public static final String ID = "org.txm.rcp.editors.GenericMultiPageEditor"; //$NON-NLS-1$
......
208 208
	public void setPartName(String partName) {
209 209
		super.setPartName(partName);
210 210
	}
211
	
212
	@Override
213
	public JobHandler compute(boolean update) {
214
		JobHandler job = null;
215
		for (EditorPart editor : editors) {
216
			if (editor instanceof ITXMResultEditor) {
217
				job = ((ITXMResultEditor) editor).compute(update);
218
			}
219
		}
220
		return job;
221
	}
222

  
223
	@Override
224
	public void refresh(boolean update) throws Exception {
225
		for (EditorPart editor : editors) {
226
			if (editor instanceof ITXMResultEditor) {
227
				((ITXMResultEditor) editor).refresh(update);
228
			}
229
		}
230
	}
231 211
}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/BaseAbstractHandler.java (revision 2255)
12 12
import org.eclipse.core.commands.ParameterValuesException;
13 13
import org.eclipse.core.commands.ParameterizedCommand;
14 14
import org.eclipse.core.commands.common.NotDefinedException;
15
import org.eclipse.ui.IEditorPart;
16 15
import org.eclipse.ui.IViewPart;
17 16
import org.eclipse.ui.IWorkbenchPage;
18 17
import org.eclipse.ui.IWorkbenchWindow;
......
21 20
import org.eclipse.ui.commands.ICommandService;
22 21
import org.eclipse.ui.contexts.IContextActivation;
23 22
import org.eclipse.ui.contexts.IContextService;
24
import org.eclipse.ui.handlers.HandlerUtil;
25 23
import org.eclipse.ui.handlers.IHandlerService;
26 24
import org.txm.Toolbox;
27 25
import org.txm.core.engines.EngineType;
28 26
import org.txm.core.preferences.TXMPreferences;
29 27
import org.txm.core.results.TXMResult;
30
import org.txm.rcp.editors.TXMEditor;
31
import org.txm.rcp.editors.TXMMultiPageEditor;
32 28
import org.txm.rcp.utils.SWTEditorsUtils;
33 29
import org.txm.rcp.views.corpora.CorporaView;
34 30
import org.txm.searchengine.cqp.CQPSearchEngine;
tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/SWTEditorsUtils.java (revision 2255)
75 75
			for (IWorkbenchPage page : pages) {
76 76
				for (IEditorReference reference : page.getEditorReferences()) {
77 77
					IEditorPart tmpEditor = reference.getEditor(false);
78

  
79
					if(tmpEditor instanceof ITXMResultEditor)	{
80
						editors.add((ITXMResultEditor<?>) tmpEditor);
81
					}
82
					else if(tmpEditor instanceof TXMMultiPageEditor)	{
78
					
79
					if(tmpEditor instanceof TXMMultiPageEditor)	{
83 80
						TXMMultiPageEditor txmMultipageEditor = ((TXMMultiPageEditor)tmpEditor);
84 81
						for (int i = 0; i < txmMultipageEditor.getEditors().size(); i++) {
85 82
							if(txmMultipageEditor.getEditors().get(i) instanceof ITXMResultEditor)	{
......
87 84
								editors.add(txmEditor);
88 85
							}
89 86
						}
87
					} else if(tmpEditor instanceof ITXMResultEditor)	{
88
						editors.add((ITXMResultEditor<?>) tmpEditor);
90 89
					}
91 90
				}
92 91
			}
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAEditor.java (revision 2255)
59 59
import org.txm.ca.rcp.messages.CAUIMessages;
60 60
import org.txm.chartsengine.rcp.editors.ChartEditor;
61 61
import org.txm.chartsengine.rcp.editors.ChartEditorInput;
62
import org.txm.rcp.editors.ITXMResultEditor;
62 63
import org.txm.rcp.editors.TXMMultiPageEditor;
63 64
import org.txm.rcp.editors.TXMResultEditorInput;
64 65
import org.txm.rcp.messages.TXMUIMessages;
......
83 84

  
84 85
	@Override
85 86
	protected void createPages() {
86
		
87

  
87 88
		// Tabs titles
88 89
		this.names = Arrays.asList(new String[] {CAUIMessages.factPlan, CACoreMessages.rows, CACoreMessages.columns, CAUIMessages.eigenvaluesBarChat, CAUIMessages.eigenvalues});
89
		
90

  
90 91
		Composite container = this.getContainer();
91 92
		final Composite parentContainer = container.getParent();
92 93

  
......
174 175
				int editorIndex = this.addPage(editors.get(i), inputs.get(i)); // NOTE: the method addPage() calls the createPartControl() method of the editors
175 176
				this.setPageText(editorIndex, this.names.get(i));
176 177
			}
177
	
178

  
178 179
			caFactorialMapEditorPart.compute(false);
179
			
180

  
180 181
		}
181 182
		catch (Exception e1) {
182 183
			Log.printStackTrace(e1);
......
184 185
			return;
185 186
		}
186 187

  
187
		
188

  
189 188
		// Selection changed listener to highlight CA chart points from table lines selection
190 189
		ISelectionChangedListener selectionChangedListener = new ISelectionChangedListener() {
191 190

  
......
202 201

  
203 202
				CAFactorialMapChartEditor chartEditor = (CAFactorialMapChartEditor) editors.get(0);
204 203
				((CAChartCreator) chartEditor.getResult().getChartCreator()).updateChartCAFactorialMapHighlightPoints(chartEditor.getChart(), (e.getSource() == getRowsInfosEditor().getViewer()), selectedLabels);
205
				
204

  
206 205
				// SJ: fix a Linux focus bug with MultiPageEditorPart
207
//				if(OSDetector.isFamilyUnix())	{
208
//					table.getParent().setFocus();
209
//				}
206
				//				if(OSDetector.isFamilyUnix())	{
207
				//					table.getParent().setFocus();
208
				//				}
210 209

  
211
				
210

  
212 211
			}
213 212
		};
214 213

  
......
290 289
	 */
291 290
	public void initRowsTableEditor()	{
292 291
		ColsRowsInfosEditor editor = new ColsRowsInfosEditor(ca, CAUIMessages.rowsInfos) {
293
			
292

  
294 293
			@Override
295 294
			public String[] getTableTitles() {
296 295
				return ca.getRowInfosTitles();
297 296
			}
298
			
297

  
299 298
			@Override
300 299
			public Object getTableInput() {
301 300
				return ca.getRowInfos();
302 301
			}
303 302
		};
304
		
303

  
305 304
		editors.add(editor);
306 305
		inputs.add(editor.getEditorInput());
307
		
306

  
308 307
	}
309 308

  
310 309
	/**
......
313 312
	public void initColumnsTableEditor()	{
314 313

  
315 314
		ColsRowsInfosEditor editor = new ColsRowsInfosEditor(ca, CAUIMessages.colsInfos) {
316
			
315

  
317 316
			@Override
318 317
			public String[] getTableTitles() {
319 318
				return ca.getColInfosTitles();
320 319
			}
321
			
320

  
322 321
			@Override
323 322
			public Object getTableInput() {
324 323
				return ca.getColInfos();
325 324
			}
326 325
		};
327
		
326

  
328 327
		editors.add(editor);
329 328
		inputs.add(editor.getEditorInput());
330 329
	}
......
374 373
		//		editors.get(4).setFocus();
375 374
	}
376 375

  
377
	@Override
376
//	@Override
378 377
	public CA getResult() {
379 378
		return ca;
380 379
	}
381 380

  
382

  
383

  
384
	@Override
385
	public void close() {
386
		close(false);
387
	}
388

  
389
	@Override
390
	public void close(final boolean deleteResult) {
391
		final EditorPart self = this;
392
		this.getSite().getShell().getDisplay().syncExec(new Runnable() {
393
			@Override
394
			public void run() {
395
				getSite().getPage().closeEditor(self, false);
396
				if(deleteResult)	{
397
					try {
398
						getResult().delete();
399
					}
400
					catch(Exception e) {
401
						
402
					}
403
				}
404
			}
405
		});
406
	}
407

  
408
	@Override
409
	public void setLocked(boolean locked) {
410
	}
381
//
382
//
383
//	@Override
384
//	public void close() {
385
//		close(false);
386
//	}
387
//
388
//	@Override
389
//	public void close(final boolean deleteResult) {
390
//		final EditorPart self = this;
391
//		this.getSite().getShell().getDisplay().syncExec(new Runnable() {
392
//			@Override
393
//			public void run() {
394
//				getSite().getPage().closeEditor(self, false);
395
//				if(deleteResult)	{
396
//					try {
397
//						getResult().delete();
398
//					}
399
//					catch(Exception e) {
400
//
401
//					}
402
//				}
403
//			}
404
//		});
405
//	}
406
//
407
//	@Override
408
//	public void setLocked(boolean locked) {
409
//	}
410
//
411
//	@Override
412
//	public JobHandler compute(boolean update) {
413
//		// TODO Auto-generated method stub
414
//		return null;
415
//	}
416
//
417
//	@Override
418
//	public void refresh(boolean update) throws Exception {
419
//		// TODO Auto-generated method stub
420
//		
421
//	}
411 422
}
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/handlers/ComputeCA.java (revision 2255)
171 171
			try {
172 172
				Log.fine(CAUIMessages.loadingCorrespondenceAnalysisResults);
173 173

  
174
				TXMResultEditorInput<CA> editorInput = new TXMResultEditorInput(ca);
174
				TXMResultEditorInput<CA> editorInput = new TXMResultEditorInput<CA>(ca);
175 175
				IWorkbenchPage page = TXMWindows.getActivePage();
176 176
				StatusLine.setMessage(CAUIMessages.openingTheCorrespondenceAnalysisResults);
177 177
				IEditorPart editor = page.openEditor(editorInput, CAEditor.class.getName());
178
				
178
				if (editor == null) {
179
					
180
				}
179 181
			}
180 182
			catch (Throwable e) {
181 183
				Log.severe(CAUIMessages.bind(CAUIMessages.error_opening, ca));

Formats disponibles : Unified diff