Révision 3395

TXM/trunk/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java (revision 3395)
271 271
	public Object evaluate(String code) {
272 272
		if (Log.getLevel().intValue() <= Level.FINEST.intValue()) System.out.println(code);
273 273
		try {
274
			if (getBrowser() == null) return null;
274 275
			return getBrowser().evaluate(code);
275 276
		} catch(Exception e) {
276 277
			String error = e.getMessage();
......
1197 1198
	
1198 1199
	public String getTextSelection() {
1199 1200
		// System.out.println("DOM="+getTextSelectionDOM());
1200
		String rez = getTextSelectionDOM().replaceAll("<[^>]+>", ""); //$NON-NLS-1$ //$NON-NLS-2$
1201
		String dom = getTextSelectionDOM();
1202
		if (dom == null) return "";
1203
		
1204
		String rez = dom.replaceAll("<[^>]+>", ""); //$NON-NLS-1$ //$NON-NLS-2$
1201 1205
		// System.out.println("STR="+rez);
1202 1206
		return rez;
1203 1207
	}
TXM/trunk/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SynopticEditionEditor.java (revision 3395)
844 844
						if (i == 0) { // TODO: how to manage multiple menu manager -> the text selection does not work only the first panel selection is used
845 845
							panel.initMenu();
846 846
							getSite().registerContextMenu(panel.getMenuManager(), panel.getSelectionProvider());
847
							getSite().setSelectionProvider(panel.getSelectionProvider());
847 848
						}
848 849
						
849 850
						editionPanels.put(editionName, panel);
......
900 901
		return true;
901 902
	}
902 903
	
904
//	/**
905
//	 * Returns the selection provider for a part.
906
//	 */
907
//	@Override
908
//	public ISelectionProvider getSelectionProvider() {
909
//		return getEditionPanel(0).getSelectionProvider();
910
//	}
911
	
903 912
	/**
904 913
	 * 
905 914
	 * @param textId the text containing the word to focus
......
1033 1042
			if (n == i) {
1034 1043
				return p;
1035 1044
			}
1045
			n++;
1036 1046
		}
1037 1047
		return null;
1038 1048
	}
TXM/trunk/org.txm.concordance.rcp/src/org/txm/concordance/rcp/handlers/ComputeConcordance.java (revision 3395)
36 36
import org.txm.rcp.StatusLine;
37 37
import org.txm.rcp.editors.TXMEditor;
38 38
import org.txm.rcp.handlers.BaseAbstractHandler;
39
import org.txm.searchengine.core.QueryBasedTXMResult;
39 40
import org.txm.searchengine.cqp.corpus.CQPCorpus;
41
import org.txm.utils.logger.Log;
40 42

  
41 43
/**
42 44
 * Opens a Concordance editor.
......
59 61
		// From link: creating from parameter node
60 62
		String parametersNodePath = event.getParameter(TXMPreferences.RESULT_PARAMETERS_NODE_PATH);
61 63
		if (parametersNodePath != null && !parametersNodePath.isEmpty()) {
64
			if ("none".equals(parametersNodePath)) {
65
				Log.warning("Selection error");
66
				return null;
67
			}
62 68
			concordance = new Concordance(parametersNodePath);
63
		}
64
		// From view result node
69
		} // From view result node
65 70
		else {
66 71
			Object selection = this.getCorporaViewSelectedObject(event);
67 72
			
......
74 79
			else if (selection instanceof Concordance) {
75 80
				concordance = (Concordance) selection;
76 81
			}
82
			// Reopening existing result
83
			else if (selection instanceof QueryBasedTXMResult) {
84
				QueryBasedTXMResult r = (QueryBasedTXMResult)selection;
85
				concordance = new Concordance(r.getFirstParent(CQPCorpus.class));
86
				concordance.setQuery(r.getQuery());
87
			}
77 88
			// Error
78 89
			else {
79 90
				return this.logCanNotExecuteCommand(selection);
TXM/trunk/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java (revision 3395)
1812 1812
	 * 
1813 1813
	 * @param query the query to set
1814 1814
	 */
1815
	public void setQuery(CQLQuery query) {
1815
	public void setQuery(IQuery query) {
1816 1816
		this.pQuery = query;
1817 1817
	}
1818 1818
	

Formats disponibles : Unified diff