Révision 2714

tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 2714)
971 971
					
972 972
					// monitor.worked(50);
973 973
					
974
					// refresh the UI (especially update the Editor fields from the TXMResult data
974
					// refresh the UI (especially update the Editor fields from the TXMResult data)
975 975
					this.syncExec(new Runnable() {
976 976
						
977 977
						@Override
......
1049 1049
		IWorkbenchPage page = window.getActivePage();
1050 1050
		try {
1051 1051
			
1052
			// boolean wasAlreadyOpened = true;
1053 1052
			boolean wasAlreadyOpened = SWTEditorsUtils.isOpenEditor(editorInput, editorId);
1054
			// TODO pre-compute result ?
1055
			// if (!wasAlreadyOpened && (RCPPreferences.getInstance().getBoolean(RCPPreferences.AUTO_COMPUTE_ON_EDITOR_OPEN))) {
1056
			// editorInput.getResult().compute(false);
1057
			// }
1058 1053
			
1059
			// FIXME: SJ: Quick'n'dirty fix
1060
			// without that the result is computed twice, one time when checking the branch is consistent
1061
			// and another time when calling editor.compute().
1062
			// See if we can do this directly in the editor ?
1063
			// or pre-compute only the parents and not the result iself ?
1064
			// boolean needComputing = true;
1065
			
1066 1054
			// since some editor fields need some values of their parent,
1067 1055
			// ensure the parents branch is ready (e.g. Sub-corpus properties in Cooccurrence editor, etc.)
1068 1056
			// show modal blocking cancelable progression dialog
......
1070 1058
			// && !editorInput.getResult().getParent().hasBeenComputedOnce()
1071 1059
			) {
1072 1060
				try {
1073
					// AdvancedProgressMonitorDialog dialog = new AdvancedProgressMonitorDialog(window.getShell(), editorInput.getResult().getParent());
1074
					// FIXME: SJ: finally it may be better to call the current result computing? it will do the parents branch computing but
1075
					// the main task stays the compute of the result itself, not the parent
1076
					
1077 1061
					if (editorInput.getResult().isDirty()) {
1078 1062
						try {
1079 1063
							StatusLine.setMessage(editorInput.getResult().getComputingStartMessage());
......
1086 1070
					
1087 1071
					ComputeProgressMonitorDialog dialog = new ComputeProgressMonitorDialog(window.getShell(), editorInput.getResult());
1088 1072
					dialog.runComputingProcess(true);
1089
					
1090
					// needComputing = false;
1091 1073
				}
1092 1074
				// user canceling case
1093 1075
				catch (InterruptedException e) {
......
1121 1103
				// editor.compute(false);
1122 1104
				// }
1123 1105
				// else {
1106
				
1107
				
1108
				//editor.compute(false); // FIXME: temporary fix for the AHC SVG bug but there are 2 computing (skipped but it stays a quick'n'dirty fix)
1124 1109
				editor.refresh(false);
1110
				
1111
				// TODO: SJ: focus in the main widget
1112
				// or maybe better to do the call directly at the end of TXMEditor.refresh()?
1113
				// editor.setFocus();
1114
				
1125 1115
				// }
1126 1116
			}
1127 1117
		}

Formats disponibles : Unified diff