use of org.obeonetwork.dsl.interaction.InteractionUse in project InformationSystem by ObeoNetwork.
the class InteractionServices method computePredecessorForInteractionUse.
public InteractionUse computePredecessorForInteractionUse(InteractionUse interactionUse) {
// Get the preceding end
List<End> precedingEnds = getPrecedingEnds(interactionUse.getStartingEnd());
// The predecessor is the last InteractionUse found amongst the preceding interaction uses
InteractionUse predecessor = null;
for (End end : precedingEnds) {
if (end.isInteractionUseEnd() && end.isStartingEnd()) {
predecessor = end.getInteractionUse();
}
}
return predecessor;
}
use of org.obeonetwork.dsl.interaction.InteractionUse in project InformationSystem by ObeoNetwork.
the class DeleteServices method getInteractionUsesForParticipant.
private List<InteractionUse> getInteractionUsesForParticipant(Participant participant) {
Interaction interaction = (Interaction) participant.eContainer();
List<InteractionUse> result = new ArrayList<InteractionUse>();
for (InteractionUse interactionUse : interaction.getInteractionUses()) {
if (interactionUse.getCoveredParticipants().size() == 1 && interactionUse.getCoveredParticipants().contains(participant)) {
result.add(interactionUse);
}
}
return result;
}
use of org.obeonetwork.dsl.interaction.InteractionUse in project InformationSystem by ObeoNetwork.
the class InteractionUseInteractionUsePropertiesEditionComponent 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 InteractionUse interactionUse = (InteractionUse) elt;
final InteractionUsePropertiesEditionPart interactionUsePart = (InteractionUsePropertiesEditionPart) editingPart;
// init values
if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.name))
interactionUsePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, interactionUse.getName()));
if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.type))
interactionUsePart.setType(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, interactionUse.getType()));
if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.interaction_)) {
// init part
interactionSettings = new EObjectFlatComboSettings(interactionUse, InteractionPackage.eINSTANCE.getInteractionUse_Interaction());
interactionUsePart.initInteraction(interactionSettings);
// set the button mode
interactionUsePart.setInteractionButtonMode(ButtonsModeEnum.BROWSE);
}
if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.description))
interactionUsePart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, interactionUse.getDescription()));
if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.interaction_)) {
interactionUsePart.addFilterToInteraction(new ViewerFilter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
return (element instanceof Interaction);
}
});
// Start of user code for additional businessfilters for interaction
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
Aggregations