/**
   * {@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 Namespace namespace = (Namespace) elt;
      final NamespacePropertiesEditionPart namespacePart =
          (NamespacePropertiesEditionPart) editingPart;
      // init values
      if (isAccessible(EnvironmentViewsRepository.Namespace.Properties.name))
        namespacePart.setName(
            EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, namespace.getName()));

      if (isAccessible(EnvironmentViewsRepository.Namespace.Properties.description))
        namespacePart.setDescription(
            EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, namespace.getDescription()));
      // init filters

      // init values for referenced views

      // init filters for referenced views

    }
    setInitializing(false);
  }
コード例 #2
0
 public BindingRegistry getBindingRegistry(Namespace namespace) {
   if (namespace.getBindingRegistries().isEmpty()) {
     BindingRegistry bindingRegistry = EnvironmentFactory.eINSTANCE.createBindingRegistry();
     namespace.getBindingRegistries().add(bindingRegistry);
     namespace.eResource().getContents().add(bindingRegistry);
     return bindingRegistry;
   } else {
     return namespace.getBindingRegistries().get(0);
   }
 }
 /**
  * {@inheritDoc}
  *
  * @see
  *     org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updateSemanticModel(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
  */
 public void updateSemanticModel(final IPropertiesEditionEvent event) {
   Namespace namespace = (Namespace) semanticObject;
   if (EnvironmentViewsRepository.Namespace.Properties.name == event.getAffectedEditor()) {
     namespace.setName(
         (java.lang.String)
             EEFConverterUtil.createFromString(
                 EcorePackage.Literals.ESTRING, (String) event.getNewValue()));
   }
   if (EnvironmentViewsRepository.Namespace.Properties.description == event.getAffectedEditor()) {
     namespace.setDescription(
         (java.lang.String)
             EEFConverterUtil.createFromString(
                 EcorePackage.Literals.ESTRING, (String) event.getNewValue()));
   }
 }
コード例 #4
0
  public Collection<BindingInfo> getRelatedBindingInfos(Namespace namespace) {
    // Use of LinkedHashSet to keep order and avoid potential lock/unlock
    // loops problems
    Set<BindingInfo> results = new LinkedHashSet<BindingInfo>();

    // BindingInfos to be displayed for a namespace are :
    // - the instances directly contained by the namespace
    // - bindings concerning a Structured Type directly from the namespace

    for (BindingRegistry bindingRegistry : namespace.getBindingRegistries()) {
      results.addAll(bindingRegistry.getBindingInfos());
    }

    for (Type containedType : namespace.getTypes()) {
      if (containedType instanceof StructuredType) {
        StructuredType containedStructuredType = (StructuredType) containedType;
        results.addAll(getRelatedBindingInfos(containedStructuredType));
      }
    }

    return results;
  }
コード例 #5
0
 @Override
 public String caseNamespace(Namespace object) {
   return object.getName();
 }