Révision 1527

tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/messages.properties (revision 1527)
1
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
1
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)

2 2
#TXM messages generated by the PluginMessagesManager class
3 3
#Thu Dec 06 15:02:43 CET 2018
4 4

  
......
57 57

  
58 58
qualityColumnFormat = Quality column format
59 59

  
60
rowsInfos = Rows informations
60
rowsInfos = Rows information
61 61

  
62 62
showPointShapes = Show points
63 63

  
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/messages_fr.properties (revision 1527)
1
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
1
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)

2 2
#TXM messages generated by the PluginMessagesManager class
3 3
#Thu Dec 06 15:02:43 CET 2018
4 4

  
......
15 15

  
16 16
chi = χ²
17 17

  
18
colsInfos = Informations sur les colonnes
18
colsInfos = Informations colonnes
19 19

  
20 20
computingCorrespondenceAnalysisOnP0WithPropertyP1 = Calcul de l''analyse factorielle des correspondances de {0} avec la propriété {1}
21 21

  
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAEditor.java (revision 1527)
55 55
import org.txm.ca.core.chartsengine.base.CAChartCreator;
56 56
import org.txm.ca.core.functions.CA;
57 57
import org.txm.ca.core.functions.Eigenvalues;
58
import org.txm.ca.core.messages.CACoreMessages;
58 59
import org.txm.ca.rcp.messages.CAUIMessages;
59 60
import org.txm.chartsengine.rcp.editors.ChartEditor;
60 61
import org.txm.chartsengine.rcp.editors.ChartEditorInput;
......
87 88
	protected void createPages() {
88 89
		
89 90
		// Tabs titles
90
		this.names = Arrays.asList(new String[] {CAUIMessages.factPlan, CAUIMessages.rowsInfos, CAUIMessages.colsInfos, CAUIMessages.eigenvaluesBarChat, CAUIMessages.eigenvalues});
91
		this.names = Arrays.asList(new String[] {CAUIMessages.factPlan, CACoreMessages.rows, CACoreMessages.columns, CAUIMessages.eigenvaluesBarChat, CAUIMessages.eigenvalues});
91 92
		
92 93
		Composite container = this.getContainer();
93 94
		final Composite parentContainer = container.getParent();
......
142 143
		this.initCAFactorialMapEditor();
143 144
		this.initRowsTableEditor();
144 145
		this.initColumnsTableEditor();
145
		this.initCASingularValuesBarChartEditor();
146
		this.initCASingularValuesTableEditor();
146
		this.initCAEigenvaluesBarChartEditor();
147
		this.initCAEigenvaluesTableEditor();
147 148

  
148 149

  
149 150
		if (editors.size() != inputs.size()) {
......
263 264
	}
264 265

  
265 266
	/**
266
	 * Initializes CA singular values bar chart editor.
267
	 * Initializes CA Eigenvalues bar chart editor.
267 268
	 */
268
	public void initCASingularValuesBarChartEditor()	{
269
	public void initCAEigenvaluesBarChartEditor()	{
269 270
		Eigenvalues eigenvalues = (Eigenvalues) ca.getFirstChild(Eigenvalues.class);
270 271
		EigenvaluesChartEditor editor = new EigenvaluesChartEditor(new ChartEditorInput<Eigenvalues>(eigenvalues));
271 272
		editors.add(editor);
......
273 274
	}
274 275

  
275 276
	/**
276
	 * Initializes CA singular values table editor.
277
	 * Initializes CA Eigenvalues table editor.
277 278
	 */
278
	public void initCASingularValuesTableEditor()	{
279
	public void initCAEigenvaluesTableEditor()	{
279 280
		EigenvaluesTableEditor editor = new EigenvaluesTableEditor(ca); 
280 281
		editors.add(editor);
281 282
		inputs.add(editor.getEditorInput());
......
285 286
	 * Initializes rows data table editor.
286 287
	 */
287 288
	public void initRowsTableEditor()	{
288
		ColsRowsInfosEditor editor = new ColsRowsInfosEditor(ca) {
289
		ColsRowsInfosEditor editor = new ColsRowsInfosEditor(ca, CAUIMessages.rowsInfos) {
289 290
			
290 291
			@Override
291 292
			public String[] getTableTitles() {
......
300 301
		
301 302
		editors.add(editor);
302 303
		inputs.add(editor.getEditorInput());
304
		
303 305
	}
304 306

  
305 307
	/**
......
307 309
	 */
308 310
	public void initColumnsTableEditor()	{
309 311

  
310
		ColsRowsInfosEditor editor = new ColsRowsInfosEditor(ca) {
312
		ColsRowsInfosEditor editor = new ColsRowsInfosEditor(ca, CAUIMessages.colsInfos) {
311 313
			
312 314
			@Override
313 315
			public String[] getTableTitles() {
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/ColsRowsInfosEditor.java (revision 1527)
59 59
import org.txm.rcp.StatusLine;
60 60
import org.txm.rcp.editors.ITablableEditorInput;
61 61
import org.txm.rcp.editors.TXMEditor;
62
import org.txm.rcp.editors.TXMResultEditorInput;
62 63
import org.txm.rcp.editors.TableKeyListener;
63 64
import org.txm.rcp.editors.TableLinesViewerComparator;
64 65
import org.txm.rcp.editors.TableSorter;
......
67 68
import org.txm.rcp.swt.GLComposite;
68 69

  
69 70
/**
70
 * Used to display rows and cols informations such as contribution, inertia,
71
 * mass, coord...
71
 * Used to display rows and columns information such as contribution, inertia, mass, coord...
72 72
 * 
73 73
 * @author mdecorde
74
 * @author sjacquot
74 75
 * 
75 76
 */
76 77
public abstract class ColsRowsInfosEditor extends TXMEditor {
......
85 86
	 * 
86 87
	 * @param result
87 88
	 */
88
	public ColsRowsInfosEditor(TXMResult result) {
89
		super(result);
89
	public ColsRowsInfosEditor(TXMResult result, final String tabTooltip) {
90
		super(new TXMResultEditorInput<TXMResult>(result) {
91
			@Override
92
			public String getToolTipText() {
93
				return tabTooltip;
94
			}
95
		});
90 96
	}
91 97

  
92 98
	
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/handlers/ComputeCA.java (revision 1527)
143 143

  
144 144
					Log.info(NLS.bind(CAUIMessages.computingCorrespondenceAnalysisOnP0WithPropertyP1, lexicalTable, property));
145 145

  
146
					if (lexicalTable.getNColumns() < 4) {
146
					if (lexicalTable.hasBeenComputedOnce() && lexicalTable.getNColumns() < 4) {
147 147
						// FIXME: remove this swing code that freeze the UI, need to use SWT in main thread
148 148
						MessageBox.error(CAUIMessages.canNotComputeCAOnLexicalTableWithLessThan4Columns);
149 149
						return null;
150 150
					}
151
					if (lexicalTable.getNRows() < 4) {
151
					if (lexicalTable.hasBeenComputedOnce() && lexicalTable.getNRows() < 4) {
152 152
						// FIXME: remove this swing code that freeze the UI, need to use SWT in main thread
153 153
						MessageBox.error(CAUIMessages.canNotComputeCAWithLessThan4RowsInTheTable);
154 154
						return null;
tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SynopticEditionEditor.java (revision 1527)
312 312
		return controlsArea;
313 313
	}
314 314

  
315
	/* (non-Javadoc)
316
	 * @see org.eclipse.ui.internal.browser.WebBrowserEditor#createPartControl(org.eclipse.swt.widgets.Composite)
317
	 */
318 315
	@Override
319 316
	public void _createPartControl() {
320 317

  
318
		// remove the compute button
319
		this.removeComputeButton();
320
		
321 321
		editionsArea = getResultArea();
322 322

  
323 323
		controlsArea = getBottomToolbar().installGLComposite(EditionUIMessages.controls, 15, false);
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 1527)
6 6
import java.lang.reflect.Field;
7 7
import java.util.ArrayList;
8 8
import java.util.Arrays;
9
import java.util.HashMap;
10 9
import java.util.HashSet;
11 10
import java.util.List;
12 11

  
......
18 17
import org.eclipse.core.runtime.SafeRunner;
19 18
import org.eclipse.core.runtime.Status;
20 19
import org.eclipse.core.runtime.jobs.Job;
20
import org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem;
21
import org.eclipse.jface.action.ContributionManager;
21 22
import org.eclipse.jface.action.MenuManager;
22 23
import org.eclipse.jface.dialogs.MessageDialog;
23 24
import org.eclipse.jface.viewers.ISelectionProvider;
......
45 46
import org.eclipse.swt.widgets.ToolItem;
46 47
import org.eclipse.ui.IEditorInput;
47 48
import org.eclipse.ui.IEditorPart;
48
import org.eclipse.ui.IEditorReference;
49 49
import org.eclipse.ui.IEditorSite;
50 50
import org.eclipse.ui.IPartListener;
51 51
import org.eclipse.ui.IPartListener2;
52
import org.eclipse.ui.ISaveablePart2;
53 52
import org.eclipse.ui.IWorkbenchPage;
54 53
import org.eclipse.ui.IWorkbenchPart;
55 54
import org.eclipse.ui.IWorkbenchPartReference;
......
57 56
import org.eclipse.ui.IWorkbenchWindow;
58 57
import org.eclipse.ui.PartInitException;
59 58
import org.eclipse.ui.PlatformUI;
60
import org.eclipse.ui.internal.browser.SWTUtil;
61 59
import org.eclipse.ui.menus.IMenuService;
62 60
import org.eclipse.ui.part.EditorPart;
63 61
import org.txm.core.messages.TXMCoreMessages;
62
import org.txm.core.preferences.TBXPreferences;
64 63
import org.txm.core.results.Parameter;
65 64
import org.txm.core.results.TXMResult;
66
import org.txm.core.results.TXMResultListener;
67 65
import org.txm.rcp.JobsTimer;
68 66
import org.txm.rcp.StatusLine;
69 67
import org.txm.rcp.TXMWindows;
......
207 205
	 * @param result
208 206
	 */
209 207
	public TXMEditor(TXMResult result) {
210
		this();
211
		this.setInput(new TXMResultEditorInput<TXMResult>(result)); // FIXME: SJ: the input is defined twice, on time here and one time in init(), need to see if we still the assignation here in the constructor
208
		this(new TXMResultEditorInput<TXMResult>(result));
212 209
	}
213 210

  
214 211

  
212
	/**
213
	 * Creates an editor with the specified editor input.
214
	 * @param editorInput
215
	 */
216
	public TXMEditor(TXMResultEditorInput<TXMResult> editorInput) {
217
		this.setInput(editorInput); // FIXME: SJ: the input is defined twice, on time here and one time in init(), need to see if we still need the assignment here in the constructor		
218
	}
219
	
220

  
215 221
	@Override
216 222
	public void init(IEditorSite site, IEditorInput input) throws PartInitException {
217 223
		this.setSite(site);
......
368 374
			this.firstLineComposite.getLayout().numColumns = 2;
369 375
			this.firstLineComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
370 376

  
371
			this.mainParametersComposite = new GLComposite(firstLineComposite, SWT.NONE, "Main parameters area"); //$NON-NLS-1$
377
			this.mainParametersComposite = new GLComposite(this.firstLineComposite, SWT.NONE, "Main parameters area"); //$NON-NLS-1$
372 378
			this.mainParametersComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false));
373 379
			this.mainParametersComposite.getLayout().marginLeft = 5;
374 380
			this.mainParametersComposite.getLayout().horizontalSpacing = 5;
......
384 390
			// computing parameters components
385 391
			boolean showExtendedParameters = false;
386 392
			// only show the area if the result can not compute and is dirty
387
			// FIXME: to discuss if when hiding or showing the extended parameters 
393
			// FIXME: to discuss about when hiding or showing the extended parameters 
388 394
			//			if(!this.getResult().canCompute() && this.getResult().isDirty())	{
389 395
			//				showExtendedParameters = true;
390 396
			//			}
......
419 425
			this._createPartControl(); // child editor creates its parameters and displays widgets
420 426
			this.notifyExtensions("notifyEndOfCreatePartControl"); //$NON-NLS-1$
421 427

  
422
			
423 428
			this.firstLineComposite.pack();
424 429
			this.extendedParametersGroup.pack();
425 430
			
431
			
426 432
			// remove empty toolbar
427 433
			//TODO SJ: Hack? MD: yeah -> need to find a way to not display the bottom toolbar on Windows instead
428 434
			if (this.bottomToolBar.getItems().length == 0) {
......
440 446
				this.topToolBar.unInstallGroup(COMPUTING_PARAMETERS_GROUP_ID);
441 447
			}
442 448

  
449
			// FIXME: SJ: this code doesn't work even if we call removeComputeButton()
450
			// remove empty first line composite
451
//			if(this.mainParametersComposite.getChildren().length == 0 && this.topToolBar.isDisposed())	{
452
//				this.firstLineComposite.dispose();
453
//			}
454
			
455

  
456
			
443 457
			if (this.getResult().isLocked()) {
444 458
				this.setLocked(true);
445 459
			}
......
767 781
		return this.getEditorInput().getResult().getStringParameterValue(key);
768 782
	}
769 783

  
770

  
771 784
	/**
772
	 * Opens a popup to inform that the result has been manually edited.
773
	 * @return
774
	 */
775
	public boolean promptResultEditedAlert()	{
776
		return MessageDialog.openQuestion(this.getShell(), "Warning", "The result have been edited. Changes will be lost. Do you want to continue?");
777
	}
778
	
779

  
780
	/**
781 785
	 * Computes the TXMResult if all necessary parameters are set then refreshes the editor UI.
782 786
	 * Also loads and savesd some parameters from result to Widgets fields and from Widgets fields to result.
783 787
	 * 
......
816 820
						public void run() {
817 821
							if(update)	{
818 822

  
819
								if (TXMEditor.this.getResult().isAltered() && !promptResultEditedAlert()) {
823
								// popup alert to inform user that the result has been manually edited
824
								if (TXMEditor.this.getResult().isAltered() && !MessageDialog.openQuestion(getShell(), "Warning", "The result have been edited. Changes will be lost. Do you want to continue?")) {
820 825
										setCanceled(true);
821 826
								}
822 827
								else	{
828
									
829
									// popup alert to inform user that children results will be recomputed
830
									if(!TBXPreferences.getInstance().getBoolean(TBXPreferences.EXPERT_USER)
831
											&& TXMEditor.this.getResult().hasChildren() && !MessageDialog.openQuestion(getShell(), "Warning", "All children results based on this one will be recomputed. Do you want to continue?"))	{
832
										setCanceled(true);
833
									}
834
									
823 835

  
824 836
									// subclasses manual result updating from editor fields
825 837
									Log.finest("TXMEditor.compute(): " + TXMEditor.this.getClass().getSimpleName() + ": manually updating result from editor."); //$NON-NLS-1$
......
1539 1551
		return -1;
1540 1552
	}
1541 1553

  
1542
//	/**
1543
//	 * @return the lastComputingParameters
1544
//	 */
1545
//	public HashMap<String, Object> getLastComputingParameters() {
1546
//		return lastComputingParameters;
1547
//	}
1548
//
1549
//	/**
1550
//	 * @param lastComputingParameters the lastComputingParameters to set
1551
//	 */
1552
//	public void setLastComputingParameters(HashMap<String, Object> lastComputingParameters) {
1553
//		this.lastComputingParameters = lastComputingParameters;
1554
//	}
1555 1554

  
1556 1555
	public Composite getContainer() {
1557 1556
		return parent;
......
1687 1686
	}
1688 1687

  
1689 1688
	/**
1690
	 * Remove the Compute Tool item button.
1689
	 * Removes the Compute Tool item button.
1691 1690
	 */
1692 1691
	protected void removeComputeButton()	{
1693 1692
		if (this.computeButton != null && !this.computeButton.isDisposed()) {
1693
			
1694
			// FIXME: SJ: the contribution should be released before the dispose but this code doesn't seem to work. And without the release the code in createPartControl() that disposes the first line composite  if empty doesn't work
1695
//			IMenuService menuService = (IMenuService) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(IMenuService.class);
1696
//			menuService.releaseContributions((ContributionManager) ((HandledContributionItem) this.computeButton.getData()).getParent());
1697
			
1694 1698
			this.computeButton.dispose();
1695 1699
		}
1696 1700
	}

Formats disponibles : Unified diff