/**
   * {@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 Goal goal = (Goal) elt;
      final GoalPropertiesEditionPart basePart = (GoalPropertiesEditionPart) editingPart;
      // init values
      if (goal.getIdentifier() != null
          && isAccessible(GsnViewsRepository.Goal.Properties.identifier))
        basePart.setIdentifier(
            EEFConverterUtil.convertToString(
                ArmPackage.eINSTANCE.getString(), goal.getIdentifier()));

      if (goal.getDescription() != null
          && isAccessible(GsnViewsRepository.Goal.Properties.description))
        basePart.setDescription(
            EEFConverterUtil.convertToString(
                ArmPackage.eINSTANCE.getString(), goal.getDescription()));

      if (goal.getContent() != null && isAccessible(GsnViewsRepository.Goal.Properties.content))
        basePart.setContent(
            EEFConverterUtil.convertToString(ArmPackage.eINSTANCE.getString(), goal.getContent()));

      if (isAccessible(GsnViewsRepository.Goal.Properties.isTagged)) {
        isTaggedSettings =
            new ReferencesTableSettings(goal, ArmPackage.eINSTANCE.getModelElement_IsTagged());
        basePart.initIsTagged(isTaggedSettings);
      }
      if (isAccessible(GsnViewsRepository.Goal.Properties.assumed)) {
        basePart.setAssumed(goal.isAssumed());
      }
      if (isAccessible(GsnViewsRepository.Goal.Properties.toBeSupported)) {
        basePart.setToBeSupported(goal.isToBeSupported());
      }
      if (isAccessible(GsnViewsRepository.Goal.Properties.subGoals)) {
        subGoalsSettings =
            new ReferencesTableSettings(goal, GsnPackage.eINSTANCE.getGoal_SubGoals());
        basePart.initSubGoals(subGoalsSettings);
      }
      if (isAccessible(GsnViewsRepository.Goal.Properties.strategies)) {
        strategiesSettings =
            new ReferencesTableSettings(goal, GsnPackage.eINSTANCE.getGoal_Strategies());
        basePart.initStrategies(strategiesSettings);
      }
      if (isAccessible(GsnViewsRepository.Goal.Properties.goalContexts)) {
        goalContextsSettings =
            new ReferencesTableSettings(goal, GsnPackage.eINSTANCE.getGoal_GoalContexts());
        basePart.initGoalContexts(goalContextsSettings);
      }
      if (isAccessible(GsnViewsRepository.Goal.Properties.assumptions)) {
        assumptionsSettings =
            new ReferencesTableSettings(goal, GsnPackage.eINSTANCE.getGoal_Assumptions());
        basePart.initAssumptions(assumptionsSettings);
      }
      if (isAccessible(GsnViewsRepository.Goal.Properties.goalSolutions)) {
        goalSolutionsSettings =
            new ReferencesTableSettings(goal, GsnPackage.eINSTANCE.getGoal_GoalSolutions());
        basePart.initGoalSolutions(goalSolutionsSettings);
      }
      // init filters

      basePart.addFilterToIsTagged(
          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 String && element.equals(""))
                  || (element instanceof TaggedValue); // $NON-NLS-1$
            }
          });
      // Start of user code for additional businessfilters for isTagged

      // End of user code

      basePart.addFilterToSubGoals(
          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 String && element.equals(""))
                  || (element instanceof Goal); // $NON-NLS-1$
            }
          });
      // Start of user code for additional businessfilters for subGoals

      // End of user code

      basePart.addFilterToStrategies(
          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 String && element.equals(""))
                  || (element instanceof Strategy); // $NON-NLS-1$
            }
          });
      // Start of user code for additional businessfilters for strategies

      // End of user code

      basePart.addFilterToGoalContexts(
          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 String && element.equals(""))
                  || (element instanceof Context); // $NON-NLS-1$
            }
          });
      // Start of user code for additional businessfilters for goalContexts

      // End of user code

      basePart.addFilterToAssumptions(
          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 String && element.equals(""))
                  || (element instanceof Assumption); // $NON-NLS-1$
            }
          });
      // Start of user code for additional businessfilters for assumptions

      // End of user code

      basePart.addFilterToGoalSolutions(
          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 String && element.equals(""))
                  || (element instanceof Solution); // $NON-NLS-1$
            }
          });
      // Start of user code for additional businessfilters for goalSolutions

      // End of user code

      // init values for referenced views

      // init filters for referenced views

    }
    setInitializing(false);
  }
  /**
   * {@inheritDoc}
   *
   * @see
   *     org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification)
   */
  public void updatePart(Notification msg) {
    if (editingPart.isVisible()) {
      GoalPropertiesEditionPart basePart = (GoalPropertiesEditionPart) editingPart;
      if (ArmPackage.eINSTANCE.getModelElement_Identifier().equals(msg.getFeature())
          && basePart != null
          && isAccessible(GsnViewsRepository.Goal.Properties.identifier)) {
        if (msg.getNewValue() != null) {
          basePart.setIdentifier(
              EcoreUtil.convertToString(ArmPackage.eINSTANCE.getString(), msg.getNewValue()));
        } else {
          basePart.setIdentifier("");
        }
      }
      if (ArmPackage.eINSTANCE.getModelElement_Description().equals(msg.getFeature())
          && basePart != null
          && isAccessible(GsnViewsRepository.Goal.Properties.description)) {
        if (msg.getNewValue() != null) {
          basePart.setDescription(
              EcoreUtil.convertToString(ArmPackage.eINSTANCE.getString(), msg.getNewValue()));
        } else {
          basePart.setDescription("");
        }
      }
      if (ArmPackage.eINSTANCE.getModelElement_Content().equals(msg.getFeature())
          && basePart != null
          && isAccessible(GsnViewsRepository.Goal.Properties.content)) {
        if (msg.getNewValue() != null) {
          basePart.setContent(
              EcoreUtil.convertToString(ArmPackage.eINSTANCE.getString(), msg.getNewValue()));
        } else {
          basePart.setContent("");
        }
      }
      if (ArmPackage.eINSTANCE.getModelElement_IsTagged().equals(msg.getFeature())
          && isAccessible(GsnViewsRepository.Goal.Properties.isTagged)) basePart.updateIsTagged();
      if (ArmPackage.eINSTANCE.getClaim_Assumed().equals(msg.getFeature())
          && basePart != null
          && isAccessible(GsnViewsRepository.Goal.Properties.assumed))
        basePart.setAssumed((Boolean) msg.getNewValue());

      if (ArmPackage.eINSTANCE.getClaim_ToBeSupported().equals(msg.getFeature())
          && basePart != null
          && isAccessible(GsnViewsRepository.Goal.Properties.toBeSupported))
        basePart.setToBeSupported((Boolean) msg.getNewValue());

      if (GsnPackage.eINSTANCE.getGoal_SubGoals().equals(msg.getFeature())
          && isAccessible(GsnViewsRepository.Goal.Properties.subGoals)) basePart.updateSubGoals();
      if (GsnPackage.eINSTANCE.getGoal_Strategies().equals(msg.getFeature())
          && isAccessible(GsnViewsRepository.Goal.Properties.strategies))
        basePart.updateStrategies();
      if (GsnPackage.eINSTANCE.getGoal_GoalContexts().equals(msg.getFeature())
          && isAccessible(GsnViewsRepository.Goal.Properties.goalContexts))
        basePart.updateGoalContexts();
      if (GsnPackage.eINSTANCE.getGoal_Assumptions().equals(msg.getFeature())
          && isAccessible(GsnViewsRepository.Goal.Properties.assumptions))
        basePart.updateAssumptions();
      if (GsnPackage.eINSTANCE.getGoal_GoalSolutions().equals(msg.getFeature())
          && isAccessible(GsnViewsRepository.Goal.Properties.goalSolutions))
        basePart.updateGoalSolutions();
    }
  }