Ignore:
Timestamp:
03/12/12 14:19:21 (13 years ago)
Author:
wschamai
Message:

BUG FIX: canceling of the "run design verification models action"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modelicaml/org.openmodelica.modelicaml.simulation/src/org/openmodelica/modelicaml/simulation/handlers/GenerateTestSiMDataAction.java

    r1376 r1388  
    164164        // set the list of simulation models to be executed.
    165165        EObject rootModel = null;
    166 
     166        boolean someModelsSelected = false;
    167167        try {
    168168            rootModel = umlModel.lookupRoot();
    169169            if (rootModel instanceof Model) {
    170                 setTestModels((Element) rootModel);
     170                someModelsSelected = setTestModels((Element) rootModel);
    171171            }
    172172        } catch (NotFoundException e) {
     
    175175        }
    176176       
    177         if (rootModel != null && VerificationExecutionServices.verificationModels != null && VerificationExecutionServices.verificationModels.size() > 0) {
     177        if (someModelsSelected && rootModel != null && VerificationExecutionServices.verificationModels != null && VerificationExecutionServices.verificationModels.size() > 0) {
    178178           
    179179            org.eclipse.emf.common.util.URI chainURI = null;
     
    244244                MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Error", "Could not save the model and load the generation chain...");
    245245            }
    246         }
    247        
    248         CompoundCommand cc = new CompoundCommand("Verification Models Data Generation");
    249         return (cc.unwrap());
    250     }
    251 
    252    
    253     public void setTestModels(Element rootModel){
     246            CompoundCommand cc = new CompoundCommand("Verification Models Data Generation");
     247            return (cc.unwrap());
     248        }
     249        return null;
     250    }
     251
     252   
     253    public boolean setTestModels(Element rootModel){
    254254        ElementsCollector ec = new ElementsCollector();
    255255        ec.collectElementsFromModel(rootModel, Constants.stereotypeQName_VerificationModel);
     
    267267                }
    268268            }
    269         }
     269           
     270            return true;
     271        }
     272        return false;
    270273    }
    271274   
Note: See TracChangeset for help on using the changeset viewer.