use of org.obeonetwork.dsl.interaction.Operand in project InformationSystem by ObeoNetwork.
the class DeleteServices method deleteOperand.
public void deleteOperand(Operand operand) {
EObject result = operand.eContainer();
if (result instanceof CombinedFragment) {
CombinedFragment combinedFragment = (CombinedFragment) result;
End startingEnd = operand.getStartingEnd();
End finishingEnd = null;
EList<Operand> siblings = combinedFragment.getOwnedOperands();
if (siblings.size() == 1) {
deleteCombinedFragment(combinedFragment);
return;
}
int index = siblings.indexOf(operand);
if (index == siblings.size() - 1) {
// The last operand ends with the CF
finishingEnd = combinedFragment.getFinishingEnd();
} else {
// Other operands ends when their successor starts
finishingEnd = siblings.get(index + 1).getStartingEnd();
}
delete((Interaction) combinedFragment.eContainer(), startingEnd, finishingEnd, false, combinedFragment.getCoveredParticipants());
}
return;
}
use of org.obeonetwork.dsl.interaction.Operand in project InformationSystem by ObeoNetwork.
the class InteractionServices method computePredecessorForOperand.
public Operand computePredecessorForOperand(Operand operand) {
// Get the preceding end
List<End> precedingEnds = getPrecedingEnds(operand.getStartingEnd());
// The predecessor is the last Operand found amongst the preceding operands for the same combined fragment
Operand predecessor = null;
for (End end : precedingEnds) {
if (end.isOperandEnd() && end.isStartingEnd() && operand.eContainer().equals(end.getOperand().eContainer())) {
predecessor = end.getOperand();
}
}
return predecessor;
}
use of org.obeonetwork.dsl.interaction.Operand in project InformationSystem by ObeoNetwork.
the class OperandOperandPropertiesEditionComponent method initPart.
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final Operand operand = (Operand) elt;
final OperandPropertiesEditionPart operandPart = (OperandPropertiesEditionPart) editingPart;
// init values
if (isAccessible(InteractionViewsRepository.Operand.Properties.name))
operandPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, operand.getName()));
if (isAccessible(InteractionViewsRepository.Operand.Properties.description))
operandPart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, operand.getDescription()));
// init filters
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.obeonetwork.dsl.interaction.Operand in project InformationSystem by ObeoNetwork.
the class OperandImpl method getFinishingEnd.
/**
* @generated NOT
*/
@Override
public End getFinishingEnd() {
End result = null;
EObject eContainer = eContainer();
if (eContainer instanceof CombinedFragment) {
CombinedFragment cf = (CombinedFragment) eContainer;
result = cf.getFinishingEnd();
Operand prev = null;
for (Operand op : cf.getOwnedOperands()) {
if (this.equals(prev)) {
result = op.getStartingEnd();
break;
} else {
prev = op;
}
}
}
return result;
}
Aggregations