Java Code Examples for org.eclipse.emf.common.notify.Notification#getFeature()
The following examples show how to use
org.eclipse.emf.common.notify.Notification#getFeature() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomLaneEditPart.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Override protected void handleNotificationEvent(final Notification notification) { final Object feature = notification.getFeature(); if (NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) { refreshBounds(); for (final CustomLaneEditPart lane : ((CustomPoolCompartmentEditPart) getParent()).getPoolLanes()) { if (!lane.equals(this)) { lane.refreshBounds(); } } ((CustomPoolEditPart) getParent().getParent()).refreshBounds(); } else { super.handleNotificationEvent(notification); } }
Example 2
Source File: AbstractEReferenceChangedListener.java From kieker with Apache License 2.0 | 6 votes |
@Override public final void notifyChanged(final Notification notification) { if (notification.getFeature() == this.listenedFeature) { switch (notification.getEventType()) { case Notification.ADD: this.notifyElementAddedIntern(notification.getNewValue()); break; case Notification.ADD_MANY: final List<?> addedOperationTypes = (List<?>) notification.getNewValue(); addedOperationTypes.forEach(o -> this.notifyElementAddedIntern(o)); break; case Notification.REMOVE: this.notifyElementRemovedIntern(notification.getOldValue()); break; case Notification.REMOVE_MANY: final List<?> removedOperationTypes = (List<?>) notification.getOldValue(); removedOperationTypes.forEach(o -> this.notifyElementRemovedIntern(o)); break; default: break; } } super.notifyChanged(notification); }
Example 3
Source File: ReceiveTaskLabel2EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void handleNotificationEvent(Notification event) { Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { Integer c = (Integer) event.getNewValue(); setFontColor(DiagramColorRegistry.getInstance().getColor(c)); } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { refreshUnderline(); } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { refreshStrikeThrough(); } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { refreshFont(); } else { if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { refreshLabel(); } if (getParser() instanceof ISemanticParser) { ISemanticParser modelParser = (ISemanticParser) getParser(); if (modelParser.areSemanticElementsAffected(null, event)) { removeSemanticListeners(); if (resolveSemanticElement() != null) { addSemanticListeners(); } refreshLabel(); } } } super.handleNotificationEvent(event); }
Example 4
Source File: WrappingLabel2EditPart.java From scava with Eclipse Public License 2.0 | 5 votes |
/** * @generated */ protected void handleNotificationEvent(Notification event) { Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { Integer c = (Integer) event.getNewValue(); setFontColor(DiagramColorRegistry.getInstance().getColor(c)); } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { refreshUnderline(); } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { refreshStrikeThrough(); } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { refreshFont(); } else { if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { refreshLabel(); } if (getParser() instanceof ISemanticParser) { ISemanticParser modelParser = (ISemanticParser) getParser(); if (modelParser.areSemanticElementsAffected(null, event)) { removeSemanticListeners(); if (resolveSemanticElement() != null) { addSemanticListeners(); } refreshLabel(); } } } super.handleNotificationEvent(event); }
Example 5
Source File: ServiceTaskLabelEditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void handleNotificationEvent(Notification event) { Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { Integer c = (Integer) event.getNewValue(); setFontColor(DiagramColorRegistry.getInstance().getColor(c)); } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { refreshUnderline(); } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { refreshStrikeThrough(); } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { refreshFont(); } else { if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { refreshLabel(); } if (getParser() instanceof ISemanticParser) { ISemanticParser modelParser = (ISemanticParser) getParser(); if (modelParser.areSemanticElementsAffected(null, event)) { removeSemanticListeners(); if (resolveSemanticElement() != null) { addSemanticListeners(); } refreshLabel(); } } } super.handleNotificationEvent(event); }
Example 6
Source File: IntermediateThrowMessageEventLabelEditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void handleNotificationEvent(Notification event) { Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { Integer c = (Integer) event.getNewValue(); setFontColor(DiagramColorRegistry.getInstance().getColor(c)); } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { refreshUnderline(); } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { refreshStrikeThrough(); } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { refreshFont(); } else { if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { refreshLabel(); } if (getParser() instanceof ISemanticParser) { ISemanticParser modelParser = (ISemanticParser) getParser(); if (modelParser.areSemanticElementsAffected(null, event)) { removeSemanticListeners(); if (resolveSemanticElement() != null) { addSemanticListeners(); } refreshLabel(); } } } //if 'to' link changed if (event.getEventType() == Notification.SET && feature.equals(ProcessPackage.Literals.THROW_LINK_EVENT__TO)) { refreshLabel(); } super.handleNotificationEvent(event); }
Example 7
Source File: CallActivityNameEditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void handleNotificationEvent(Notification event) { Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { Integer c = (Integer) event.getNewValue(); setFontColor(DiagramColorRegistry.getInstance().getColor(c)); } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { refreshUnderline(); } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { refreshStrikeThrough(); } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { refreshFont(); } else { if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { refreshLabel(); } if (getParser() instanceof ISemanticParser) { ISemanticParser modelParser = (ISemanticParser) getParser(); if (modelParser.areSemanticElementsAffected(null, event)) { removeSemanticListeners(); if (resolveSemanticElement() != null) { addSemanticListeners(); } refreshLabel(); } } } super.handleNotificationEvent(event); }
Example 8
Source File: IntermediateCatchTimerEventLabel2EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void handleNotificationEvent(Notification event) { Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { Integer c = (Integer) event.getNewValue(); setFontColor(DiagramColorRegistry.getInstance().getColor(c)); } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { refreshUnderline(); } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { refreshStrikeThrough(); } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { refreshFont(); } else { if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { refreshLabel(); } if (getParser() instanceof ISemanticParser) { ISemanticParser modelParser = (ISemanticParser) getParser(); if (modelParser.areSemanticElementsAffected(null, event)) { removeSemanticListeners(); if (resolveSemanticElement() != null) { addSemanticListeners(); } refreshLabel(); } } } //if 'to' link changed if (event.getEventType() == Notification.SET && feature.equals(ProcessPackage.Literals.THROW_LINK_EVENT__TO)) { refreshLabel(); } super.handleNotificationEvent(event); }
Example 9
Source File: CustomSubprocessEventCompartmentEditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Override protected void handleNotificationEvent(Notification event) { super.handleNotificationEvent(event); Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getDrawerStyle_Collapsed().equals(feature)){ updateBackgroundColor(event.getNewBooleanValue()) ; updateCollapse(event.getNewBooleanValue()); } }
Example 10
Source File: EndTerminatedEventLabelEditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void handleNotificationEvent(Notification event) { Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { Integer c = (Integer) event.getNewValue(); setFontColor(DiagramColorRegistry.getInstance().getColor(c)); } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { refreshUnderline(); } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { refreshStrikeThrough(); } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { refreshFont(); } else { if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { refreshLabel(); } if (getParser() instanceof ISemanticParser) { ISemanticParser modelParser = (ISemanticParser) getParser(); if (modelParser.areSemanticElementsAffected(null, event)) { removeSemanticListeners(); if (resolveSemanticElement() != null) { addSemanticListeners(); } refreshLabel(); } } } //if 'to' link changed if (event.getEventType() == Notification.SET && feature.equals(ProcessPackage.Literals.THROW_LINK_EVENT__TO)) { refreshLabel(); } super.handleNotificationEvent(event); }
Example 11
Source File: IntermediateErrorCatchEventLabel6EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void handleNotificationEvent(Notification event) { Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { Integer c = (Integer) event.getNewValue(); setFontColor(DiagramColorRegistry.getInstance().getColor(c)); } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { refreshUnderline(); } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { refreshStrikeThrough(); } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { refreshFont(); } else { if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { refreshLabel(); } if (getParser() instanceof ISemanticParser) { ISemanticParser modelParser = (ISemanticParser) getParser(); if (modelParser.areSemanticElementsAffected(null, event)) { removeSemanticListeners(); if (resolveSemanticElement() != null) { addSemanticListeners(); } refreshLabel(); } } } //if 'to' link changed if (event.getEventType() == Notification.SET && feature.equals(ProcessPackage.Literals.THROW_LINK_EVENT__TO)) { refreshLabel(); } super.handleNotificationEvent(event); }
Example 12
Source File: XORGatewayLabelEditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void handleNotificationEvent(Notification event) { Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { Integer c = (Integer) event.getNewValue(); setFontColor(DiagramColorRegistry.getInstance().getColor(c)); } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { refreshUnderline(); } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { refreshStrikeThrough(); } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { refreshFont(); } else { if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { refreshLabel(); } if (getParser() instanceof ISemanticParser) { ISemanticParser modelParser = (ISemanticParser) getParser(); if (modelParser.areSemanticElementsAffected(null, event)) { removeSemanticListeners(); if (resolveSemanticElement() != null) { addSemanticListeners(); } refreshLabel(); } } } //if 'to' link changed if (event.getEventType() == Notification.SET && feature.equals(ProcessPackage.Literals.THROW_LINK_EVENT__TO)) { refreshLabel(); } super.handleNotificationEvent(event); }
Example 13
Source File: IntermediateErrorCatchEventLabel3EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void handleNotificationEvent(Notification event) { Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { Integer c = (Integer) event.getNewValue(); setFontColor(DiagramColorRegistry.getInstance().getColor(c)); } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { refreshUnderline(); } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { refreshStrikeThrough(); } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { refreshFont(); } else { if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { refreshLabel(); } if (getParser() instanceof ISemanticParser) { ISemanticParser modelParser = (ISemanticParser) getParser(); if (modelParser.areSemanticElementsAffected(null, event)) { removeSemanticListeners(); if (resolveSemanticElement() != null) { addSemanticListeners(); } refreshLabel(); } } } //if 'to' link changed if (event.getEventType() == Notification.SET && feature.equals(ProcessPackage.Literals.THROW_LINK_EVENT__TO)) { refreshLabel(); } super.handleNotificationEvent(event); }
Example 14
Source File: CsvSinkNameEditPart.java From scava with Eclipse Public License 2.0 | 5 votes |
/** * @generated */ protected void handleNotificationEvent(Notification event) { Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { Integer c = (Integer) event.getNewValue(); setFontColor(DiagramColorRegistry.getInstance().getColor(c)); } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { refreshUnderline(); } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { refreshStrikeThrough(); } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { refreshFont(); } else { if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { refreshLabel(); } if (getParser() instanceof ISemanticParser) { ISemanticParser modelParser = (ISemanticParser) getParser(); if (modelParser.areSemanticElementsAffected(null, event)) { removeSemanticListeners(); if (resolveSemanticElement() != null) { addSemanticListeners(); } refreshLabel(); } } } super.handleNotificationEvent(event); }
Example 15
Source File: TextAnnotationText2EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void handleNotificationEvent(Notification event) { Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { Integer c = (Integer) event.getNewValue(); setFontColor(DiagramColorRegistry.getInstance().getColor(c)); } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { refreshUnderline(); } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { refreshStrikeThrough(); } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { refreshFont(); } else { if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { refreshLabel(); } if (getParser() instanceof ISemanticParser) { ISemanticParser modelParser = (ISemanticParser) getParser(); if (modelParser.areSemanticElementsAffected(null, event)) { removeSemanticListeners(); if (resolveSemanticElement() != null) { addSemanticListeners(); } refreshLabel(); } } } super.handleNotificationEvent(event); }
Example 16
Source File: TypeNameEditPart.java From scava with Eclipse Public License 2.0 | 5 votes |
/** * @generated */ protected void handleNotificationEvent(Notification event) { Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { Integer c = (Integer) event.getNewValue(); setFontColor(DiagramColorRegistry.getInstance().getColor(c)); } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { refreshUnderline(); } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { refreshStrikeThrough(); } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { refreshFont(); } else { if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { refreshLabel(); } if (getParser() instanceof ISemanticParser) { ISemanticParser modelParser = (ISemanticParser) getParser(); if (modelParser.areSemanticElementsAffected(null, event)) { removeSemanticListeners(); if (resolveSemanticElement() != null) { addSemanticListeners(); } refreshLabel(); } } } super.handleNotificationEvent(event); }
Example 17
Source File: ActivityNameEditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void handleNotificationEvent(Notification event) { Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { Integer c = (Integer) event.getNewValue(); setFontColor(DiagramColorRegistry.getInstance().getColor(c)); } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { refreshUnderline(); } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { refreshStrikeThrough(); } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { refreshFont(); } else { if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { refreshLabel(); } if (getParser() instanceof ISemanticParser) { ISemanticParser modelParser = (ISemanticParser) getParser(); if (modelParser.areSemanticElementsAffected(null, event)) { removeSemanticListeners(); if (resolveSemanticElement() != null) { addSemanticListeners(); } refreshLabel(); } } } super.handleNotificationEvent(event); }
Example 18
Source File: IntermediateCatchMessageEventLabel2EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void handleNotificationEvent(Notification event) { Object feature = event.getFeature(); if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { Integer c = (Integer) event.getNewValue(); setFontColor(DiagramColorRegistry.getInstance().getColor(c)); } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { refreshUnderline(); } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { refreshStrikeThrough(); } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { refreshFont(); } else { if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { refreshLabel(); } if (getParser() instanceof ISemanticParser) { ISemanticParser modelParser = (ISemanticParser) getParser(); if (modelParser.areSemanticElementsAffected(null, event)) { removeSemanticListeners(); if (resolveSemanticElement() != null) { addSemanticListeners(); } refreshLabel(); } } } //if 'to' link changed if (event.getEventType() == Notification.SET && feature.equals(ProcessPackage.Literals.THROW_LINK_EVENT__TO)) { refreshLabel(); } super.handleNotificationEvent(event); }
Example 19
Source File: XtextLinker.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@SuppressWarnings("unchecked") @Override public void notifyChanged(Notification msg) { super.notifyChanged(msg); if (!msg.isTouch() && msg.getOldValue() != null) { ResourceSet set; Resource notifyingResource; if (!(msg.getNotifier() instanceof Resource)) { Object feature = msg.getFeature(); if (!(feature instanceof EReference)) return; EReference ref = (EReference) feature; if (!ref.isContainment()) return; notifyingResource = ((EObject) msg.getNotifier()).eResource(); } else { notifyingResource = ((Resource) msg.getNotifier()); } if (notifyingResource == null) return; set = notifyingResource.getResourceSet(); if (set == null) return; switch (msg.getEventType()) { case Notification.REMOVE_MANY: case Notification.REMOVE: case Notification.SET: Object oldValue = msg.getOldValue(); Collection<Resource> resourcesToRemove = Sets.newHashSet(); Collection<Resource> resourcesToUnload = Sets.newHashSet(); Collection<Resource> referencedResources = Sets.newHashSet(notifyingResource); if (oldValue instanceof Grammar) { processMetamodelDeclarations(((Grammar) oldValue).getMetamodelDeclarations(), set, resourcesToRemove, resourcesToUnload, referencedResources); } else if (oldValue instanceof AbstractMetamodelDeclaration) { processMetamodelDeclarations(Collections .singletonList((AbstractMetamodelDeclaration) oldValue), set, resourcesToRemove, resourcesToUnload, referencedResources); } else if (oldValue instanceof Collection<?>) { if (XtextPackage.Literals.GRAMMAR__METAMODEL_DECLARATIONS == msg.getFeature()) { Collection<AbstractMetamodelDeclaration> metamodelDeclarations = (Collection<AbstractMetamodelDeclaration>) oldValue; processMetamodelDeclarations(metamodelDeclarations, set, resourcesToRemove, resourcesToUnload, referencedResources); } } resourcesToRemove.removeAll(referencedResources); if (unloader != null) { resourcesToUnload.removeAll(referencedResources); for (Resource resource : resourcesToUnload) { if(resource.getResourceSet() == set) { for (EObject content : resource.getContents()) unloader.unloadRoot(content); } } } set.getResources().removeAll(resourcesToRemove); break; default: break; } } }
Example 20
Source File: AbstractPriorityDecorationProvider.java From statecharts with Eclipse Public License 1.0 | 4 votes |
public void notifyChanged(Notification notification) { if (notification.getFeature() == owningReference) refresh(); }