Java 类com.intellij.psi.PsiTreeChangeEvent 实例源码

项目:hybris-integration-intellij-idea-plugin    文件:ImpexHeaderHighlighterComponent.java   
private void highlightHeader(final PsiTreeChangeEvent psiTreeChangeEvent) {
    final PsiFile file = psiTreeChangeEvent.getFile();

    if (null == file) {
        return;
    }

    final Editor editor = PsiUtilBase.findEditor(file);

    if (null == editor) {
        return;
    }

    impexHeaderNameHighlighterService.highlightCurrentHeader(editor);
    impexColumnHighlighterService.highlightCurrentColumn(editor);
}
项目:intellij-ce-playground    文件:ExternalPSIChangeListener.java   
@Override
protected void updatePsi(PsiTreeChangeEvent event) {
  boolean runState = myRunState;
  super.updatePsi(event);

  if (!runState && myResourceDepends != null && !myUpdateRenderer) {
    PsiFile psiFile = event.getFile();
    if (psiFile == null) {
      return;
    }
    VirtualFile file = psiFile.getVirtualFile();
    if (file == null) {
      return;
    }
    for (VirtualFile resourceDir : myResourceDepends) {
      if (VfsUtilCore.isAncestor(resourceDir, file, false)) {
        myUpdateRenderer = true;
        break;
      }
    }
  }
}
项目:cordovastudio    文件:ExternalPSIChangeListener.java   
protected void updatePsi(PsiTreeChangeEvent event) {
    boolean runState = myRunState;

    if (myRunState && myFile == event.getFile()) {
        addRequest();
    }

    if (!runState && !myUpdateRenderer) {
        PsiFile psiFile = event.getFile();
        if (psiFile == null) {
            return;
        }
        VirtualFile file = psiFile.getVirtualFile();
        if (file == null) {
            //ignore
        }
    }
}
项目:consulo-ui-designer    文件:GuiEditor.java   
private void handleEvent(final PsiTreeChangeEvent event)
{
    if(event.getParent() != null)
    {
        PsiFile containingFile = event.getParent().getContainingFile();
        if(containingFile instanceof PropertiesFile)
        {
            LOG.debug("Received PSI change event for properties file");
            myAlarm.cancelRequest(myRefreshPropertiesRequest);
            myAlarm.addRequest(myRefreshPropertiesRequest, 500, ModalityState.stateForComponent(GuiEditor.this));
        }
        else if(containingFile instanceof PsiPlainTextFile && containingFile.getFileType().equals(GuiFormFileType.INSTANCE))
        {
            // quick check if relevant
            String resourceName = FormEditingUtil.buildResourceName(containingFile);
            if(myDocument.getText().indexOf(resourceName) >= 0)
            {
                LOG.debug("Received PSI change event for nested form");
                // TODO[yole]: handle multiple nesting
                myAlarm.cancelRequest(mySynchronizeRequest);
                myAlarm.addRequest(mySynchronizeRequest, 500, ModalityState.stateForComponent(GuiEditor.this));
            }
        }
    }
}
项目:manifold-ij    文件:ManifoldPsiClassCache.java   
/**
 * Handle when callers of FileManagerImpl.invalidateAllPsi() send this event.
 * Basically we need to listen to property change events here that are not file
 * oriented, but instead are PSI-oriented, and that pretty much rip out all psi
 * from underneath this cache.
 */
