svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.swing / org.gvsig.fmap.dal.swing.impl / src / main / java / org / gvsig / fmap / dal / swing / impl / featuretype / DefaultFeatureTypePanel.java @ 44500
History | View | Annotate | Download (17.1 KB)
1 | 44077 | jjdelcerro | package org.gvsig.fmap.dal.swing.impl.featuretype; |
---|---|---|---|
2 | |||
3 | 44096 | jjdelcerro | import org.gvsig.fmap.dal.swing.featuretype.FeatureTypePanel; |
4 | 44077 | jjdelcerro | import java.awt.BorderLayout; |
5 | 44085 | jjdelcerro | import java.awt.Dimension; |
6 | import java.awt.event.ActionEvent; |
||
7 | import java.awt.event.ActionListener; |
||
8 | import java.util.Date; |
||
9 | 44077 | jjdelcerro | import java.util.Objects; |
10 | import javax.swing.JComponent; |
||
11 | 44149 | jjdelcerro | import javax.swing.JOptionPane; |
12 | 44478 | jjdelcerro | import javax.swing.event.ChangeListener; |
13 | 44077 | jjdelcerro | import javax.swing.event.ListSelectionEvent; |
14 | import javax.swing.event.ListSelectionListener; |
||
15 | 44085 | jjdelcerro | import javax.swing.event.TableModelEvent; |
16 | 44077 | jjdelcerro | import javax.swing.table.AbstractTableModel; |
17 | 44149 | jjdelcerro | import org.apache.commons.lang3.StringUtils; |
18 | 44085 | jjdelcerro | import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor; |
19 | 44077 | jjdelcerro | import org.gvsig.fmap.dal.feature.EditableFeatureType; |
20 | import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
||
21 | 44085 | jjdelcerro | import org.gvsig.fmap.dal.feature.FeatureStore; |
22 | 44077 | jjdelcerro | import org.gvsig.fmap.dal.feature.FeatureType; |
23 | 44085 | jjdelcerro | import org.gvsig.tools.ToolsLocator; |
24 | import org.gvsig.tools.dataTypes.DataTypes; |
||
25 | 44253 | jjdelcerro | import org.gvsig.tools.dynobject.DynStruct_v2; |
26 | 44085 | jjdelcerro | import org.gvsig.tools.i18n.I18nManager; |
27 | 44478 | jjdelcerro | import org.gvsig.tools.swing.api.ChangeListenerHelper; |
28 | 44128 | jjdelcerro | import org.gvsig.tools.swing.api.ToolsSwingLocator; |
29 | import org.gvsig.tools.swing.api.ToolsSwingManager; |
||
30 | 44500 | omartinez | import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager; |
31 | 44149 | jjdelcerro | import org.slf4j.Logger; |
32 | import org.slf4j.LoggerFactory; |
||
33 | 44077 | jjdelcerro | |
34 | /**
|
||
35 | *
|
||
36 | * @author jjdelcerro
|
||
37 | */
|
||
38 | public class DefaultFeatureTypePanel |
||
39 | extends FeatureTypePanelView
|
||
40 | implements FeatureTypePanel
|
||
41 | { |
||
42 | |||
43 | 44149 | jjdelcerro | private static final Logger LOGGER = LoggerFactory.getLogger(DefaultFeatureTypePanel.class); |
44 | 44500 | omartinez | private FeatureType originalFeatureType;
|
45 | |||
46 | 44077 | jjdelcerro | private class FeatureTypeTableModel extends AbstractTableModel { |
47 | |||
48 | private final FeatureType featureType; |
||
49 | private final String[] columnNames = new String[] { |
||
50 | "Name",
|
||
51 | "Type",
|
||
52 | "Size",
|
||
53 | "Precision",
|
||
54 | "Default value",
|
||
55 | 44085 | jjdelcerro | "Calculated"
|
56 | 44077 | jjdelcerro | }; |
57 | private final Class[] columnClasses = new Class[] { |
||
58 | String.class,
|
||
59 | String.class,
|
||
60 | Integer.class,
|
||
61 | Integer.class,
|
||
62 | String.class,
|
||
63 | Boolean.class
|
||
64 | }; |
||
65 | |||
66 | public FeatureTypeTableModel() {
|
||
67 | this.featureType = null; |
||
68 | } |
||
69 | |||
70 | public FeatureTypeTableModel(FeatureType featureType) {
|
||
71 | this.featureType = featureType;
|
||
72 | } |
||
73 | |||
74 | @Override
|
||
75 | public int getRowCount() { |
||
76 | if( this.featureType==null ) { |
||
77 | return 0; |
||
78 | } |
||
79 | return this.featureType.size(); |
||
80 | } |
||
81 | |||
82 | @Override
|
||
83 | public int getColumnCount() { |
||
84 | if( this.featureType==null ) { |
||
85 | return 0; |
||
86 | } |
||
87 | return this.columnNames.length; |
||
88 | } |
||
89 | |||
90 | @Override
|
||
91 | public String getColumnName(int columnIndex) { |
||
92 | if( this.featureType==null ) { |
||
93 | return ""; |
||
94 | } |
||
95 | return this.columnNames[columnIndex]; |
||
96 | } |
||
97 | |||
98 | @Override
|
||
99 | public Class<?> getColumnClass(int columnIndex) { |
||
100 | if( this.featureType==null ) { |
||
101 | return String.class; |
||
102 | } |
||
103 | return this.columnClasses[columnIndex]; |
||
104 | } |
||
105 | |||
106 | @Override
|
||
107 | public boolean isCellEditable(int rowIndex, int columnIndex) { |
||
108 | return false; |
||
109 | } |
||
110 | |||
111 | @Override
|
||
112 | public Object getValueAt(int rowIndex, int columnIndex) { |
||
113 | if( this.featureType==null ) { |
||
114 | return ""; |
||
115 | } |
||
116 | FeatureAttributeDescriptor descriptor = this.featureType.getAttributeDescriptor(rowIndex);
|
||
117 | switch(columnIndex) {
|
||
118 | case 0: |
||
119 | return descriptor.getName();
|
||
120 | case 1: |
||
121 | return descriptor.getDataTypeName();
|
||
122 | case 2: |
||
123 | return descriptor.getSize();
|
||
124 | case 3: |
||
125 | return descriptor.getPrecision();
|
||
126 | case 4: |
||
127 | return Objects.toString(descriptor.getDefaultValue(),""); |
||
128 | case 5: |
||
129 | return descriptor.isComputed();
|
||
130 | default:
|
||
131 | return ""; |
||
132 | } |
||
133 | } |
||
134 | |||
135 | @Override
|
||
136 | public void setValueAt(Object aValue, int rowIndex, int columnIndex) { |
||
137 | } |
||
138 | 44085 | jjdelcerro | |
139 | public void fireUpdateEvent() { |
||
140 | this.fireTableChanged(new TableModelEvent(this)); |
||
141 | } |
||
142 | 44077 | jjdelcerro | } |
143 | |||
144 | private DefaultFeatureTypeAttributePanel descriptorPanel;
|
||
145 | private FeatureType featureType;
|
||
146 | 44085 | jjdelcerro | private boolean editable; |
147 | private FeatureTypeTableModel tableModel;
|
||
148 | private FeatureStore store;
|
||
149 | 44149 | jjdelcerro | private int currentRow; |
150 | private boolean fieldSelectionAllowed; |
||
151 | 44253 | jjdelcerro | private TagsController tagsController;
|
152 | 44478 | jjdelcerro | private ChangeListenerHelper changeListenerHelper;
|
153 | 44077 | jjdelcerro | |
154 | public DefaultFeatureTypePanel() {
|
||
155 | 44085 | jjdelcerro | this.editable = true; |
156 | 44149 | jjdelcerro | this.currentRow = -1; |
157 | this.fieldSelectionAllowed = true; |
||
158 | 44077 | jjdelcerro | this.initComponents();
|
159 | } |
||
160 | |||
161 | 44351 | jjdelcerro | @SuppressWarnings("Convert2Lambda") |
162 | 44077 | jjdelcerro | private void initComponents() { |
163 | 44128 | jjdelcerro | ToolsSwingManager swingManager = ToolsSwingLocator.getToolsSwingManager(); |
164 | |||
165 | 44478 | jjdelcerro | this.changeListenerHelper = swingManager.createChangeListenerHelper();
|
166 | |||
167 | 44128 | jjdelcerro | swingManager.translate(this.btnDelete);
|
168 | swingManager.translate(this.btnFormFieldAccept);
|
||
169 | swingManager.translate(this.btnFormFieldDiscard);
|
||
170 | swingManager.translate(this.btnFormFieldModify);
|
||
171 | swingManager.translate(this.btnNew);
|
||
172 | 44253 | jjdelcerro | swingManager.translate(this.lblLabel);
|
173 | swingManager.translate(this.lblDescription);
|
||
174 | swingManager.translate(this.lblTags);
|
||
175 | swingManager.translate(this.tabFeatureType);
|
||
176 | 44128 | jjdelcerro | |
177 | 44085 | jjdelcerro | this.tableModel = new FeatureTypeTableModel(); |
178 | this.tblFields.setModel(this.tableModel); |
||
179 | 44077 | jjdelcerro | this.tblFields.getSelectionModel().addListSelectionListener(new ListSelectionListener() { |
180 | @Override
|
||
181 | public void valueChanged(ListSelectionEvent e) { |
||
182 | 44128 | jjdelcerro | if( e.getValueIsAdjusting() ) {
|
183 | return;
|
||
184 | } |
||
185 | 44149 | jjdelcerro | doChangeFieldSelection(); |
186 | 44077 | jjdelcerro | } |
187 | }); |
||
188 | this.descriptorPanel = new DefaultFeatureTypeAttributePanel(); |
||
189 | this.pnlField.setLayout(new BorderLayout()); |
||
190 | this.pnlField.add(this.descriptorPanel, BorderLayout.CENTER); |
||
191 | this.descriptorPanel.setEnabled(false); |
||
192 | 44085 | jjdelcerro | |
193 | 44128 | jjdelcerro | this.btnFormFieldModify.addActionListener(new ActionListener() { |
194 | @Override
|
||
195 | public void actionPerformed(ActionEvent e) { |
||
196 | doFormFieldModify(); |
||
197 | } |
||
198 | }); |
||
199 | 44085 | jjdelcerro | this.btnFormFieldDiscard.addActionListener(new ActionListener() { |
200 | @Override
|
||
201 | public void actionPerformed(ActionEvent e) { |
||
202 | 44149 | jjdelcerro | doFormFieldDiscard(); |
203 | 44085 | jjdelcerro | } |
204 | }); |
||
205 | this.btnFormFieldAccept.addActionListener(new ActionListener() { |
||
206 | @Override
|
||
207 | public void actionPerformed(ActionEvent e) { |
||
208 | 44149 | jjdelcerro | doFormFieldAccept(); |
209 | 44085 | jjdelcerro | } |
210 | }); |
||
211 | this.btnNew.addActionListener(new ActionListener() { |
||
212 | @Override
|
||
213 | public void actionPerformed(ActionEvent e) { |
||
214 | doNewField(); |
||
215 | } |
||
216 | }); |
||
217 | this.btnDelete.addActionListener(new ActionListener() { |
||
218 | @Override
|
||
219 | public void actionPerformed(ActionEvent e) { |
||
220 | doDeleteField(); |
||
221 | } |
||
222 | }); |
||
223 | |||
224 | 44253 | jjdelcerro | this.tagsController = new TagsController( |
225 | tblTags, |
||
226 | cboTagsName, |
||
227 | 44351 | jjdelcerro | cboTagsValue, |
228 | 44253 | jjdelcerro | btnTagsAdd, |
229 | btnTagsUpdate, |
||
230 | btnTagsRemove, |
||
231 | lblTagsDescription |
||
232 | ); |
||
233 | |||
234 | |||
235 | 44478 | jjdelcerro | this.setPreferredSize(new Dimension(700, 500)); |
236 | 44128 | jjdelcerro | if( this.tblFields.getRowCount()>0 ) { |
237 | this.tblFields.getSelectionModel().setSelectionInterval(0, 0); |
||
238 | doFormFieldPut(); |
||
239 | } |
||
240 | 44077 | jjdelcerro | } |
241 | |||
242 | 44152 | jjdelcerro | private boolean doFormFieldFetch() { |
243 | 44077 | jjdelcerro | int row = this.tblFields.getSelectedRow(); |
244 | if( row<0 ) { |
||
245 | 44152 | jjdelcerro | return true; |
246 | 44077 | jjdelcerro | } |
247 | FeatureAttributeDescriptor descriptor = this.featureType.getAttributeDescriptor(row);
|
||
248 | 44500 | omartinez | int previousType = descriptor.getType();
|
249 | 44085 | jjdelcerro | if( descriptor instanceof EditableFeatureAttributeDescriptor ) { |
250 | 44152 | jjdelcerro | if( this.descriptorPanel.fetch((EditableFeatureAttributeDescriptor) descriptor)==null ) { |
251 | return false; |
||
252 | } |
||
253 | 44085 | jjdelcerro | this.tableModel.fireUpdateEvent();
|
254 | } |
||
255 | 44500 | omartinez | |
256 | FeatureAttributeDescriptor oldDescriptor = this.originalFeatureType.getAttributeDescriptor(descriptor.getName());
|
||
257 | if (oldDescriptor !=null && |
||
258 | oldDescriptor.getDataType()!=descriptor.getDataType() && |
||
259 | previousType != descriptor.getType()) { |
||
260 | ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager(); |
||
261 | I18nManager i18manager = ToolsLocator.getI18nManager(); |
||
262 | StringBuilder message = new StringBuilder(); |
||
263 | |||
264 | String[] messageArgs = new String[]{oldDescriptor.getName()}; |
||
265 | message.append(i18manager.getTranslation("_Already_existed_a_field_named_XfieldnameX_but_with_different_data_type", messageArgs));
|
||
266 | message.append(".\n");
|
||
267 | message.append(i18manager.getTranslation("_Values_of_data_will_try_to_coerce_to_this_type"));
|
||
268 | dialogs.messageDialog( |
||
269 | message.toString(), |
||
270 | null,
|
||
271 | i18manager.getTranslation("_Values_will_change"),
|
||
272 | JOptionPane.INFORMATION_MESSAGE,
|
||
273 | "feature-type-manager-field-already-exist-in-previous-schema");
|
||
274 | } |
||
275 | |||
276 | |||
277 | 44152 | jjdelcerro | return true; |
278 | 44085 | jjdelcerro | } |
279 | |||
280 | private void doFormFieldPut() { |
||
281 | int row = this.tblFields.getSelectedRow(); |
||
282 | if( row<0 ) { |
||
283 | return;
|
||
284 | } |
||
285 | FeatureAttributeDescriptor descriptor = this.featureType.getAttributeDescriptor(row);
|
||
286 | 44149 | jjdelcerro | this.currentRow = row;
|
287 | 44077 | jjdelcerro | this.descriptorPanel.put(descriptor);
|
288 | 44149 | jjdelcerro | updateButtonState(); |
289 | 44085 | jjdelcerro | if( descriptor instanceof EditableFeatureAttributeDescriptor ) { |
290 | 44128 | jjdelcerro | this.btnFormFieldModify.setEnabled(this.editable); |
291 | } else {
|
||
292 | this.btnFormFieldModify.setEnabled(false); |
||
293 | } |
||
294 | } |
||
295 | |||
296 | 44149 | jjdelcerro | private void updateButtonState() { |
297 | this.descriptorPanel.setEnabled(true); |
||
298 | this.descriptorPanel.setEditable(false); |
||
299 | this.btnFormFieldAccept.setEnabled(false); |
||
300 | this.btnFormFieldDiscard.setEnabled(false); |
||
301 | this.btnFormFieldModify.setEnabled(this.editable); |
||
302 | 44164 | jjdelcerro | this.btnNew.setEnabled(this.editable); |
303 | this.btnDelete.setEnabled(this.editable); |
||
304 | 44149 | jjdelcerro | } |
305 | |||
306 | 44128 | jjdelcerro | private void doFormFieldModify() { |
307 | int row = this.tblFields.getSelectedRow(); |
||
308 | if( row<0 ) { |
||
309 | return;
|
||
310 | } |
||
311 | FeatureAttributeDescriptor descriptor = this.featureType.getAttributeDescriptor(row);
|
||
312 | this.descriptorPanel.put(descriptor);
|
||
313 | this.descriptorPanel.setEnabled(true); |
||
314 | this.btnFormFieldAccept.setEnabled(this.editable); |
||
315 | this.btnFormFieldDiscard.setEnabled(this.editable); |
||
316 | this.btnFormFieldModify.setEnabled(false); |
||
317 | 44152 | jjdelcerro | this.btnNew.setEnabled(false); |
318 | this.btnDelete.setEnabled(false); |
||
319 | 44128 | jjdelcerro | if( descriptor instanceof EditableFeatureAttributeDescriptor ) { |
320 | 44085 | jjdelcerro | this.descriptorPanel.setEditable(this.editable); |
321 | } else {
|
||
322 | this.descriptorPanel.setEditable(false); |
||
323 | } |
||
324 | 44149 | jjdelcerro | this.fieldSelectionAllowed = false; |
325 | 44478 | jjdelcerro | this.changeListenerHelper.fireEvent();
|
326 | 44077 | jjdelcerro | } |
327 | |||
328 | 44478 | jjdelcerro | @Override
|
329 | public boolean isModifyingAField() { |
||
330 | return btnFormFieldAccept.isEnabled();
|
||
331 | } |
||
332 | |||
333 | 44149 | jjdelcerro | private void doFormFieldAccept() { |
334 | 44152 | jjdelcerro | int row = this.tblFields.getSelectedRow(); |
335 | if( row<0 ) { |
||
336 | return;
|
||
337 | } |
||
338 | if( doFormFieldFetch() ) {
|
||
339 | this.updateButtonState();
|
||
340 | this.tblFields.getSelectionModel().setSelectionInterval(row, row);
|
||
341 | this.tblFields.scrollRectToVisible(this.tblFields.getCellRect(row, 0, true)); |
||
342 | this.fieldSelectionAllowed = true; |
||
343 | } |
||
344 | 44478 | jjdelcerro | this.changeListenerHelper.fireEvent();
|
345 | 44149 | jjdelcerro | } |
346 | |||
347 | private void doFormFieldDiscard() { |
||
348 | doFormFieldPut(); |
||
349 | this.updateButtonState();
|
||
350 | this.fieldSelectionAllowed = true; |
||
351 | 44478 | jjdelcerro | this.changeListenerHelper.fireEvent();
|
352 | 44149 | jjdelcerro | } |
353 | |||
354 | private void doChangeFieldSelection() { |
||
355 | int row = this.tblFields.getSelectedRow(); |
||
356 | if( row<0 ) { |
||
357 | return;
|
||
358 | } |
||
359 | if( !this.fieldSelectionAllowed ) { |
||
360 | if( row !=this.currentRow ) { |
||
361 | I18nManager i18n = ToolsLocator.getI18nManager(); |
||
362 | JOptionPane.showMessageDialog(
|
||
363 | this,
|
||
364 | i18n.getTranslation("_Before_changing_field_accept_or_discard_the_changes"),
|
||
365 | i18n.getTranslation("_Warning"),
|
||
366 | JOptionPane.WARNING_MESSAGE
|
||
367 | ); |
||
368 | this.tblFields.getSelectionModel().setSelectionInterval(
|
||
369 | this.currentRow,
|
||
370 | this.currentRow
|
||
371 | ); |
||
372 | } |
||
373 | return;
|
||
374 | } |
||
375 | doFormFieldPut(); |
||
376 | } |
||
377 | |||
378 | 44077 | jjdelcerro | @Override
|
379 | public JComponent asJComponent() { |
||
380 | return this; |
||
381 | } |
||
382 | |||
383 | 44351 | jjdelcerro | @Override
|
384 | 44085 | jjdelcerro | public void setEditable(boolean editable) { |
385 | this.editable = editable;
|
||
386 | this.btnNew.setEnabled(editable);
|
||
387 | this.btnDelete.setEnabled(editable);
|
||
388 | 44149 | jjdelcerro | updateButtonState(); |
389 | 44077 | jjdelcerro | } |
390 | |||
391 | @Override
|
||
392 | public EditableFeatureType fetch(EditableFeatureType type) {
|
||
393 | 44253 | jjdelcerro | ((DynStruct_v2)type).setLabel( |
394 | StringUtils.defaultIfBlank(this.txtLabel.getText(), null) |
||
395 | ); |
||
396 | ((DynStruct_v2)type).setDescription( |
||
397 | StringUtils.defaultIfBlank(this.txtDescription.getText(), null) |
||
398 | ); |
||
399 | this.tagsController.fetch(((DynStruct_v2)type).getTags());
|
||
400 | 44077 | jjdelcerro | return type;
|
401 | } |
||
402 | |||
403 | @Override
|
||
404 | public void put(FeatureType type) { |
||
405 | 44500 | omartinez | FeatureType ftypeToCompare = type.getOriginalFeatureType(); |
406 | if (ftypeToCompare==null) { |
||
407 | ftypeToCompare = type; |
||
408 | } |
||
409 | this.originalFeatureType = ftypeToCompare.getCopy();
|
||
410 | 44077 | jjdelcerro | this.featureType = type;
|
411 | 44085 | jjdelcerro | if( type == null ) { |
412 | this.store = null; |
||
413 | } else {
|
||
414 | // Nos quedamos una referencia para evitar que se destruya, ya que
|
||
415 | 44149 | jjdelcerro | // el featureType se guarda solo una WeakReference.
|
416 | 44085 | jjdelcerro | this.store = type.getStore();
|
417 | 44253 | jjdelcerro | this.txtLabel.setText(
|
418 | StringUtils.defaultIfBlank(((DynStruct_v2)type).getLabel(), "")
|
||
419 | ); |
||
420 | this.txtDescription.setText(
|
||
421 | StringUtils.defaultIfBlank(((DynStruct_v2)type).getDescription(), "")
|
||
422 | ); |
||
423 | this.tagsController.set(((DynStruct_v2)type).getTags());
|
||
424 | 44085 | jjdelcerro | } |
425 | if( !(type instanceof EditableFeatureType) ) { |
||
426 | this.setEditable(false); |
||
427 | } |
||
428 | this.tableModel = new FeatureTypeTableModel(type); |
||
429 | this.tblFields.setModel(this.tableModel); |
||
430 | 44149 | jjdelcerro | if( type!=null && !type.isEmpty() ) { |
431 | 44077 | jjdelcerro | this.tblFields.getSelectionModel().setSelectionInterval(0, 0); |
432 | } |
||
433 | 44149 | jjdelcerro | updateButtonState(); |
434 | doFormFieldPut(); |
||
435 | 44077 | jjdelcerro | } |
436 | |||
437 | 44085 | jjdelcerro | private void doNewField() { |
438 | EditableFeatureType eft = (EditableFeatureType)this.featureType;
|
||
439 | EditableFeatureAttributeDescriptor descriptor = eft.add( |
||
440 | 44500 | omartinez | this.featureType.getNewFieldName(),
|
441 | 44152 | jjdelcerro | DataTypes.STRING, |
442 | 50
|
||
443 | 44085 | jjdelcerro | ); |
444 | this.tableModel.fireUpdateEvent();
|
||
445 | int row = descriptor.getIndex();
|
||
446 | this.tblFields.getSelectionModel().addSelectionInterval(row,row);
|
||
447 | 44152 | jjdelcerro | this.tblFields.scrollRectToVisible(this.tblFields.getCellRect(row, 0, true)); |
448 | 44149 | jjdelcerro | updateButtonState(); |
449 | 44478 | jjdelcerro | doFormFieldModify(); |
450 | this.changeListenerHelper.fireEvent();
|
||
451 | 44085 | jjdelcerro | } |
452 | |||
453 | private void doDeleteField() { |
||
454 | int row = this.tblFields.getSelectedRow(); |
||
455 | if( row<0 ) { |
||
456 | return;
|
||
457 | } |
||
458 | 44149 | jjdelcerro | // FeatureAttributeDescriptor descriptor = this.featureType.getAttributeDescriptor(row);
|
459 | 44085 | jjdelcerro | ((EditableFeatureType)this.featureType).remove(row);
|
460 | this.tableModel.fireUpdateEvent();
|
||
461 | if( row >= this.tblFields.getRowCount()) { |
||
462 | row = this.tblFields.getRowCount()-1; |
||
463 | } |
||
464 | this.tblFields.getSelectionModel().addSelectionInterval(row,row);
|
||
465 | 44149 | jjdelcerro | updateButtonState(); |
466 | doFormFieldPut(); |
||
467 | 44478 | jjdelcerro | this.changeListenerHelper.fireEvent();
|
468 | 44085 | jjdelcerro | } |
469 | |||
470 | 44478 | jjdelcerro | @Override
|
471 | public void addChangeListener(ChangeListener listener) { |
||
472 | this.changeListenerHelper.addChangeListener(listener);
|
||
473 | } |
||
474 | |||
475 | @Override
|
||
476 | public ChangeListener[] getChangeListeners() { |
||
477 | return this.changeListenerHelper.getChangeListeners(); |
||
478 | } |
||
479 | |||
480 | @Override
|
||
481 | public void removeChangeListener(ChangeListener listener) { |
||
482 | this.changeListenerHelper.removeChangeListener(listener);
|
||
483 | } |
||
484 | |||
485 | @Override
|
||
486 | public void removeAllChangeListener() { |
||
487 | this.changeListenerHelper.removeAllChangeListener();
|
||
488 | } |
||
489 | |||
490 | @Override
|
||
491 | public boolean hasChangeListeners() { |
||
492 | return this.changeListenerHelper.hasChangeListeners(); |
||
493 | } |
||
494 | |||
495 | 44077 | jjdelcerro | } |