Package com.intellij.util.ui.update

Examples of com.intellij.util.ui.update.MergingUpdateQueue


    return project.getUserData(LIVE_PREVIEW_QUEUE);
  }

  private static final Key<MergingUpdateQueue> LIVE_PREVIEW_QUEUE = Key.create("LIVE_PREVIEW_QUEUE");
  private static void installUpdateListener(final Project project) {
    MergingUpdateQueue queue = project.getUserData(LIVE_PREVIEW_QUEUE);
    if (queue == null) {
      JComponent activationComponent = WindowManager.getInstance().getFrame(project).getRootPane();
      project.putUserData(LIVE_PREVIEW_QUEUE, queue = new MergingUpdateQueue("LIVE_PREVIEW_QUEUE", 1000, true, null, project, activationComponent));
    }
    final FileEditorManager fileEditorManager = FileEditorManager.getInstance(project);
    final MergingUpdateQueue finalQueue = queue;
    EditorFactory.getInstance().getEventMulticaster().addDocumentListener(new DocumentAdapter() {
      @Override
      public void documentChanged(DocumentEvent e) {
        Document document = e.getDocument();
        final FileDocumentManager fileDocumentManager = FileDocumentManager.getInstance();
        VirtualFile file = fileDocumentManager.getFile(document);
        if (file == null || file.getFileType() != BnfFileType.INSTANCE) return;
        finalQueue.cancelAllUpdates();
        finalQueue.queue(new Update(Boolean.TRUE, true) {
          @Override
          public void run() {
            FileManager fileManager = ((PsiManagerEx)PsiManager.getInstance(project)).getFileManager();
            for (FileEditor fileEditor : fileEditorManager.getAllEditors()) {
              if (!(fileEditor instanceof TextEditor)) continue;
View Full Code Here


    private MergingUpdateQueue myQueue;

    public LeiningenProjectsManagerWatcher(Project project, LeiningenProjectsManager manager) {
        this.project = project;
        this.manager = manager;
        myQueue = new MergingUpdateQueue(getClass() + ": Document changes queue",
                1000,
                false,
                MergingUpdateQueue.ANY_COMPONENT);
    }
View Full Code Here

        assert myEditorDocument != null;
        myConsoleEditor = (EditorEx) editorFactory.createEditor(myEditorDocument, myProject);
        myConsoleEditor.addFocusListener(myFocusListener);
        myCurrentEditor = myConsoleEditor;
        myHistoryViewer = (EditorEx) editorFactory.createViewer(((EditorFactoryImpl) editorFactory).createDocument(true), myProject);
        myUpdateQueue = new MergingUpdateQueue("ConsoleUpdateQueue", 300, true, null);
        Disposer.register(this, myUpdateQueue);

        // action shortcuts are not yet registered
        ApplicationManager.getApplication().invokeLater(new Runnable() {
            @Override
View Full Code Here

  private final MergingUpdateQueue myUpdateQueue;

  public AbstractTreeUpdater(AbstractTreeBuilder treeBuilder) {
    myTreeBuilder = treeBuilder;
    final JTree tree = myTreeBuilder.getTree();
    myUpdateQueue = new MergingUpdateQueue("UpdateQueue", 300, tree.isShowing(), tree);
    final UiNotifyConnector uiNotifyConnector = new UiNotifyConnector(tree, myUpdateQueue);
    Disposer.register(this, myUpdateQueue);
    Disposer.register(this, uiNotifyConnector);
  }
View Full Code Here

TOP

Related Classes of com.intellij.util.ui.update.MergingUpdateQueue

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.