svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.expressionevaluator / org.gvsig.expressionevaluator.lib / org.gvsig.expressionevaluator.lib.impl / src / main / java / org / gvsig / expressionevaluator / impl / function / programming / DesktopEdit.java @ 47376
History | View | Annotate | Download (1.18 KB)
1 | 45011 | jjdelcerro | package org.gvsig.expressionevaluator.impl.function.programming; |
---|---|---|---|
2 | |||
3 | 47376 | jjdelcerro | import java.io.File; |
4 | 45011 | jjdelcerro | import java.net.URL; |
5 | import org.apache.commons.lang3.Range; |
||
6 | 47376 | jjdelcerro | import org.gvsig.desktopopen.DesktopOpen; |
7 | import static org.gvsig.expressionevaluator.ExpressionBuilder.FUNCTION_DESKTOPEDIT; |
||
8 | 45011 | jjdelcerro | import org.gvsig.expressionevaluator.Function; |
9 | import org.gvsig.expressionevaluator.Interpreter; |
||
10 | import org.gvsig.expressionevaluator.spi.AbstractFunction; |
||
11 | 47376 | jjdelcerro | import org.gvsig.tools.util.ToolsUtilLocator; |
12 | 45011 | jjdelcerro | |
13 | /**
|
||
14 | *
|
||
15 | * @author jjdelcerro
|
||
16 | */
|
||
17 | 47376 | jjdelcerro | public class DesktopEdit extends AbstractFunction { |
18 | 45011 | jjdelcerro | |
19 | 47376 | jjdelcerro | public DesktopEdit() {
|
20 | 45011 | jjdelcerro | super(Function.GROUP_PROGRAMMING,
|
21 | 47376 | jjdelcerro | FUNCTION_DESKTOPEDIT, |
22 | 45011 | jjdelcerro | Range.is(1),
|
23 | null,
|
||
24 | 47376 | jjdelcerro | FUNCTION_DESKTOPEDIT+"({{file}})",
|
25 | 45011 | jjdelcerro | null,
|
26 | 47376 | jjdelcerro | "NULL",
|
27 | 45011 | jjdelcerro | false
|
28 | ); |
||
29 | } |
||
30 | |||
31 | @Override
|
||
32 | public boolean allowConstantFolding() { |
||
33 | return false; |
||
34 | } |
||
35 | |||
36 | @Override
|
||
37 | public Object call(Interpreter interpreter, Object[] args) throws Exception { |
||
38 | 47376 | jjdelcerro | File f = getFile(args,0); |
39 | DesktopOpen desktop = ToolsUtilLocator.getToolsUtilManager().createDesktopOpen(); |
||
40 | desktop.edit(f); |
||
41 | return null; |
||
42 | 45011 | jjdelcerro | } |
43 | |||
44 | } |