Index: DefaultExpressionEvaluatorSwingManager.java
===================================================================
--- DefaultExpressionEvaluatorSwingManager.java	(revision 43982)
+++ DefaultExpressionEvaluatorSwingManager.java	(revision 43983)
@@ -1,41 +1,56 @@
-
 package org.gvsig.expressionevaluator.swing.impl;
 
+import java.awt.TextComponent;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import org.gvsig.expressionevaluator.ExpressionEvaluatorLocator;
-import org.gvsig.expressionevaluator.ExpressionEvaluatorManager;
+import javax.swing.JButton;
+import javax.swing.text.JTextComponent;
 import org.gvsig.expressionevaluator.Function;
+import org.gvsig.expressionevaluator.SymbolTable;
 import org.gvsig.expressionevaluator.swing.ExpressionEvaluatorSwingManager;
 import org.gvsig.expressionevaluator.swing.JExpressionBuilder;
-import org.gvsig.expressionevaluator.swing.JExpressionBuilder.Element;
-import org.gvsig.expressionevaluator.swing.JExpressionBuilder.GroupElement;
+import org.gvsig.expressionevaluator.swing.Element;
+import org.gvsig.expressionevaluator.swing.Element.ConstantElement;
+import org.gvsig.expressionevaluator.swing.Element.FunctionElement;
+import org.gvsig.expressionevaluator.swing.Element.GroupElement;
+import org.gvsig.expressionevaluator.swing.Element.VariableElement;
+import org.gvsig.expressionevaluator.swing.ElementFactory;
+import org.gvsig.expressionevaluator.swing.ExpressionPickerController;
+import org.gvsig.expressionevaluator.swing.JExpressionPicker;
+import org.gvsig.expressionevaluator.swing.impl.elements.DefaultConstantValueElement;
+import org.gvsig.expressionevaluator.swing.impl.elements.DefaultFunctionElement;
+import org.gvsig.expressionevaluator.swing.impl.elements.DefaultGroupElement;
+import org.gvsig.expressionevaluator.swing.impl.elements.DefaultVariableElement;
 
