Révision 3393

TXM/trunk/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java (revision 3393)
69 69
	}
70 70
	
71 71
	@Override
72
	public TXMResult getResultParent(ExecutionEvent event) {
72
	public TXMResult getResultParent(ExecutionEvent event, String id) {
73 73
		@SuppressWarnings("unchecked")
74 74
		TXMEditor<Index> editor = (TXMEditor<Index>) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart();
75 75
		
......
78 78
		CQPCorpus corpus = CQPCorpus.getFirstParentCorpus(index);
79 79
		
80 80
		// TODO enable subcorpus from index query when the hidden subcorpus deletion will be managed or another system implemented (eg new SubCorpus(TXMResult result)
81
		if (index.getQuery() instanceof CQLQuery && IndexPreferences.getInstance().getBoolean(IndexPreferences.LINK_USING_SUBCORPUS)) {
81
		if (id.contains("Concordance")) {
82 82
			CQLQuery cqlQuery = (CQLQuery) index.getQuery();
83 83
			if (cqlQuery == null || cqlQuery.isEmpty() || // no query
84 84
					cqlQuery.getQueryString().equals("[]") ||
TXM/trunk/org.txm.index.rcp/src/org/txm/index/rcp/preferences/IndexPreferencesPage.java (revision 3393)
30 30
	protected void createFieldEditors() {
31 31
		this.addField(new IntegerFieldEditor(TXMPreferences.N_LINES_PER_PAGE, IndexUIMessages.numberOfLinesPerResultPage, this.getFieldEditorParent()));
32 32
		
33
		this.addField(new BooleanFieldEditor(IndexPreferences.LINK_USING_SUBCORPUS, "Experimental: create a subcorpus when calling a command from an index", this.getFieldEditorParent()));
33
//		this.addField(new BooleanFieldEditor(IndexPreferences.LINK_USING_SUBCORPUS, "Experimental: create a subcorpus when calling a command from an index", this.getFieldEditorParent()));
34 34
	}
35 35
}
TXM/trunk/org.txm.index.core/src/org/txm/index/core/preferences/IndexPreferences.java (revision 3393)
23 23
	 */
24 24
	public static final String N_TOP_INDEX = "n_top_index"; //$NON-NLS-1$
25 25
	
26
	/**
27
	 * if true the links from index will create a subcorpus of the index occurrences
28
	 */
29
	public static final String LINK_USING_SUBCORPUS = "link_using_subcorpus";
26
//	/**
27
//	 * if true the links from index will create a subcorpus of the index occurrences
28
//	 */
29
//	public static final String LINK_USING_SUBCORPUS = "link_using_subcorpus";
30 30
	
31 31
	/**
32 32
	 * Gets the instance.
......
54 54
		preferences.putInt(F_MAX, Integer.MAX_VALUE);
55 55
		preferences.putInt(V_MAX, Integer.MAX_VALUE);
56 56
		preferences.putInt(N_LINES_PER_PAGE, 100);
57
		preferences.putBoolean(LINK_USING_SUBCORPUS, false);
57
//		preferences.putBoolean(LINK_USING_SUBCORPUS, false);
58 58
	}
59 59
}
TXM/trunk/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/SendEditionTo.java (revision 3393)
146 146
	}
147 147
	
148 148
	@Override
149
	public TXMResult getResultParent(ExecutionEvent event) {
149
	public TXMResult getResultParent(ExecutionEvent event, String id) {
150 150
		return ((IEditionEditor) SWTEditorsUtils.getActiveEditor(event)).getCorpus();
151 151
	}
152 152
}
TXM/trunk/org.txm.concordance.rcp/src/org/txm/concordance/rcp/handlers/SendConcordanceToTIGERSearch.java (revision 3393)
128 128
	}
129 129
	
130 130
	@Override
131
	public TXMResult getResultParent(ExecutionEvent event) {
131
	public TXMResult getResultParent(ExecutionEvent event, String id) {
132 132
		@SuppressWarnings("unchecked")
133 133
		TXMEditor<Concordance> editor = (TXMEditor<Concordance>) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart();
134 134
		
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java (revision 3393)
312 312
		}
313 313
		else {
314 314
			return (NLS.bind(TXMUIMessages.prettyVersionP0P1,
315
					version.getMajor() + "." + version.getMinor() + "." + version.getMicro(), "update " + txm_date + " - build " + build_date));
315
					version.getMajor() + "." + version.getMinor() + "." + version.getMicro(), "update " + txm_date + " - installer " + build_date));
316 316
		}
317 317
	}
318 318
	
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/BaseAbstractHandler.java (revision 3393)
162 162
	 * This method is essentially dedicated to be overridden, if needed, to define a parent that is not the direct parent (eg. the corpus parent instead of the partition parent).
163 163
	 * 
164 164
	 * @param event
165
	 * @param id 
165 166
	 * @return
166 167
	 */
167
	public TXMResult getResultParent(ExecutionEvent event) {
168
	public TXMResult getResultParent(ExecutionEvent event, String id) {
168 169
		return getActiveEditorResult(event).getParent();
169 170
	}
170 171
	
TXM/trunk/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToMatchable.java (revision 3393)
72 72
			}
73 73
			
74 74
			// create a local result node in the project node, store in some parameters and call the linked command
75
			TXMResult result = this.getResultParent(event);
75
			TXMResult result = this.getResultParent(event, event.getCommand().getId());
76 76
			if (result == null) {
77 77
				System.out.println("No result found with " + event);
78 78
				return null;
TXM/trunk/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToQueryable.java (revision 3393)
105 105
			}
106 106
			
107 107
			// create a local result node in the project node, store in some parameters and call the linked command
108
			TXMResult result = this.getResultParent(event);
108
			String id = event.getCommand().getId();
109
			TXMResult result = this.getResultParent(event, id);
109 110
			String resultParametersNodePath = result.getProject().getParametersNodeRootPath() + TXMResult.createUUID() + "_link"; // FIXME: we can't put the class name here since
110 111
																																	 // we does not know the target class
111 112
			TXMPreferences.put(resultParametersNodePath, TXMPreferences.PARENT_PARAMETERS_NODE_PATH, result.getParametersNodePath());
......
114 115
			TXMPreferences.put(resultParametersNodePath, TXMPreferences.INDEX, index);
115 116
			TXMPreferences.put(resultParametersNodePath, TXMPreferences.SUB_INDEX, subindex);
116 117
			
117
			BaseAbstractHandler.executeSendToCommand(event.getCommand().getId(), resultParametersNodePath);
118
			BaseAbstractHandler.executeSendToCommand(id, resultParametersNodePath);
118 119
			// TODO we should test if there is already a linked editor and used it. Do to it we must either A) know which editor class is must be opened B) know why a previous editor has been open
119 120
		}
120 121
		else {

Formats disponibles : Unified diff