Revision 44259
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/symboltables/functionPanels/firstlayerfeature/FirstLayerFeatureAditionalPanel.java | ||
---|---|---|
23 | 23 |
import org.gvsig.app.project.symboltables.ProjectSymbolTable; |
24 | 24 |
import org.gvsig.expressionevaluator.Expression; |
25 | 25 |
import org.gvsig.expressionevaluator.swing.ExpressionEvaluatorSwingLocator; |
26 |
import org.gvsig.expressionevaluator.swing.ExpressionEvaluatorSwingManager; |
|
27 | 26 |
import org.gvsig.expressionevaluator.swing.ExpressionPickerController; |
28 | 27 |
import org.gvsig.expressionevaluator.swing.JExpressionBuilder; |
29 | 28 |
import org.gvsig.fmap.dal.DALLocator; |
... | ... | |
136 | 135 |
|
137 | 136 |
|
138 | 137 |
this.featureSymbolTable = dataManager.createFeatureSymbolTable(); |
139 |
this.storeElement = dataSwingManager.createFeatureStoreElement(this.picketFilter);
|
|
138 |
this.storeElement = dataSwingManager.createFeatureStoreElement(); |
|
140 | 139 |
this.picketFilter.addElement(this.storeElement); |
141 | 140 |
} |
142 | 141 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/expressionevaluator/savedpoints/SavedPointsElement.java | ||
---|---|---|
29 | 29 |
extends AbstractElement |
30 | 30 |
implements ConstantElement { |
31 | 31 |
|
32 |
private final Object value; |
|
33 |
|
|
34 | 32 |
public PointEntryElement(Object value, String name) { |
35 |
super(name, "expressionbuilder-element-constant"); |
|
36 |
this.value = value; |
|
33 |
super(name, value, "expressionbuilder-element-constant"); |
|
37 | 34 |
} |
38 | 35 |
|
39 |
@Override |
|
40 |
public Object getValue() { |
|
41 |
return value; |
|
42 |
} |
|
43 | 36 |
} |
44 | 37 |
|
45 | 38 |
private final List<Element> childs; |
46 | 39 |
|
47 | 40 |
public SavedPointsElement() { |
48 |
super(ToolsLocator.getI18nManager().getTranslation("Saved points"), "view-query-coordinate-capture"); |
|
41 |
super(ToolsLocator.getI18nManager().getTranslation("Saved points"), null, "view-query-coordinate-capture");
|
|
49 | 42 |
|
50 | 43 |
ExpressionEvaluatorSwingManager evManager = ExpressionEvaluatorSwingLocator.getManager(); |
51 | 44 |
TemporaryStorageManager manager = TemporaryStorageLocator.getTemporaryStorageManager(); |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/expressionevaluator/ViewLayersElement.java | ||
---|---|---|
31 | 31 |
private final FLayer layer; |
32 | 32 |
|
33 | 33 |
public LayerEntryElement(ViewDocument view, FLayer layer) { |
34 |
super(layer.getName(), "expressionbuilder-element-constant"); |
|
34 |
super(layer.getName(), layer.getName(), "expressionbuilder-element-constant");
|
|
35 | 35 |
this.layer = layer; |
36 | 36 |
} |
37 | 37 |
|
... | ... | |
54 | 54 |
FLayer layer = it.next(); |
55 | 55 |
if( layer instanceof SingleLayer ) { |
56 | 56 |
if( layer instanceof FLyrVect ) { |
57 |
FeatureStoreElement e = dalSwingManager.createFeatureStoreElement(null);
|
|
57 |
FeatureStoreElement e = dalSwingManager.createFeatureStoreElement(); |
|
58 | 58 |
e.setFeatureStore(((FLyrVect) layer).getFeatureStore()); |
59 | 59 |
e.setName(layer.getName()); |
60 | 60 |
this.childs.add(e); |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/expressionevaluator/viewcapturepoint/ViewCapturePointElement.java | ||
---|---|---|
27 | 27 |
public ViewCapturePointElement() { |
28 | 28 |
super( |
29 | 29 |
ToolsLocator.getI18nManager().getTranslation("_Capture_point"), |
30 |
null, |
|
30 | 31 |
"expressionbuilder-element-view-capture-point" |
31 | 32 |
); |
32 | 33 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/SearchByAttributesExtension.java | ||
---|---|---|
1 |
package org.gvsig.app.extension; |
|
2 |
|
|
3 |
import org.gvsig.andami.plugins.Extension; |
|
4 |
import org.gvsig.app.ApplicationLocator; |
|
5 |
import org.gvsig.app.ApplicationManager; |
|
6 |
import org.gvsig.app.project.documents.view.ViewDocument; |
|
7 |
import org.gvsig.app.project.documents.view.gui.IView; |
|
8 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
9 |
import org.gvsig.fmap.dal.swing.DALSwingLocator; |
|
10 |
import org.gvsig.fmap.dal.swing.DataSwingManager; |
|
11 |
import org.gvsig.fmap.dal.swing.searchpanel.FeatureStoreSearchPanel; |
|
12 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
13 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
14 |
import org.gvsig.tools.ToolsLocator; |
|
15 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
16 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
17 |
|
|
18 |
/** |
|
19 |
* |
|
20 |
* @author jjdelcerro |
|
21 |
*/ |
|
22 |
public class SearchByAttributesExtension extends Extension { |
|
23 |
|
|
24 |
@Override |
|
25 |
public void initialize() { |
|
26 |
} |
|
27 |
|
|
28 |
@Override |
|
29 |
public void execute(String actionCommand) { |
|
30 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
31 |
|
|
32 |
IView view = (IView) application.getActiveComponent(ViewDocument.class); |
|
33 |
if (view == null) { |
|
34 |
return; |
|
35 |
} |
|
36 |
if ("search-by-attributes-layer".equals(actionCommand)) { |
|
37 |
DataSwingManager dataSwingManager = DALSwingLocator.getSwingManager(); |
|
38 |
WindowManager winManager = ToolsSwingLocator.getWindowManager(); |
|
39 |
|
|
40 |
ViewDocument document = view.getViewDocument(); |
|
41 |
|
|
42 |
FLayer layer = document.getMapContext().getLayers().getActives()[0]; |
|
43 |
String title = "Search: " + layer.getName(); |
|
44 |
FeatureStore featureStore = ((FLyrVect) layer).getFeatureStore(); |
|
45 |
|
|
46 |
FeatureStoreSearchPanel panel = dataSwingManager.createFeatureStoreSearchPanel(featureStore); |
|
47 |
winManager.showWindow( |
|
48 |
panel.asJComponent(), |
|
49 |
title, |
|
50 |
WindowManager.MODE.WINDOW |
|
51 |
); |
|
52 |
|
|
53 |
} |
|
54 |
} |
|
55 |
|
|
56 |
@Override |
|
57 |
public boolean isEnabled() { |
|
58 |
return true; |
|
59 |
} |
|
60 |
|
|
61 |
@Override |
|
62 |
public boolean isVisible() { |
|
63 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
64 |
|
|
65 |
IView view = (IView) application.getActiveComponent(ViewDocument.class); |
|
66 |
if (view == null) { |
|
67 |
return false; |
|
68 |
} |
|
69 |
ViewDocument document = view.getViewDocument(); |
|
70 |
return document.getMapContext().hasActiveVectorLayers(); |
|
71 |
} |
|
72 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/config.xml | ||
---|---|---|
850 | 850 |
|
851 | 851 |
</extension> |
852 | 852 |
|
853 |
<extension class-name="org.gvsig.app.extension.SearchByAttributesExtension" |
|
854 |
description="" |
|
855 |
active="true"> |
|
856 |
|
|
857 |
<action |
|
858 |
name="search-by-attributes-layer" |
|
859 |
label="_Search_by_attributes" |
|
860 |
position="200700000" |
|
861 |
icon="search-by-attributes-layer" |
|
862 |
tooltip="_Search_by_attributes" |
|
863 |
action-command="search-by-attributes-layer" |
|
864 |
accelerator="" |
|
865 |
/> |
|
866 |
|
|
867 |
<menu |
|
868 |
name="search-by-attributes-layer" |
|
869 |
text="Edit/_Search_by_attributes" |
|
870 |
/> |
|
871 |
|
|
872 |
<tool-bar name="edit"> |
|
873 |
<action-tool name="search-by-attributes-layer" /> |
|
874 |
</tool-bar> |
|
875 |
|
|
876 |
</extension> |
|
877 |
|
|
853 | 878 |
<extension class-name="org.gvsig.app.extension.dispose.DisposableManagementExtension" |
854 | 879 |
description="Extensi?n con informaci?n sobre disposables." |
855 | 880 |
active="true" |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/extension/SelectByAttributesInTableExtension.java | ||
---|---|---|
79 | 79 |
if ("selection-by-attributes-table".equals(actionCommand)) { |
80 | 80 |
table = (FeatureTableDocumentPanel) v; |
81 | 81 |
|
82 |
featureStore = table.getModel().getStore(); |
|
83 |
filterTitle = table.getModel().getName(); |
|
84 |
table.getModel().setModified(true); |
|
82 |
|
|
83 |
featureStore = table.getFeatureStore(); |
|
84 |
filterTitle = featureStore.getName(); |
|
85 |
// table.getModel().setModified(true); |
|
85 | 86 |
SelectByAttributes selector = new SelectByAttributes(); |
86 | 87 |
selector.showWindow(filterTitle, featureStore, WindowManager.MODE.TOOL); |
87 | 88 |
|
88 | 89 |
} else if ("selection-by-attributes-table-old".equals(actionCommand)) { |
89 | 90 |
table = (FeatureTableDocumentPanel) v; |
90 | 91 |
|
91 |
featureStore = table.getModel().getStore();
|
|
92 |
filterTitle = table.getModel().getName();
|
|
93 |
table.getModel().setModified(true); |
|
92 |
featureStore = table.getFeatureStore();
|
|
93 |
filterTitle = featureStore.getName();
|
|
94 |
// table.getModel().setModified(true);
|
|
94 | 95 |
|
95 | 96 |
doExecute(); |
96 | 97 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.fmap.control/src/main/java/org/gvsig/fmap/mapcontrol/dal/feature/swing/FeatureTypesTablePanel.java | ||
---|---|---|
25 | 25 |
|
26 | 26 |
import java.awt.BorderLayout; |
27 | 27 |
import java.awt.Dimension; |
28 |
import java.util.List; |
|
29 | 28 |
import javax.swing.DefaultListModel; |
30 | 29 |
import javax.swing.JComponent; |
31 | 30 |
|
... | ... | |
34 | 33 |
import javax.swing.JList; |
35 | 34 |
import javax.swing.event.ListSelectionEvent; |
36 | 35 |
import javax.swing.event.ListSelectionListener; |
36 |
import org.gvsig.fmap.dal.DataStore; |
|
37 | 37 |
|
38 | 38 |
import org.gvsig.fmap.dal.exception.DataException; |
39 | 39 |
import org.gvsig.fmap.dal.feature.Feature; |
... | ... | |
46 | 46 |
import org.gvsig.fmap.mapcontrol.dal.feature.swing.table.SelectedFeatureTypeChangeListener; |
47 | 47 |
import org.gvsig.tools.exception.BaseException; |
48 | 48 |
import org.gvsig.tools.swing.api.ListElement; |
49 |
import org.gvsig.tools.util.UnmodifiableBasicMap; |
|
49 | 50 |
import org.slf4j.Logger; |
50 | 51 |
import org.slf4j.LoggerFactory; |
51 | 52 |
|
... | ... | |
134 | 135 |
} |
135 | 136 |
|
136 | 137 |
private boolean hasManyFeatureTypes() throws DataException { |
137 |
List<String> childNames = this.model.getFeatureStore().getChildrenNames();
|
|
138 |
if( childNames!=null && !childNames.isEmpty() ) {
|
|
138 |
UnmodifiableBasicMap<String, DataStore> children = this.model.getFeatureStore().getChildren();
|
|
139 |
if( !children.isEmpty() ) {
|
|
139 | 140 |
return true; |
140 | 141 |
} |
141 | 142 |
return typesControl.getFeatureTypesSize() > 1; |
... | ... | |
241 | 242 |
DefaultListModel model = new DefaultListModel(); |
242 | 243 |
FeatureStore store = this.model.getFeatureStore(); |
243 | 244 |
model.addElement(new ListElement<>(store.getName(),store)); |
244 |
for (String childName : store.getChildrenNames()) {
|
|
245 |
model.addElement(new ListElement<>(childName,store.getChild(childName))); |
|
245 |
for (String childName : store.getChildren().keySet() ) {
|
|
246 |
model.addElement(new ListElement<>(childName,store.getChildren().get(childName)));
|
|
246 | 247 |
} |
247 | 248 |
l.setModel(model); |
248 | 249 |
l.addListSelectionListener(new ListSelectionListener() { |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.main/src/main/java/org/gvsig/expressionevaluator/main/MainDialog.java | ||
---|---|---|
49 | 49 |
openStore() |
50 | 50 |
); |
51 | 51 |
if( element != null ) { |
52 |
panel.getElements().add(element);
|
|
52 |
panel.addElement(element);
|
|
53 | 53 |
} |
54 | 54 |
Dialog dialog = windowManager.createDialog( |
55 | 55 |
panel.asJComponent(), |
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/DefaultExpressionBuilder.java | ||
---|---|---|
743 | 743 |
} |
744 | 744 |
|
745 | 745 |
@Override |
746 |
public boolean isEmpty() { |
|
747 |
return value == null; |
|
748 |
} |
|
749 |
|
|
750 |
@Override |
|
746 | 751 |
public ExpressionBuilder createExpressionBuilder() { |
747 | 752 |
return new DefaultExpressionBuilder(); |
748 | 753 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.api/src/main/java/org/gvsig/expressionevaluator/ExpressionBuilder.java | ||
---|---|---|
536 | 536 |
|
537 | 537 |
public Function toStr(Value object); |
538 | 538 |
|
539 |
public boolean isEmpty(); |
|
539 | 540 |
} |
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/DefaultExpressionEvaluatorSwingManager.java | ||
---|---|---|
19 | 19 |
import org.gvsig.expressionevaluator.swing.Element.ConstantElement; |
20 | 20 |
import org.gvsig.expressionevaluator.swing.Element.FunctionElement; |
21 | 21 |
import org.gvsig.expressionevaluator.swing.Element.GroupElement; |
22 |
import org.gvsig.expressionevaluator.swing.Element.VariableElement; |
|
23 | 22 |
import org.gvsig.expressionevaluator.swing.ElementFactory; |
24 | 23 |
import org.gvsig.expressionevaluator.swing.ExpressionBuilderConfig; |
25 | 24 |
import org.gvsig.expressionevaluator.swing.ExpressionPickerController; |
... | ... | |
28 | 27 |
import org.gvsig.expressionevaluator.swing.impl.elements.DefaultConstantValueElement; |
29 | 28 |
import org.gvsig.expressionevaluator.swing.impl.elements.DefaultFunctionElement; |
30 | 29 |
import org.gvsig.expressionevaluator.swing.impl.elements.DefaultGroupElement; |
31 |
import org.gvsig.expressionevaluator.swing.impl.elements.DefaultVariableElement; |
|
32 | 30 |
import org.gvsig.tools.ToolsLocator; |
33 | 31 |
import org.gvsig.tools.i18n.I18nManager; |
34 | 32 |
|
... | ... | |
44 | 42 |
} |
45 | 43 |
|
46 | 44 |
@Override |
47 |
public List<Element> createElements(ExpressionBuilderConfig config, Collection<SymbolTable> symbolTables) {
|
|
45 |
public List<Element> createElements(Collection<SymbolTable> symbolTables) { |
|
48 | 46 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
49 | 47 |
Map<String, Function> functions = new HashMap<>(); |
50 | 48 |
|
... | ... | |
61 | 59 |
String groupName = function.group(); |
62 | 60 |
GroupElement group = operatorGroups.get(groupName); |
63 | 61 |
if (group == null) { |
64 |
group = new DefaultGroupElement(config, groupName);
|
|
62 |
group = new DefaultGroupElement(groupName); |
|
65 | 63 |
operatorGroups.put(groupName, group); |
66 | 64 |
} |
67 |
group.addElement(new DefaultFunctionElement(config, function));
|
|
65 |
group.addElement(new DefaultFunctionElement(function)); |
|
68 | 66 |
} else { |
69 | 67 |
String groupName = function.group(); |
70 | 68 |
GroupElement group = functionGroups.get(groupName); |
71 | 69 |
if (group == null) { |
72 |
group = new DefaultGroupElement(config, groupName);
|
|
70 |
group = new DefaultGroupElement(groupName); |
|
73 | 71 |
functionGroups.put(groupName, group); |
74 | 72 |
} |
75 |
group.addElement(new DefaultFunctionElement(config, function));
|
|
73 |
group.addElement(new DefaultFunctionElement(function)); |
|
76 | 74 |
} |
77 | 75 |
} |
78 |
GroupElement builtinFunctions = this.createGroupElement(config, i18n.getTranslation("_Functions"));
|
|
76 |
GroupElement builtinFunctions = this.createGroupElement(i18n.getTranslation("_Functions")); |
|
79 | 77 |
for (GroupElement group : functionGroups.values()) { |
80 | 78 |
builtinFunctions.addElement(group); |
81 | 79 |
} |
82 |
GroupElement operatorFunctions = this.createGroupElement(config, i18n.getTranslation("_Operators"));
|
|
80 |
GroupElement operatorFunctions = this.createGroupElement(i18n.getTranslation("_Operators")); |
|
83 | 81 |
for (GroupElement group : operatorGroups.values()) { |
84 | 82 |
operatorFunctions.addElement(group); |
85 | 83 |
} |
... | ... | |
126 | 124 |
} |
127 | 125 |
|
128 | 126 |
@Override |
129 |
public GroupElement createGroupElement(ExpressionBuilderConfig config, String name) {
|
|
130 |
GroupElement e = new DefaultGroupElement(config, name);
|
|
127 |
public GroupElement createGroupElement(String name) { |
|
128 |
GroupElement e = new DefaultGroupElement(name); |
|
131 | 129 |
return e; |
132 | 130 |
} |
133 | 131 |
|
134 | 132 |
@Override |
135 |
public GroupElement createGroupElement(ExpressionBuilderConfig config, String name, List<Element> elements) {
|
|
136 |
GroupElement e = new DefaultGroupElement(this, config, name, elements);
|
|
133 |
public GroupElement createGroupElement(String name, List<Element> elements) { |
|
134 |
GroupElement e = new DefaultGroupElement(this, name, elements); |
|
137 | 135 |
return e; |
138 | 136 |
} |
139 | 137 |
|
140 | 138 |
@Override |
141 |
public FunctionElement createFunctionElement(ExpressionBuilderConfig config, Function function) {
|
|
142 |
FunctionElement e = new DefaultFunctionElement(config, function);
|
|
139 |
public FunctionElement createFunctionElement(Function function) { |
|
140 |
FunctionElement e = new DefaultFunctionElement(function); |
|
143 | 141 |
return e; |
144 | 142 |
} |
145 | 143 |
|
146 | 144 |
@Override |
147 |
public ConstantElement createConstantElement(ExpressionBuilderConfig config, Object value) { |
|
148 |
ConstantElement e = new DefaultConstantValueElement(config, value, null); |
|
145 |
public ConstantElement createConstantElement(Object value, String label) { |
|
146 |
ConstantElement e = new DefaultConstantValueElement( |
|
147 |
value, |
|
148 |
label, |
|
149 |
null |
|
150 |
); |
|
149 | 151 |
return e; |
150 | 152 |
} |
151 | 153 |
|
152 | 154 |
@Override |
153 |
public ConstantElement createConstantElement(ExpressionBuilderConfig config, Object value, String description) { |
|
154 |
ConstantElement e = new DefaultConstantValueElement(config, value, description); |
|
155 |
public ConstantElement createConstantElement(Object value, String label, String description) { |
|
156 |
ConstantElement e = new DefaultConstantValueElement( |
|
157 |
value, |
|
158 |
StringUtils.defaultIfEmpty(label, ""), |
|
159 |
description |
|
160 |
); |
|
155 | 161 |
return e; |
156 | 162 |
} |
163 |
// |
|
164 |
// @Override |
|
165 |
// public VariableElement createVariableElement(ExpressionBuilderConfig config, String label, String source, String name, String typeName, String description) { |
|
166 |
// VariableElement e = new DefaultVariableElement(config, label, source, name, typeName, description); |
|
167 |
// return e; |
|
168 |
// } |
|
157 | 169 |
|
158 | 170 |
@Override |
159 |
public VariableElement createVariableElement(ExpressionBuilderConfig config, String label, String source, String name, String typeName, String description) { |
|
160 |
VariableElement e = new DefaultVariableElement(config, label, source, name, typeName, description); |
|
161 |
return e; |
|
162 |
} |
|
163 |
|
|
164 |
@Override |
|
165 | 171 |
public ExpressionPickerController createExpressionPickerController(JTextComponent text, JButton button) { |
166 | 172 |
ExpressionPickerController c = new DefaultExpressionPickerController(this, text, button); |
167 | 173 |
return c; |
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/FilteredListModel.java | ||
---|---|---|
8 | 8 |
import java.util.ArrayList; |
9 | 9 |
import java.util.Comparator; |
10 | 10 |
import java.util.List; |
11 |
import java.util.Objects; |
|
11 | 12 |
import javax.swing.AbstractListModel; |
12 | 13 |
import javax.swing.SwingUtilities; |
13 | 14 |
import org.apache.commons.io.FilenameUtils; |
15 |
import org.apache.commons.lang3.ObjectUtils; |
|
14 | 16 |
import org.apache.commons.lang3.StringUtils; |
15 |
import org.gvsig.expressionevaluator.swing.Element.ConstantElement;
|
|
16 |
import org.gvsig.tools.swing.api.ListElement;
|
|
17 |
import org.gvsig.tools.util.LabeledValue;
|
|
18 |
import org.gvsig.tools.util.LabeledValueImpl;
|
|
17 | 19 |
|
18 | 20 |
/** |
19 | 21 |
* |
... | ... | |
21 | 23 |
*/ |
22 | 24 |
class FilteredListModel extends AbstractListModel { |
23 | 25 |
|
24 |
private List<ListElement> elements;
|
|
25 |
private List<ListElement> filteredElements;
|
|
26 |
private List<LabeledValue> elements;
|
|
27 |
private List<LabeledValue> filteredElements;
|
|
26 | 28 |
private String filter; |
27 | 29 |
|
28 | 30 |
public FilteredListModel() { |
... | ... | |
37 | 39 |
} |
38 | 40 |
|
39 | 41 |
@Override |
40 |
public Object getElementAt(int index) {
|
|
42 |
public LabeledValue getElementAt(int index) {
|
|
41 | 43 |
return this.filteredElements.get(index); |
42 | 44 |
} |
43 | 45 |
|
44 |
void addElement(ListElement element) {
|
|
46 |
void addElement(LabeledValue element) {
|
|
45 | 47 |
this.elements.add(element); |
46 | 48 |
if (this.elements != this.filteredElements) { |
47 | 49 |
this.filteredElements.add(element); |
48 | 50 |
} |
49 | 51 |
} |
50 | 52 |
|
53 |
void addElement(Object element) { |
|
54 |
this.addElement(new LabeledValueImpl<>(Objects.toString(element, ""), element)); |
|
55 |
} |
|
56 |
|
|
51 | 57 |
public void setFilter(String filter) { |
52 | 58 |
if (StringUtils.isEmpty(filter)) { |
53 | 59 |
this.filter = null; |
... | ... | |
55 | 61 |
} else { |
56 | 62 |
this.filter = filter; |
57 | 63 |
this.filteredElements = new ArrayList<>(); |
58 |
for (ListElement element : elements) {
|
|
64 |
for (LabeledValue element : elements) {
|
|
59 | 65 |
if (FilenameUtils.wildcardMatch(element.getValue().toString().toLowerCase(), this.filter.toLowerCase())) { |
60 | 66 |
this.filteredElements.add(element); |
61 | 67 |
} |
... | ... | |
97 | 103 |
} |
98 | 104 |
|
99 | 105 |
private void sortForeground(final boolean ascending) { |
100 |
final List<ListElement> items = new ArrayList<>(elements); |
|
101 |
final Comparator comparator = Utils.naturalComparator(); |
|
102 |
items.sort(new Comparator<ListElement>() { |
|
106 |
final List items = new ArrayList<>(elements); |
|
107 |
items.sort(new Comparator<Comparable>() { |
|
103 | 108 |
@Override |
104 |
public int compare(ListElement o1, ListElement o2) { |
|
105 |
int r; |
|
106 |
if (o1 == null && o2 == null) { |
|
107 |
r = 0; |
|
108 |
} else if (o1 == null && o2 != null) { |
|
109 |
r = -1; |
|
110 |
} else if (o1 != null && o2 == null) { |
|
111 |
r = 1; |
|
112 |
} else { |
|
113 |
if( o1.getValue() instanceof ConstantElement && |
|
114 |
o2.getValue() instanceof ConstantElement ) { |
|
115 |
r = comparator.compare( |
|
116 |
((ConstantElement)o1.getValue()).getValue(), |
|
117 |
((ConstantElement)o2.getValue()).getValue() |
|
118 |
); |
|
119 |
} else { |
|
120 |
r = comparator.compare(o1.getValue(),o2.getValue()); |
|
121 |
} |
|
122 |
} |
|
109 |
public int compare(Comparable o1, Comparable o2) { |
|
110 |
int r = ObjectUtils.compare(o1, o2); |
|
123 | 111 |
if (ascending) { |
124 | 112 |
return r; |
125 | 113 |
} |
... | ... | |
135 | 123 |
} |
136 | 124 |
} |
137 | 125 |
|
138 |
void addElement(Object data) { |
|
139 |
ListElement e = new ListElement(data.toString(), data); |
|
140 |
this.addElement(e); |
|
141 |
} |
|
142 | 126 |
} |
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/DefaultJExpressionPicker.java | ||
---|---|---|
3 | 3 |
import java.awt.BorderLayout; |
4 | 4 |
import java.util.Collection; |
5 | 5 |
import java.util.List; |
6 |
import java.util.Map; |
|
7 | 6 |
import javax.swing.JButton; |
8 | 7 |
import javax.swing.JComponent; |
9 | 8 |
import javax.swing.JPanel; |
... | ... | |
41 | 40 |
this.add(text, BorderLayout.CENTER); |
42 | 41 |
this.add(button, BorderLayout.LINE_END); |
43 | 42 |
} |
43 |
|
|
44 |
@Override |
|
45 |
public Preferences getPreferences() { |
|
46 |
return this.controller.getPreferences(); |
|
47 |
} |
|
44 | 48 |
|
45 | 49 |
@Override |
46 | 50 |
public ExpressionPickerController getController() { |
... | ... | |
62 | 66 |
return this; |
63 | 67 |
} |
64 | 68 |
|
65 |
|
|
66 | 69 |
@Override |
67 |
public int getSimpleElementsLimit() { |
|
68 |
return this.controller.getSimpleElementsLimit(); |
|
69 |
} |
|
70 |
|
|
71 |
@Override |
|
72 |
public void setSimpleElementsLimit(int limit) { |
|
73 |
this.controller.setSimpleElementsLimit(limit); |
|
74 |
} |
|
75 |
|
|
76 |
@Override |
|
77 | 70 |
public List<Element> getElements() { |
78 | 71 |
return this.controller.getElements(); |
79 | 72 |
} |
... | ... | |
109 | 102 |
} |
110 | 103 |
|
111 | 104 |
@Override |
112 |
public void setScriptsEnabled(boolean enabled) { |
|
113 |
this.controller.setScriptsEnabled(enabled); |
|
114 |
} |
|
115 |
|
|
116 |
@Override |
|
117 |
public boolean getScriptsEnabled() { |
|
118 |
return this.controller.getScriptsEnabled(); |
|
119 |
} |
|
120 |
|
|
121 |
@Override |
|
122 | 105 |
public SymbolTable getPreviewSymbolTable() { |
123 | 106 |
return this.controller.getPreviewSymbolTable(); |
124 | 107 |
} |
... | ... | |
128 | 111 |
this.controller.setPreviewSymbolTable(symbolTable); |
129 | 112 |
} |
130 | 113 |
|
131 |
@Override |
|
132 |
public void setSQLCompatible(boolean sqlCompatible) { |
|
133 |
this.controller.setSQLCompatible(sqlCompatible); |
|
134 |
} |
|
135 |
|
|
136 |
@Override |
|
137 |
public boolean isSQLCompatible() { |
|
138 |
return this.controller.isSQLCompatible(); |
|
139 |
} |
|
140 |
|
|
141 |
@Override |
|
142 |
public Object getProperty(String string) { |
|
143 |
return this.controller.getProperty(string); |
|
144 |
} |
|
145 |
|
|
146 |
@Override |
|
147 |
public void setProperty(String string, Object o) { |
|
148 |
this.controller.setProperty(string, o); |
|
149 |
} |
|
150 |
|
|
151 |
@Override |
|
152 |
public Map<String, Object> getProperties() { |
|
153 |
return this.controller.getProperties(); |
|
154 |
} |
|
155 | 114 |
} |
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/elements/DefaultFunctionElement.java | ||
---|---|---|
28 | 28 |
implements FunctionElement { |
29 | 29 |
|
30 | 30 |
private final Function function; |
31 |
private final ExpressionBuilderConfig config; |
|
32 | 31 |
|
33 |
public DefaultFunctionElement(ExpressionBuilderConfig config, Function function) {
|
|
32 |
public DefaultFunctionElement(Function function) { |
|
34 | 33 |
super( |
35 | 34 |
function.name(), |
35 |
function.name(), |
|
36 | 36 |
function.isSQLCompatible() |
37 | 37 |
? "expressionbuilder-element-function-sql" |
38 | 38 |
: "expressionbuilder-element-function" |
39 | 39 |
); |
40 | 40 |
this.function = function; |
41 |
this.config = config; |
|
42 | 41 |
} |
43 | 42 |
|
44 | 43 |
@Override |
... | ... | |
48 | 47 |
|
49 | 48 |
@Override |
50 | 49 |
public boolean isEnabled() { |
51 |
if( this.config.isSQLCompatible() ) {
|
|
50 |
if( this.getConfig().getPreferences().isSQLCompatible() ) {
|
|
52 | 51 |
return this.function.isSQLCompatible(); |
53 | 52 |
} |
54 | 53 |
return true; |
... | ... | |
65 | 64 |
} |
66 | 65 |
|
67 | 66 |
@Override |
67 |
public String getName() { |
|
68 |
return this.function.name(); |
|
69 |
} |
|
70 |
|
|
71 |
@Override |
|
72 |
public Object getValue() { |
|
73 |
return this.function.name(); |
|
74 |
} |
|
75 |
|
|
76 |
@Override |
|
77 |
public String getLabel() { |
|
78 |
return "<html><b>" + function.name() + "</b> return " + function.returnType() + "</html>"; |
|
79 |
} |
|
80 |
|
|
81 |
@Override |
|
82 |
public String getRenderedValue() { |
|
83 |
return function.template() == null ? function.name() + "({{}})" : function.template(); |
|
84 |
} |
|
85 |
|
|
86 |
@Override |
|
68 | 87 |
public String getDescription() { |
69 | 88 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
70 | 89 |
|
... | ... | |
72 | 91 |
html.append("<html>\n"); |
73 | 92 |
|
74 | 93 |
Function theFunction = this.getFunction(); |
75 |
if (theFunction == null) { |
|
76 |
html.append("<b>").append(i18n.getTranslation("_Function")).append("</b> ").append(this.getName()).append("<br>\n<br>\n"); |
|
77 |
html.append("<b>").append(i18n.getTranslation("_Return")).append("</b> Object<br>\n<br>\n"); |
|
78 |
html.append("<b>").append(i18n.getTranslation("_Template")).append(":</b> ").append(this.getName()).append("()<br>\n"); |
|
79 |
} else { |
|
80 |
html.append("<b>").append(i18n.getTranslation("_Function")).append("</b> ").append(this.getName()).append("<br>\n<br>\n"); |
|
81 |
List<String> aliases = theFunction.aliases(); |
|
82 |
if( aliases!=null && !aliases.isEmpty() ) { |
|
83 |
html.append("<b>").append(i18n.getTranslation("_Aliases")).append(":</b> ").append("<ul>\n"); |
|
84 |
for (String alias : aliases) { |
|
85 |
html.append("<li>").append(alias).append("</li>\n"); |
|
86 |
} |
|
87 |
html.append("</ul>\n"); |
|
94 |
html.append("<b>").append(i18n.getTranslation("_Function")).append("</b> ").append(this.getName()).append("<br>\n<br>\n"); |
|
95 |
List<String> aliases = theFunction.aliases(); |
|
96 |
if( aliases!=null && !aliases.isEmpty() ) { |
|
97 |
html.append("<b>").append(i18n.getTranslation("_Aliases")).append(":</b> ").append("<ul>\n"); |
|
98 |
for (String alias : aliases) { |
|
99 |
html.append("<li>").append(alias).append("</li>\n"); |
|
88 | 100 |
} |
89 |
html.append("<b>").append(i18n.getTranslation("_Return")).append("</b> "); |
|
90 |
html.append(StringUtils.isEmpty(theFunction.returnType()) ? "Objec" : theFunction.returnType()); |
|
91 |
html.append("<br>\n"); |
|
92 |
html.append("<b>").append(i18n.getTranslation("_Template")).append("</b> "); |
|
93 |
html.append(StringUtils.isEmpty(theFunction.template()) ? this.getName() + "()" : theFunction.template()); |
|
94 |
html.append("<br>\n"); |
|
101 |
html.append("</ul>\n"); |
|
102 |
} |
|
103 |
html.append("<b>").append(i18n.getTranslation("_Return")).append("</b> "); |
|
104 |
html.append(StringUtils.isEmpty(theFunction.returnType()) ? "Objec" : theFunction.returnType()); |
|
105 |
html.append("<br>\n"); |
|
106 |
html.append("<b>").append(i18n.getTranslation("_Template")).append("</b> "); |
|
107 |
html.append(StringUtils.isEmpty(theFunction.template()) ? this.getName() + "()" : theFunction.template()); |
|
108 |
html.append("<br>\n"); |
|
95 | 109 |
|
96 |
String[] args = theFunction.descriptionArgs(); |
|
97 |
if (args != null) { |
|
98 |
html.append("<b>").append(i18n.getTranslation("_Arguments")).append(":</b> ").append("<ul>\n"); |
|
99 |
for (String arg : args) { |
|
100 |
html.append("<li>").append(arg).append("</li>\n"); |
|
101 |
} |
|
102 |
html.append("</ul>\n"); |
|
103 |
html.append("<br>\n"); |
|
110 |
String[] args = theFunction.descriptionArgs(); |
|
111 |
if (args != null) { |
|
112 |
html.append("<b>").append(i18n.getTranslation("_Arguments")).append(":</b> ").append("<ul>\n"); |
|
113 |
for (String arg : args) { |
|
114 |
html.append("<li>").append(arg).append("</li>\n"); |
|
104 | 115 |
} |
105 |
String functionDescription = theFunction.description(); |
|
106 |
if( !StringUtils.isBlank(functionDescription) ) { |
|
107 |
html.append("<b>").append(i18n.getTranslation("_Description")).append("</b><br>\n"); |
|
108 |
html.append(functionDescription.replace("\n", "<br>")).append("<br>\n"); |
|
109 |
} |
|
116 |
html.append("</ul>\n"); |
|
117 |
html.append("<br>\n"); |
|
110 | 118 |
} |
119 |
String functionDescription = theFunction.description(); |
|
120 |
if( !StringUtils.isBlank(functionDescription) ) { |
|
121 |
html.append("<b>").append(i18n.getTranslation("_Description")).append("</b><br>\n"); |
|
122 |
html.append(functionDescription.replace("\n", "<br>")).append("<br>\n"); |
|
123 |
} |
|
111 | 124 |
|
112 | 125 |
html.append("</html>\n"); |
113 | 126 |
return html.toString(); |
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/elements/DefaultVariableElement.java | ||
---|---|---|
1 | 1 |
package org.gvsig.expressionevaluator.swing.impl.elements; |
2 | 2 |
|
3 | 3 |
import org.apache.commons.lang3.StringUtils; |
4 |
import org.gvsig.expressionevaluator.swing.Element.VariableElement; |
|
4 |
//import org.gvsig.expressionevaluator.swing.Element.VariableElement;
|
|
5 | 5 |
import org.gvsig.expressionevaluator.swing.ExpressionBuilderConfig; |
6 | 6 |
import org.gvsig.expressionevaluator.swing.spi.AbstractElement; |
7 | 7 |
import org.gvsig.tools.ToolsLocator; |
... | ... | |
11 | 11 |
* |
12 | 12 |
* @author jjdelcerro |
13 | 13 |
*/ |
14 |
public class DefaultVariableElement
|
|
15 |
extends AbstractElement |
|
16 |
implements VariableElement {
|
|
14 |
public class DefaultVariableElement |
|
15 |
extends AbstractElement // implements VariableElement
|
|
16 |
{ |
|
17 | 17 |
|
18 | 18 |
private final String label; |
19 | 19 |
private final String source; |
20 | 20 |
private final String typeName; |
21 | 21 |
private final String description; |
22 | 22 |
private final ExpressionBuilderConfig config; |
23 |
|
|
23 |
|
|
24 | 24 |
public DefaultVariableElement(ExpressionBuilderConfig config, String label, String source, String name, String typeName, String description) { |
25 | 25 |
super(name, "expressionbuilder-element"); |
26 | 26 |
this.description = description; |
... | ... | |
30 | 30 |
this.config = config; |
31 | 31 |
} |
32 | 32 |
|
33 |
@Override |
|
33 |
// @Override
|
|
34 | 34 |
public String getSource() { |
35 | 35 |
return this.source; |
36 | 36 |
} |
... | ... | |
40 | 40 |
return this.label; |
41 | 41 |
} |
42 | 42 |
|
43 |
@Override |
|
43 |
// @Override
|
|
44 | 44 |
public String getTypeName() { |
45 | 45 |
return typeName; |
46 | 46 |
} |
47 |
|
|
47 | 48 |
@Override |
48 | 49 |
public String getDescription() { |
49 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
50 |
// I18nManager i18n = ToolsLocator.getI18nManager(); |
|
51 |
// |
|
52 |
// StringBuilder html = new StringBuilder(); |
|
53 |
// html.append("<html>\n"); |
|
54 |
// |
|
55 |
// html.append("<b>").append(this.getLabel()).append("</b><br>\n<br>\n"); |
|
56 |
// html.append("<b>").append(i18n.getTranslation("_Source")).append("</b> ").append(this.getSource()).append("<br>\n"); |
|
57 |
// html.append("<b>").append(i18n.getTranslation("_Name")).append("</b> ").append(this.getName()).append("<br>\n"); |
|
58 |
// html.append("<b>").append(i18n.getTranslation("_Type")).append("</b> ").append(this.getTypeName()).append("<br>\n"); |
|
59 |
// if( !StringUtils.isBlank(this.description) && |
|
60 |
// StringUtils.equalsAnyIgnoreCase(this.getName(), this.description) ) { |
|
61 |
// html.append("<b>").append(i18n.getTranslation("_Description")).append("</b><br>\n"); |
|
62 |
// html.append(this.description.replace("\n", "<br>")).append("<br>\n"); |
|
63 |
// } |
|
64 |
// html.append("</html>\n"); |
|
65 |
// return html.toString(); |
|
66 |
return null; |
|
67 |
} |
|
50 | 68 |
|
51 |
StringBuilder html = new StringBuilder(); |
|
52 |
html.append("<html>\n"); |
|
53 |
|
|
54 |
html.append("<b>").append(this.getLabel()).append("</b><br>\n<br>\n"); |
|
55 |
html.append("<b>").append(i18n.getTranslation("_Source")).append("</b> ").append(this.getSource()).append("<br>\n"); |
|
56 |
html.append("<b>").append(i18n.getTranslation("_Name")).append("</b> ").append(this.getName()).append("<br>\n"); |
|
57 |
html.append("<b>").append(i18n.getTranslation("_Type")).append("</b> ").append(this.getTypeName()).append("<br>\n"); |
|
58 |
if( !StringUtils.isBlank(this.description) && |
|
59 |
StringUtils.equalsAnyIgnoreCase(this.getName(), this.description) ) { |
|
60 |
html.append("<b>").append(i18n.getTranslation("_Description")).append("</b><br>\n"); |
|
61 |
html.append(this.description.replace("\n", "<br>")).append("<br>\n"); |
|
62 |
} |
|
63 |
html.append("</html>\n"); |
|
64 |
return html.toString(); |
|
65 |
} |
|
66 |
|
|
67 | 69 |
} |
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/elements/DefaultConstantValueElement.java | ||
---|---|---|
5 | 5 |
*/ |
6 | 6 |
package org.gvsig.expressionevaluator.swing.impl.elements; |
7 | 7 |
|
8 |
import java.util.Comparator; |
|
8 | 9 |
import java.util.Objects; |
9 | 10 |
import org.gvsig.expressionevaluator.swing.Element.ConstantElement; |
10 | 11 |
import org.gvsig.expressionevaluator.swing.ExpressionBuilderConfig; |
... | ... | |
12 | 13 |
import org.gvsig.expressionevaluator.swing.spi.AbstractElement; |
13 | 14 |
import org.gvsig.tools.ToolsLocator; |
14 | 15 |
import org.gvsig.tools.i18n.I18nManager; |
16 |
import org.gvsig.tools.util.LabeledValue; |
|
15 | 17 |
|
16 | 18 |
/** |
17 | 19 |
* |
... | ... | |
21 | 23 |
extends AbstractElement |
22 | 24 |
implements ConstantElement { |
23 | 25 |
|
24 |
private final Object value; |
|
25 |
private final ExpressionBuilderConfig config; |
|
26 |
private final String label; |
|
26 | 27 |
|
27 |
public DefaultConstantValueElement(ExpressionBuilderConfig config, Object value, String description) { |
|
28 |
super(Objects.toString(value, ""), "expressionbuilder-element-constant"); |
|
29 |
this.value = value; |
|
30 |
this.config = config; |
|
28 |
public DefaultConstantValueElement(Object value, String label, String description) { |
|
29 |
super(Objects.toString(value,""), value, "expressionbuilder-element-constant"); |
|
30 |
if( label == null ) { |
|
31 |
this.label = Objects.toString(value,""); |
|
32 |
} else { |
|
33 |
this.label = label; |
|
34 |
} |
|
31 | 35 |
} |
32 | 36 |
|
33 | 37 |
@Override |
34 |
public Object getValue() {
|
|
35 |
return value;
|
|
38 |
public String getLabel() {
|
|
39 |
return this.label;
|
|
36 | 40 |
} |
37 | 41 |
|
38 | 42 |
@Override |
43 |
public String getRenderedValue() { |
|
44 |
return " "+Utils.repr(this.getValue())+" "; |
|
45 |
} |
|
46 |
|
|
47 |
@Override |
|
39 | 48 |
public String getDescription() { |
40 | 49 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
41 | 50 |
|
... | ... | |
54 | 63 |
return html.toString(); |
55 | 64 |
} |
56 | 65 |
|
66 |
@Override |
|
67 |
public int compareTo(Object other) { |
|
68 |
if( !(other instanceof LabeledValue) ) { |
|
69 |
return super.compareTo(other); |
|
70 |
} |
|
71 |
Comparator comparator = Utils.naturalComparator(); |
|
72 |
return comparator.compare(this.getValue(), ((LabeledValue)other).getValue()); |
|
73 |
} |
|
74 |
|
|
57 | 75 |
} |
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/elements/DefaultGroupElement.java | ||
---|---|---|
11 | 11 |
import org.gvsig.expressionevaluator.Function; |
12 | 12 |
import org.gvsig.expressionevaluator.swing.Element; |
13 | 13 |
import org.gvsig.expressionevaluator.swing.Element.GroupElement; |
14 |
import org.gvsig.expressionevaluator.swing.ExpressionBuilderConfig; |
|
15 | 14 |
import org.gvsig.expressionevaluator.swing.spi.AbstractElement; |
16 | 15 |
import org.gvsig.expressionevaluator.swing.ExpressionEvaluatorSwingManager; |
17 | 16 |
|
... | ... | |
25 | 24 |
{ |
26 | 25 |
|
27 | 26 |
final private List<Element> elements; |
28 |
final private ExpressionBuilderConfig config; |
|
29 | 27 |
private ExpressionEvaluatorSwingManager manager; |
30 | 28 |
|
31 |
public DefaultGroupElement(ExpressionEvaluatorSwingManager manager, ExpressionBuilderConfig config, String name, List<Element> elements) {
|
|
32 |
super(name, "expressionbuilder-element-group"); |
|
29 |
public DefaultGroupElement(ExpressionEvaluatorSwingManager manager, String name, List<Element> elements) { |
|
30 |
super(name, name, "expressionbuilder-element-group");
|
|
33 | 31 |
this.manager = manager; |
34 | 32 |
this.elements = elements; |
35 |
this.config = config; |
|
36 | 33 |
} |
37 | 34 |
|
38 |
public DefaultGroupElement(ExpressionBuilderConfig config, String name) { |
|
39 |
super(name, "expressionbuilder-element-group"); |
|
40 |
this.config = config; |
|
35 |
public DefaultGroupElement(String name) { |
|
36 |
super(name, name, "expressionbuilder-element-group"); |
|
41 | 37 |
this.elements = new ArrayList<>(); |
42 | 38 |
} |
43 | 39 |
|
... | ... | |
68 | 64 |
|
69 | 65 |
@Override |
70 | 66 |
public void addElement(Function function) { |
71 |
Element item = this.manager.createConstantElement(this.config, function);
|
|
67 |
Element item = this.manager.createConstantElement(function, function.name());
|
|
72 | 68 |
this.addElement(item); |
73 | 69 |
} |
74 | 70 |
|
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/AbstractAutomaticExpressionChecker.java | ||
---|---|---|
51 | 51 |
private static final Color COLOR_ERROR = new Color(255,225,232); |
52 | 52 |
|
53 | 53 |
private final JTextComponent text; |
54 |
private final ExpressionBuilderConfig config;
|
|
54 |
private final ExpressionBuilderConfig builderConfig;
|
|
55 | 55 |
|
56 | 56 |
private Color color_ok; |
57 | 57 |
private Timer timerExpression; |
... | ... | |
69 | 69 |
|
70 | 70 |
public AbstractAutomaticExpressionChecker(ExpressionBuilderConfig config, JTextComponent theText) { |
71 | 71 |
this.text = theText; |
72 |
this.config = config;
|
|
72 |
this.builderConfig = config;
|
|
73 | 73 |
this.initComponents(); |
74 | 74 |
} |
75 | 75 |
|
... | ... | |
162 | 162 |
} |
163 | 163 |
|
164 | 164 |
private void doCheckExpression() { |
165 |
if( this.text == null || this.config == null ) {
|
|
165 |
if( this.text == null || this.builderConfig == null ) {
|
|
166 | 166 |
return; |
167 | 167 |
} |
168 | 168 |
Expression expression = this.getExpression(); |
... | ... | |
184 | 184 |
} |
185 | 185 |
final Mutable<String> theTip = new MutableObject<>(null); |
186 | 186 |
expression.setSQLCompatible(false); |
187 |
if (this.config.getPreviewSymbolTable() == null) {
|
|
187 |
if (this.builderConfig.getPreviewSymbolTable() == null) {
|
|
188 | 188 |
try { |
189 | 189 |
ExpressionEvaluatorManager theManager = ExpressionEvaluatorLocator.getManager(); |
190 | 190 |
MutableSymbolTable symbolTable = theManager.createSymbolTable(); |
... | ... | |
195 | 195 |
} |
196 | 196 |
} else { |
197 | 197 |
try { |
198 |
Object theValue = expression.execute(this.config.getPreviewSymbolTable());
|
|
198 |
Object theValue = expression.execute(this.builderConfig.getPreviewSymbolTable());
|
|
199 | 199 |
this.setPreview(theValue); |
200 | 200 |
} catch (ExpressionRuntimeException ex) { |
201 | 201 |
theTip.setValue(ex.getTip()); |
... | ... | |
204 | 204 |
this.setMessage(JOptionPane.ERROR_MESSAGE, "Runtime error. " + ex.getMessage()); |
205 | 205 |
} |
206 | 206 |
} |
207 |
if( this.config.isSQLCompatible() ) {
|
|
207 |
if( this.builderConfig.getPreferences().isSQLCompatible() ) {
|
|
208 | 208 |
Code code = expression.getCode(); |
209 | 209 |
try { |
210 | 210 |
code.accept(new Visitor() { |
... | ... | |
219 | 219 |
} |
220 | 220 |
break; |
221 | 221 |
case Code.IDENTIFIER: |
222 |
if( config.getPreviewSymbolTable()!=null &&
|
|
223 |
!config.getPreviewSymbolTable().isSQLCompatible(((Identifier)code).name()) ) {
|
|
222 |
if( builderConfig.getPreviewSymbolTable()!=null &&
|
|
223 |
!builderConfig.getPreviewSymbolTable().isSQLCompatible(((Identifier)code).name()) ) {
|
|
224 | 224 |
theTip.setValue(I18N.Avoid_the_use_of_functions_not_compatible_with_SQL_in_this_data_source(((Identifier)code).name())); |
225 | 225 |
} |
226 | 226 |
break; |
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/Utils.java | ||
---|---|---|
25 | 25 |
return new Comparator() { |
26 | 26 |
@Override |
27 | 27 |
public int compare(Object o1, Object o2) { |
28 |
if (o1 instanceof Double) { |
|
29 |
return Double.compare((Double) o1, (Double) o2); |
|
30 |
} else if (o1 instanceof Float) { |
|
31 |
return Double.compare((Float) o1, (Float) o2); |
|
32 |
} else if (o1 instanceof Number) { |
|
33 |
return Double.compare( getLong((Number) o1), getLong((Number) o2)); |
|
28 |
if (o1 instanceof Integer && o2 instanceof Number ) { |
|
29 |
return Long.compare((Integer) o1, ((Number)o2).intValue()); |
|
30 |
|
|
31 |
} else if (o1 instanceof Long && o2 instanceof Number ) { |
|
32 |
return Long.compare((Long) o1, ((Number)o2).longValue()); |
|
33 |
|
|
34 |
} else if (o1 instanceof Double && o2 instanceof Number ) { |
|
35 |
return Double.compare((Double) o1, ((Number)o2).doubleValue()); |
|
36 |
|
|
37 |
} else if (o1 instanceof Float && o2 instanceof Number) { |
|
38 |
return Double.compare((Float) o1, ((Number)o2).floatValue()); |
|
39 |
|
|
40 |
} else if (o1 instanceof Number && o2 instanceof Number) { |
|
41 |
return Double.compare( getDouble((Number) o1), getDouble((Number) o2)); |
|
42 |
|
|
43 |
} else if (o1 instanceof String && o2 instanceof String) { |
|
44 |
return ((String) o1).compareToIgnoreCase((String)o2); |
|
45 |
|
|
34 | 46 |
} else { |
35 |
return Objects.toString(o1, "").compareTo(Objects.toString(o2, "")); |
|
47 |
try { |
|
48 |
return ((Comparable) o1).compareTo((Comparable)o2); |
|
49 |
} catch(Exception ex) { |
|
50 |
return Objects.toString(o1, "").compareTo(Objects.toString(o2, "")); |
|
51 |
} |
|
36 | 52 |
} |
37 | 53 |
} |
38 | 54 |
}; |
39 | 55 |
} |
40 | 56 |
|
41 |
private static long getLong(Number n) {
|
|
57 |
private static double getDouble(Number n) {
|
|
42 | 58 |
if( n==null ) { |
43 | 59 |
return 0; |
44 | 60 |
} |
45 |
return n.longValue();
|
|
61 |
return n.doubleValue();
|
|
46 | 62 |
} |
47 | 63 |
|
48 | 64 |
public static String repr(Object value) { |
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 | ||
---|---|---|
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 |
} |
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/ExpressionEvaluatorSwingLibraryImpl.java | ||
---|---|---|
41 | 41 |
new String[] { "action", "expressionbuilder-insert-text" }, |
42 | 42 |
new String[] { "action", "expressionbuilder-sortdown" }, |
43 | 43 |
new String[] { "action", "expressionbuilder-sortup" }, |
44 |
new String[] { "action", "expressionbuilder-history" }, |
|
45 |
new String[] { "action", "expressionbuilder-bookmarks" }, |
|
44 | 46 |
new String[] { "action", "expressionbuilder-time-limit" } |
45 | 47 |
}; |
46 | 48 |
IconTheme theme = ToolsSwingLocator.getIconThemeManager().getCurrent(); |
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/DefaultJExpressionBuilderView2.java | ||
---|---|---|
1 |
package org.gvsig.expressionevaluator.swing.impl; |
|
2 |
|
|
3 |
import java.awt.BorderLayout; |
|
4 |
import java.awt.Color; |
|
5 |
import java.awt.GridBagConstraints; |
|
6 |
import java.awt.GridBagLayout; |
|
7 |
import java.awt.Insets; |
|
8 |
import javax.swing.ImageIcon; |
|
9 |
import javax.swing.JButton; |
|
10 |
import javax.swing.JComboBox; |
|
11 |
import javax.swing.JLabel; |
|
12 |
import javax.swing.JList; |
|
13 |
import javax.swing.JPanel; |
|
14 |
import javax.swing.JScrollPane; |
|
15 |
import javax.swing.JSplitPane; |
|
16 |
import javax.swing.JTabbedPane; |
|
17 |
import javax.swing.JTextArea; |
|
18 |
import javax.swing.JTextField; |
|
19 |
import javax.swing.JTree; |
|
20 |
import javax.swing.border.EmptyBorder; |
|
21 |
|
|
22 |
public class DefaultJExpressionBuilderView2 extends JPanel { |
|
23 |
|
|
24 |
private static class GridBagConstraintsBuilder { |
|
25 |
|
|
26 |
private GridBagConstraints gbc; |
|
27 |
|
|
28 |
public GridBagConstraintsBuilder() { |
|
29 |
this.gbc = new GridBagConstraints(); |
|
30 |
this.gbc.insets = new Insets(1, 1, 1, 1); |
|
31 |
} |
|
32 |
|
|
33 |
public GridBagConstraintsBuilder clear() { |
|
34 |
this.gbc = new GridBagConstraints(); |
|
35 |
this.gbc.insets = new Insets(1, 1, 1, 1); |
|
36 |
return this; |
|
37 |
} |
|
38 |
|
|
39 |
public GridBagConstraints get() { |
|
40 |
return this.gbc; |
|
41 |
} |
|
42 |
|
|
43 |
public GridBagConstraintsBuilder insets(int top, int left, int bottom, int right) { |
|
44 |
this.gbc.insets = new Insets(top, left, bottom, right); |
|
45 |
return this; |
|
46 |
} |
|
47 |
|
|
48 |
public GridBagConstraintsBuilder anchor(int anchor) { |
|
49 |
this.gbc.anchor = anchor; |
|
50 |
return this; |
|
51 |
} |
|
52 |
|
|
53 |
public GridBagConstraintsBuilder fill(int fill) { |
|
54 |
this.gbc.fill = fill; |
|
55 |
return this; |
|
56 |
} |
|
57 |
|
|
58 |
public GridBagConstraintsBuilder growx(float growx) { |
|
59 |
this.gbc.weightx = growx; |
|
60 |
return this; |
|
61 |
} |
|
62 |
|
|
63 |
public GridBagConstraintsBuilder growy(float growy) { |
|
64 |
this.gbc.weighty = growy; |
|
65 |
return this; |
|
66 |
} |
|
67 |
|
|
68 |
public GridBagConstraintsBuilder grow(float growx, float growy) { |
|
69 |
this.gbc.weightx = growx; |
|
70 |
this.gbc.weighty = growy; |
|
71 |
return this; |
|
72 |
} |
|
73 |
|
|
74 |
public GridBagConstraintsBuilder nogrow() { |
|
75 |
this.gbc.weightx = 0; |
|
76 |
this.gbc.weighty = 0; |
|
77 |
return this; |
|
78 |
} |
|
79 |
|
|
80 |
public GridBagConstraintsBuilder xy(int x, int y) { |
|
81 |
this.gbc.gridx = x; |
|
82 |
this.gbc.gridy = y; |
|
83 |
return this; |
|
84 |
} |
|
85 |
|
|
86 |
private GridBagConstraintsBuilder colspan(int n) { |
|
87 |
this.gbc.gridwidth = n; |
|
88 |
return this; |
|
89 |
} |
|
90 |
|
|
91 |
private GridBagConstraintsBuilder rowspan(int n) { |
|
92 |
this.gbc.gridheight = n; |
|
93 |
return this; |
|
94 |
} |
|
95 |
|
|
96 |
private GridBagConstraintsBuilder span(int cols, int rows) { |
|
97 |
this.gbc.gridwidth = cols; |
|
98 |
this.gbc.gridheight = rows; |
|
99 |
return this; |
|
100 |
} |
|
101 |
|
|
102 |
private GridBagConstraintsBuilder nospan() { |
|
103 |
this.gbc.gridwidth = 1; |
|
104 |
this.gbc.gridheight = 1; |
|
105 |
return this; |
|
106 |
} |
|
107 |
|
|
108 |
} |
|
109 |
|
|
110 |
JTabbedPane tabExpressionBuilder = new JTabbedPane(); |
|
111 |
|
|
112 |
JList lstSimpleElement = new JList(); |
|
113 |
JScrollPane scrSimpleElement = new JScrollPane(); |
|
114 |
|
|
115 |
JTree treeElements = new JTree(); |
|
116 |
JScrollPane scrElements = new JScrollPane(); |
|
117 |
|
|
118 |
JTextArea txtExpression = new JTextArea(); |
|
119 |
JScrollPane scrExpression = new JScrollPane(); |
|
120 |
|
|
121 |
JButton btnHistory = new JButton(); |
|
122 |
JButton btnBookmarks = new JButton(); |
|
123 |
JButton btnEq = new JButton(); |
|
124 |
JButton btnNeq = new JButton(); |
|
125 |
JButton btnAdd = new JButton(); |
|
126 |
JButton btnSubst = new JButton(); |
|
127 |
JButton btnMult = new JButton(); |
|
128 |
JButton btnDiv = new JButton(); |
|
129 |
JButton btnParentOpen = new JButton(); |
|
130 |
JButton btnParentClose = new JButton(); |
|
131 |
JLabel lblMsg = new JLabel(); |
|
132 |
JButton btnTip = new JButton(); |
|
133 |
JLabel lblColumn = new JLabel(); |
|
134 |
JTextField txtGroupElement = new JTextField(); |
|
135 |
JButton btnGroupElementInsert = new JButton(); |
|
136 |
JButton btnSimpleElementInsert = new JButton(); |
|
137 |
JButton btnSimpleElementSortDown = new JButton(); |
|
138 |
JButton btnSimpleElementSortUp = new JButton(); |
|
139 |
JLabel lblSimpleElementsMsg = new JLabel(); |
|
140 |
JButton btnSimpleElementTimeLimit = new JButton(); |
|
141 |
JTextField txtSimpleElementFilter = new JTextField(); |
|
142 |
JButton btnSimpleElementFilter = new JButton(); |
|
143 |
JPanel pnlDescription = new JPanel(); |
|
144 |
JPanel pnlScriptEditorContainer = new JPanel(); |
|
145 |
JComboBox cboPickerScripts = new JComboBox(); |
|
146 |
JButton btnPickerRemove = new JButton(); |
|
147 |
JButton btnPickerSelectScript = new JButton(); |
|
148 |
|
|
149 |
JSplitPane spnlExpression = new JSplitPane(JSplitPane.VERTICAL_SPLIT); |
|
150 |
JSplitPane spnlBottom = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); |
|
151 |
JSplitPane spnlItem = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); |
|
152 |
|
|
153 |
JPanel pnlTop; |
|
154 |
JPanel pnlElement; |
|
155 |
|
|
156 |
/** |
|
157 |
* Default constructor |
|
158 |
*/ |
|
159 |
public DefaultJExpressionBuilderView2() { |
|
160 |
initComponents(); |
|
161 |
} |
|
162 |
|
|
163 |
private void initComponents() { |
|
164 |
EmptyBorder emptyborder2x2 = new EmptyBorder(2, 2, 2, 2); |
|
165 |
|
|
166 |
lstSimpleElement.setName("lstSimpleElement"); |
|
167 |
|
|
168 |
treeElements.setName("treeElements"); |
|
169 |
pnlDescription.setName("pnlDescription"); |
|
170 |
txtExpression.setLineWrap(true); |
|
171 |
txtExpression.setName("txtExpression"); |
|
172 |
txtExpression.setRows(2); |
|
173 |
|
|
174 |
|
|
175 |
btnHistory.setActionCommand("+"); |
|
176 |
btnHistory.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-history.png")); |
|
177 |
btnHistory.setName("btnHistory"); |
|
178 |
btnHistory.setText(""); |
|
179 |
btnHistory.setBorder(emptyborder2x2); |
|
180 |
|
|
181 |
btnBookmarks.setActionCommand("+"); |
|
182 |
btnBookmarks.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-bookmarks.png")); |
|
183 |
btnBookmarks.setName("btnBookmarks"); |
|
184 |
btnBookmarks.setText(""); |
|
185 |
btnBookmarks.setBorder(emptyborder2x2); |
|
186 |
|
|
187 |
btnEq.setActionCommand("+"); |
|
188 |
btnEq.setName("btnEq"); |
|
189 |
btnEq.setText("="); |
|
190 |
btnEq.setBorder(emptyborder2x2); |
|
191 |
|
|
192 |
btnNeq.setActionCommand("+"); |
|
193 |
btnNeq.setName("btnNeq"); |
|
194 |
btnNeq.setText("<>"); |
|
195 |
btnNeq.setBorder(emptyborder2x2); |
|
196 |
|
|
197 |
btnAdd.setActionCommand("+"); |
|
198 |
btnAdd.setName("btnAdd"); |
|
199 |
btnAdd.setText("+"); |
|
200 |
btnAdd.setBorder(emptyborder2x2); |
|
201 |
|
|
202 |
btnSubst.setActionCommand("+"); |
|
203 |
btnSubst.setName("btnSubst"); |
|
204 |
btnSubst.setText("-"); |
|
205 |
btnSubst.setBorder(emptyborder2x2); |
|
206 |
|
|
207 |
btnMult.setActionCommand("+"); |
|
208 |
btnMult.setName("btnMult"); |
|
209 |
btnMult.setText("*"); |
|
210 |
btnMult.setBorder(emptyborder2x2); |
|
211 |
|
|
212 |
btnDiv.setActionCommand("+"); |
|
213 |
btnDiv.setName("btnDiv"); |
|
214 |
btnDiv.setText("/"); |
|
215 |
btnDiv.setBorder(emptyborder2x2); |
|
216 |
|
|
217 |
btnParentOpen.setActionCommand("+"); |
|
218 |
btnParentOpen.setName("btnParentOpen"); |
|
219 |
btnParentOpen.setText("("); |
|
220 |
btnParentOpen.setBorder(emptyborder2x2); |
|
221 |
|
|
222 |
btnParentClose.setActionCommand("+"); |
|
223 |
btnParentClose.setName("btnParentClose"); |
|
224 |
btnParentClose.setText(")"); |
|
225 |
btnParentClose.setBorder(emptyborder2x2); |
|
226 |
|
|
227 |
lblMsg.setName("lblMsg"); |
|
228 |
|
|
229 |
btnTip.setActionCommand("+"); |
|
230 |
btnTip.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-tip.png.png")); |
|
231 |
btnTip.setName("btnTip"); |
|
232 |
btnTip.setBorder(emptyborder2x2); |
|
233 |
|
|
234 |
lblColumn.setName("lblColumn"); |
|
235 |
lblColumn.setText("0"); |
|
236 |
|
|
237 |
txtGroupElement.setBackground(new Color(236, 233, 216)); |
|
238 |
txtGroupElement.setEditable(false); |
|
239 |
txtGroupElement.setName("txtGroupElement"); |
|
240 |
|
|
241 |
btnGroupElementInsert.setActionCommand("+"); |
|
242 |
btnGroupElementInsert.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-insert-text.png")); |
|
243 |
btnGroupElementInsert.setName("btnGroupElementInsert"); |
|
244 |
btnGroupElementInsert.setBorder(emptyborder2x2); |
|
245 |
|
|
246 |
btnSimpleElementInsert.setActionCommand("+"); |
|
247 |
btnSimpleElementInsert.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-insert-text.png")); |
|
248 |
btnSimpleElementInsert.setName("btnSimpleElementInsert"); |
|
249 |
btnSimpleElementInsert.setBorder(emptyborder2x2); |
|
250 |
|
|
251 |
btnSimpleElementSortDown.setActionCommand("+"); |
|
252 |
btnSimpleElementSortDown.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-sortdown.png")); |
|
253 |
btnSimpleElementSortDown.setName("btnSimpleElementSortDown"); |
|
254 |
btnSimpleElementSortDown.setBorder(emptyborder2x2); |
|
255 |
|
|
256 |
btnSimpleElementSortUp.setActionCommand("+"); |
|
257 |
btnSimpleElementSortUp.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-sortup.png")); |
|
258 |
btnSimpleElementSortUp.setName("btnSimpleElementSortUp"); |
|
259 |
btnSimpleElementSortUp.setBorder(emptyborder2x2); |
|
260 |
|
|
261 |
lblSimpleElementsMsg.setName("lblSimpleElementsMsg"); |
|
262 |
|
|
263 |
btnSimpleElementTimeLimit.setActionCommand("+"); |
|
264 |
btnSimpleElementTimeLimit.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-time-limit.png")); |
|
265 |
btnSimpleElementTimeLimit.setName("btnSimpleElementTimeLimit"); |
|
266 |
btnSimpleElementTimeLimit.setBorder(emptyborder2x2); |
|
267 |
|
|
268 |
txtSimpleElementFilter.setName("txtSimpleElementFilter"); |
|
269 |
|
|
270 |
btnSimpleElementFilter.setActionCommand("+"); |
|
271 |
btnSimpleElementFilter.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-filter-values.png")); |
|
272 |
btnSimpleElementFilter.setName("btnSimpleElementFilter"); |
|
273 |
btnSimpleElementFilter.setBorder(emptyborder2x2); |
|
274 |
|
|
275 |
pnlScriptEditorContainer.setName("pnlScriptEditorContainer"); |
|
276 |
|
|
277 |
cboPickerScripts.setName("cboPickerScripts"); |
|
278 |
|
|
279 |
btnPickerRemove.setActionCommand("+"); |
|
280 |
btnPickerRemove.setName("btnPickerRemove"); |
|
281 |
btnPickerRemove.setText("R"); |
|
282 |
btnPickerRemove.setBorder(emptyborder2x2); |
|
283 |
|
|
284 |
btnPickerSelectScript.setActionCommand("+"); |
Also available in: Unified diff