Revision 44338 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
51 51
            this.type = OrderedAttribute.TYPE_REGURAL;
52 52
            this.childs = new ArrayList<>();
53 53
            for (OrderedAttribute attribute : attributes) {
54
                this.childs.add(new DefaultNode(store, attribute.getDescriptor(), this.type));
54
                this.childs.add(new DefaultNode(store, attribute.getDescriptor(), attribute.getType()));
55 55
            }
56 56
        }
57 57

  
58 58
        private DefaultNode(FeatureStore store, FeatureAttributeDescriptor attribute, int type) {
59
            super(attribute.getLabel(), attribute);
59
            super(attribute.getLocalizedLabel(), attribute);
60 60
            this.store = store;
61 61
            this.type = type;
62 62
            this.childs = null;
......
76 76
                case Search.OrderedAttribute.TYPE_REGURAL:
77 77
                    break;
78 78
                case Search.OrderedAttribute.TYPE_FAVORITE:
79
                    theLabel = "<b>"+theLabel+"</b>";
79
                    theLabel = "<html><b>"+theLabel+"</b></html>";
80 80
                    break;
81 81
                case Search.OrderedAttribute.TYPE_RECENT:
82
                    theLabel = "<i><b>"+theLabel+"</b></i>";
82
                    theLabel = "<html><i><b>"+theLabel+"</b></i></html>";
83 83
                    break;
84 84
            }
85 85
            return theLabel;
......
103 103
                    ContextForeingKey context = foreingKey.createContext();
104 104
                    // Ojo, no liberamos el contexto para que no se destruya el store.
105 105
                    FeatureStore theStore = foreingKey.getFeatureStore(context);
106
                    FeatureType featureType = foreingKey.getFeatureType(context);
107
                    String fullName = theStore.getFullName();
108
                    if (stores.contains(fullName)) {
109
                        // Si ya hemos a?adido el store al arbol no lo volvemos a a?adir.
106
                    if( theStore==null ) {
110 107
                        this.childs = Collections.EMPTY_LIST;
111 108
                    } else {
112
                        Search featureTypeSearch = (Search) ToolsLocator.getComplementsManager().get(
113
                                Search.COMPLEMENT_MANE, featureType
114
                        );
115
                        List<Search.OrderedAttribute> attributes = featureTypeSearch.getOrderedAttributes(
116
                                filterByDataType,
117
                                Search.LABEL_ORDER,
118
                                -1
119
                        );
120
                        this.childs = new ArrayList<>();
121
                        for (Search.OrderedAttribute attribute : attributes) {
122
                            this.childs.add(new DefaultNode(theStore, attribute.getDescriptor(), attribute.getType()));
109
                        FeatureType featureType = foreingKey.getFeatureType(context);
110
                        String fullName = theStore.getFullName();
111
                        if (stores.contains(fullName)) {
112
                            // Si ya hemos a?adido el store al arbol no lo volvemos a a?adir.
113
                            this.childs = Collections.EMPTY_LIST;
114
                        } else {
115
                            Search featureTypeSearch = (Search) ToolsLocator.getComplementsManager().get(
116
                                    Search.COMPLEMENT_MANE, featureType
117
                            );
118
                            List<Search.OrderedAttribute> attributes = featureTypeSearch.getOrderedAttributes(
119
                                    filterByDataType,
120
                                    Search.LABEL_ORDER,
121
                                    -1
122
                            );
123
                            this.childs = new ArrayList<>();
124
                            for (Search.OrderedAttribute attribute : attributes) {
125
                                this.childs.add(new DefaultNode(theStore, attribute.getDescriptor(), attribute.getType()));
126
                            }
123 127
                        }
124 128
                    }
125 129
                } else {

Also available in: Unified diff