Revision 47049 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/DefaultDataSwingManager.java

View differences:

DefaultDataSwingManager.java
103 103
import org.gvsig.fmap.dal.swing.featuretype.FeatureAttributesSelectionPanel;
104 104
import org.gvsig.fmap.dal.swing.featuretype.FeatureTypeAttributePanel;
105 105
import org.gvsig.fmap.dal.swing.featuretype.FeatureTypePanel;
106
import org.gvsig.fmap.dal.swing.impl.actions.CopyFormAction;
107
import org.gvsig.fmap.dal.swing.impl.actions.CopyFormAction.CopyFormActionFactory;
108
import org.gvsig.fmap.dal.swing.impl.actions.GraphAction.GraphActionFactory;
109
import org.gvsig.fmap.dal.swing.impl.actions.SelectionAddAction.SelectionAddActionFactory;
110
import org.gvsig.fmap.dal.swing.impl.actions.SelectionFilterAction.SelectionFilterActionFactory;
111
import org.gvsig.fmap.dal.swing.impl.actions.SelectionSetAction.SelectionSetActionFactory;
112
import org.gvsig.fmap.dal.swing.impl.actions.ShowFormAction.ShowFormActionFactory;
106
import org.gvsig.fmap.dal.swing.impl.actions.ReportStoreAction;
107
import org.gvsig.fmap.dal.swing.impl.actions.ReportStoreAction.ReportStoreActionFactory;
113 108
import org.gvsig.fmap.dal.swing.impl.expressionevaluator.DefaultFeatureStoreElement2;
114 109
import org.gvsig.fmap.dal.swing.impl.expressionevaluator.suggestions.CheckTableFieldsSuggestionProviderFactory;
115 110
import org.gvsig.fmap.dal.swing.impl.expressionevaluator.suggestions.DivSuggestionProviderFactory;
......
141 136
import org.gvsig.fmap.dal.swing.impl.visualdbmodeler.Visualdbmodeler;
142 137
import org.gvsig.fmap.dal.swing.jdbc.JDBCConnectionDialog;
143 138
import org.gvsig.fmap.dal.swing.jdbc.JDBCConnectionPanel;
139
import org.gvsig.fmap.dal.swing.report.ReportActionFactory;
140
import org.gvsig.fmap.dal.swing.report.ReportActionFactory.ReportCustomActionFactory;
144 141
import org.gvsig.fmap.dal.swing.searchPostProcess.SearchPostProcessFactory;
145 142
import org.gvsig.fmap.dal.swing.searchpanel.FeatureStoreSearchPanel;
146 143
import org.gvsig.fmap.dal.swing.searchpanel.SearchConditionPanel.SearchConditionPanelFactory;
......
170 167

  
171 168
    private static final Logger LOGGER = LoggerFactory.getLogger(DefaultDataSwingManager.class);
172 169
    
173
    private final Map<String,DALActionFactory> featureStoreSearchActions;
170
    private final Map<String,DALActionFactory> featureStoreActions;
174 171
    private final Map<String,SearchPostProcessFactory> searchPostProcess;
175 172
    private Map<String,SearchConditionPanelFactory> searchConditionPanelFactories;
176 173
    private Integer useLabels;
177 174
    
178 175
    public DefaultDataSwingManager() {
179
        this.featureStoreSearchActions = new LinkedHashMap<>();
180
        this.registerStoreAction(new SelectionAddActionFactory());
181
        this.registerStoreAction(new SelectionFilterActionFactory());
182
        this.registerStoreAction(new SelectionSetActionFactory());
183
        this.registerStoreAction(new ShowFormActionFactory());
184
        this.registerStoreAction(new GraphActionFactory());
185
        this.registerStoreAction(new CopyFormActionFactory());
186
        
176
        this.featureStoreActions = new LinkedHashMap<>();
187 177
        this.searchPostProcess = new HashMap<>();
188 178
    }
189 179
    
......
493 483

  
494 484
    @Override
495 485
    public final void registerStoreAction(DALActionFactory action) {
496
        this.featureStoreSearchActions.put(action.getName().toLowerCase(), action);
486
        this.featureStoreActions.put(action.getName().toLowerCase(), action);
497 487
    }
498 488
    
499 489
    @Override
500 490
    public  Collection<DALActionFactory> getStoreActions() {
501
        return Collections.unmodifiableCollection(this.featureStoreSearchActions.values());
491
        return Collections.unmodifiableCollection(this.featureStoreActions.values());
502 492
    }
503 493

  
504 494
    @Override
505 495
    public Collection<DALActionFactory> getApplicableStoreActions(DALActionContext context) {
506 496
        Collection<DALActionFactory> factories = new ArrayList<>();
507 497
        try {
508
            for (DALActionFactory factory : this.featureStoreSearchActions.values()) {
498
            for (DALActionFactory factory : this.featureStoreActions.values()) {
509 499
                if (factory == null ) {
510 500
                    continue;
511 501
                }
......
526 516

  
527 517
    @Override
528 518
    public  DALActionFactory getStoreAction(String name) {
529
        DALActionFactory action = this.featureStoreSearchActions.get(name.toLowerCase());
519
        DALActionFactory action = this.featureStoreActions.get(name.toLowerCase());
530 520
        return action;
531 521
    }
532 522
    
......
732 722
        return new DefaultSearchParameters();
733 723
    }
734 724

  
725
    @Override
735 726
    public FeatureQueryPickerController createFeatureQueryPickerController(JTextComponent text, JButton button, JButton history, JButton bookmarks) {
736 727
        DefaultFeatureQueryPickerController controller = new DefaultFeatureQueryPickerController(text, button, history, bookmarks);
737 728
        return controller;
......
804 795
        return this.askUserStopEditing(null, featureStore, true);
805 796
    }
806 797

  
798
    @Override
807 799
    public int askUserStopEditing(FeatureStore featureStore, boolean allowContinue) {
808 800
        return this.askUserStopEditing(null, featureStore, allowContinue);
809 801
    }
810 802

  
803
    @Override
811 804
    public int askUserStopEditing(Component parent, FeatureStore featureStore, boolean allowContinue) {
812 805
        boolean allowWrite = featureStore.allowWrite();
813 806

  
......
884 877
        return true;
885 878
    }
886 879
        
880
    @Override
887 881
    public JPanel createVisualdbModelerPanel() {
888 882
        return new Visualdbmodeler();
889 883
    }
890 884

  
885
    private Map<String,ReportActionFactory> reportActionFactories;
886
    
887
    @Override
888
    public void registerReportAction(ReportActionFactory factory) {
889
        if( this.reportActionFactories == null ) {
890
            this.reportActionFactories = new HashMap<>();
891
        }
892
        this.reportActionFactories.put(factory.getName().toLowerCase(), factory);
893
    }
894
    
895
    @Override
896
    public ReportActionFactory getReportActionFactory(String name) {
897
        if( StringUtils.isBlank(name) ) {
898
            return null;
899
        }
900
        return this.reportActionFactories.get(name.toLowerCase());
901
    }
902

  
903
    @Override
904
    public Collection<ReportActionFactory> getReportActionFactories() {
905
        return this.reportActionFactories.values();
906
    }
907
    
908
    @Override
909
    public void registerReportsCustomAction(ReportCustomActionFactory customFactory, boolean insertSeparator) {
910
        ReportStoreActionFactory factory = (ReportStoreActionFactory) this.getStoreAction(ReportStoreAction.ACTION_NAME);
911
        factory.registerCustomAction(customFactory, insertSeparator);
912
    }    
913

  
891 914
}
892 915
        

Also available in: Unified diff