Ejemplo n.º 1
0
  /** @generated */
  @Override
  protected void handleNotificationEvent(Notification notification) {
    super.handleNotificationEvent(notification);

    if (notification.getNotifier() instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Feature
        && ((EStructuralFeature) notification.getFeature()).getName().equals("expressed")) {
      IGraphicalEditPart parent = (IGraphicalEditPart) getParent();
      de.uni_mannheim.informatik.swt.models.plm.PLM.Element self =
          (de.uni_mannheim.informatik.swt.models.plm.PLM.Element) resolveSemanticElement();

      // Check is visible
      if (parent.resolveSemanticElement()
          instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) {
        de.uni_mannheim.informatik.swt.models.plm.PLM.Context container =
            (de.uni_mannheim.informatik.swt.models.plm.PLM.Context) parent.resolveSemanticElement();
        if ((container.getOrigin().equalsIgnoreCase("computed") && self.isExpressed())
            || (container.getOrigin().equalsIgnoreCase("expressed") && !self.isExpressed())) {
          getNotationView().setVisible(false);
        }
      } else {
        getNotationView().setVisible(true);
      }

      de.uni_mannheim.informatik.swt.models.plm.PLM.Feature f =
          (de.uni_mannheim.informatik.swt.models.plm.PLM.Feature) resolveSemanticElement();
      if (f.isExpressed()) {
        ((org.eclipse.gmf.runtime.notation.Shape) this.getNotationView()).setItalic(false);
        ((org.eclipse.gmf.runtime.notation.Shape) this.getNotationView()).setFontColor(0);
      } else {
        ((org.eclipse.gmf.runtime.notation.Shape) this.getNotationView()).setItalic(true);
        ((org.eclipse.gmf.runtime.notation.Shape) this.getNotationView())
            .setFontColor(FigureUtilities.colorToInteger(DiagramColorConstants.diagramGray));
      }
    }
  }
 /** @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);
 }
Ejemplo n.º 3
0
 @Override
 public void notifyChanged(Notification notification) {
   if (notification.getFeatureID(Diagram.class) == NotationPackage.DIAGRAM__NAME
       && notification.getNotifier() == diagram) {
     setPartName(diagram.getName());
   }
 }
 public static boolean affects(Notification notification, EClass clz) {
   if (notification.isTouch()) {
     return false;
   }
   switch (notification.getEventType()) {
     case Notification.ADD:
     case Notification.SET:
       return clz.isInstance(notification.getNewValue());
     case Notification.REMOVE:
     case Notification.UNSET:
       return clz.isInstance(notification.getOldValue());
     case Notification.ADD_MANY:
       return affects(notification.getNewValue(), clz);
     case Notification.REMOVE_MANY:
       return affects(notification.getOldValue(), clz);
     case Notification.MOVE:
       if (notification.getNotifier() instanceof EObject
           && notification.getFeature() instanceof EStructuralFeature) {
         return affects(
             ((EObject) notification.getNotifier())
                 .eGet((EStructuralFeature) notification.getFeature()),
             clz);
       }
       return false;
   }
   return false;
 }
Ejemplo n.º 5
0
  /**
   * Checks only if removed object was an Ensemble, if true, closes all open Ensemble Editors.
   *
   * <p>Checking remove event and correct classes is done by the NotificationFilter
   */
  @Override
  protected void handleNotification(TransactionalEditingDomain domain, Notification notification) {

    if (notification.getOldValue() instanceof Ensemble) {
      final Ensemble oldEnsemble = (Ensemble) notification.getOldValue();

      Display.getDefault()
          .asyncExec(
              new Runnable() {
                @Override
                public void run() {
                  IWorkbenchPage page = getActivePage();
                  Ensemble ens = oldEnsemble;

                  if (page != null) {
                    IEditorReference[] editors =
                        page.findEditors(
                            new EnsembleEditorInput(ens),
                            EnsembleEditor.ID,
                            IWorkbenchPage.MATCH_ID | IWorkbenchPage.MATCH_INPUT);

                    page.closeEditors(editors, false);
                  }
                }
              });
    }
  }
 /**
  * Add the following notifications to the list to be processed at the next asynchronous
  * opportunity. Returns true if any of the notifications could remove, add, or change any
  * violations.
  *
  * @param notifications
  * @return boolean
  */
 public final boolean enqueue(List<Notification> notifications) {
   Boolean isPaused = null;
   List<Notification> filtered = new ArrayList<Notification>();
   for (Notification notification : notifications) {
     if (notification.getEventType() == Notification.RESOLVE) {
       continue;
     } else if (notification.getEventType() == ControlNotification.PAUSE) {
       isPaused = true;
       continue;
     } else if (notification.getEventType() == ControlNotification.RESUME) {
       isPaused = false;
       filtered.add(notification);
       continue;
     }
     if (isImportant(notification)) {
       filtered.add(notification);
     }
   }
   if (filtered.isEmpty() && (isPaused == null || !isPaused)) {
     return false;
   }
   synchronized (queueLock) {
     if (isPaused != null) {
       paused = isPaused;
     }
     queuedNotifications.addAll(filtered);
     queueLock.notify();
   }
   return !paused;
 }
