Ignore:
Timestamp:
07/04/12 17:25:21 (12 years ago)
Author:
wschamai
Message:

MOD: marker support
NEW: (Initial) Discovery of relations between scenarios and requirements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modelicaml/org.openmodelica.modelicaml.view.componentstree/src/org/openmodelica/modelicaml/view/componentstree/views/ComponentsTree.java

    r1496 r1562  
    113113import org.openmodelica.modelicaml.common.services.StringUtls;
    114114import org.openmodelica.modelicaml.common.utls.ResourceManager;
     115import org.openmodelica.modelicaml.common.validation.services.ModelicaMLMarkerSupport;
    115116import org.openmodelica.modelicaml.gen.modelica.cg.helpers.OMCClassValidator;
    116117import org.openmodelica.modelicaml.helper.handlers.InstantiateRequirementsHandler;
     
    12331234                   
    12341235                    String fullModificationString = item.getDotPathWithoutFirstLevelComponent() + " = " + modificationString;
    1235                    
    1236                     //modificationStringDialog = new DialogModificationStringInput(shell, "Edit Component Modification", item.getDothPath() + " = ", modificationString, item, null, root);
    12371236                    modificationStringDialog = new DialogComponentModification(shell, "Edit Component Modification", item.getDotPath(), fullModificationString, item, null, root);
    12381237                   
     
    12441243                       
    12451244                        if ( string.trim().equals("")) {
    1246                             // Delete modification in items firstLevelComponent
     1245
    12471246                            // Delete modification
    12481247                            Element modificationStoreLocation = item.getModificationStoreLocation();
     
    12561255                            ModificationManager.deleteComponentModificationBasedOnLeftHandValue(modificationStoreLocation, componentPath);
    12571256
    1258                             // Delete modification in item list.
    1259                             //item.deleteFromModificationListBasedOnLeftRightHandValue(item.getDothPath(), modificationString);
    1260 
    1261                             item.setFinalModificationRightHand(null); // TODO: verify against the line above
     1257                            item.setFinalModificationRightHand(null);
    12621258                            item.setFinalModificationSource(null);
    1263 //                          viewer.update(item, null);
    1264 //                          updateItem(item);
     1259                           
    12651260                        }
    12661261                        else {
     
    12881283                                item.setFinalModificationRightHand(null); // verify against the line above
    12891284                                item.setFinalModificationSource(null);
    1290 //                              viewer.update(item, null);
    1291 //                              updateItem(item);
    12921285
    12931286                            }
     
    12951288                           
    12961289                            // Add the new value to firstLevelComponent and to the component modifications list.
    1297                             //ModificationManager.addComponentModification(item.getFirstLevelComponent(), item.getDotPathWithoutFirstLevelComponent(), modificationStringDialog.getValue(), true);
    12981290                            String[] parts = modStringWithoutBraces.split("=");
    12991291                            if (parts.length > 0) {
    1300 //                              String leftHandPart = parts[0];
    13011292                               
    13021293                                // TODO: test it!
     
    13121303                                    String rightHandPart = parts[1];
    13131304                                    //System.err.println("rightHandPart " + rightHandPart);
     1305                                   
    13141306                                    ModificationManager.addComponentModification(item.getModificationStoreLocation(), leftHandPart, rightHandPart, true);
    1315                                     //ModificationManager.addComponentModification(item.getFirstLevelComponent(), item.getDotPathWithoutFirstLevelComponent(), modificationStringDialog.getValue(), true); // OLD
    1316                                    
    1317 //                                  // Add to the modification in item list.
    1318 //                                  //item.addToModificationList(item.getDothPath() + " = " + modificationStringDialog.getValue()); // OLD
    1319 //                                  String storeString = "";
    1320 //                                  if (hasOutterBraces) {
    1321 //                                      storeString = "(" + StringUtls.replaceSpecChar(item.getFirstLevelComponent().getName()) + "." + modStringWithoutBraces + ")";
    1322 //                                  }
    1323 //                                  else {
    1324 //                                      storeString = StringUtls.replaceSpecChar(item.getFirstLevelComponent().getName()) + "." + modStringWithoutBraces ;
    1325 //                                  }
    1326                                     //item.addToModificationList(storeString); // Store with braces if there are any!
     1307
    13271308                                    item.setFinalModificationRightHand(rightHandPart); // verify this against the line above!
    13281309                                    item.setFinalModificationSource(item.getFirstLevelComponent()); // TODO: this is wrong if the modification source is Generalization!
    1329 //                                  viewer.update(item, null);
    1330 //                                  updateItem(item);
     1310                                   
     1311                                    /*
     1312                                     * In case there were markers that were for not successful value bindings:
     1313                                     * -> Delete those markers that have the first level component as source
     1314                                     * and the marker message contains the item dot path.
     1315                                     */
     1316//                                  ModelicaMLMarkerSupport.deleteMarker(item.getFirstLevelComponent(), Constants.MARKERTYPE_VALUEBINDINGS);
     1317                                    ModelicaMLMarkerSupport.deleteMarker(item.getFirstLevelComponent(), item.getDotPath(), Constants.MARKERTYPE_VALUEBINDINGS);
     1318                                   
    13311319                                }
    13321320                                else {
     
    13391327                                MessageDialog.openError(shell, "ModelicaML modifications parsing error (ComponentsTree.java 04)", "The modification string '"+string+"' does not contain an equality lign ('='). It will not be stored.");
    13401328                            }
    1341                             //viewer.update(item, null);
    13421329                        }
    1343                         //viewer.update(item, null);
    13441330                    }
    1345 //                  viewer.update(item, null);
    13461331                    updateItem(item);
    13471332                }
Note: See TracChangeset for help on using the changeset viewer.