Revision 44505

View differences:

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
5 5
import java.awt.Dimension;
6 6
import java.awt.event.ActionEvent;
7 7
import java.awt.event.ActionListener;
8
import java.util.Date;
9 8
import java.util.Objects;
10 9
import javax.swing.JComponent;
11 10
import javax.swing.JOptionPane;
......
15 14
import javax.swing.event.TableModelEvent;
16 15
import javax.swing.table.AbstractTableModel;
17 16
import org.apache.commons.lang3.StringUtils;
17
import org.gvsig.configurableactions.ConfigurableActionsMamager;
18
import org.gvsig.expressionevaluator.ExpressionUtils;
18 19
import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor;
19 20
import org.gvsig.fmap.dal.feature.EditableFeatureType;
20 21
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
......
28 29
import org.gvsig.tools.swing.api.ToolsSwingLocator;
29 30
import org.gvsig.tools.swing.api.ToolsSwingManager;
30 31
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
32
import org.gvsig.tools.util.ToolsUtilLocator;
31 33
import org.slf4j.Logger;
32 34
import org.slf4j.LoggerFactory;
33 35

  
......
42 44

  
43 45
    private static final Logger LOGGER = LoggerFactory.getLogger(DefaultFeatureTypePanel.class);
44 46
    private FeatureType originalFeatureType = null;
45
    
47

  
46 48
    private class FeatureTypeTableModel extends AbstractTableModel {
47 49

  
48 50
        private final FeatureType featureType;
......
142 144
    }
143 145
    
144 146
    private DefaultFeatureTypeAttributePanel descriptorPanel;
145
    private FeatureType featureType;
146
    private boolean editable;
147
    private EditableFeatureType featureType;
148
    private int mode;
147 149
    private FeatureTypeTableModel tableModel;
148 150
    private FeatureStore store;
149 151
    private int currentRow;
......
152 154
    private ChangeListenerHelper changeListenerHelper;
153 155
        
