Revision 44351 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/searchpanel/AdvancedAttributeSelectionTreeModel.java

View differences:

AdvancedAttributeSelectionTreeModel.java
17 17
import org.gvsig.fmap.dal.feature.FeatureType;
18 18
import org.gvsig.fmap.dal.feature.ForeingKey;
19 19
import org.gvsig.fmap.dal.feature.ForeingKey.ContextForeingKey;
20
import static org.gvsig.fmap.dal.swing.impl.searchpanel.DefaultSearchPanel.getAttributeDescriptorLabel;
20 21
import org.gvsig.tools.ToolsLocator;
21 22
import org.gvsig.tools.util.LabeledValue;
22 23
import org.gvsig.tools.util.LabeledValueImpl;
......
66 67
        public String getLabel() {
67 68
            String theLabel;
68 69
            FeatureAttributeDescriptor attrdesc = this.getValue();
69
            if( attrdesc!=null && attrdesc.isForeingKey() ) {
70
                ForeingKey foreingKey = attrdesc.getForeingKey();
71
                theLabel = String.format("%s [%s]", super.getLabel(), foreingKey.getTableName());
70
            if( attrdesc==null ) {
71
                theLabel = super.getLabel();
72 72
            } else {
73
                theLabel = super.getLabel();
73
                String tableName = null;
74
                if( attrdesc.isForeingKey() ) {
75
                    ForeingKey foreingKey = attrdesc.getForeingKey();
76
                    tableName = foreingKey.getTableName();
77
                }
78
                theLabel = getAttributeDescriptorLabel(attrdesc, tableName);
74 79
            }
75 80
            switch(this.type) {
76 81
                case Search.OrderedAttribute.TYPE_REGURAL:

Also available in: Unified diff