Révision 433
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/link/IndexToCooccurrence.java (revision 433) | ||
---|---|---|
33 | 33 |
import org.eclipse.core.commands.ExecutionEvent; |
34 | 34 |
import org.eclipse.core.commands.ExecutionException; |
35 | 35 |
import org.eclipse.jface.viewers.IStructuredSelection; |
36 |
import org.eclipse.ui.IWorkbenchPage; |
|
37 | 36 |
import org.eclipse.ui.IWorkbenchWindow; |
38 | 37 |
import org.eclipse.ui.handlers.HandlerUtil; |
39 |
import org.txm.cooccurrence.rcp.editors.CooccurrenceEditorInput; |
|
40 | 38 |
import org.txm.cooccurrence.rcp.editors.CooccurrencesEditor; |
39 |
import org.txm.core.results.TXMParameters; |
|
41 | 40 |
import org.txm.index.core.functions.Line; |
42 | 41 |
import org.txm.index.rcp.editors.IndexEditor; |
43 | 42 |
import org.txm.rcp.Messages; |
43 |
import org.txm.rcp.editors.TXMEditorPart; |
|
44 | 44 |
import org.txm.rcp.editors.TXMResultEditorInput; |
45 | 45 |
import org.txm.searchengine.cqp.corpus.Corpus; |
46 | 46 |
import org.txm.searchengine.cqp.corpus.Property; |
... | ... | |
60 | 60 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
61 | 61 |
IWorkbenchWindow window; |
62 | 62 |
IStructuredSelection selection; |
63 |
CooccurrenceEditorInput editorInput; |
|
64 | 63 |
window = HandlerUtil.getActiveWorkbenchWindow(event); |
65 | 64 |
selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event); |
66 | 65 |
|
... | ... | |
75 | 74 |
.getActivePart(); |
76 | 75 |
Corpus corpus = voceditor.getCorpus(); |
77 | 76 |
|
78 |
editorInput = new CooccurrenceEditorInput(corpus); |
|
79 |
|
|
80 |
IWorkbenchPage page = window.getActivePage(); |
|
81 | 77 |
try { |
82 |
//FIXME: tests |
|
83 |
// CooccurrencesEditor conceditor = (CooccurrencesEditor) page.openEditor(editorInput, "org.txm.rcp.editors.cooccurrences.CooccurrencesEditor"); //$NON-NLS-1$ |
|
84 |
CooccurrencesEditor conceditor = (CooccurrencesEditor) page.openEditor(new TXMResultEditorInput(corpus), "CooccurrencesEditor"); //$NON-NLS-1$ |
|
85 |
|
|
86 |
|
|
87 |
|
|
78 |
CooccurrencesEditor conceditor = (CooccurrencesEditor) TXMEditorPart.openEditor(new TXMResultEditorInput(corpus, new TXMParameters()), "CooccurrencesEditor"); //$NON-NLS-1$ |
|
88 | 79 |
conceditor.setFocus(query); |
89 | 80 |
conceditor.computeResult(false); |
90 | 81 |
} catch (Exception e) { |
... | ... | |
109 | 100 |
if (query.length() == 0) |
110 | 101 |
return null; |
111 | 102 |
Corpus corpus = voceditor.getCorpus(); |
112 |
CooccurrenceEditorInput editorInput = new CooccurrenceEditorInput(corpus); |
|
113 |
|
|
114 |
IWorkbenchPage page = voceditor.getEditorSite().getWorkbenchWindow() |
|
115 |
.getActivePage(); |
|
116 | 103 |
try { |
117 |
CooccurrencesEditor conceditor = (CooccurrencesEditor) page |
|
118 |
.openEditor(editorInput, |
|
119 |
"org.txm.rcp.editors.cooccurrences.CooccurrencesEditor"); //$NON-NLS-1$ |
|
104 |
CooccurrencesEditor conceditor = (CooccurrencesEditor) TXMEditorPart.openEditor(new TXMResultEditorInput(corpus, new TXMParameters()), "CooccurrencesEditor"); //$NON-NLS-1$ |
|
120 | 105 |
conceditor.setFocus(query); |
121 | 106 |
conceditor.computeResult(false); |
122 | 107 |
} catch (Exception e) { |
Formats disponibles : Unified diff