Revision 28289
trunk/extensions/extExpressionField/src/com/iver/cit/gvsig/project/documents/table/gui/EvalExpressionDialog.java | ||
---|---|---|
11 | 11 |
import java.io.File; |
12 | 12 |
import java.io.FileReader; |
13 | 13 |
import java.io.IOException; |
14 |
import java.io.UnsupportedEncodingException; |
|
14 | 15 |
import java.util.ArrayList; |
15 | 16 |
import java.util.prefs.Preferences; |
16 | 17 |
|
... | ... | |
298 | 299 |
*/ |
299 | 300 |
private boolean evalExpression() throws ReadDriverException, BSFException{ |
300 | 301 |
long rowCount = sds.getRowCount(); |
301 |
String expression=getTxtExp().getText() |
|
302 |
.replaceAll("\\[","field(\"") |
|
303 |
.replaceAll("\\]","\")"); |
|
302 |
String expression=getTxtExp().getText(); |
|
303 |
byte[] expressionBytes; |
|
304 |
String encoding = System.getProperty("file.encoding"); |
|
305 |
try { |
|
306 |
expressionBytes = expression.getBytes(encoding); |
|
307 |
expression = new String(expressionBytes, "ISO-8859-1"); |
|
308 |
} catch (UnsupportedEncodingException e) { |
|
309 |
// TODO Auto-generated catch block |
|
310 |
e.printStackTrace(); |
|
311 |
} |
|
312 |
expression=expression.replaceAll("\\[","field(\"").replaceAll("\\]","\")"); |
|
313 |
|
|
304 | 314 |
interpreter.declareBean("ee",evalExpression,EvalExpression.class); |
305 | 315 |
interpreter.exec(ExpressionFieldExtension.JYTHON,null,-1,-1,"def expression():\n" + |
306 | 316 |
" return " +expression+ ""); |
Also available in: Unified diff