@Override
public void propertyChanged( @NotNull PsiTreeChangeEvent event )
{
  PsiFile file = event.getFile();
  String propertyName = event.getPropertyName();
  if( file == null &&
      (propertyName == null
       || propertyName.equals( PsiTreeChangeEvent.PROP_FILE_TYPES )
       || propertyName.equals( PsiTreeChangeEvent.PROP_ROOTS )) )
  {
    refreshed();
  }
}
项目:intellij-ce-playground    文件:PropertiesAnchorizer.java   
public PropertiesAnchorizer(Project project) {
  PsiManager.getInstance(project).addPsiTreeChangeListener(new PsiTreeChangeAdapter() {
    @Override
    public void childRemoved(@NotNull PsiTreeChangeEvent event) {
      final PsiElement removed = event.getChild();
      if (removed instanceof IProperty) {
        myAnchors.remove(removed);
      }
    }
  });
}
项目:intellij-ce-playground    文件:PsiEventsTest.java   
public void testEditingInDocComment() throws  Exception {
  final Ref<Boolean> gotIt = new Ref<Boolean>(false);
  getPsiManager().addPsiTreeChangeListener(new PsiTreeChangeAdapter() {
    @Override
    public void childReplaced(@NotNull PsiTreeChangeEvent event) {
      gotIt.set(true);
    }
  });

  GroovyFile file = GroovyPsiElementFactory.getInstance(myProject).createGroovyFile("/** This is doc comment*/class C{}", true, null);
  final PsiDocumentManager docManager = PsiDocumentManager.getInstance(myProject);
  final Document doc = docManager.getDocument(file);
  assertNotNull(doc);
  CommandProcessor.getInstance().executeCommand(myProject,
    new Runnable() {
      @Override
      public void run() {
        ApplicationManager.getApplication().runWriteAction(new Runnable() {
          @Override
          public void run() {
            doc.insertString(3, " ");
            docManager.commitDocument(doc);
          }
        });
      }
    },
    "file text set",
    this
  );


  assertTrue(gotIt.get());
}
项目:tools-idea    文件:PsiEventsTest.java   
public void testEditingInDocComment() throws  Exception {
  final Ref<Boolean> gotIt = new Ref<Boolean>(false);
  getPsiManager().addPsiTreeChangeListener(new PsiTreeChangeAdapter() {
    @Override
    public void childReplaced(@NotNull PsiTreeChangeEvent event) {
      gotIt.set(true);
    }
  });

  GroovyFile file = GroovyPsiElementFactory.getInstance(myProject).createGroovyFile("/** This is doc comment*/class C{}", true, null);
  final PsiDocumentManager docManager = PsiDocumentManager.getInstance(myProject);
  final Document doc = docManager.getDocument(file);
  assertNotNull(doc);
  CommandProcessor.getInstance().executeCommand(myProject,
    new Runnable() {
      @Override
      public void run() {
        ApplicationManager.getApplication().runWriteAction(new Runnable() {
          @Override
          public void run() {
            doc.insertString(3, " ");
            docManager.commitDocument(doc);
          }
        });
      }
    },
    "file text set",
    this
  );


  assertTrue(gotIt.get());
}
项目:consulo-ui-designer    文件:GuiEditor.java   
@Override
public void propertyChanged(@NotNull final PsiTreeChangeEvent event)
{
    if(PsiTreeChangeEvent.PROP_ROOTS.equals(event.getPropertyName()))
    {
        myAlarm.cancelRequest(myRefreshPropertiesRequest);
        myAlarm.addRequest(myRefreshPropertiesRequest, 500, ModalityState.stateForComponent(GuiEditor.this));
    }
}
项目:otto-intellij-plugin    文件:OttoProjectHandler.java   
private void maybeInvalidate(PsiTreeChangeEvent event) {
  PsiFile file = event.getFile();
  if (file == null) {
    return;
  }

  VirtualFile virtualFile = file.getVirtualFile();
  synchronized (filesToScan) {
    filesToScan.add(virtualFile);
  }
}
项目:hybris-integration-intellij-idea-plugin    文件:ImpexHeaderHighlighterComponent.java   
@Override
public void beforeChildAddition(@NotNull final PsiTreeChangeEvent psiTreeChangeEvent) {
    //this.highlightHeader(psiTreeChangeEvent);
}
项目:hybris-integration-intellij-idea-plugin    文件:ImpexHeaderHighlighterComponent.java   
@Override
public void beforeChildRemoval(@NotNull final PsiTreeChangeEvent psiTreeChangeEvent) {
    //this.highlightHeader(psiTreeChangeEvent);
}
项目:hybris-integration-intellij-idea-plugin    文件:ImpexHeaderHighlighterComponent.java   
@Override
public void beforeChildReplacement(@NotNull final PsiTreeChangeEvent psiTreeChangeEvent) {
    //this.highlightHeader(psiTreeChangeEvent);
}
项目:hybris-integration-intellij-idea-plugin    文件:ImpexHeaderHighlighterComponent.java   
@Override
public void beforeChildMovement(@NotNull final PsiTreeChangeEvent psiTreeChangeEvent) {
    //this.highlightHeader(psiTreeChangeEvent);
}
项目:hybris-integration-intellij-idea-plugin    文件:ImpexHeaderHighlighterComponent.java   
@Override
public void beforeChildrenChange(@NotNull final PsiTreeChangeEvent psiTreeChangeEvent) {
    //this.highlightHeader(psiTreeChangeEvent);
}
项目:hybris-integration-intellij-idea-plugin    文件:ImpexHeaderHighlighterComponent.java   
@Override
public void beforePropertyChange(@NotNull final PsiTreeChangeEvent psiTreeChangeEvent) {
    //this.highlightHeader(psiTreeChangeEvent);
}
项目:hybris-integration-intellij-idea-plugin    文件:ImpexHeaderHighlighterComponent.java   
@Override
public void childAdded(@NotNull final PsiTreeChangeEvent psiTreeChangeEvent) {
    this.highlightHeader(psiTreeChangeEvent);
}
项目:hybris-integration-intellij-idea-plugin    文件:ImpexHeaderHighlighterComponent.java   
@Override
public void childRemoved(@NotNull final PsiTreeChangeEvent psiTreeChangeEvent) {
    this.highlightHeader(psiTreeChangeEvent);
}
项目:hybris-integration-intellij-idea-plugin    文件:ImpexHeaderHighlighterComponent.java   
@Override
public void childReplaced(@NotNull final PsiTreeChangeEvent psiTreeChangeEvent) {
    this.highlightHeader(psiTreeChangeEvent);
}
项目:hybris-integration-intellij-idea-plugin    文件:ImpexHeaderHighlighterComponent.java   
@Override
        public void childrenChanged(@NotNull final PsiTreeChangeEvent psiTreeChangeEvent) {
//            this.highlightHeader(psiTreeChangeEvent);
        }
