Révision 531
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/BaseAbstractHandler.java (revision 531) | ||
|---|---|---|
| 1 | 1 |
package org.txm.rcp.handlers; |
| 2 | 2 |
|
| 3 | 3 |
import org.eclipse.core.commands.AbstractHandler; |
| 4 |
import org.eclipse.core.commands.ExecutionEvent; |
|
| 4 | 5 |
import org.txm.Toolbox; |
| 6 |
import org.txm.core.results.TXMParameters; |
|
| 5 | 7 |
import org.txm.rcp.views.corpora.CorporaView; |
| 6 | 8 |
import org.txm.searchengine.cqp.CQPEngine; |
| 7 | 9 |
import org.txm.statsengine.r.core.RStatsEngine; |
| ... | ... | |
| 21 | 23 |
public BaseAbstractHandler() {
|
| 22 | 24 |
// TODO Auto-generated constructor stub |
| 23 | 25 |
} |
| 24 |
|
|
| 25 | 26 |
|
| 26 | 27 |
/** |
| 27 | 28 |
* Checks the Statistics Engine running status and displays a message if it's not running. |
| ... | ... | |
| 41 | 42 |
* @return |
| 42 | 43 |
*/ |
| 43 | 44 |
public boolean checkCorpusEngine() {
|
| 44 |
if(!CQPEngine.isInitialized()) {
|
|
| 45 |
if (!CQPEngine.isInitialized()) {
|
|
| 45 | 46 |
Log.severe("Corpus Engine is not ready, canceling command.");
|
| 46 | 47 |
return false; |
| 47 | 48 |
} |
| 48 | 49 |
return true; |
| 49 | 50 |
} |
| 50 | 51 |
|
| 52 |
public Object getSelection() {
|
|
| 53 |
return getSelection(null); |
|
| 54 |
} |
|
| 51 | 55 |
|
| 52 | 56 |
/** |
| 53 | 57 |
* Gets the current selected object. |
| 58 |
* @param event the ExecutionEvent that provok the command call. |
|
| 54 | 59 |
* @return |
| 55 | 60 |
*/ |
| 56 |
public Object getSelection() {
|
|
| 61 |
public Object getSelection(ExecutionEvent event) {
|
|
| 62 |
|
|
| 57 | 63 |
//FIXME: check this, because it may be too linked to the Corpora view |
| 58 | 64 |
Object o = CorporaView.getSelection(); |
| 59 | 65 |
// otherwise use this code |
| 66 |
// yeah but selection might be tricky |
|
| 60 | 67 |
//Object o = (IStructuredSelection) HandlerUtil.getCurrentSelection(event).getFirstElement(); |
| 61 |
if(o == null) {
|
|
| 68 |
if (o == null) {
|
|
| 62 | 69 |
System.err.println("BaseAbstractHandler.getSelection(): current selection is null.");
|
| 63 | 70 |
} |
| 64 | 71 |
|
Formats disponibles : Unified diff