Package org.eclipse.emf.ecore

Examples of org.eclipse.emf.ecore.EAnnotation


    List result = new UniqueEList();
    List annotations = metaObject.getEAnnotations();
    int size = annotations.size();
    for (int i=0; i<size; i++)
    {
      EAnnotation annotation = (EAnnotation)annotations.get(i);
      String propertyURI = annotation.getSource();
     
      for (Iterator iter = annotation.getDetails().iterator(); iter.hasNext(); )
      {
        EStringToStringMapEntryImpl entry = (EStringToStringMapEntryImpl)iter.next();
        String propertyName = entry.getTypedKey();
       
        Property globalProperty = getGlobalProperty(hc, propertyURI, propertyName);
View Full Code Here


  /**
   * Returns the listing of alias names as specified by the sdo:aliasNames
   * property.
   */
  public List getAliasNames(EModelElement modelElement) {
    EAnnotation eAnnotation = getAnnotation(modelElement, false);
    List list = null;
    if (eAnnotation != null) {
      String aliasNames = (String)eAnnotation.getDetails().get("aliasNames");
      if (aliasNames != null) {
        list = new ArrayList();
        StringTokenizer st = new StringTokenizer(aliasNames, " ");
        while (st.hasMoreTokens()) {
          String t = st.nextToken();
View Full Code Here

 
  /**
   * Adds an alias name per sdo:aliasName
   */
  public void setAliasNames(EModelElement modelElement, String aliasNames) {
    EAnnotation eAnnotation = getAnnotation(modelElement, true);
    eAnnotation.getDetails().put("aliasNames", aliasNames);
  }
View Full Code Here

    setInstanceProperty((ENamedElement)property, namespaceURI, propertyName, propertyValue);
  }
 
  private void setInstanceProperty(ENamedElement eNamedElement, String namespaceURI, String propertyName, String propertyValue)
  {
    EAnnotation annotation = eNamedElement.getEAnnotation(namespaceURI);
    if (annotation == null)
    {
      addAnnotation(eNamedElement, namespaceURI, new String[]{propertyName, propertyValue});
    } else
    {
      annotation.getDetails().put(propertyName, propertyValue);
    }
  }
View Full Code Here

    List result = new UniqueEList();
    List annotations = metaObject.getEAnnotations();
    int size = annotations.size();
    for (int i=0; i<size; i++)
    {
      EAnnotation annotation = (EAnnotation)annotations.get(i);
      String propertyURI = annotation.getSource();
     
      for (Iterator iter = annotation.getDetails().iterator(); iter.hasNext(); )
      {
        EStringToStringMapEntryImpl entry = (EStringToStringMapEntryImpl)iter.next();
        String propertyName = entry.getTypedKey();
       
        Property globalProperty = getGlobalProperty(hc, propertyURI, propertyName);
View Full Code Here

        addInstanceProperty((EModelElement)definedProperty, instanceProperty, value);
    }

    protected void addInstanceProperty(EModelElement metaObject, Property property, Object value) {
        String uri = property.getContainingType().getURI();
        EAnnotation eAnnotation = metaObject.getEAnnotation(uri);
        if (eAnnotation == null) {
            eAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
            eAnnotation.setSource(uri);
            metaObject.getEAnnotations().add(eAnnotation);
        }
        // TODO if (property.isMany()) ... // convert list of values
        String stringValue = convertToString(property.getType(), value);
        eAnnotation.getDetails().put(property.getName(), stringValue);
    }
View Full Code Here

  protected Command getDestroyElementCommand(DestroyElementRequest req) {
    View view = (View) getHost().getModel();
    CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(
        getEditingDomain(), null);
    cmd.setTransactionNestingEnabled(false);
    EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
    if (annotation == null) {
      // there are indirectly referenced children, need extra commands: false
      addDestroyChildNodesCommand(cmd);
      addDestroyShortcutsCommand(cmd, view);
      // delete host element
View Full Code Here

  protected Command getDestroyElementCommand(DestroyElementRequest req) {
    View view = (View) getHost().getModel();
    CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(
        getEditingDomain(), null);
    cmd.setTransactionNestingEnabled(false);
    EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
    if (annotation == null) {
      // there are indirectly referenced children, need extra commands: false
      addDestroyChildNodesCommand(cmd);
      addDestroyShortcutsCommand(cmd, view);
      // delete host element
View Full Code Here

  protected Command getDestroyElementCommand(DestroyElementRequest req) {
    View view = (View) getHost().getModel();
    CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(
        getEditingDomain(), null);
    cmd.setTransactionNestingEnabled(false);
    EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
    if (annotation == null) {
      // there are indirectly referenced children, need extra commands: true
      addDestroyChildNodesCommand(cmd);
      addDestroyShortcutsCommand(cmd, view);
      // delete host element
View Full Code Here

        cmd.add(new DestroyElementCommand(r));
        cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
        continue;
      }
    }
    EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
    if (annotation == null) {
      // there are indirectly referenced children, need extra commands: true
      addDestroyChildNodesCommand(cmd);
      addDestroyShortcutsCommand(cmd, view);
      // delete host element
View Full Code Here

TOP

Related Classes of org.eclipse.emf.ecore.EAnnotation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.