Changeset 829 for trunk


Ignore:
Timestamp:
06/20/11 20:35:03 (13 years ago)
Author:
wschamai
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modelicaml/org.openmodelica.modelicaml.common/src/org/openmodelica/modelicaml/common/instantiation/ModificationManager.java

    r765 r829  
    4141import org.eclipse.emf.common.command.Command;
    4242import org.eclipse.emf.common.command.CompoundCommand;
     43import org.eclipse.emf.common.util.BasicEList;
    4344import org.eclipse.emf.transaction.RecordingCommand;
    4445import org.eclipse.emf.transaction.TransactionalEditingDomain;
     
    127128           
    128129            //component.eNotify(new NotificationImpl(PapyrusNotification.SET, null, null)); // notify Papyrus
     130        }
     131       
     132    }
     133   
     134   
     135    public static void deleteAllComponentModifications( final Element element){
     136        final Stereotype stereotype = getElementStereotype(element);
     137        if (stereotype != null) {
     138            //########## storing start
     139            TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
     140            CompoundCommand cc = new CompoundCommand();
     141            Command command = new RecordingCommand(editingDomain) {
     142                @Override
     143                protected void doExecute() {
     144                    element.setValue(stereotype, Constants.propertyName_modification, new ArrayList<String>()); // set the value
     145                }
     146            };
     147            cc.append(command);
     148            editingDomain.getCommandStack().execute(cc);
     149            //########## storing end
    129150        }
    130151       
Note: See TracChangeset for help on using the changeset viewer.