use of org.tmdmaker.ui.dialogs.ImplementInfoEditDialog in project tmdmaker by tmdmaker.
the class ImplementInfoEditAction method run.
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
ImplementInfoEditDialog dialog = new ImplementInfoEditDialog(getPart().getViewer().getControl().getShell(), getModel());
if (dialog.open() == Dialog.OK) {
CompoundCommand ccommand = new CompoundCommand();
ccommand.add(new ModelEditCommand(getModel(), dialog.getEditedValueEntity()));
for (EditImplementAttribute ea : dialog.getEditedValueAttributes()) {
IAttribute original = ea.getOriginalAttribute();
IAttribute newAttribute = original.getCopy();
ea.copyTo(newAttribute);
ccommand.add(new AttributeEditCommand(original, newAttribute, ea.getContainerModel()));
}
SurrogateKey newSurrogateKey = new SurrogateKey();
EditSurrogateKey edited = dialog.getEditedSurrogateKey();
edited.copyTo(newSurrogateKey);
ImplementRule.setSurrogateKeyDefaultValue(newSurrogateKey);
SurrogateKey original = (SurrogateKey) edited.getOriginalAttribute();
ccommand.add(new AttributeEditCommand(original, newSurrogateKey, edited.getContainerModel()));
execute(ccommand);
}
}
Aggregations