Ejemplo n.º 7
0
        @Override
        public void notifyChanged(Notification notification) {
          if (notification.getNotifier() instanceof Resource) {
            switch (notification.getFeatureID(Resource.class)) {
              case Resource.RESOURCE__IS_LOADED:
              case Resource.RESOURCE__ERRORS:
              case Resource.RESOURCE__WARNINGS:
                {
                  Resource resource = (Resource) notification.getNotifier();
                  Diagnostic diagnostic = analyzeResourceProblems(resource, null);
                  if (diagnostic.getSeverity() != Diagnostic.OK) {
                    resourceToDiagnosticMap.put(resource, diagnostic);
                  } else {
                    resourceToDiagnosticMap.remove(resource);
                  }

                  if (updateProblemIndication) {
                    getSite()
                        .getShell()
                        .getDisplay()
                        .asyncExec(
                            new Runnable() {
                              @Override
                              public void run() {
                                updateProblemIndication();
                              }
                            });
                  }
                  break;
                }
            }
          } else {
            super.notifyChanged(notification);
          }
        }
Ejemplo n.º 8
0
 @Override
 protected boolean affectsViolations(Notification notification) {
   Object feature = notification.getFeature();
   if ((feature == PlanPackage.Literals.EPLAN_PARENT__CHILDREN)
       || (feature == PlanPackage.Literals.EACTIVITY__CHILDREN)) {
     return true;
   }
   if ((feature == TemporalPackage.Literals.TEMPORAL_MEMBER__START_TIME)
       || (feature == TemporalPackage.Literals.TEMPORAL_MEMBER__DURATION)
       || (feature == TemporalPackage.Literals.TEMPORAL_MEMBER__END_TIME)
       || (feature == TemporalPackage.Literals.TEMPORAL_MEMBER__SCHEDULED)) {
     return true;
   }
   if ((feature == ConstraintsPackage.Literals.CONSTRAINTS_MEMBER__PERIODIC_TEMPORAL_CONSTRAINTS)
       || (feature == ConstraintsPackage.Literals.CONSTRAINTS_MEMBER__BINARY_TEMPORAL_CONSTRAINTS)
       || (feature == ConstraintsPackage.Literals.CONSTRAINTS_MEMBER__CHAIN)) {
     return true;
   }
   if (feature == AdvisorPackage.Literals.IWAIVABLE__WAIVER_RATIONALE) {
     return true;
   }
   if (ADParameterUtils.isActivityAttributeOrParameter(notification.getNotifier())) {
     return true;
   }
   return false;
 }