154 156
    public DefaultFeatureTypePanel() {
155
        this.editable = true;
157
        this.mode = MODE_SHOW_ONLY;
156 158
        this.currentRow = -1;
157 159
        this.fieldSelectionAllowed = true;
158 160
        this.initComponents();
......
161 163
    @SuppressWarnings("Convert2Lambda")
162 164
    private void initComponents() {
163 165
        ToolsSwingManager swingManager = ToolsSwingLocator.getToolsSwingManager();
166
        ConfigurableActionsMamager cfgActionsManager = ToolsUtilLocator.getConfigurableActionsMamager();
167
        JComponent c = cfgActionsManager.getConfigurableActionsComponent(CONFIGURABLE_PANEL_ID, this);
168
        this.pnlCfgActions.setLayout(new BorderLayout(0,0));
169
        this.pnlCfgActions.add(c, BorderLayout.CENTER);
164 170

  
165 171
        this.changeListenerHelper = swingManager.createChangeListenerHelper();
166 172
        
......
288 294
        this.descriptorPanel.put(descriptor);
289 295
        updateButtonState();
290 296
        if( descriptor instanceof EditableFeatureAttributeDescriptor ) {
291
            this.btnFormFieldModify.setEnabled(this.editable);
297
            this.btnFormFieldModify.setEnabled(this.mode==MODE_EDIT_ALL || this.mode==MODE_EDIT_ONLY_METADATA);
292 298
        } else {
293 299
            this.btnFormFieldModify.setEnabled(false);
294 300
        }
......
296 302
    
297 303
    private void updateButtonState() {
298 304
        this.descriptorPanel.setEnabled(true);
299
        this.descriptorPanel.setEditable(false);
305
        this.descriptorPanel.setMode(MODE_SHOW_ONLY);
300 306
        this.btnFormFieldAccept.setEnabled(false);
301 307
        this.btnFormFieldDiscard.setEnabled(false);
302
        this.btnFormFieldModify.setEnabled(this.editable);
303
        this.btnNew.setEnabled(this.editable);
304
        this.btnDelete.setEnabled(this.editable);
308
        
309
        switch(this.mode) {
310
            case MODE_EDIT_ALL:
311
                this.btnDelete.setEnabled(true);
312
                this.btnFormFieldModify.setEnabled(true);
313
                this.btnNew.setEnabled(true);
314
                this.tagsController.setEditable(true);
315
                this.txtLabel.setEditable(true);
316
                this.txtDescription.setEditable(true);
317
                break;
318
            case MODE_EDIT_ONLY_METADATA:
319
                this.btnDelete.setEnabled(this.descriptorPanel.isVirtualField());
320
                this.btnFormFieldModify.setEnabled(true);
321
                this.btnNew.setEnabled(true);
322
                this.tagsController.setEditable(true);
323
                this.txtLabel.setEditable(true);
324
                this.txtDescription.setEditable(true);
325
                break;
326
            case MODE_SHOW_ONLY:
327
                this.btnDelete.setEnabled(false);
328
                this.btnFormFieldModify.setEnabled(false);
329
                this.btnNew.setEnabled(false);
330
                this.tagsController.setEditable(false);
331
                this.txtLabel.setEditable(false);
332
                this.txtDescription.setEditable(false);
333
                break;
334
        }
305 335
    }
306 336
    
307 337
    private void doFormFieldModify() {
......
311 341
        }
312 342
        FeatureAttributeDescriptor descriptor = this.featureType.getAttributeDescriptor(row);
313 343
        this.descriptorPanel.put(descriptor);
314
        this.descriptorPanel.setEnabled(true);
315
        this.btnFormFieldAccept.setEnabled(this.editable);
316
        this.btnFormFieldDiscard.setEnabled(this.editable);
344
        this.descriptorPanel.setEnabled(this.mode==MODE_EDIT_ALL || this.mode==MODE_EDIT_ONLY_METADATA);
345
        this.btnFormFieldAccept.setEnabled(this.mode==MODE_EDIT_ALL || this.mode==MODE_EDIT_ONLY_METADATA);
346
        this.btnFormFieldDiscard.setEnabled(this.mode==MODE_EDIT_ALL || this.mode==MODE_EDIT_ONLY_METADATA);
317 347
        this.btnFormFieldModify.setEnabled(false);
318 348
        this.btnNew.setEnabled(false);
319 349
        this.btnDelete.setEnabled(false);
320 350
        if( descriptor instanceof EditableFeatureAttributeDescriptor ) {
321
            this.descriptorPanel.setEditable(this.editable);
351
            this.descriptorPanel.setMode(this.mode);
322 352
        } else {
323
            this.descriptorPanel.setEditable(false);
353
            this.descriptorPanel.setMode(MODE_SHOW_ONLY);
324 354
        }
325 355
        this.fieldSelectionAllowed = false;
326 356
        this.changeListenerHelper.fireEvent();
......
382 412
    }
383 413

  
384 414
    @Override
385
    public void setEditable(boolean editable) {
386
        this.editable = editable;
387
        this.btnNew.setEnabled(editable);
388
        this.btnDelete.setEnabled(editable);
415
    public int getMode() {
416
        return this.mode;
417
    }
418
    
419
    @Override
420
    public void setMode(int mode) {
421
        this.mode = mode;
389 422
        updateButtonState();
390 423
    }
391 424

  
392 425
    @Override
393 426
    public EditableFeatureType fetch(EditableFeatureType type) {
394
        ((DynStruct_v2)type).setLabel(
395
                StringUtils.defaultIfBlank(this.txtLabel.getText(), null)
427
        if( type == null ) {
428
            type = (EditableFeatureType) this.featureType.getCopy();
429
        } else {
430
            type.removeAll();
431
            type.addAll(this.featureType);
432
        }
433
        type.setLabel(
434
            StringUtils.defaultIfBlank(this.txtLabel.getText(), null)
396 435
        );
397
        ((DynStruct_v2)type).setDescription(
398
                StringUtils.defaultIfBlank(this.txtDescription.getText(), null)
436
        type.setDescription(
437
            StringUtils.defaultIfBlank(this.txtDescription.getText(), null)
399 438
        );
400
        this.tagsController.fetch(((DynStruct_v2)type).getTags());
439
        this.tagsController.fetch(type.getTags());
401 440
        return type;
402 441
    }
403 442

  
404 443
    @Override
405 444
    public void put(FeatureType type) {
406
        this.featureType = type;
445
        this.featureType = null;
407 446
        this.originalFeatureType = null;
408 447
        if (type == null) {
409 448
            this.store = null;
......
413 452
                ftypeToCompare = type;
414 453
            }
415 454
            this.originalFeatureType = ftypeToCompare.getCopy();
455
            this.featureType = (EditableFeatureType) type.getCopy();
416 456
            // Nos quedamos una referencia para evitar que se destruya, ya que
417 457
            // el featureType se guarda solo una WeakReference.
418 458
            this.store = type.getStore();
......
425 465
            this.tagsController.set(((DynStruct_v2) type).getTags());
426 466
        }
427 467
        if( !(type instanceof EditableFeatureType) ) {
428
            this.setEditable(false);
468
            this.setMode(MODE_SHOW_ONLY);
429 469
        }
430 470
        this.tableModel = new FeatureTypeTableModel(type);
431 471
        this.tblFields.setModel(this.tableModel);
......
443 483
                DataTypes.STRING,
444 484
                50
445 485
        );
486
        if( this.mode == MODE_EDIT_ONLY_METADATA ) {
487
            descriptor.setFeatureAttributeEmulator(ExpressionUtils.createExpression("NULL"));
488
        }
446 489
        this.tableModel.fireUpdateEvent();
447 490
        int row = descriptor.getIndex();
448 491
        this.tblFields.getSelectionModel().addSelectionInterval(row,row);
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/DefaultFeatureTypeAttributePanel.java
51 51
import org.gvsig.fmap.dal.swing.DALSwingLocator;
52 52
import org.gvsig.fmap.dal.swing.DataSwingManager;
53 53
import org.gvsig.fmap.dal.swing.expressionevaluator.FeatureStoreElement;
54
import org.gvsig.fmap.dal.swing.featuretype.FeatureTypePanel;
55
import static org.gvsig.fmap.dal.swing.featuretype.FeatureTypePanel.MODE_EDIT_ALL;
56
import static org.gvsig.fmap.dal.swing.featuretype.FeatureTypePanel.MODE_EDIT_ONLY_METADATA;
57
import static org.gvsig.fmap.dal.swing.featuretype.FeatureTypePanel.MODE_SHOW_ONLY;
54 58
import org.gvsig.fmap.geom.Geometry;
55 59
import org.gvsig.fmap.geom.GeometryLocator;
56 60
import org.gvsig.fmap.geom.GeometryManager;
......
408 412
    private TagsController tagsController;
409 413
    private ForeingKeyController foreingKeyController;
410 414

  
411
    private boolean editable;
415
    private int mode;
412 416
    private FeatureStoreElement featureStoreElement;
413 417

  
414 418
    public DefaultFeatureTypeAttributePanel() {
415
        this.editable = true;
419
        this.mode = FeatureTypePanel.MODE_SHOW_ONLY;
416 420
        DataTypesManager dataManager = ToolsLocator.getDataTypesManager();
417 421
        this.fieldTypes = new ArrayList<>();
418 422
        for (DataType dataType : dataManager) {
......
615 619
            @Override
616 620
            public void stateChanged(ChangeEvent e) {
617 621
                if (chkVirtualField.isSelected()) {
618
                    pickerVirtualField.setEnabled(editable);
622
                    pickerVirtualField.setEditable(mode==MODE_EDIT_ALL || mode==MODE_EDIT_ONLY_METADATA);
619 623
                } else {
620
                    pickerVirtualField.setEnabled(false);
624
                    pickerVirtualField.setEditable(false);
621 625
                }
622 626
            }
623 627
        });
......
715 719
                    StringUtils.defaultIfBlank((String) ListElement.getSelected(cboDataProfile), null)
716 720
            );
717 721

  
718
            if (this.chkVirtualField.isSelected() && this.pickerVirtualField.isEnabled()) {
722
            if (this.chkVirtualField.isSelected() ) { //&& this.pickerVirtualField.isEnabled()) {
719 723
                Expression expression = this.pickerVirtualField.get();
720 724
                if (expression == null) {
721 725
                    descriptor.setFeatureAttributeEmulator((String) null);
......
819 823
        this.chkIsPrimaryKey.setSelected(false);
820 824

  
821 825
        this.chkVirtualField.setSelected(false);
822
        this.chkVirtualField.setEnabled(editable);
823
        this.pickerVirtualField.setEnabled(false);
826
        this.chkVirtualField.setEnabled(this.mode==MODE_EDIT_ALL || this.mode==MODE_EDIT_ONLY_METADATA);
827
        this.pickerVirtualField.setEditable(false);
824 828
        this.pickerVirtualField.set(null);
825 829

  
826 830
        ListElement.setSelected(cboGeometryType, null);
......
880 884
                groupModel.addElement(group);
881 885
            }
882 886
        }
883
        if (!(descriptor instanceof EditableFeatureAttributeDescriptor)) {
884
            this.setEditable(false);
885
        }
886 887

  
887 888
        this.pickerDefaultValue.set(descriptor.getDefaultValue());
888 889
        this.txtFieldName.setText(descriptor.getName());
......
901 902
        this.chkIsAutomatic.setSelected(descriptor.isAutomatic());
902 903
        this.chkIsPrimaryKey.setSelected(descriptor.isPrimaryKey());
903 904

  
905
        this.pickerVirtualField.setEnabled(true);
904 906
        FeatureAttributeEmulator attrEmulator = descriptor.getFeatureAttributeEmulator();
905 907
        if (attrEmulator instanceof FeatureAttributeEmulatorExpression) {
906 908
            Expression expression = ((FeatureAttributeEmulatorExpression) attrEmulator).getExpression();
907
            this.chkVirtualField.setEnabled(editable);
909
            this.chkVirtualField.setEnabled(this.mode==MODE_EDIT_ALL);
908 910
            this.chkVirtualField.setSelected(true);
909
            this.pickerVirtualField.setEnabled(editable);
910 911
            this.pickerVirtualField.set(expression);
911 912
        } else if (descriptor.isComputed()) {
912 913
            this.chkVirtualField.setEnabled(false);
913 914
            this.chkVirtualField.setSelected(true);
914
            this.pickerVirtualField.setEnabled(false);
915 915
            this.pickerVirtualField.set(null);
916 916
        } else {
917
            this.chkVirtualField.setEnabled(editable);
917
            this.chkVirtualField.setEnabled(this.mode==MODE_EDIT_ALL);
918 918
            this.chkVirtualField.setSelected(false);
919
            this.pickerVirtualField.setEnabled(false);
920 919
            this.pickerVirtualField.set(null);
921 920
        }
922 921

  
......
947 946
        this.tagsController.set(descriptor.getTags());
948 947

  
949 948
        this.foreingKeyController.put(descriptor.getForeingKey());
949
        
950
        if (!(descriptor instanceof EditableFeatureAttributeDescriptor)) {
951
            this.setMode(FeatureTypePanel.MODE_SHOW_ONLY);
952
        }
953
        this.updateEditableStates();
950 954
    }
951 955

  
952 956
    private void doFieldTypeChanged() {
......
976 980

  
977 981
            switch (fieldType) {
978 982
                case DataTypes.GEOMETRY:
979
                    this.cboGeometryType.setEnabled(editable);
980
                    this.cboGeometrySubtype.setEnabled(editable);
981
                    this.pickerCRS.setEnabled(editable);
983
                    this.cboGeometryType.setEnabled(this.mode==MODE_EDIT_ALL);
984
                    this.cboGeometrySubtype.setEnabled(this.mode==MODE_EDIT_ALL);
985
                    this.pickerCRS.setEnabled(this.mode==MODE_EDIT_ALL);
982 986
                    this.cboDateFormat.setEnabled(false);
983 987
                    this.pickerIntervalStart.setEnabled(false);
984 988
                    this.pickerIntervalEnd.setEditable(false);
......
997 1001
                    this.cboGeometryType.setEnabled(false);
998 1002
                    this.cboGeometrySubtype.setEnabled(false);
999 1003
                    this.pickerCRS.setEnabled(false);
1000
                    this.cboDateFormat.setEnabled(editable);
1001
                    this.pickerIntervalStart.setEnabled(editable);
1002
                    this.pickerIntervalEnd.setEnabled(editable);
1004
                    this.cboDateFormat.setEnabled(this.mode==MODE_EDIT_ALL || this.mode==MODE_EDIT_ONLY_METADATA);
1005
                    this.pickerIntervalStart.setEnabled(this.mode==MODE_EDIT_ALL || this.mode==MODE_EDIT_ONLY_METADATA);
1006
                    this.pickerIntervalEnd.setEnabled(this.mode==MODE_EDIT_ALL || this.mode==MODE_EDIT_ONLY_METADATA);
1003 1007
                    this.tabAditionalFields.setEnabledAt(1, false);
1004 1008
                    this.tabAditionalFields.setEnabledAt(2, true);
1005 1009
                    this.pickerSize.set(null);
......
1024 1028
                    this.tabAditionalFields.setEnabledAt(2, false);
1025 1029

  
1026 1030
                    this.pickerPrecision.set(null);
1027
                    this.pickerSize.setEnabled(true);
1031
                    this.pickerSize.setEnabled(this.mode==MODE_EDIT_ALL);
1028 1032
                    this.pickerPrecision.setEnabled(false);
1029 1033
                    break;
1030 1034
                case DataTypes.FLOAT:
......
1038 1042
                    this.tabAditionalFields.setEnabledAt(1, false);
1039 1043
                    this.tabAditionalFields.setEnabledAt(2, false);
1040 1044

  
1041
                    this.pickerSize.setEnabled(true);
1042
                    this.pickerPrecision.setEnabled(true);
1045
                    this.pickerSize.setEnabled(this.mode==MODE_EDIT_ALL);
1046
                    this.pickerPrecision.setEnabled(this.mode==MODE_EDIT_ALL);
1043 1047
                    break;
1044 1048
                default:
1045 1049
                    this.cboGeometryType.setEnabled(false);
......
1060 1064
        }
1061 1065

  
1062 1066
    }
1067
    boolean isVirtualField() {
1068
        return this.chkVirtualField.isSelected();
1069
    }
1063 1070

  
1064 1071
    @Override
1065
    public void setEditable(boolean editable) {
1066
        this.editable = editable;
1067
        this.pickerDefaultValue.setEditable(editable);
1068
        this.txtFieldName.setEditable(editable);
1069
//        this.pickerFieldName.setEditable(editable);
1070
        this.pickerIntervalEnd.setEditable(editable);
1071
        this.pickerIntervalStart.setEditable(editable);
1072
        this.pickerPrecision.setEditable(editable);
1073
        this.pickerSize.setEditable(editable);
1074
        this.cboDataProfile.setEnabled(editable);
1072
    public int getMode() {
1073
        return this.mode;
1074
    }
1075
    
1076
    @Override
1077
    public void setMode(int mode) {
1078
        this.mode = mode;
1079
        updateEditableStates();
1080
    }
1081
    
1082
    private void updateEditableStates() {
1083
        switch(this.mode) {
1084
            case MODE_EDIT_ALL:
1085
                this.pickerDefaultValue.setEditable(true);
1086
                this.txtFieldName.setEditable(true);
1087
                this.pickerIntervalEnd.setEditable(true);
1088
                this.pickerIntervalStart.setEditable(true);
1089
                this.pickerPrecision.setEditable(true);
1090
                this.pickerSize.setEditable(true);
1091
                this.cboDataProfile.setEnabled(true);
1075 1092

  
1076
        this.chkAllowNulls.setEnabled(editable);
1077
        this.chkIsAutomatic.setEnabled(editable);
1078
        this.chkIsPrimaryKey.setEnabled(editable);
1093
                this.chkAllowNulls.setEnabled(true);
1094
                this.chkIsAutomatic.setEnabled(true);
1095
                if( this.isVirtualField() ) {
1096
                    this.chkIsPrimaryKey.setEnabled(false);
1097
                } else {
1098
                    this.chkIsPrimaryKey.setEnabled(true);
1099
                }
1079 1100

  
1080
        this.chkVirtualField.setEnabled(editable);
1081
        this.pickerVirtualField.setEditable(editable);
1101
                this.chkVirtualField.setEnabled(true);
1102
                this.pickerVirtualField.setEditable(true);
1082 1103

  
1083
        this.cboDateFormat.setEnabled(editable);
1084
        this.cboFieldType.setEnabled(editable);
1085
        this.cboGeometryType.setEnabled(editable);
1086
        this.cboGeometrySubtype.setEnabled(editable);
1087
        this.pickerCRS.setEditable(editable);
1104
                this.cboDateFormat.setEnabled(true);
1105
                this.cboFieldType.setEnabled(true);
1106
                this.cboGeometryType.setEnabled(true);
1107
                this.cboGeometrySubtype.setEnabled(true);
1108
                this.pickerCRS.setEditable(true);
1088 1109

  
1089
        this.cboGroup.setEnabled(editable);
1090
        this.pickerOrder.setEditable(editable);
1091
        this.chkHidden.setEnabled(editable);
1092
        this.txtLabel.setEditable(editable);
1093
        this.txtDescription.setEditable(editable);
1094
        this.txtMinValue.setEditable(false);
1095
        this.txtMaxValue.setEditable(false);
1096
        this.availableValuesController.setEditable(editable);
1097
        this.tagsController.setEditable(editable);
1098
        this.foreingKeyController.setEditable(editable);
1110
                this.cboGroup.setEnabled(true);
1111
                this.pickerOrder.setEditable(true);
1112
                this.chkHidden.setEnabled(true);
1113
                this.txtLabel.setEditable(true);
1114
                this.txtDescription.setEditable(true);
1115
                this.txtMinValue.setEditable(false);
1116
                this.txtMaxValue.setEditable(false);
1117
                this.availableValuesController.setEditable(true);
1118
                this.tagsController.setEditable(true);
1119
                this.foreingKeyController.setEditable(true);
1120
                break;
1121
            case MODE_EDIT_ONLY_METADATA:
1122
                if( this.chkVirtualField.isSelected() ) {
1123
                    this.txtFieldName.setEditable(true);
1124
                    this.pickerPrecision.setEditable(true);
1125
                    this.pickerSize.setEditable(true);
1126
                    this.pickerVirtualField.setEditable(true);
1127
                    this.cboFieldType.setEnabled(true);
1128
                    this.cboGeometryType.setEnabled(true);
1129
                    this.cboGeometrySubtype.setEnabled(true);
1130
                    this.pickerCRS.setEditable(true);
1131
                } else {
1132
                    this.txtFieldName.setEditable(false);
1133
                    this.pickerPrecision.setEditable(false);
1134
                    this.pickerSize.setEditable(false);
1135
                    this.pickerVirtualField.setEditable(false);
1136
                    this.cboFieldType.setEnabled(false);
1137
                    this.cboGeometryType.setEnabled(false);
1138
                    this.cboGeometrySubtype.setEnabled(false);
1139
                    this.pickerCRS.setEditable(false);
1140
                }
1141

  
1142
                this.pickerDefaultValue.setEditable(true);
1143
                this.pickerIntervalEnd.setEditable(true);
1144
                this.pickerIntervalStart.setEditable(true);
1145

  
1146
                this.cboDataProfile.setEnabled(true);
1147

  
1148
                this.chkAllowNulls.setEnabled(false);
1149
                this.chkIsAutomatic.setEnabled(false);
1150
                if( this.isVirtualField() ) {
1151
                    this.chkIsPrimaryKey.setEnabled(false);
1152
                } else {
1153
                    this.chkIsPrimaryKey.setEnabled(true);
1154
                }
1155

  
1156
                this.chkVirtualField.setEnabled(false);
1157

  
1158
                this.cboDateFormat.setEnabled(true);
1159

  
1160
                this.cboGroup.setEnabled(true);
1161
                this.pickerOrder.setEditable(true);
1162
                this.chkHidden.setEnabled(true);
1163
                this.txtLabel.setEditable(true);
1164
                this.txtDescription.setEditable(true);
1165
                this.txtMinValue.setEditable(false);
1166
                this.txtMaxValue.setEditable(false);
1167
                this.availableValuesController.setEditable(true);
1168
                this.tagsController.setEditable(true);
1169
                this.foreingKeyController.setEditable(true);
1170
                break;
1171
            case MODE_SHOW_ONLY:
1172
                this.pickerDefaultValue.setEditable(false);
1173
                this.txtFieldName.setEditable(false);
1174
                this.pickerIntervalEnd.setEditable(false);
1175
                this.pickerIntervalStart.setEditable(false);
1176
                this.pickerPrecision.setEditable(false);
1177
                this.pickerSize.setEditable(false);
1178
                this.cboDataProfile.setEnabled(false);
1179

  
1180
                this.chkAllowNulls.setEnabled(false);
1181
                this.chkIsAutomatic.setEnabled(false);
1182
                this.chkIsPrimaryKey.setEnabled(false);
1183

  
1184
                this.chkVirtualField.setEnabled(false);
1185
                this.pickerVirtualField.setEditable(false);
1186

  
1187
                this.cboDateFormat.setEnabled(false);
1188
                this.cboFieldType.setEnabled(false);
1189
                this.cboGeometryType.setEnabled(false);
1190
                this.cboGeometrySubtype.setEnabled(false);
1191
                this.pickerCRS.setEditable(false);
1192

  
1193
                this.cboGroup.setEnabled(false);
1194
                this.pickerOrder.setEditable(false);
1195
                this.chkHidden.setEnabled(false);
1196
                this.txtLabel.setEditable(false);
1197
                this.txtDescription.setEditable(false);
1198
                this.txtMinValue.setEditable(false);
1199
                this.txtMaxValue.setEditable(false);
1200
                this.availableValuesController.setEditable(false);
1201
                this.tagsController.setEditable(false);
1202
                this.foreingKeyController.setEditable(false);
1203
                break;
1204
        }
1099 1205
    }
1100 1206

  
1101 1207
    private int getMaxSizeOfType(int dataType) {
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/FeatureTypePanelView.xml
25 25
    <at name="componentclass">com.jeta.forms.gui.form.FormComponent</at>
26 26
   </super>
27 27
   <at name="id">/home/jjdelcerro/datos/devel/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/FeatureTypePanelView.xml</at>
28
   <at name="rowspecs">CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE</at>
28
   <at name="path">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/FeatureTypePanelView.xml</at>
29
   <at name="rowspecs">CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE</at>
29 30
   <at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE</at>
30 31
   <at name="components">
31 32
    <object classname="java.util.LinkedList">
......
36 37
         <at name="cellconstraints">
37 38
          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
38 39
           <at name="column">2</at>
39
           <at name="row">2</at>
40
           <at name="row">3</at>
40 41
           <at name="colspan">1</at>
41 42
           <at name="rowspan">1</at>
42 43
           <at name="halign">default</at>
......
108 109
                      </at>
109 110
                      <at name="componentclass">com.jeta.forms.gui.form.FormComponent</at>
110 111
                     </super>
111
                     <at name="id">embedded.814183280</at>
112
                     <at name="id">embedded.1273782783</at>
112 113
                     <at name="rowspecs">CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE</at>
113 114
                     <at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE</at>
114 115
                     <at name="components">
......
158 159
                               </object>
159 160
                              </at>
160 161
                              <at name="name">tblFields</at>
161
                              <at name="width">352</at>
162
                              <at name="width">771</at>
162 163
                              <at name="scollBars">
163 164
                               <object classname="com.jeta.forms.store.properties.ScrollBarsProperty">
164 165
                                <at name="name">scollBars</at>
......
296 297
                            <at name="properties">
297 298
                             <object classname="com.jeta.forms.store.support.PropertyMap">
298 299
                              <at name="name">pnlField</at>
299
                              <at name="width">354</at>
300
                              <at name="height">197</at>
300
                              <at name="width">773</at>
301
                              <at name="height">186</at>
301 302
                             </object>
302 303
                            </at>
303 304
                           </object>
......
322 323
                           </at>
323 324
                           <at name="componentclass">com.jeta.forms.gui.form.FormComponent</at>
324 325
                          </super>
325
                          <at name="id">embedded.67298992</at>
326
                          <at name="id">embedded.1749258674</at>
326 327
                          <at name="rowspecs">CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0)</at>
327 328
                          <at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE</at>
328 329
                          <at name="components">
......
550 551
                           </at>
551 552
                           <at name="componentclass">com.jeta.forms.gui.form.FormComponent</at>
552 553
                          </super>
553
                          <at name="id">embedded.1130170627</at>
554
                          <at name="id">embedded.1409956988</at>
554 555
                          <at name="rowspecs">CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,FILL:2DLU:GROW(1.0)</at>
555 556
                          <at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE</at>
556 557
                          <at name="components">
......
740 741
                                </at>
741 742
                               </object>
742 743
                              </at>
743
                              <at name="name"></at>
744
                              <at name="name"/>
744 745
                              <at name="fill">
745 746
                               <object classname="com.jeta.forms.store.properties.effects.PaintProperty">
746 747
                                <at name="name">fill</at>
......
950 951
                      </at>
951 952
                      <at name="componentclass">com.jeta.forms.gui.form.FormComponent</at>
952 953
                     </super>
953
                     <at name="id">embedded.718039135</at>
954
                     <at name="id">embedded.1256345326</at>
954 955
                     <at name="rowspecs">CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:GROW(0.1),CENTER:2DLU:NONE,FILL:DEFAULT:GROW(0.8),CENTER:2DLU:NONE</at>
955 956
                     <at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE</at>
956 957
                     <at name="components">
......
1121 1122
                               </object>
1122 1123
                              </at>
1123 1124
                              <at name="name">txtLabel</at>
1124
                              <at name="width">375</at>
1125
                              <at name="width">794</at>
1125 1126
                              <at name="height">20</at>
1126 1127
                             </object>
1127 1128
                            </at>
......
1177 1178
                              <at name="scrollableTracksViewportHeight">true</at>
1178 1179
                              <at name="scrollableTracksViewportWidth">true</at>
1179 1180
                              <at name="name">txtDescription</at>
1180
                              <at name="width">373</at>
1181
                              <at name="width">792</at>
1181 1182
                              <at name="scollBars">
1182 1183
                               <object classname="com.jeta.forms.store.properties.ScrollBarsProperty">
1183 1184
                                <at name="name">scollBars</at>
......
1205 1206
                                </at>
1206 1207
                               </object>
1207 1208
                              </at>
1208
                              <at name="height">91</at>
1209
                              <at name="height">88</at>
1209 1210
                             </object>
1210 1211
                            </at>
1211 1212
                           </object>
......
1215 1216
                       </item>
1216 1217
                       <item >
1217 1218
                        <at name="value">
1219
                         <object classname="com.jeta.forms.store.memento.BeanMemento">
1220
                          <super classname="com.jeta.forms.store.memento.ComponentMemento">
1221
                           <at name="cellconstraints">
1222
                            <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
1223
                             <at name="column">2</at>
1224
                             <at name="row">6</at>
1225
                             <at name="colspan">1</at>
1226
                             <at name="rowspan">1</at>
1227
                             <at name="halign">default</at>
1228
                             <at name="valign">default</at>
1229
                             <at name="insets" object="insets">0,0,0,0</at>
1230
                            </object>
1231
                           </at>
1232
                           <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
1233
                          </super>
1234
                          <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
1235
                          <at name="beanclass">com.jeta.forms.components.label.JETALabel</at>
1236
                          <at name="beanproperties">
1237
                           <object classname="com.jeta.forms.store.memento.PropertiesMemento">
1238
                            <at name="classname">com.jeta.forms.components.label.JETALabel</at>
1239
                            <at name="properties">
1240
                             <object classname="com.jeta.forms.store.support.PropertyMap">
1241
                              <at name="border">
1242
                               <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
1243
                                <super classname="com.jeta.forms.store.properties.BorderProperty">
1244
                                 <at name="name">border</at>
1245
                                </super>
1246
                                <at name="borders">
1247
                                 <object classname="java.util.LinkedList">
1248
                                  <item >
1249
                                   <at name="value">
1250
                                    <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
1251
                                     <super classname="com.jeta.forms.store.properties.BorderProperty">
1252
                                      <at name="name">border</at>
1253
                                     </super>
1254
                                    </object>
1255
                                   </at>
1256
                                  </item>
1257
                                 </object>
1258
                                </at>
1259
                               </object>
1260
                              </at>
1261
                              <at name="name">lblTags</at>
1262
                              <at name="width">70</at>
1263
                              <at name="text">_Tags</at>
1264
                              <at name="fill">
1265
                               <object classname="com.jeta.forms.store.properties.effects.PaintProperty">
1266
                                <at name="name">fill</at>
1267
                               </object>
1268
                              </at>
1269
                              <at name="verticalAlignment">1</at>
1270
                              <at name="height">261</at>
1271
                             </object>
1272
                            </at>
1273
                           </object>
1274
                          </at>
1275
                         </object>
1276
                        </at>
1277
                       </item>
1278
                       <item >
1279
                        <at name="value">
1218 1280
                         <object classname="com.jeta.forms.store.memento.FormMemento">
1219 1281
                          <super classname="com.jeta.forms.store.memento.ComponentMemento">
1220 1282
                           <at name="cellconstraints">
......
1230 1292
                           </at>
1231 1293
                           <at name="componentclass">com.jeta.forms.gui.form.FormComponent</at>
1232 1294
                          </super>
1233
                          <at name="id">embedded.1338466775</at>
1295
                          <at name="id">embedded.246708215</at>
1234 1296
                          <at name="rowspecs">FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:GROW(0.1)</at>
1235 1297
                          <at name="colspecs">FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE</at>
1236 1298
                          <at name="components">
......
1403 1465
                                   <at name="editable">true</at>
1404 1466
                                   <at name="requestFocusEnabled">false</at>
1405 1467
                                   <at name="name">cboTagsName</at>
1406
                                   <at name="width">221</at>
1468
                                   <at name="width">640</at>
1407 1469
                                   <at name="items">
1408 1470
                                    <object classname="com.jeta.forms.store.properties.ItemsProperty">
1409 1471
                                     <at name="name">items</at>
......
1462 1524
                                    </object>
1463 1525
                                   </at>
1464 1526
                                   <at name="name">tblTags</at>
1465
                                   <at name="width">269</at>
1527
                                   <at name="width">688</at>
1466 1528
                                   <at name="scollBars">
1467 1529
                                    <object classname="com.jeta.forms.store.properties.ScrollBarsProperty">
1468 1530
                                     <at name="name">scollBars</at>
......
1500 1562
                            </item>
1501 1563
                            <item >
1502 1564
                             <at name="value">
1565
                              <object classname="com.jeta.forms.store.memento.BeanMemento">
1566
                               <super classname="com.jeta.forms.store.memento.ComponentMemento">
1567
                                <at name="cellconstraints">
1568
                                 <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
1569
                                  <at name="column">3</at>
1570
                                  <at name="row">6</at>
1571
                                  <at name="colspan">1</at>
1572
                                  <at name="rowspan">1</at>
1573
                                  <at name="halign">default</at>
1574
                                  <at name="valign">default</at>
1575
                                  <at name="insets" object="insets">0,0,0,0</at>
1576
                                 </object>
1577
                                </at>
1578
                                <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
1579
                               </super>
1580
                               <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
1581
                               <at name="beanclass">com.jeta.forms.components.label.JETALabel</at>
1582
                               <at name="beanproperties">
1583
                                <object classname="com.jeta.forms.store.memento.PropertiesMemento">
1584
                                 <at name="classname">com.jeta.forms.components.label.JETALabel</at>
1585
                                 <at name="properties">
1586
                                  <object classname="com.jeta.forms.store.support.PropertyMap">
1587
                                   <at name="border">
1588
                                    <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
1589
                                     <super classname="com.jeta.forms.store.properties.BorderProperty">
1590
                                      <at name="name">border</at>
1591
                                     </super>
1592
                                     <at name="borders">
1593
                                      <object classname="java.util.LinkedList">
1594
                                       <item >
1595
                                        <at name="value">
1596
                                         <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
1597
                                          <super classname="com.jeta.forms.store.properties.BorderProperty">
1598
                                           <at name="name">border</at>
1599
                                          </super>
1600
                                         </object>
1601
                                        </at>
1602
                                       </item>
1603
                                      </object>
1604
                                     </at>
1605
                                    </object>
1606
                                   </at>
1607
                                   <at name="name">lblTagsDescription</at>
1608
                                   <at name="width">640</at>
1609
                                   <at name="fill">
1610
                                    <object classname="com.jeta.forms.store.properties.effects.PaintProperty">
1611
                                     <at name="name">fill</at>
1612
                                    </object>
1613
                                   </at>
1614
                                   <at name="height">12</at>
1615
                                  </object>
1616
                                 </at>
1617
                                </object>
1618
                               </at>
1619
                              </object>
1620
                             </at>
1621
                            </item>
1622
                            <item >
1623
                             <at name="value">
1624
                              <object classname="com.jeta.forms.store.memento.BeanMemento">
1625
                               <super classname="com.jeta.forms.store.memento.ComponentMemento">
1626
                                <at name="cellconstraints">
1627
                                 <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
1628
                                  <at name="column">3</at>
1629
                                  <at name="row">5</at>
1630
                                  <at name="colspan">1</at>
1631
                                  <at name="rowspan">1</at>
1632
                                  <at name="halign">default</at>
1633
                                  <at name="valign">default</at>
1634
                                  <at name="insets" object="insets">0,0,0,0</at>
1635
                                 </object>
1636
                                </at>
1637
                                <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
1638
                               </super>
1639
                               <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
1640
                               <at name="beanclass">javax.swing.JComboBox</at>
1641
                               <at name="beanproperties">
1642
                                <object classname="com.jeta.forms.store.memento.PropertiesMemento">
1643
                                 <at name="classname">javax.swing.JComboBox</at>
1644
                                 <at name="properties">
1645
                                  <object classname="com.jeta.forms.store.support.PropertyMap">
1646
                                   <at name="border">
1647
                                    <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
1648
                                     <super classname="com.jeta.forms.store.properties.BorderProperty">
1649
                                      <at name="name">border</at>
1650
                                     </super>
1651
                                     <at name="borders">
1652
                                      <object classname="java.util.LinkedList">
1653
                                       <item >
1654
                                        <at name="value">
1655
                                         <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
1656
                                          <super classname="com.jeta.forms.store.properties.BorderProperty">
1657
                                           <at name="name">border</at>
1658
                                          </super>
1659
                                         </object>
1660
                                        </at>
1661
                                       </item>
1662
                                      </object>
1663
                                     </at>
1664
                                    </object>
1665
                                   </at>
1666
                                   <at name="componentCount">3</at>
1667
                                   <at name="editable">true</at>
1668
                                   <at name="requestFocusEnabled">false</at>
1669
                                   <at name="name">cboTagsValue</at>
1670
                                   <at name="width">640</at>
1671
                                   <at name="items">
1672
                                    <object classname="com.jeta.forms.store.properties.ItemsProperty">
1673
                                     <at name="name">items</at>
1674
                                    </object>
1675
                                   </at>
1676
                                   <at name="height">20</at>
1677
                                  </object>
1678
                                 </at>
1679
                                </object>
1680
                               </at>
1681
                              </object>
1682
                             </at>
1683
                            </item>
1684
                            <item >
1685
                             <at name="value">
1503 1686
                              <object classname="com.jeta.forms.store.memento.FormMemento">
1504 1687
                               <super classname="com.jeta.forms.store.memento.ComponentMemento">
1505 1688
                                <at name="cellconstraints">
......
1515 1698
                                </at>
1516 1699
                                <at name="componentclass">com.jeta.forms.gui.form.FormComponent</at>
1517 1700
                               </super>
1518
                               <at name="id">embedded.309531731</at>
1701
                               <at name="id">embedded.1918701574</at>
1519 1702
                               <at name="rowspecs">CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE</at>
1520 1703
                               <at name="colspecs">FILL:DEFAULT:NONE</at>
1521 1704
                               <at name="components">
......
1782 1965
                              </object>
1783 1966
                             </at>
1784 1967
                            </item>
1785
                            <item >
1786
                             <at name="value">
1787
                              <object classname="com.jeta.forms.store.memento.BeanMemento">
1788
                               <super classname="com.jeta.forms.store.memento.ComponentMemento">
1789
                                <at name="cellconstraints">
1790
                                 <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
1791
                                  <at name="column">3</at>
1792
                                  <at name="row">6</at>
1793
                                  <at name="colspan">1</at>
1794
                                  <at name="rowspan">1</at>
1795
                                  <at name="halign">default</at>
1796
                                  <at name="valign">default</at>
1797
                                  <at name="insets" object="insets">0,0,0,0</at>
1798
                                 </object>
1799
                                </at>
1800
                                <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
1801
                               </super>
1802
                               <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
1803
                               <at name="beanclass">com.jeta.forms.components.label.JETALabel</at>
1804
                               <at name="beanproperties">
1805
                                <object classname="com.jeta.forms.store.memento.PropertiesMemento">
1806
                                 <at name="classname">com.jeta.forms.components.label.JETALabel</at>
1807
                                 <at name="properties">
1808
                                  <object classname="com.jeta.forms.store.support.PropertyMap">
1809
                                   <at name="border">
1810
                                    <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
1811
                                     <super classname="com.jeta.forms.store.properties.BorderProperty">
1812
                                      <at name="name">border</at>
1813
                                     </super>
1814
                                     <at name="borders">
1815
                                      <object classname="java.util.LinkedList">
1816
                                       <item >
1817
                                        <at name="value">
1818
                                         <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
1819
                                          <super classname="com.jeta.forms.store.properties.BorderProperty">
1820
                                           <at name="name">border</at>
1821
                                          </super>
1822
                                         </object>
1823
                                        </at>
1824
                                       </item>
1825
                                      </object>
1826
                                     </at>
1827
                                    </object>
1828
                                   </at>
1829
                                   <at name="name">lblTagsDescription</at>
1830
                                   <at name="width">221</at>
1831
                                   <at name="fill">
1832
                                    <object classname="com.jeta.forms.store.properties.effects.PaintProperty">
1833
                                     <at name="name">fill</at>
1834
                                    </object>
1835
                                   </at>
1836
                                   <at name="height">12</at>
1837
                                  </object>
1838
                                 </at>
1839
                                </object>
1840
                               </at>
1841
                              </object>
1842
                             </at>
1843
                            </item>
1844
                            <item >
1845
                             <at name="value">
1846
                              <object classname="com.jeta.forms.store.memento.BeanMemento">
1847
                               <super classname="com.jeta.forms.store.memento.ComponentMemento">
1848
                                <at name="cellconstraints">
1849
                                 <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
1850
                                  <at name="column">3</at>
1851
                                  <at name="row">5</at>
1852
                                  <at name="colspan">1</at>
1853
                                  <at name="rowspan">1</at>
1854
                                  <at name="halign">default</at>
1855
                                  <at name="valign">default</at>
1856
                                  <at name="insets" object="insets">0,0,0,0</at>
1857
                                 </object>
1858
                                </at>
1859
                                <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
1860
                               </super>
1861
                               <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
1862
                               <at name="beanclass">javax.swing.JComboBox</at>
1863
                               <at name="beanproperties">
1864
                                <object classname="com.jeta.forms.store.memento.PropertiesMemento">
1865
                                 <at name="classname">javax.swing.JComboBox</at>
1866
                                 <at name="properties">
1867
                                  <object classname="com.jeta.forms.store.support.PropertyMap">
1868
                                   <at name="border">
1869
                                    <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
1870
                                     <super classname="com.jeta.forms.store.properties.BorderProperty">
1871
                                      <at name="name">border</at>
1872
                                     </super>
1873
                                     <at name="borders">
1874
                                      <object classname="java.util.LinkedList">
1875
                                       <item >
1876
                                        <at name="value">
1877
                                         <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
1878
                                          <super classname="com.jeta.forms.store.properties.BorderProperty">
1879
                                           <at name="name">border</at>
1880
                                          </super>
1881
                                         </object>
1882
                                        </at>
1883
                                       </item>
1884
                                      </object>
1885
                                     </at>
1886
                                    </object>
1887
                                   </at>
1888
                                   <at name="componentCount">3</at>
1889
                                   <at name="editable">true</at>
1890
                                   <at name="requestFocusEnabled">false</at>
1891
                                   <at name="name">cboTagsValue</at>
1892
                                   <at name="width">221</at>
1893
                                   <at name="items">
1894
                                    <object classname="com.jeta.forms.store.properties.ItemsProperty">
1895
                                     <at name="name">items</at>
1896
                                    </object>
1897
                                   </at>
1898
                                   <at name="height">20</at>
1899
                                  </object>
1900
                                 </at>
1901
                                </object>
1902
                               </at>
1903
                              </object>
1904
                             </at>
1905
                            </item>
1906 1968
                           </object>
1907 1969
                          </at>
1908 1970
                          <at name="properties">
......
2000 2062
                         </object>
2001 2063
                        </at>
2002 2064
                       </item>
2003
                       <item >
2004
                        <at name="value">
2005
                         <object classname="com.jeta.forms.store.memento.BeanMemento">
2006
                          <super classname="com.jeta.forms.store.memento.ComponentMemento">
2007
                           <at name="cellconstraints">
2008
                            <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
2009
                             <at name="column">2</at>
2010
                             <at name="row">6</at>
2011
                             <at name="colspan">1</at>
2012
                             <at name="rowspan">1</at>
2013
                             <at name="halign">default</at>
2014
                             <at name="valign">default</at>
2015
                             <at name="insets" object="insets">0,0,0,0</at>
2016
                            </object>
2017
                           </at>
2018
                           <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
2019
                          </super>
2020
                          <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
2021
                          <at name="beanclass">com.jeta.forms.components.label.JETALabel</at>
2022
                          <at name="beanproperties">
2023
                           <object classname="com.jeta.forms.store.memento.PropertiesMemento">
2024
                            <at name="classname">com.jeta.forms.components.label.JETALabel</at>
2025
                            <at name="properties">
2026
                             <object classname="com.jeta.forms.store.support.PropertyMap">
2027
                              <at name="border">
2028
                               <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
2029
                                <super classname="com.jeta.forms.store.properties.BorderProperty">
2030
                                 <at name="name">border</at>
2031
                                </super>
2032
                                <at name="borders">
2033
                                 <object classname="java.util.LinkedList">
2034
                                  <item >
2035
                                   <at name="value">
2036
                                    <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
2037
                                     <super classname="com.jeta.forms.store.properties.BorderProperty">
2038
                                      <at name="name">border</at>
2039
                                     </super>
2040
                                    </object>
2041
                                   </at>
2042
                                  </item>
2043
                                 </object>
2044
                                </at>
2045
                               </object>
2046
                              </at>
2047
                              <at name="name">lblTags</at>
2048
                              <at name="width">70</at>
2049
                              <at name="text">_Tags</at>
2050
                              <at name="fill">
2051
                               <object classname="com.jeta.forms.store.properties.effects.PaintProperty">
2052
                                <at name="name">fill</at>
2053
                               </object>
2054
                              </at>
2055
                              <at name="verticalAlignment">1</at>
2056
                              <at name="height">281</at>
2057
                             </object>
2058
                            </at>
2059
                           </object>
2060
                          </at>
2061
                         </object>
2062
                        </at>
2063
                       </item>
2064 2065
                      </object>
2065 2066
                     </at>
2066 2067
                     <at name="properties">
......
2167 2168
              </at>
2168 2169
             </object>
2169 2170
            </at>
2170
            <at name="width">510</at>
2171
            <at name="width">929</at>
2171 2172
            <at name="tabCount">2</at>
2172
            <at name="height">490</at>
2173
            <at name="height">467</at>
2173 2174
           </object>
2174 2175
          </at>
2175 2176
         </object>
......
2177 2178
       </object>
2178 2179
      </at>
2179 2180
     </item>
2181
     <item >
2182
      <at name="value">
2183
       <object classname="com.jeta.forms.store.memento.FormMemento">
2184
        <super classname="com.jeta.forms.store.memento.ComponentMemento">
2185
         <at name="cellconstraints">
2186
          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
2187
           <at name="column">2</at>
2188
           <at name="row">2</at>
2189
           <at name="colspan">1</at>
2190
           <at name="rowspan">1</at>
2191
           <at name="halign">default</at>
2192
           <at name="valign">default</at>
2193
           <at name="insets" object="insets">0,0,0,0</at>
2194
          </object>
2195
         </at>
2196
         <at name="componentclass">com.jeta.forms.gui.form.FormComponent</at>
2197
        </super>
2198
        <at name="id">embedded.792555960</at>
2199
        <at name="rowspecs">CENTER:DEFAULT:NONE</at>
2200
        <at name="colspecs">FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE</at>
2201
        <at name="components">
2202
         <object classname="java.util.LinkedList">
2203
          <item >
2204
           <at name="value">
2205
            <object classname="com.jeta.forms.store.memento.BeanMemento">
2206
             <super classname="com.jeta.forms.store.memento.ComponentMemento">
2207
              <at name="cellconstraints">
2208
               <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
2209
                <at name="column">2</at>
2210
                <at name="row">1</at>
2211
                <at name="colspan">1</at>
2212
                <at name="rowspan">1</at>
2213
                <at name="halign">default</at>
2214
                <at name="valign">default</at>
2215
                <at name="insets" object="insets">0,0,0,0</at>
2216
               </object>
2217
              </at>
2218
              <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
2219
             </super>
2220
             <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
2221
             <at name="beanclass">javax.swing.JPanel</at>
2222
             <at name="beanproperties">
2223
              <object classname="com.jeta.forms.store.memento.PropertiesMemento">
2224
               <at name="classname">javax.swing.JPanel</at>
2225
               <at name="properties">
2226
                <object classname="com.jeta.forms.store.support.PropertyMap">
2227
                 <at name="opaque">false</at>
2228
                 <at name="name">pnlCfgActions</at>
2229
                 <at name="width">12</at>
2230
                 <at name="height">12</at>
2231
                </object>
2232
               </at>
2233
              </object>
2234
             </at>
2235
            </object>
2236
           </at>
2237
          </item>
2238
         </object>
2239
        </at>
2240
        <at name="properties">
2241
         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
2242
          <at name="classname">com.jeta.forms.gui.form.GridView</at>
2243
          <at name="properties">
2244
           <object classname="com.jeta.forms.store.support.PropertyMap">
2245
            <at name="border">
2246
             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
2247
              <super classname="com.jeta.forms.store.properties.BorderProperty">
2248
               <at name="name">border</at>
2249
              </super>
2250
              <at name="borders">
2251
               <object classname="java.util.LinkedList"/>
2252
              </at>
2253
             </object>
2254
            </at>
2255
            <at name="name"></at>
2256
            <at name="fill">
2257
             <object classname="com.jeta.forms.store.properties.effects.PaintProperty">
2258
              <at name="name">fill</at>
2259
             </object>
2260
            </at>
2261
            <at name="scollBars">
2262
             <object classname="com.jeta.forms.store.properties.ScrollBarsProperty">
2263
              <at name="name">scollBars</at>
2264
              <at name="verticalpolicy">21</at>
2265
              <at name="horizontalpolicy">31</at>
2266
              <at name="border">
2267
               <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
2268
                <super classname="com.jeta.forms.store.properties.BorderProperty">
2269
                 <at name="name">border</at>
2270
                </super>
2271
                <at name="borders">
2272
                 <object classname="java.util.LinkedList">
2273
                  <item >
2274
                   <at name="value">
2275
                    <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
2276
                     <super classname="com.jeta.forms.store.properties.BorderProperty">
2277
                      <at name="name">border</at>
2278
                     </super>
2279
                    </object>
2280
                   </at>
2281
                  </item>
2282
                 </object>
2283
                </at>
2284
               </object>
2285
              </at>
2286
             </object>
2287
            </at>
2288
           </object>
2289
          </at>
2290
         </object>
2291
        </at>
2292
        <at name="cellpainters">
2293
         <object classname="com.jeta.forms.store.support.Matrix">
2294
          <at name="rows">
2295
           <object classname="[Ljava.lang.Object;" size="1">
2296
            <at name="item" index="0">
2297
             <object classname="[Ljava.lang.Object;" size="2"/>
2298
            </at>
2299
           </object>
2300
          </at>
2301
         </object>
2302
        </at>
2303
        <at name="rowgroups">
2304
         <object classname="com.jeta.forms.store.memento.FormGroupSet">
2305
          <at name="groups">
2306
           <object classname="java.util.HashMap"/>
2307
          </at>
2308
         </object>
2309
        </at>
2310
        <at name="colgroups">
2311
         <object classname="com.jeta.forms.store.memento.FormGroupSet">
2312
          <at name="groups">
2313
           <object classname="java.util.HashMap"/>
2314
          </at>
2315
         </object>
2316
        </at>
2317
       </object>
2318
      </at>
2319
     </item>
2180 2320
    </object>
2181 2321
   </at>
2182 2322
   <at name="properties">
......
2194 2334
         </at>
2195 2335
        </object>
2196 2336
       </at>
2197
       <at name="name"/>
2337
       <at name="name"></at>
2198 2338
       <at name="fill">
2199 2339
        <object classname="com.jeta.forms.store.properties.effects.PaintProperty">
2200 2340
         <at name="name">fill</at>
......
2234 2374
   <at name="cellpainters">
2235 2375
    <object classname="com.jeta.forms.store.support.Matrix">
2236 2376
     <at name="rows">
2237
      <object classname="[Ljava.lang.Object;" size="3">
2377
      <object classname="[Ljava.lang.Object;" size="4">
2238 2378
       <at name="item" index="0">
2239 2379
        <object classname="[Ljava.lang.Object;" size="3"/>
2240 2380
       </at>
......
2244 2384
       <at name="item" index="2">
2245 2385
        <object classname="[Ljava.lang.Object;" size="3"/>
2246 2386
       </at>
2387
       <at name="item" index="3">
2388
        <object classname="[Ljava.lang.Object;" size="3"/>
2389
       </at>
2247 2390
      </object>
2248 2391
     </at>
2249 2392
    </object>
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/FeatureTypePanelView.java
39 39
   JLabel lblDescription = new JLabel();
40 40
   JTextField txtLabel = new JTextField();
41 41
   JTextArea txtDescription = new JTextArea();
42
   JLabel lblTags = new JLabel();
42 43
   JLabel lblTagsName = new JLabel();
43 44
   JLabel lblTagsValue = new JLabel();
44 45
   JComboBox cboTagsName = new JComboBox();
45 46
   JTable tblTags = new JTable();
47
   JLabel lblTagsDescription = new JLabel();
48
   JComboBox cboTagsValue = new JComboBox();
46 49
   JButton btnTagsAdd = new JButton();
47 50
   JButton btnTagsUpdate = new JButton();
48 51
   JButton btnTagsRemove = new JButton();
49
   JLabel lblTagsDescription = new JLabel();
50
   JComboBox cboTagsValue = new JComboBox();
51
   JLabel lblTags = new JLabel();
52
   JPanel pnlCfgActions = new JPanel();
52 53

  
53 54
   /**
54 55
    * Default constructor
......
160 161
   public JPanel createPanel()
161 162
   {
162 163
      JPanel jpanel1 = new JPanel();
163
      FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE");
164
      FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE");
164 165
      CellConstraints cc = new CellConstraints();
165 166
      jpanel1.setLayout(formlayout1);
166 167

  
167 168
      tabFeatureType.setName("tabFeatureType");
168 169
      tabFeatureType.addTab("_Main",null,createPanel1());
169 170
      tabFeatureType.addTab("_Visualization",null,createPanel4());
170
      jpanel1.add(tabFeatureType,cc.xy(2,2));
171
      jpanel1.add(tabFeatureType,cc.xy(2,3));
171 172

  
172
      addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,2,3 });
173
      jpanel1.add(createPanel7(),cc.xy(2,2));
174
      addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,2,3,4 });
173 175
      return jpanel1;
174 176
   }
175 177

  
......
271 273
      jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
272 274
      jpanel1.add(jscrollpane1,new CellConstraints(4,4,1,1,CellConstraints.DEFAULT,CellConstraints.FILL));
273 275

  
274
      jpanel1.add(createPanel5(),cc.xy(4,6));
275 276
      lblTags.setName("lblTags");
276 277
      lblTags.setText("_Tags");
277 278
      lblTags.setVerticalAlignment(JLabel.TOP);
278 279
      jpanel1.add(lblTags,cc.xy(2,6));
279 280

  
281
      jpanel1.add(createPanel5(),cc.xy(4,6));
280 282
      addFillComponents(jpanel1,new int[]{ 1,2,3,4,5 },new int[]{ 1,2,3,4,5,6,7 });
281 283
      return jpanel1;
282 284
   }
......
308 310
      jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
309 311
      jpanel1.add(jscrollpane1,cc.xywh(1,1,3,1));
310 312

  
311
      jpanel1.add(createPanel6(),cc.xywh(5,1,1,5));
312 313
      lblTagsDescription.setName("lblTagsDescription");
313 314
      jpanel1.add(lblTagsDescription,cc.xy(3,6));
314 315

  
......
317 318
      cboTagsValue.setRequestFocusEnabled(false);
318 319
      jpanel1.add(cboTagsValue,cc.xy(3,5));
319 320

  
321
      jpanel1.add(createPanel6(),cc.xywh(5,1,1,5));
320 322
      addFillComponents(jpanel1,new int[]{ 2,3,4,5 },new int[]{ 2,4,6 });
321 323
      return jpanel1;
322 324
   }
......
347 349
      return jpanel1;
348 350
   }
349 351

  
352
   public JPanel createPanel7()
353
   {
354
      JPanel jpanel1 = new JPanel();
355
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE");
356
      CellConstraints cc = new CellConstraints();
357
      jpanel1.setLayout(formlayout1);
358

  
359
      pnlCfgActions.setName("pnlCfgActions");
360
      pnlCfgActions.setOpaque(false);
361
      jpanel1.add(pnlCfgActions,cc.xy(2,1));
362

  
363
      addFillComponents(jpanel1,new int[]{ 1 },new int[]{ 1 });
364
      return jpanel1;
365
   }
366

  
350 367
   /**
351 368
    * Initializer
352 369
    */
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.api/src/main/java/org/gvsig/fmap/dal/swing/featuretype/FeatureTypePanel.java
10 10
 * @author jjdelcerro
11 11
 */
12 12
public interface FeatureTypePanel extends Component, ChangeListenerSupport {
13

  
14
    public static final String CONFIGURABLE_PANEL_ID = "FeatureTypePanel";
15

  
16
    public static final int MODE_EDIT_ONLY_METADATA = 0;
17
    public static final int MODE_EDIT_ALL = 1;
18
    public static final int MODE_SHOW_ONLY = 2;
13 19
    
20
    
14 21
    public EditableFeatureType fetch(EditableFeatureType type);
15 22
    
16 23
    public void put(FeatureType type);
17 24
    
18
    public void setEditable(boolean editable);
25
    /**
26
     * Sets the display mode of the panel.
27
     * Can be:
28
     * <ul>
29
     * <li>MODE_EDIT_ONLY_METADATA, only allows you to modify the metadata. 
30
     *   It can be used without being in store edition.
31
     * </li>
32
     * <li>MODE_EDIT_ALL, allows you to modify all values. 
33
     * The store must be in edition.
34
     * </li>
35
     * <li>MODE_SHOW_ONLY, only display the values.</li>
36
     * </ul>
37
     * 
38
     * @param mode 
39
     */    
40
    public void setMode(int mode);
41
    
42
    public int getMode();
19 43

  
20 44
    public boolean isModifyingAField();
21 45
}
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.api/src/main/java/org/gvsig/fmap/dal/swing/featuretype/FeatureTypeAttributePanel.java
21 21
    
22 22
    public String getName();
23 23
    
24
    public void setEditable(boolean editable);
24
    /**
25
     * Sets the display mode of the panel.
26
     * Can be:
27
     * <ul>
28
     * <li>MODE_EDIT_ONLY_METADATA, only allows you to modify the metadata. 
29
     *   It can be used without being in store edition.
30
     * </li>
31
     * <li>MODE_EDIT_ALL, allows you to modify all values. 
32
     * The store must be in edition.
33
     * </li>
34
     * <li>MODE_SHOW_ONLY, only display the values.</li>
35
     * </ul>
36
     * 
37
     * @see {FeatureTypePanel.setMode}
38
     * 
39
     * @param mode 
40
     */
41
    public void setMode(int mode);
25 42

  
43
    public int getMode();
26 44
}
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/EditableFeatureType.java
78 78
	 * 		
79 79
	 */
80 80
	public Object remove(int index);
81
        
82
        public void removeAll();
83
        
84
        public void addAll(FeatureType other);
81 85

  
82 86
	/**
83 87
	 * Adds an attribute to this EditableFeatureType. 
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureType.java
152 152
        this.internalID = internalIDSaved;
153 153
    }
154 154
    
155
    protected void addAll(FeatureType attributes) {
156
        for (FeatureAttributeDescriptor attribute : attributes) {
157
            DefaultFeatureAttributeDescriptor copy = this.getCopyAttributeDescriptor((DefaultFeatureAttributeDescriptor) attribute);
158
            super.add(copy);
159
        }
160
        DefaultFeatureType ft = (DefaultFeatureType) attributes; 
161
        this.pk = null;
162
        this.defaultGeometryAttributeName = ft.defaultGeometryAttributeName;
163
        this.defaultTimeAttributeName = ft.defaultTimeAttributeName;
164
        this.defaultGeometryAttributeIndex = ft.defaultGeometryAttributeIndex;
165
        this.defaultTimeAttributeIndex = ft.defaultTimeAttributeIndex;
166
    }
167
    
155 168
    protected void copyFrom(DefaultFeatureType other, boolean copyAttributes) {
156 169
        this.id = other.getId();
157 170
        if (copyAttributes) {
158
            Iterator iter = other.iterator();
159
            DefaultFeatureAttributeDescriptor attr;
160
            while (iter.hasNext()) {
161
                attr = (DefaultFeatureAttributeDescriptor) iter.next();
162
                DefaultFeatureAttributeDescriptor copy = this.getCopyAttributeDescriptor(attr);
163
                super.add(copy);
164
            }
165
            this.pk = null;
171
            this.addAll((FeatureType)other);
166 172
        }
167
        this.defaultGeometryAttributeName = other.defaultGeometryAttributeName;
168
        this.defaultTimeAttributeName = other.defaultTimeAttributeName;
173

  
169 174
        this.hasEvaluators = other.hasEvaluators;
170 175
        this.hasEmulators = other.hasEmulators;
171 176
        this.rules = (DefaultFeatureRules) other.rules.getCopy();
172
        this.defaultGeometryAttributeIndex = other.defaultGeometryAttributeIndex;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff