Revision 44259 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/java/org/gvsig/expressionevaluator/swing/impl/DefaultExpressionBuilderConfig.java
DefaultExpressionBuilderConfig.java | ||
---|---|---|
20 | 20 |
* @author jjdelcerro |
21 | 21 |
*/ |
22 | 22 |
public class DefaultExpressionBuilderConfig |
23 |
implements ExpressionBuilderConfig { |
|
23 |
implements ExpressionBuilderConfig, ExpressionBuilderConfig.Preferences {
|
|
24 | 24 |
|
25 | 25 |
private List<Element> elements; |
26 | 26 |
private int limit; |
... | ... | |
29 | 29 |
private boolean scriptsEnabled = true; |
30 | 30 |
private SymbolTable previewSymbolTable; |
31 | 31 |
private boolean SQLCompatible; |
32 |
private PropertiesSupportHelper propertiesSupportHelper; |
|
32 |
private final PropertiesSupportHelper propertiesSupportHelper; |
|
33 |
private boolean showLabelsOfAttributes; |
|
33 | 34 |
|
34 | 35 |
public DefaultExpressionBuilderConfig(ExpressionEvaluatorSwingManager manager) { |
35 | 36 |
this.manager = manager; |
36 | 37 |
this.limit = 6; |
37 | 38 |
this.SQLCompatible = false; |
38 | 39 |
this.propertiesSupportHelper = new PropertiesSupportHelper(); |
40 |
this.showLabelsOfAttributes = true; |
|
39 | 41 |
initSymbolTables(); |
40 | 42 |
} |
41 | 43 |
|
44 |
@Override |
|
45 |
public Preferences getPreferences() { |
|
46 |
return this; |
|
47 |
} |
|
48 |
|
|
42 | 49 |
private void initSymbolTables() { |
43 | 50 |
ExpressionEvaluatorManager theManager = ExpressionEvaluatorLocator.getManager(); |
44 | 51 |
for (SymbolTableFactory factory : theManager.getSymbolTableFactories()) { |
... | ... | |
51 | 58 |
@Override |
52 | 59 |
public List<Element> getElements() { |
53 | 60 |
if (this.elements == null) { |
54 |
this.elements = manager.createElements(this, this.getSymbolTables());
|
|
61 |
this.elements = manager.createElements(this.getSymbolTables()); |
|
55 | 62 |
for (ElementFactory factory : manager.getElementFactories()) { |
56 | 63 |
if (factory.isAutoload()) { |
57 | 64 |
Element e = factory.createElement(); |
58 | 65 |
this.elements.add(e); |
66 |
e.setConfig(this); |
|
59 | 67 |
} |
60 | 68 |
} |
61 | 69 |
} |
... | ... | |
74 | 82 |
} |
75 | 83 |
} |
76 | 84 |
this.elements.add(element); |
85 |
element.setConfig(this); |
|
77 | 86 |
} |
78 | 87 |
|
79 | 88 |
@Override |
... | ... | |
169 | 178 |
public Map<String, Object> getProperties() { |
170 | 179 |
return this.propertiesSupportHelper.getProperties(); |
171 | 180 |
} |
181 |
|
|
182 |
@Override |
|
183 |
public boolean getShowLabelsOfElements() { |
|
184 |
return this.showLabelsOfAttributes; |
|
185 |
} |
|
186 |
|
|
187 |
@Override |
|
188 |
public void setShowLabelsOfElements(boolean showLabels) { |
|
189 |
this.showLabelsOfAttributes = showLabels; |
|
190 |
} |
|
191 |
|
|
172 | 192 |
|
173 | 193 |
} |
Also available in: Unified diff