Ejemplo n.º 9
0
 @Override
 public void notifyChanged(Notification notification) {
   super.notifyChanged(notification);
   if (this.object == notification.getNotifier() && this.feature == notification.getFeature()) {
     button.setSelection((Boolean) object.eGet(feature));
   }
 }
 @Override
 public void processNotifications(TemporalEdgeManager manager, List<Notification> notifications) {
   for (Notification notification : notifications) {
     Object feature = notification.getFeature();
     // Temporal changes
     //
     if (TemporalPackage.Literals.TEMPORAL_MEMBER__START_TIME == feature
         || TemporalPackage.Literals.TEMPORAL_MEMBER__DURATION == feature
         || TemporalPackage.Literals.TEMPORAL_MEMBER__END_TIME == feature) {
       EActivity eActivity =
           (EActivity) ((TemporalMember) notification.getNotifier()).getPlanElement();
       removeActivityEdges(manager, eActivity);
       addActivityEdges(manager, eActivity);
     }
     // Hierarchy changes
     //
     if (PlanPackage.Literals.EPLAN_PARENT__CHILDREN == feature
         || PlanPackage.Literals.EACTIVITY__CHILDREN == feature) {
       for (EActivity activity : EMFUtils.getAddedObjects(notification, EActivity.class)) {
         addActivityEdges(manager, activity);
       }
       for (EActivity activity : EMFUtils.getRemovedObjects(notification, EActivity.class)) {
         removeActivityEdges(manager, activity);
       }
     }
   }
 }
