Revision 1963
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/chartsengine/events/ProgressionEventCallBack.java (revision 1963) | ||
---|---|---|
179 | 179 |
// String query = ((Progression) chartEditor.getResultData()).getQueries().get(selectedSeries.get(selectedSeries.size() - 1).intValue()).getQueryString(); |
180 | 180 |
|
181 | 181 |
int lastSelectedSeries = ((ProgressionChartCreator) chartEditor.getResult().getChartCreator()).getLastSelectedSeries(chartEditor.getChart()); |
182 |
if (lastSelectedSeries == -1) { // no selection |
|
183 |
return; |
|
184 |
} |
|
182 | 185 |
String query = ((Progression) chartEditor.getResult()).getQueries().get(lastSelectedSeries).getQueryString(); |
183 | 186 |
|
184 |
// Remove "[" and "]" only if it's a simple query as "[faire]" |
|
185 |
if(query.startsWith("[") && !query.contains("=")) { //$NON-NLS-1$ //$NON-NLS-2$ |
|
186 |
int length = query.length(); |
|
187 |
if(query.endsWith("]")) { //$NON-NLS-1$ |
|
188 |
length--; |
|
189 |
} |
|
190 |
query = query.substring(1, length); |
|
191 |
} |
|
187 |
// // Remove "[" and "]" only if it's a simple query as "[faire]"
|
|
188 |
// if(query.startsWith("[") && !query.contains("=")) { //$NON-NLS-1$ //$NON-NLS-2$
|
|
189 |
// int length = query.length();
|
|
190 |
// if(query.endsWith("]")) { //$NON-NLS-1$
|
|
191 |
// length--;
|
|
192 |
// }
|
|
193 |
// query = query.substring(1, length);
|
|
194 |
// }
|
|
192 | 195 |
|
193 | 196 |
// FIXME: case 2, the query is the combination of all the queries of the progression |
194 | 197 |
// String query = ((Progression) chartEditor.getResultData()).getQueriesString(); |
195 | 198 |
|
196 |
|
|
197 | 199 |
// gets the linked editor according to the query if it exists |
198 | 200 |
ConcordanceEditor linkedEditor = null; |
199 | 201 |
for(int i = 0; i < linkedEditors.size(); i++) { |
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java (revision 1963) | ||
---|---|---|
201 | 201 |
@Override |
202 | 202 |
public void keyPressed(KeyEvent e) { |
203 | 203 |
if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) { |
204 |
if (queryWidget.getRawString().length() > 0 && onPlusButtonPressed(null, queryWidget.getRawString())) {
|
|
204 |
if (queryWidget.getQueryString().length() > 0 && onPlusButtonPressed(null, queryWidget.getQueryString())) {
|
|
205 | 205 |
super.keyPressed(e); // recompute only if the query has been added |
206 | 206 |
queryWidget.clearQuery(); |
207 |
} else { |
|
208 |
queryWidget.setText(queryWidget.getQueryString()); |
|
207 | 209 |
} |
208 | 210 |
} |
209 | 211 |
} |
... | ... | |
217 | 219 |
|
218 | 220 |
@Override |
219 | 221 |
public void widgetSelected(SelectionEvent e) { |
220 |
if (queryWidget.getRawString().length() > 0 && onPlusButtonPressed(null, queryWidget.getQueryString())) {
|
|
222 |
if (queryWidget.getQueryString().length() > 0 && onPlusButtonPressed(null, queryWidget.getQueryString())) {
|
|
221 | 223 |
compute(true); |
222 | 224 |
queryWidget.clearQuery(); |
223 | 225 |
} else { |
Also available in: Unified diff