- Timestamp:
- 07/04/12 17:25:21 (12 years ago)
- 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 113 113 import org.openmodelica.modelicaml.common.services.StringUtls; 114 114 import org.openmodelica.modelicaml.common.utls.ResourceManager; 115 import org.openmodelica.modelicaml.common.validation.services.ModelicaMLMarkerSupport; 115 116 import org.openmodelica.modelicaml.gen.modelica.cg.helpers.OMCClassValidator; 116 117 import org.openmodelica.modelicaml.helper.handlers.InstantiateRequirementsHandler; … … 1233 1234 1234 1235 String fullModificationString = item.getDotPathWithoutFirstLevelComponent() + " = " + modificationString; 1235 1236 //modificationStringDialog = new DialogModificationStringInput(shell, "Edit Component Modification", item.getDothPath() + " = ", modificationString, item, null, root);1237 1236 modificationStringDialog = new DialogComponentModification(shell, "Edit Component Modification", item.getDotPath(), fullModificationString, item, null, root); 1238 1237 … … 1244 1243 1245 1244 if ( string.trim().equals("")) { 1246 // Delete modification in items firstLevelComponent 1245 1247 1246 // Delete modification 1248 1247 Element modificationStoreLocation = item.getModificationStoreLocation(); … … 1256 1255 ModificationManager.deleteComponentModificationBasedOnLeftHandValue(modificationStoreLocation, componentPath); 1257 1256 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); 1262 1258 item.setFinalModificationSource(null); 1263 // viewer.update(item, null); 1264 // updateItem(item); 1259 1265 1260 } 1266 1261 else { … … 1288 1283 item.setFinalModificationRightHand(null); // verify against the line above 1289 1284 item.setFinalModificationSource(null); 1290 // viewer.update(item, null);1291 // updateItem(item);1292 1285 1293 1286 } … … 1295 1288 1296 1289 // Add the new value to firstLevelComponent and to the component modifications list. 1297 //ModificationManager.addComponentModification(item.getFirstLevelComponent(), item.getDotPathWithoutFirstLevelComponent(), modificationStringDialog.getValue(), true);1298 1290 String[] parts = modStringWithoutBraces.split("="); 1299 1291 if (parts.length > 0) { 1300 // String leftHandPart = parts[0];1301 1292 1302 1293 // TODO: test it! … … 1312 1303 String rightHandPart = parts[1]; 1313 1304 //System.err.println("rightHandPart " + rightHandPart); 1305 1314 1306 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 1327 1308 item.setFinalModificationRightHand(rightHandPart); // verify this against the line above! 1328 1309 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 1331 1319 } 1332 1320 else { … … 1339 1327 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."); 1340 1328 } 1341 //viewer.update(item, null);1342 1329 } 1343 //viewer.update(item, null);1344 1330 } 1345 // viewer.update(item, null);1346 1331 updateItem(item); 1347 1332 }
Note: See TracChangeset
for help on using the changeset viewer.