Revision 3519 org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/VCSGisEntitySelectorControllerJTree.java

View differences:

VCSGisEntitySelectorControllerJTree.java
27 27
import java.awt.event.ActionEvent;
28 28
import java.awt.event.ActionListener;
29 29
import java.util.ArrayList;
30
import java.util.Collection;
30 31
import java.util.Collections;
31 32
import java.util.HashMap;
32 33
import java.util.HashSet;
......
400 401
    private void reloadEntities(VCSGisWorkspace workspace) {
401 402
        I18nManager i18n = ToolsLocator.getI18nManager();
402 403
        try {
404
            fireActionEvent(new ActionEvent(this, ACTION_BEGIN_PROCESSING_ID, ACTION_BEGIN_PROCESSING));
403 405
            this.processing = true;
404 406
            this.doUpdateComponents();
405 407
            workspace.reloadRepositoryEntities(null);
......
484 486
        } finally {
485 487
            this.processing = false;
486 488
            this.doUpdateComponents();
489
            fireActionEvent(new ActionEvent(this, ACTION_END_PROCESSING_ID, ACTION_END_PROCESSING));
487 490
        }
488 491

  
489 492
    }
490 493

  
494
    @Override
495
    public Collection<VCSGisEntity> getEntities() {
496
        return this.entities.values();
497
    }
498

  
491 499
    private void addNodeEntity(Map<String, DefaultMutableTreeNode> theEntityNodes, String category, LabeledValue entry) {
492 500
        DefaultMutableTreeNode branch = theEntityNodes.get(category);
493 501
        if (branch == null) {
......
506 514
        filteredTree.setModel(new DefaultTreeModel(entities));
507 515
        this.expandAllNodes(treeEntities);
508 516
        this.processing = false;
509
        this.changeListeners.fireEvent();
517
        fireActionEvent(new ActionEvent(this, ACTION_RELOAD_ID, ACTION_RELOAD));
510 518
    }
511 519

  
512 520
    private void doUpdateComponents() {
......
608 616
    public void check(VCSGisEntity entity) {
609 617
        this.checkedEntityCodes.add(entity.getEntityCode());
610 618
        this.treeEntities.repaint();
619
        fireActionEvent(new ActionEvent(this, ACTION_CHECK_ID, ACTION_CHECK));
611 620
    }
612 621

  
613 622
    @Override
......
616 625
            this.checkedEntityCodes.add(entry.getValue().getEntityCode());
617 626
        }
618 627
        this.treeEntities.repaint();
628
        fireActionEvent(new ActionEvent(this, ACTION_CHECK_ID, ACTION_CHECK));
619 629
    }
620 630
    
621 631
    @Override
622 632
    public void clearChecks() {
623 633
        this.checkedEntityCodes.clear();
624 634
        this.treeEntities.repaint();
635
        fireActionEvent(new ActionEvent(this, ACTION_CHECK_ID, ACTION_CHECK));
625 636
    }
626 637
    
627 638
    private void expandAllNodes(JTree tree) {

Also available in: Unified diff