项目:hybris-integration-intellij-idea-plugin    文件:ImpexHeaderHighlighterComponent.java   
@Override
public void childMoved(@NotNull final PsiTreeChangeEvent psiTreeChangeEvent) {
    this.highlightHeader(psiTreeChangeEvent);
}
项目:hybris-integration-intellij-idea-plugin    文件:ImpexHeaderHighlighterComponent.java   
@Override
public void propertyChanged(@NotNull final PsiTreeChangeEvent psiTreeChangeEvent) {
    //this.highlightHeader(psiTreeChangeEvent);
}
项目:intellij-plugin    文件:PsiTreeAnyChangeAbstractAdapter.java   
@Override
public void childAdded(@NotNull PsiTreeChangeEvent event) {
    onChange(event.getFile());
}
项目:intellij-plugin    文件:PsiTreeAnyChangeAbstractAdapter.java   
@Override
public void childRemoved(@NotNull PsiTreeChangeEvent event) {
    onChange(event.getFile());
}
项目:intellij-plugin    文件:PsiTreeAnyChangeAbstractAdapter.java   
@Override
public void childReplaced(@NotNull PsiTreeChangeEvent event) {
    onChange(event.getFile());
}
项目:intellij-plugin    文件:PsiTreeAnyChangeAbstractAdapter.java   
@Override
public void childMoved(@NotNull PsiTreeChangeEvent event) {
    onChange(event.getFile());
}
项目:intellij-plugin    文件:PsiTreeAnyChangeAbstractAdapter.java   
@Override
public void childrenChanged(@NotNull PsiTreeChangeEvent event) {
    onChange(event.getFile());
}
项目:intellij-plugin    文件:PsiTreeAnyChangeAbstractAdapter.java   
@Override
public void propertyChanged(@NotNull PsiTreeChangeEvent event) {
    onChange(event.getFile());
}
项目:intellij-ce-playground    文件:EventsTestListener.java   
@Override
public void beforeChildAddition(@NotNull PsiTreeChangeEvent event) {
  myBuffer.append("beforeChildAddition\n");
}
项目:intellij-ce-playground    文件:EventsTestListener.java   
@Override
public void beforeChildRemoval(@NotNull PsiTreeChangeEvent event) {
  myBuffer.append("beforeChildRemoval\n");
}
项目:intellij-ce-playground    文件:EventsTestListener.java   
@Override
public void beforeChildReplacement(@NotNull PsiTreeChangeEvent event) {
  myBuffer.append("beforeChildReplacement\n");
}
项目:intellij-ce-playground    文件:EventsTestListener.java   
@Override
public void beforeChildMovement(@NotNull PsiTreeChangeEvent event) {
  myBuffer.append("beforeChildMovement\n");
}
项目:intellij-ce-playground    文件:EventsTestListener.java   
@Override
public void beforeChildrenChange(@NotNull PsiTreeChangeEvent event) {
  myBuffer.append("beforeChildrenChange\n");
}
项目:intellij-ce-playground    文件:EventsTestListener.java   
@Override
public void beforePropertyChange(@NotNull PsiTreeChangeEvent event) {
  myBuffer.append("beforePropertyChange " + event.getPropertyName() + "\n");
}
项目:intellij-ce-playground    文件:EventsTestListener.java   
@Override
public void childAdded(@NotNull PsiTreeChangeEvent event) {
  myBuffer.append("childAdded\n");
}
项目:intellij-ce-playground    文件:EventsTestListener.java   
@Override
public void childRemoved(@NotNull PsiTreeChangeEvent event) {
  myBuffer.append("childRemoved\n");
}
项目:intellij-ce-playground    文件:EventsTestListener.java   
@Override
public void childReplaced(@NotNull PsiTreeChangeEvent event) {
  myBuffer.append("childReplaced\n");
}
项目:intellij-ce-playground    文件:EventsTestListener.java   
@Override
public void childrenChanged(@NotNull PsiTreeChangeEvent event) {
  myBuffer.append("childrenChanged\n");
}
项目:intellij-ce-playground    文件:EventsTestListener.java   
@Override
public void childMoved(@NotNull PsiTreeChangeEvent event) {
  myBuffer.append("childMoved\n");
}
项目:intellij-ce-playground    文件:EventsTestListener.java   
@Override
public void propertyChanged(@NotNull PsiTreeChangeEvent event) {
  myBuffer.append("propertyChanged " + event.getPropertyName() + "\n");
}