Revision 43989 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/project/documents/table/gui/CreateNewAttributePanel.java
CreateNewAttributePanel.java | ||
---|---|---|
27 | 27 |
import java.awt.GridBagConstraints; |
28 | 28 |
import java.awt.GridBagLayout; |
29 | 29 |
import java.awt.GridLayout; |
30 |
import java.awt.LayoutManager; |
|
31 | 30 |
import java.awt.event.ActionEvent; |
32 | 31 |
import java.awt.event.ActionListener; |
33 | 32 |
import java.awt.event.KeyEvent; |
... | ... | |
49 | 48 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
50 | 49 |
import org.gvsig.app.ApplicationLocator; |
51 | 50 |
import org.gvsig.app.ApplicationManager; |
51 |
import org.gvsig.expressionevaluator.swing.Element; |
|
52 |
import org.gvsig.expressionevaluator.swing.ExpressionEvaluatorSwingLocator; |
|
53 |
import org.gvsig.expressionevaluator.swing.ExpressionEvaluatorSwingManager; |
|
54 |
import org.gvsig.expressionevaluator.swing.ExpressionPickerController; |
|
55 |
import org.gvsig.fmap.dal.DALLocator; |
|
52 | 56 |
import org.gvsig.fmap.dal.DataTypes; |
57 |
import org.gvsig.fmap.dal.expressionevaluator.FeatureAttributeEmulatorExpression; |
|
53 | 58 |
import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor; |
54 | 59 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
55 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
|
|
56 |
import org.gvsig.fmap.dal.feature.FeatureAttributeEmulator;
|
|
60 |
import org.gvsig.fmap.dal.feature.FeatureStore;
|
|
61 |
import org.gvsig.fmap.dal.swing.DataSwingManager;
|
|
57 | 62 |
import org.gvsig.gui.beans.AcceptCancelPanel; |
58 | 63 |
import org.gvsig.i18n.Messages; |
59 | 64 |
import org.gvsig.tools.ToolsLocator; |
... | ... | |
120 | 125 |
} |
121 | 126 |
}; |
122 | 127 |
private String[] currentFieldNames; |
128 |
private ExpressionPickerController expressionPicker; |
|
129 |
private FeatureStore store; |
|
123 | 130 |
|
124 |
public CreateNewAttributePanel() { |
|
131 |
// public CreateNewAttributePanel() { |
|
132 |
// super(); |
|
133 |
// initialize(); |
|
134 |
// } |
|
135 |
|
|
136 |
public CreateNewAttributePanel(FeatureStore store) { |
|
125 | 137 |
super(); |
138 |
this.store = store; |
|
126 | 139 |
initialize(); |
127 | 140 |
} |
128 | 141 |
|
129 |
public CreateNewAttributePanel(boolean isDoubleBuffered) { |
|
130 |
super(isDoubleBuffered); |
|
131 |
initialize(); |
|
132 |
} |
|
142 |
// public CreateNewAttributePanel(boolean isDoubleBuffered) { |
|
143 |
// super(isDoubleBuffered); |
|
144 |
// initialize(); |
|
145 |
// } |
|
146 |
// |
|
147 |
// public CreateNewAttributePanel(LayoutManager layout) { |
|
148 |
// super(layout); |
|
149 |
// initialize(); |
|
150 |
// } |
|
151 |
// |
|
152 |
// public CreateNewAttributePanel(LayoutManager layout, |
|
153 |
// boolean isDoubleBuffered) { |
|
154 |
// super(layout, isDoubleBuffered); |
|
155 |
// initialize(); |
|
156 |
// } |
|
133 | 157 |
|
134 |
public CreateNewAttributePanel(LayoutManager layout) { |
|
135 |
super(layout); |
|
136 |
initialize(); |
|
137 |
} |
|
138 |
|
|
139 |
public CreateNewAttributePanel(LayoutManager layout, |
|
140 |
boolean isDoubleBuffered) { |
|
141 |
super(layout, isDoubleBuffered); |
|
142 |
initialize(); |
|
143 |
} |
|
144 |
|
|
145 | 158 |
public WindowInfo getWindowInfo() { |
146 | 159 |
if (viewInfo == null) { |
147 | 160 |
viewInfo = new WindowInfo(WindowInfo.MODALDIALOG); |
... | ... | |
164 | 177 |
this.setPreferredSize(new java.awt.Dimension(300, 310)); |
165 | 178 |
this.add(getJPanel(), java.awt.BorderLayout.CENTER); |
166 | 179 |
this.add(getJPanelOkCancel(), java.awt.BorderLayout.SOUTH); |
180 |
|
|
181 |
jBtnExpression.setText(""); |
|
182 |
ExpressionEvaluatorSwingManager manager = ExpressionEvaluatorSwingLocator.getManager(); |
|
183 |
this.expressionPicker = manager.createExpressionPickerController(jTxtExpression, jBtnExpression); |
|
184 |
if( this.store != null ) { |
|
185 |
Element element = manager.createElement( |
|
186 |
DataSwingManager.FEATURE_STORE_EXPRESSION_ELEMENT, |
|
187 |
this.expressionPicker, |
|
188 |
this.store |
|
189 |
); |
|
190 |
if( element != null ) { |
|
191 |
this.expressionPicker.getElements().add(element); |
|
192 |
} |
|
193 |
} |
|
167 | 194 |
} |
168 | 195 |
|
169 | 196 |
/** |
... | ... | |
336 | 363 |
} |
337 | 364 |
EditableFeatureAttributeDescriptor ead = null; |
338 | 365 |
if (getJRdbFieldVirtual().isSelected()) { |
339 |
String code = getJTxtExpression().getText(); |
|
340 |
EmulatedFieldExpression myEmulated = |
|
341 |
new EmulatedFieldExpression( |
|
342 |
featureType, |
|
343 |
code); |
|
366 |
FeatureAttributeEmulatorExpression myEmulated = DALLocator.getDataManager().createFeatureAttributeEmulatorExpression( |
|
367 |
featureType, |
|
368 |
this.expressionPicker.get() |
|
369 |
); |
|
344 | 370 |
if (!myEmulated.isValid()) { |
345 | 371 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
346 | 372 |
ApplicationManager application = ApplicationLocator.getManager(); |
Also available in: Unified diff