Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.IJavaElementDelta


public class MyElementChangedListener implements IElementChangedListener {

  @Override
  public void elementChanged(ElementChangedEvent event) {
    IJavaElementDelta delta = event.getDelta();
    //System.out.println(delta);
  }
View Full Code Here


   * This method is notified on a changed element and initiates a search if
   * the appropriate change has occured.
   */
  @Override
  public void elementChanged(ElementChangedEvent event) {
    IJavaElementDelta delta = event.getDelta();

    // We are interested only in AST changes
    if ((delta.getFlags() & IJavaElementDelta.F_AST_AFFECTED) != 0) {
      // Stop execution if we should ignore the event
      if (ignoreNextEvent) {
        ignoreNextEvent = false;
        return;
      }
View Full Code Here

   * This method is notified on a changed element and initiates a search if
   * the appropriate change has occured.
   */
  @Override
  public void elementChanged(ElementChangedEvent event) {
    IJavaElementDelta delta = event.getDelta();

    // We are interested only in AST changes
    if ((delta.getFlags() & IJavaElementDelta.F_AST_AFFECTED) != 0) {
      // Stop execution if we should ignore the event
      if (ignoreNextEvent) {
        ignoreNextEvent = false;
        return;
      }
View Full Code Here

  IJavaElement element = delta.getElement();
  switch (element.getElementType()) {
    case IJavaElement.JAVA_MODEL:
      IJavaElementDelta[] children = delta.getAffectedChildren();
      for (int i = 0, length = children.length; i < length; i++) {
        IJavaElementDelta child = children[i];
        processDelta(child, eventType);
      }
      break;
    case IJavaElement.JAVA_PROJECT:
      int kind = delta.getKind();
      switch (kind) {
        case IJavaElementDelta.ADDED:
        case IJavaElementDelta.REMOVED:
          this.enclosingPaths = null;
          break;
        case IJavaElementDelta.CHANGED:
          int flags = delta.getFlags();
          if ((flags & IJavaElementDelta.F_CLOSED) != 0
              || (flags & IJavaElementDelta.F_OPENED) != 0) {
            this.enclosingPaths = null;
          } else {
            children = delta.getAffectedChildren();
            for (int i = 0, length = children.length; i < length; i++) {
              IJavaElementDelta child = children[i];
              processDelta(child, eventType);
            }
          }
          break;
      }
View Full Code Here

     * Update classpath for appropriate loader.
     * @see org.eclipse.jdt.core.IElementChangedListener#elementChanged(org.eclipse.jdt.core.ElementChangedEvent)
     */
  public void elementChanged(ElementChangedEvent event) {
    // handle classpath changes
    IJavaElementDelta delta = event.getDelta();
    if (delta.getElement().getElementType() == IJavaElement.JAVA_MODEL) {
      IJavaElementDelta[] changed = delta.getChangedChildren();
      for (int i = 0; i < changed.length; i++) {
        if ((changed[i].getFlags() & IJavaElementDelta.F_CLASSPATH_CHANGED) != 0 || (changed[i].getFlags() & IJavaElementDelta.F_REORDER) != 0 || (changed[i].getFlags() & IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED) != 0 || (changed[i].getFlags() & IJavaElementDelta.F_PRIMARY_RESOURCE) != 0) {
          IJavaElement proj = changed[i].getElement();
          handleClasspathChange(changed, i, proj);
        }
      }
    }
    else if (delta.getElement().getElementType() == IJavaElement.COMPILATION_UNIT) {
      IJavaElementDelta[] changed = delta.getChangedChildren();
      for (int i = 0; i < changed.length; i++) {
        if ((changed[i].getFlags() & IJavaElementDelta.F_SUPER_TYPES) != 0) {
          IJavaElement element = changed[i].getElement();
          handleSuperTypeChange(element);
        }
View Full Code Here

    /*
     * @see org.eclipse.jdt.core.IElementChangedListener#elementChanged(org.eclipse.jdt.core.ElementChangedEvent)
     */
    public void elementChanged(ElementChangedEvent e) {
      IJavaElementDelta delta = findElement(fInput, e.getDelta());
      if (delta != null &&
              (delta.getFlags() & (IJavaElementDelta.F_CONTENT | IJavaElementDelta.F_CHILDREN)) != 0) {

        CompilationUnit unitAST = e.getDelta().getCompilationUnitAST();
        if (shouldIgnoreDelta(unitAST, delta))
          return;

View Full Code Here

        return delta;

      IJavaElementDelta[] children = delta.getAffectedChildren();

      for (int i = 0; i < children.length; i++) {
        IJavaElementDelta d = findElement(target, children[i]);
        if (d != null)
          return d;
      }

      return null;
View Full Code Here

    /*
     * @see org.eclipse.jdt.core.IElementChangedListener#elementChanged(org.eclipse.jdt.core.ElementChangedEvent)
     */
    public void elementChanged(ElementChangedEvent e) {
      IJavaElementDelta delta = findElement(fInput, e.getDelta());
      if (delta != null &&
              (delta.getFlags() & (IJavaElementDelta.F_CONTENT | IJavaElementDelta.F_CHILDREN)) != 0) {

        CompilationUnit unitAST = e.getDelta().getCompilationUnitAST();
        if (shouldIgnoreDelta(unitAST, delta))
          return;

View Full Code Here

        return delta;

      IJavaElementDelta[] children = delta.getAffectedChildren();

      for (int i = 0; i < children.length; i++) {
        IJavaElementDelta d = findElement(target, children[i]);
        if (d != null)
          return d;
      }

      return null;
View Full Code Here

   * Adds the children of the given delta to the list of changes.
   */
  private void addAffectedChildren(IJavaElementDelta delta) throws JavaModelException {
    IJavaElementDelta[] children = delta.getAffectedChildren();
    for (int i = 0, length = children.length; i < length; i++) {
      IJavaElementDelta child = children[i];
      IJavaElement childElement = child.getElement();
      switch (childElement.getElementType()) {
        case IJavaElement.IMPORT_CONTAINER:
          addChange((IImportContainer)childElement, child);
          break;
        case IJavaElement.IMPORT_DECLARATION:
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.IJavaElementDelta

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.