@Capability(contexts = {Context.SELF, Context.SIBLINGS}) @Override public void onAnnotatedTextChanged(AnnotatedTextChangedEvent event) { Blip blip = event.getBlip(); if (!isShadowBlip(blip)) { createOrUpdateShadowBlip(blip); } }
public void testGenerateAnnotatedTextChangedEvent() throws Exception { ConversationBlip rootBlip = conversationUtil.buildConversation(wavelet).getRoot().getRootThread().getFirstBlip(); String annotationKey = "key"; String annotationValue = "value"; rootBlip.getContent().setAnnotation(0, 1, annotationKey, annotationValue); EventMessageBundle messages = generateAndCheckEvents(EventType.ANNOTATED_TEXT_CHANGED); assertEquals("Expected one event only", 1, messages.getEvents().size()); AnnotatedTextChangedEvent event = AnnotatedTextChangedEvent.as(messages.getEvents().get(0)); assertEquals("Expected the key of the annotation", annotationKey, event.getName()); assertEquals("Expected the value of the annotation", annotationValue, event.getValue()); }
switch (event.getType()) { case ANNOTATED_TEXT_CHANGED: onAnnotatedTextChanged(AnnotatedTextChangedEvent.as(event)); break; case BLIP_CONTRIBUTORS_CHANGED:
(AnnotationChanged<N, E, T>) eventComponent; AnnotatedTextChangedEvent apiEvent = new AnnotatedTextChangedEvent(null, null, deltaAuthor.getAddress(), deltaTimestamp, blip.getId(), anotationChangedEvent.key, anotationChangedEvent.newValue); addEvent(apiEvent, capabilities, blip.getId(), messages);
public void testGenerateAnnotatedTextChangedEvent() throws Exception { ConversationBlip rootBlip = conversationUtil.buildConversation(wavelet).getRoot().getRootThread().getFirstBlip(); String annotationKey = "key"; String annotationValue = "value"; rootBlip.getContent().setAnnotation(0, 1, annotationKey, annotationValue); EventMessageBundle messages = generateAndCheckEvents(EventType.ANNOTATED_TEXT_CHANGED); assertEquals("Expected one event only", 1, messages.getEvents().size()); AnnotatedTextChangedEvent event = AnnotatedTextChangedEvent.as(messages.getEvents().get(0)); assertEquals("Expected the key of the annotation", annotationKey, event.getName()); assertEquals("Expected the value of the annotation", annotationValue, event.getValue()); }