Ejemplo n.º 11
0
  /**
   * This handles model notifications by calling {@link #updateChildren} to update any cached
   * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated
   */
  @Override
  public void notifyChanged(Notification notification) {
    updateChildren(notification);

    switch (notification.getFeatureID(ListFieldMetaData.class)) {
      case RfcPackage.LIST_FIELD_META_DATA__NAME:
      case RfcPackage.LIST_FIELD_META_DATA__TYPE:
      case RfcPackage.LIST_FIELD_META_DATA__BYTE_LENGTH:
      case RfcPackage.LIST_FIELD_META_DATA__UNICODE_BYTE_LENGTH:
      case RfcPackage.LIST_FIELD_META_DATA__DECIMALS:
      case RfcPackage.LIST_FIELD_META_DATA__DEFAULTS:
      case RfcPackage.LIST_FIELD_META_DATA__DESCRIPTION:
      case RfcPackage.LIST_FIELD_META_DATA__IMPORT:
      case RfcPackage.LIST_FIELD_META_DATA__CHANGING:
      case RfcPackage.LIST_FIELD_META_DATA__EXPORT:
      case RfcPackage.LIST_FIELD_META_DATA__EXCEPTION:
      case RfcPackage.LIST_FIELD_META_DATA__OPTIONAL:
        fireNotifyChanged(
            new ViewerNotification(notification, notification.getNotifier(), false, true));
        return;
      case RfcPackage.LIST_FIELD_META_DATA__FIELD_META_DATA:
        fireNotifyChanged(
            new ViewerNotification(notification, notification.getNotifier(), true, false));
        return;
    }
    super.notifyChanged(notification);
  }
 /**
  * {@inheritDoc}
  *
  * @see
  *     org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification)
  */
 public void updatePart(Notification msg) {
   super.updatePart(msg);
   if (editingPart.isVisible()) {
     DomainClassPropertiesEditionPart domainClassPart =
         (DomainClassPropertiesEditionPart) editingPart;
     if (EnvironmentPackage.eINSTANCE.getType_Name().equals(msg.getFeature())
         && msg.getNotifier().equals(semanticObject)
         && domainClassPart != null
         && isAccessible(GraalViewsRepository.DomainClass.Properties.name)) {
       if (msg.getNewValue() != null) {
         domainClassPart.setName(
             EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
       } else {
         domainClassPart.setName("");
       }
     }
     if (EnvironmentPackage.eINSTANCE.getStructuredType_Supertype().equals(msg.getFeature())
         && domainClassPart != null
         && isAccessible(GraalViewsRepository.DomainClass.Properties.superType))
       domainClassPart.setSuperType((EObject) msg.getNewValue());
     if (EnvironmentPackage.eINSTANCE.getObeoDSMObject_Description().equals(msg.getFeature())
         && msg.getNotifier().equals(semanticObject)
         && domainClassPart != null
         && isAccessible(GraalViewsRepository.DomainClass.Properties.description)) {
       if (msg.getNewValue() != null) {
         domainClassPart.setDescription(
             EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
       } else {
         domainClassPart.setDescription("");
       }
     }
   }
 }
  /** {@inheritDoc} */
  @Override
  public void notifyChanged(final Notification notification) {
    updateChildren(notification);

    switch (notification.getFeatureID(Implementation.class)) {
      case SpdPackage.IMPLEMENTATION__DESCRIPTION:
      case SpdPackage.IMPLEMENTATION__PROPERTY_FILE:
      case SpdPackage.IMPLEMENTATION__CODE:
      case SpdPackage.IMPLEMENTATION__COMPILER:
      case SpdPackage.IMPLEMENTATION__PROGRAMMING_LANGUAGE:
      case SpdPackage.IMPLEMENTATION__HUMAN_LANGUAGE:
      case SpdPackage.IMPLEMENTATION__RUNTIME:
      case SpdPackage.IMPLEMENTATION__AEP_COMPLIANCE:
      case SpdPackage.IMPLEMENTATION__ID:
        fireNotifyChanged(
            new ViewerNotification(notification, notification.getNotifier(), false, true));
        return;
      case SpdPackage.IMPLEMENTATION__OS:
      case SpdPackage.IMPLEMENTATION__PROCESSOR:
      case SpdPackage.IMPLEMENTATION__DEPENDENCY:
      case SpdPackage.IMPLEMENTATION__USES_DEVICE:
        fireNotifyChanged(
            new ViewerNotification(notification, notification.getNotifier(), true, false));
        return;
      default:
        break;
    }
    super.notifyChanged(notification);
  }
Ejemplo n.º 14
0
  /**
   * This handles model notifications by calling {@link #updateChildren} to update any cached
   * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated
   */
  @Override
  public void notifyChanged(Notification notification) {
    updateChildren(notification);

    switch (notification.getFeatureID(DocumentRoot.class)) {
      case RulesPackage.DOCUMENT_ROOT__ACTION:
      case RulesPackage.DOCUMENT_ROOT__ACTIONS:
      case RulesPackage.DOCUMENT_ROOT__CHANNEL:
      case RulesPackage.DOCUMENT_ROOT__CHANNELS:
      case RulesPackage.DOCUMENT_ROOT__CONTAINER:
      case RulesPackage.DOCUMENT_ROOT__GLOBALS:
      case RulesPackage.DOCUMENT_ROOT__IMPLEMENTATION_RULES:
      case RulesPackage.DOCUMENT_ROOT__INPUTS:
      case RulesPackage.DOCUMENT_ROOT__LISTENER:
      case RulesPackage.DOCUMENT_ROOT__LISTENERS:
      case RulesPackage.DOCUMENT_ROOT__LOGGER:
      case RulesPackage.DOCUMENT_ROOT__LOGGERS:
      case RulesPackage.DOCUMENT_ROOT__MANIFEST:
      case RulesPackage.DOCUMENT_ROOT__MAPPING:
      case RulesPackage.DOCUMENT_ROOT__OUTPUTS:
      case RulesPackage.DOCUMENT_ROOT__PROPERTIES:
      case RulesPackage.DOCUMENT_ROOT__PROPERTY:
      case RulesPackage.DOCUMENT_ROOT__RESOURCE:
      case RulesPackage.DOCUMENT_ROOT__RESOURCES:
        fireNotifyChanged(
            new ViewerNotification(notification, notification.getNotifier(), true, false));
        return;
    }
    super.notifyChanged(notification);
  }
Ejemplo n.º 15
0
    /** @generated */
    public void notifyChanged(Notification notification) {
      if (notification.getNotifier() instanceof ResourceSet) {
        super.notifyChanged(notification);
      }
      if (!notification.isTouch() && myModifiedFilter.matches(notification)) {
        if (notification.getNotifier() instanceof Resource) {
          Resource resource = (Resource) notification.getNotifier();
          if (resource.isLoaded()) {
            boolean modified = false;
            for (Iterator /*<org.eclipse.emf.ecore.resource.Resource>*/ it =
                    myInfo.getLoadedResourcesIterator();
                it.hasNext() && !modified; ) {
              Resource nextResource = (Resource) it.next();
              if (nextResource.isLoaded()) {
                modified = nextResource.isModified();
              }
            }
            boolean dirtyStateChanged = false;
            synchronized (myInfo) {
              if (modified != myInfo.fCanBeSaved) {
                myInfo.fCanBeSaved = modified;
                dirtyStateChanged = true;
              }
            }
            if (dirtyStateChanged) {
              fireElementDirtyStateChanged(myInfo.getEditorInput(), modified);

              if (!modified) {
                myInfo.setModificationStamp(computeModificationStamp(myInfo));
              }
            }
          }
        }
      }
    }
        @Override
        public void notifyChanged(final Notification msg) {
          switch (msg.getFeatureID(SdrPackage.class)) {
            case SdrPackage.SDR_ROOT__LOAD_STATUS:
              // The value is the changed load status which will go to null during loading
              // once loading is finished the status will change to reflect that of the SDRROOT.
              if (msg.getNewValue() != null) {
                Job refreshExternalSettingProviderJob =
                    new Job("Refresh External Settings Providers") {

                      @Override
                      protected IStatus run(IProgressMonitor monitor) {
                        CoreModel.getDefault()
                            .getProjectDescriptionManager()
                            .updateExternalSettingsProviders(
                                new String[] {ExternalSettingProvider.ID}, monitor);
                        return Status.OK_STATUS;
                      }
                    };
                refreshExternalSettingProviderJob.setSystem(true); // hide from progress monitor
                refreshExternalSettingProviderJob.setUser(false);
                refreshExternalSettingProviderJob.schedule(1000);
              }
              break;
            default:
              break;
          }
        }
  /**
   * This handles model notifications by calling {@link #updateChildren} to update any cached
   * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated
   */
  @Override
  public void notifyChanged(Notification notification) {
    updateChildren(notification);

    switch (notification.getFeatureID(ComparativeRiskAssessmentForm.class)) {
      case HazardPackage.COMPARATIVE_RISK_ASSESSMENT_FORM__SEC_TRACKING_NUMBER:
      case HazardPackage.COMPARATIVE_RISK_ASSESSMENT_FORM__CRA_TITLE:
      case HazardPackage.COMPARATIVE_RISK_ASSESSMENT_FORM__SYSTEM:
      case HazardPackage.COMPARATIVE_RISK_ASSESSMENT_FORM__SUMMARY:
      case HazardPackage.COMPARATIVE_RISK_ASSESSMENT_FORM__BASELINE:
      case HazardPackage.COMPARATIVE_RISK_ASSESSMENT_FORM__PROPOSED_CHANGE:
      case HazardPackage.COMPARATIVE_RISK_ASSESSMENT_FORM__DESCRIPTION:
      case HazardPackage.COMPARATIVE_RISK_ASSESSMENT_FORM__ASSESSMENT_SUMMARY:
        fireNotifyChanged(
            new ViewerNotification(notification, notification.getNotifier(), false, true));
        return;
      case HazardPackage.COMPARATIVE_RISK_ASSESSMENT_FORM__REFERENCES:
      case HazardPackage.COMPARATIVE_RISK_ASSESSMENT_FORM__RISK_ASSESSMENT:
      case HazardPackage.COMPARATIVE_RISK_ASSESSMENT_FORM__HAZARD_LIST:
        fireNotifyChanged(
            new ViewerNotification(notification, notification.getNotifier(), true, false));
        return;
    }
    super.notifyChanged(notification);
  }
 /** @generated */
 protected void handleNotificationEvent(Notification event) {
   if (event.getNotifier() == getModel()
       && EcorePackage.eINSTANCE.getEModelElement_EAnnotations().equals(event.getFeature())) {
     handleMajorSemanticChange();
   } else {
     super.handleNotificationEvent(event);
   }
 }
 protected void highlight(final Notification notification, HighlightingParameters params) {
   int eventType = notification.getEventType();
   if (eventType == ADD || eventType == ADD_MANY) {
     fadeIn(notification.getNewValue(), params);
   } else if (eventType == REMOVE || eventType == REMOVE_MANY) {
     fadeOut(notification.getOldValue(), params);
   }
 }
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.emf.common.notify.Adapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
  */
 public void notifyChanged(Notification aNotification) {
   if (aNotification.getFeature()
       == ComponentcorePackage.eINSTANCE.getComponentResource_SourcePath()) {
     if (aNotification.getEventType() == Notification.SET) {
       resource = null;
     }
   }
 }
 public void notifyChanged(Notification msg) {
   if (debug) {
     DebugTrace.print(this, "notifyChanged", "msg=" + msg); // $NON-NLS-1$ //$NON-NLS-2$
   }
   if (msg.getFeatureID(null) == Resource.RESOURCE__IS_MODIFIED
       && msg.getEventType() == org.eclipse.emf.common.notify.Notification.SET) {
     firePropertyChange(msg.getNotifier(), PROP_DIRTY);
   }
 }
 private boolean isDTableElementStyleAttributeChange(Notification notification) {
   boolean isStyleFeature =
       notification.getFeature() == TablePackage.Literals.DTABLE_ELEMENT_STYLE__BACKGROUND_COLOR
           || notification.getFeature()
               == TablePackage.Literals.DTABLE_ELEMENT_STYLE__FOREGROUND_COLOR
           || notification.getFeature() == TablePackage.Literals.DTABLE_ELEMENT_STYLE__LABEL_FORMAT
           || notification.getFeature() == TablePackage.Literals.DTABLE_ELEMENT_STYLE__LABEL_SIZE;
   return isStyleFeature && notification.getNotifier() instanceof DTableElementStyle;
 }
Ejemplo n.º 23
0
 protected void handleNotification(Resource resource, Notification msg) {
   switch (msg.getFeatureID(Resource.class)) {
     case Resource.RESOURCE__IS_LOADED:
       if (msg.getNewBooleanValue()) {
         handleResourceLoaded(resource);
       }
       break;
   }
 }
 /** @generated NOT */
 protected void handleNotificationEvent(Notification notification) {
   Object feature = notification.getFeature();
   if (RobmodPackage.eINSTANCE.getPort_External().equals(feature)) {
     if (notification.getNewBooleanValue()) {
       primaryShape.setVisible(false);
     } else {
       primaryShape.setVisible(true);
     }
   } else super.handleNotificationEvent(notification);
 }
Ejemplo n.º 25
0
 @Override
 public void notifyChanged(Notification msg) {
   InstanceImpl inst = (InstanceImpl) target;
   if (inst.cachedAdaptedEntity != null) {
     if (msg.getEventType() == Notification.SET
         && msg.getFeature() == DfPackage.Literals.INSTANCE__ENTITY) {
       inst.cachedAdaptedEntity = null;
     }
   }
 }
  @Override
  public void notifyChanged(Notification notification) {
    super.notifyChanged(notification);

    if (!doRecord(notification)) return;

    if (notification.getNotifier() instanceof EObject) {
      recordObjectModification((EObject) notification.getNotifier());
    }
  }
Ejemplo n.º 27
0
 public void notifyChanged(Notification notification) {
   if (notification.getNotifier() == value
       && !(notification.getOldValue() instanceof InsertionAdapter)) {
     // execute if an attribute in the new value has changed
     execute();
   } else if (notification.getNotifier() == object && notification.getNewValue() == value) {
     // if the new value has been added to the object, we can remove this adapter
     object.eAdapters().remove(this);
   }
 }
 /**
  * {@inheritDoc}
  *
  * @see
  *     org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification)
  */
 public void updatePart(Notification msg) {
   super.updatePart(msg);
   if (editingPart.isVisible()) {
     FlowEventPropertiesEditionPart flowEventPart = (FlowEventPropertiesEditionPart) editingPart;
     if (EnvironmentPackage.eINSTANCE.getObeoDSMObject_Description().equals(msg.getFeature())
         && msg.getNotifier().equals(semanticObject)
         && flowEventPart != null
         && isAccessible(FlowViewsRepository.FlowEvent.Properties.description)) {
       if (msg.getNewValue() != null) {
         flowEventPart.setDescription(
             EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
       } else {
         flowEventPart.setDescription("");
       }
     }
     if (CinematicPackage.eINSTANCE.getNamedElement_Name().equals(msg.getFeature())
         && msg.getNotifier().equals(semanticObject)
         && flowEventPart != null
         && isAccessible(FlowViewsRepository.FlowEvent.Properties.name)) {
       if (msg.getNewValue() != null) {
         flowEventPart.setName(
             EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
       } else {
         flowEventPart.setName("");
       }
     }
     if (FlowPackage.eINSTANCE.getFlowEvent_Binds().equals(msg.getFeature())
         && isAccessible(FlowViewsRepository.FlowEvent.Properties.binds))
       flowEventPart.updateBinds();
   }
 }
Ejemplo n.º 29
0
  @Override
  protected void handleNotificationEvent(Notification notification) {
    super.handleNotificationEvent(notification);
    if ((notification.getEventType() == Notification.SET)
        && (notification.getNotifier() instanceof org.ow2.aspirerfid.ide.bpwme.impl.EBProcImpl)) {

      EBProcImpl epi = (EBProcImpl) notification.getNotifier();
      EAttributeImpl ei = (EAttributeImpl) notification.getFeature();
      MainControl mc = MainControl.getMainControl();

      org.ow2.aspirerfid.commons.apdl.model.EBProc ebproc =
          (org.ow2.aspirerfid.commons.apdl.model.EBProc) mc.getMapObject(epi.hashCode());

      EPCISMasterDataDocumentType doc = MasterDataUtil.getEPCISMasterDataDocument(ebproc);
      VocabularyElementType vocabularyElement = MasterDataUtil.getEBProcVocabularyElement(doc);

      if (ei.getName().equals("id")) {
        ebproc.setId(notification.getNewStringValue());
        MasterDataUtil.setVocabularyElementID(vocabularyElement, notification.getNewStringValue());
      } else if (ei.getName().equals("name")) {
        ebproc.setName(notification.getNewStringValue());
        MasterDataUtil.setVocabularyElementAttribute(
            vocabularyElement,
            "urn:epcglobal:epcis:mda:event_name",
            notification.getNewStringValue());
      } else if (ei.getName().equals("description")) {
        ebproc.setDescription(notification.getNewStringValue());
      } else {
        return;
      }

      mc.saveObject();
    }
  }
 /** {@inheritedDoc} */
 public void notifyChanged(Notification notification) {
   // change the label of the figure managed by the host edit part (managed
   // by the parent edit
   // part in general...)
   // it must be changed only if:
   // - the annotation corresponding to the display of the stereotype
   // changes
   // - the stereotype application list has changed
   final int eventType = notification.getEventType();
   if (eventType == PapyrusStereotypeListener.APPLIED_STEREOTYPE) {
     // a stereotype was applied to the notifier
     // then a new listener should be added to the stereotype application
     getDiagramEventBroker().addNotificationListener((EObject) notification.getNewValue(), this);
     createAppliedStereotypeCompartment((EObject) notification.getNewValue());
   } else if (eventType == PapyrusStereotypeListener.UNAPPLIED_STEREOTYPE) {
     getDiagramEventBroker()
         .removeNotificationListener((EObject) notification.getOldValue(), this);
     removeAppliedStereotypeCompartment((EObject) notification.getNewValue());
   }
   // if element that has changed is a stereotype => refresh the label.
   if (notification.getNotifier() instanceof Node
       && (notification.getEventType() == Notification.ADD)
       && (notification.getNewValue() instanceof EAnnotation)) {
     if (UMLVisualInformationPapyrusConstant.STEREOTYPE_ANNOTATION
         == ((EAnnotation) notification.getNewValue()).getSource()) {
       // stereotype annotation has changed => refresh label display
       refreshDisplay();
     }
   }
 }