use of org.tmdmaker.ui.editor.gef3.commands.SubsetDeleteCommand in project tmdmaker by tmdmaker.
the class SubsetEntityComponentEditPolicy method createDeleteCommand.
/**
* {@inheritDoc}
*
* @see org.eclipse.gef.editpolicies.ComponentEditPolicy#createDeleteCommand(org.eclipse.gef.requests.GroupRequest)
*/
@Override
protected Command createDeleteCommand(GroupRequest deleteRequest) {
CompoundCommand ccommand = new CompoundCommand();
SubsetDeleteCommand command1 = new SubsetDeleteCommand(getModel());
ccommand.add(command1);
if (getModel().isNotImplement()) {
AbstractEntityModel original = ImplementRule.findOriginalImplementModel(getModel());
ccommand.add(new ImplementDerivationModelsDeleteCommand(getModel(), original));
}
return ccommand;
}
use of org.tmdmaker.ui.editor.gef3.commands.SubsetDeleteCommand in project tmdmaker by tmdmaker.
the class SubsetCreateDialog method addSubsetDeleteCommand.
private void addSubsetDeleteCommand() {
List<EditSubsetEntity> deletedList = new ArrayList<EditSubsetEntity>();
for (EditSubsetEntity e : deletedSubsetEntities) {
if (e.getOriginal() != null) {
deletedList.add(e);
}
}
AbstractEntityModel original = null;
for (EditSubsetEntity e : deletedList) {
SubsetEntity subset = e.getOriginal();
if (original == null) {
original = ImplementRule.findOriginalImplementModel(subset);
}
if (subset != null) {
SubsetDeleteCommand command = new SubsetDeleteCommand(subset);
ccommand.add(command);
if (subset.isNotImplement()) {
ccommand.add(new ImplementDerivationModelsDeleteCommand(subset, original));
}
}
}
}
Aggregations