Package org.eclipse.jdt.internal.core.dom.rewrite

Examples of org.eclipse.jdt.internal.core.dom.rewrite.NodeRewriteEvent


    // force event creation
    getNodeEvent(node, property);
  }

  void postValueChangeEvent(ASTNode node, SimplePropertyDescriptor property) {
    NodeRewriteEvent event = getNodeEvent(node, property);
    event.setNewValue(node.getStructuralProperty(property));
  }
View Full Code Here


    event.setNewValue(node.getStructuralProperty(property));
  }

  void preAddChildEvent(ASTNode node, ASTNode child,  StructuralPropertyDescriptor property) {
    if(property.isChildProperty()) {
      NodeRewriteEvent event = getNodeEvent(node, property);
      event.setNewValue(child);
      if(child != null) {
        markAsMoveOrCopyTarget(node, child);
      }
    } else if(property.isChildListProperty()) {
      // force event creation
View Full Code Here

    }
  }

  void preRemoveChildEvent(ASTNode node, ASTNode child, StructuralPropertyDescriptor property) {
    if(property.isChildProperty()) {
      NodeRewriteEvent event = getNodeEvent(node, property);
      event.setNewValue(null);
    } else if(property.isChildListProperty()) {
      ListRewriteEvent event = getListEvent(node, property);
      int i = event.getIndex(child, ListRewriteEvent.NEW);
      NodeRewriteEvent nodeEvent = (NodeRewriteEvent)event.getChildren()[i];
      if(nodeEvent.getOriginalValue() == null) {
        event.revertChange(nodeEvent);
      } else {
        nodeEvent.setNewValue(null);
      }
    }
  }
View Full Code Here

    }
    validateIsCorrectAST(node);
    validatePropertyType(property, value);
    validateIsPropertyOfNode(property, node);

    NodeRewriteEvent nodeEvent= this.eventStore.getNodeEvent(node, property, true);
    nodeEvent.setNewValue(value);
    if (editGroup != null) {
      this.eventStore.setEventEditGroup(nodeEvent, editGroup);
    }
  }
View Full Code Here

    }
  }

  void preReplaceChildEvent(ASTNode node, ASTNode child, ASTNode newChild, StructuralPropertyDescriptor property) {
    if(property.isChildProperty()) {
      NodeRewriteEvent event = getNodeEvent(node, property);
      event.setNewValue(newChild);
      if(newChild != null) {
        markAsMoveOrCopyTarget(node, newChild);
      }
    } else if(property.isChildListProperty()) {
      ListRewriteEvent event = getListEvent(node, property);
      int i = event.getIndex(child, ListRewriteEvent.NEW);
      NodeRewriteEvent nodeEvent = (NodeRewriteEvent)event.getChildren()[i];
      nodeEvent.setNewValue(newChild);
      if(newChild != null) {
        markAsMoveOrCopyTarget(node, newChild);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.core.dom.rewrite.NodeRewriteEvent

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.