Révision 2438
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 2438) | ||
---|---|---|
24 | 24 |
import org.eclipse.jface.viewers.StructuredSelection; |
25 | 25 |
import org.eclipse.jface.viewers.TableViewer; |
26 | 26 |
import org.eclipse.jface.viewers.Viewer; |
27 |
import org.eclipse.osgi.util.NLS; |
|
27 | 28 |
import org.eclipse.swt.SWT; |
28 | 29 |
import org.eclipse.swt.custom.StyledText; |
29 | 30 |
import org.eclipse.swt.events.MouseAdapter; |
... | ... | |
845 | 846 |
// } |
846 | 847 |
// } |
847 | 848 |
|
849 |
|
|
850 |
JobHandler computeJob = null; |
|
848 | 851 |
/** |
849 | 852 |
* Computes the TXMResult if all required parameters are set then refreshes the editor UI. |
850 | 853 |
* Also loads and saves some parameters from result to Widgets fields and from Widgets fields to result. |
... | ... | |
854 | 857 |
*/ |
855 | 858 |
@Override |
856 | 859 |
public JobHandler compute(final boolean update) { |
857 |
|
|
860 |
if (computeJob != null && computeJob.getResult() == null) { |
|
861 |
Log.info(NLS.bind("Editor is already computing {0}. Please wait or abort the computing job ({1}).", result.getSimpleName(), computeJob.getName())); |
|
862 |
return computeJob; |
|
863 |
} |
|
858 | 864 |
StatusLine.setMessage(this.getResult().getComputingStartMessage()); |
859 | 865 |
|
860 | 866 |
// FIXME: SJ: long process simulation to test the Job cancelation or UI progress dialog visibility |
... | ... | |
913 | 919 |
// j.setUser(true); |
914 | 920 |
// j.schedule(); |
915 | 921 |
|
916 |
JobHandler job = new JobHandler(TXMCoreMessages.bind(TXMUIMessages.computing, this.getResult().getName())) {
|
|
922 |
computeJob = new JobHandler(TXMCoreMessages.bind(TXMUIMessages.computing, this.getResult().getName())) {
|
|
917 | 923 |
|
918 | 924 |
@Override |
919 | 925 |
protected IStatus run(IProgressMonitor monitor) { |
... | ... | |
1075 | 1081 |
// ps.showInDialog(null, job); |
1076 | 1082 |
// ps.busyCursorWhile(job); |
1077 | 1083 |
|
1078 |
|
|
1079 |
job.setPriority(Job.DECORATE); |
|
1084 |
computeJob.setPriority(Job.DECORATE); |
|
1080 | 1085 |
// FIXME: SJ tests |
1081 | 1086 |
// job.setPriority(Job.INTERACTIVE); |
1082 |
job.setUser(true);
|
|
1083 |
job.schedule();
|
|
1087 |
computeJob.setUser(true);
|
|
1088 |
computeJob.schedule();
|
|
1084 | 1089 |
|
1085 |
return job;
|
|
1090 |
return computeJob;
|
|
1086 | 1091 |
} |
1087 | 1092 |
|
1088 | 1093 |
/** |
Formats disponibles : Unified diff