+public class DefaultExpressionEvaluatorSwingManager
+        implements ExpressionEvaluatorSwingManager {
 
-public class DefaultExpressionEvaluatorSwingManager 
-    implements ExpressionEvaluatorSwingManager {
+    private Map<String, ElementFactory> elementsFactories;
 
-    private List<Element> elements;
-    
     public DefaultExpressionEvaluatorSwingManager() {
-        
+        this.elementsFactories = new HashMap<>();
     }
-    
-    private void initElements() {
-        ExpressionEvaluatorManager manager = ExpressionEvaluatorLocator.getManager();
+
+    @Override
+    public List<Element> createElements(Collection<SymbolTable> symbolTables) {
         Map<String, Function> functions = new HashMap<>();
-        functions.putAll(manager.getAllFunctions());
-        functions.putAll(manager.getAllOperators());
         
-        Map<String,GroupElement> functionGroups = new HashMap<>();
-        Map<String,GroupElement> operatorGroups = new HashMap<>();
+        for (SymbolTable symbolTable : symbolTables) {
+            for (Function function : symbolTable.functions()) {
+                functions.put(function.name().toUpperCase(), function);
+            }
+        }
+        
+        Map<String, GroupElement> functionGroups = new HashMap<>();
+        Map<String, GroupElement> operatorGroups = new HashMap<>();
         for (Function function : functions.values()) {
-            if( function.isOperator() ) {
+            if (function.isOperator()) {
                 String groupName = function.group();
                 GroupElement group = operatorGroups.get(groupName);
-                if( group == null ) {
+                if (group == null) {
                     group = new DefaultGroupElement(groupName);
                     operatorGroups.put(groupName, group);
                 }
@@ -43,55 +58,98 @@
             } else {
                 String groupName = function.group();
                 GroupElement group = functionGroups.get(groupName);
-                if( group == null ) {
+                if (group == null) {
                     group = new DefaultGroupElement(groupName);
                     functionGroups.put(groupName, group);
                 }
                 group.addElement(new DefaultFunctionElement(function));
             }
         }
-        GroupElement builtinFunctions = this.createGroup("_Builtin_functions");
+        GroupElement builtinFunctions = this.createGroupElement("_Builtin_functions");
         for (GroupElement group : functionGroups.values()) {
             builtinFunctions.addElement(group);
         }
-        GroupElement operatorFunctions = new DefaultGroupElement("_Operators");
+        GroupElement operatorFunctions = this.createGroupElement("_Operators");
         for (GroupElement group : operatorGroups.values()) {
             operatorFunctions.addElement(group);
         }
-        this.elements = new ArrayList<>();
-        this.elements.add(operatorFunctions);
-        this.elements.add(builtinFunctions);
+        List<Element> elements = new ArrayList<>();
+        elements.add(operatorFunctions);
+        elements.add(builtinFunctions);
+        return elements;
     }
-    
+
     @Override
-    public List<Element> getElements() {
-        if( this.elements==null ) {
-            initElements();
+    public void registerElement(ElementFactory factory) {
+        if (this.elementsFactories == null) {
+            this.elementsFactories = new HashMap<>();
         }
-        return this.elements;
+        this.elementsFactories.put(factory.getName().toLowerCase(), factory);
     }
-    
+
     @Override
-    public GroupElement createGroup(String name) {
-        DefaultGroupElement g = new DefaultGroupElement(name);
-        return g;
+    public JExpressionBuilder createJExpressionBuilder() {
+        DefaultJExpressionBuilder x = new DefaultJExpressionBuilder(
+                this, 
+                new DefaultExpressionBuilderConfig(this)
+        );
+        return x;
     }
-    
+
     @Override
-    public GroupElement createGroup(String name, List<Element>elements) {
-        DefaultGroupElement g = new DefaultGroupElement(name);
-        return g;
+    public Element createElement(String name, Object... parameters) {
+        ElementFactory factory = this.elementsFactories.get(name.toLowerCase());
+        if( factory==null ) {
+            throw new RuntimeException("Can't locate element factory '"+name+"'.");
+        }
+        return factory.createElement(parameters);
     }
     
     @Override
-    public Element createElement(Function function) {
-        Element f = new DefaultFunctionElement(function);
-        return f;
+    public GroupElement createGroupElement(String name) {
+        GroupElement e = new DefaultGroupElement(name);
+        return e;
     }
-    
+
     @Override
-    public JExpressionBuilder createJExpressionBuilder() {
-        DefaultJExpressionBuilder x = new DefaultJExpressionBuilder(this);
+    public GroupElement createGroupElement(String name, List<Element> elements) {
+        GroupElement e = new DefaultGroupElement(this, name, elements);
+        return e;
+    }
+
+    @Override
+    public FunctionElement createFunctionElement(Function function) {
+        FunctionElement e = new DefaultFunctionElement(function);
+        return e;
+    }
+
+    @Override
+    public ConstantElement createConstantElement(Object value) {
+        ConstantElement e = new DefaultConstantValueElement(value, null);
+        return e;
+    }
+
+    @Override
+    public ConstantElement createConstantElement(Object value, String description) {
+        ConstantElement e = new DefaultConstantValueElement(value, description);
+        return e;
+    }
+
+    @Override
+    public VariableElement createVariableElement(String label, String source, String name, String typeName, String description) {
+        VariableElement e = new DefaultVariableElement(label, source, name, typeName, description);
+        return e;
+    }
+
+    @Override
+    public ExpressionPickerController createExpressionPickerController(JTextComponent text, JButton button) {
+        ExpressionPickerController c = new DefaultExpressionPickerController(this, text, button);
+        return c;
+    }
+
+    @Override
+    public JExpressionPicker createJExpressionPicker() {
+        JExpressionPicker x = new DefaultJExpressionPicker(this);
         return x;
     }
 
