当前位置: 首页>>代码示例>>Java>>正文


Java BackgroundTaskQueue类代码示例

本文整理汇总了Java中com.intellij.openapi.progress.BackgroundTaskQueue的典型用法代码示例。如果您正苦于以下问题:Java BackgroundTaskQueue类的具体用法?Java BackgroundTaskQueue怎么用?Java BackgroundTaskQueue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BackgroundTaskQueue类属于com.intellij.openapi.progress包,在下文中一共展示了BackgroundTaskQueue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ZipAndQueue

import com.intellij.openapi.progress.BackgroundTaskQueue; //导入依赖的package包/类
public ZipAndQueue(final Project project, final int interval, final String title, final Runnable runnable) {
  final int correctedInterval = interval <= 0 ? 300 : interval;
  myZipperUpdater = new ZipperUpdater(correctedInterval, project);
  myQueue = new BackgroundTaskQueue(project, title);
  myInZipper = new Runnable() {
    @Override
    public void run() {
      myQueue.run(myInvokedOnQueue);
    }
  };
  myInvokedOnQueue = new Task.Backgroundable(project, title, false, BackgroundFromStartOption.getInstance()) {
    @Override
    public void run(@NotNull ProgressIndicator indicator) {
      runnable.run();
    }
  };
  Disposer.register(project, new Disposable() {
    @Override
    public void dispose() {
      myZipperUpdater.stop();
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ZipAndQueue.java

示例2: AbstractRefreshablePanel

import com.intellij.openapi.progress.BackgroundTaskQueue; //导入依赖的package包/类
protected AbstractRefreshablePanel(final Project project, final String loadingTitle, final BackgroundTaskQueue queue) {
  myQueue = queue;
  myTicket = new Ticket();
  myDetailsPanel = new DetailsPanel();
  myDetailsPanel.loading();
  myDetailsPanel.layout();
  
  myDetailsLoader = new GenericDetailsLoader<Ticket, T>(new Consumer<Ticket>() {
    @Override
    public void consume(Ticket ticket) {
      final Loader loader = new Loader(project, loadingTitle, myTicket.copy());
      loader.runSteadily(new Consumer<Task.Backgroundable>() {
        @Override
        public void consume(Task.Backgroundable backgroundable) {
          myQueue.run(backgroundable);
        }
      });
    }
  }, new PairConsumer<Ticket, T>() {
    @Override
    public void consume(Ticket ticket, T t) {
      acceptData(t);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:AbstractRefreshablePanel.java

示例3: VcsChangeDetailsManager

import com.intellij.openapi.progress.BackgroundTaskQueue; //导入依赖的package包/类
public VcsChangeDetailsManager(final Project project) {
  myProject = project;
  myQueue = new BackgroundTaskQueue(myProject, "Loading change details");
  myDedicatedList = new ArrayList<VcsChangeDetailsProvider>();

  myDedicatedList.add(new BinaryDetailsProviderNew(project));
  myDedicatedList.add(new FragmentedDiffDetailsProvider(myProject));

  VcsChangeDetailsProvider[] extensions = Extensions.getExtensions(VcsChangeDetailsProvider.EP_NAME, myProject);
  myProviders.addAll(Arrays.asList(extensions));

  Disposer.register(project, new Disposable() {
    @Override
    public void dispose() {
      myQueue.clear();
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:VcsChangeDetailsManager.java

示例4: RootsToWorkingCopies

import com.intellij.openapi.progress.BackgroundTaskQueue; //导入依赖的package包/类
public RootsToWorkingCopies(final SvnVcs vcs) {
  myProject = vcs.getProject();
  myQueue = new BackgroundTaskQueue(myProject, "SVN VCS roots authorization checker");
  myLock = new Object();
  myRootMapping = new HashMap<VirtualFile, WorkingCopy>();
  myUnversioned = new HashSet<VirtualFile>();
  myVcs = vcs;
  myRechecker = new Runnable() {
    public void run() {
      final VirtualFile[] roots = ProjectLevelVcsManager.getInstance(myProject).getRootsUnderVcs(myVcs);
      synchronized (myLock) {
        clear();
        for (VirtualFile root : roots) {
          addRoot(root);
        }
      }
    }
  };
  myZipperUpdater = new ZipperUpdater(200, Alarm.ThreadToUse.POOLED_THREAD, myProject);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:RootsToWorkingCopies.java

示例5: ZipAndQueue

import com.intellij.openapi.progress.BackgroundTaskQueue; //导入依赖的package包/类
public ZipAndQueue(final Project project, final int interval, final String title, final Runnable runnable) {
  final int correctedInterval = interval <= 0 ? 300 : interval;
  myZipperUpdater = new ZipperUpdater(correctedInterval, project);
  myQueue = new BackgroundTaskQueue(project, title);
  myInZipper = new Runnable() {
    @Override
    public void run() {
      myQueue.run(myInvokedOnQueue);
    }
  };
  myInvokedOnQueue = new Task.Backgroundable(project, title, false, BackgroundFromStartOption.getInstance()) {
    @Override
    public void run(@Nonnull ProgressIndicator indicator) {
      runnable.run();
    }
  };
  Disposer.register(project, new Disposable() {
    @Override
    public void dispose() {
      myZipperUpdater.stop();
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:ZipAndQueue.java

示例6: HistoryCacheManager

import com.intellij.openapi.progress.BackgroundTaskQueue; //导入依赖的package包/类
public HistoryCacheManager(Project project) {
  myProject = project;
  myQueue = new BackgroundTaskQueue(myProject, "VCS project history cache update");
  myKnownRepositoryLocations = new KnownRepositoryLocations();
  myRepositoryLocationCache = new RepositoryLocationCache(myProject);
  myCachesHolder = new CachesHolder(myProject, myRepositoryLocationCache);
  myDbUtil = new VcsSqliteLayer(myProject, myKnownRepositoryLocations); // does not create connection immediately
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:HistoryCacheManager.java

示例7: BinaryDiffDetailsPanel

import com.intellij.openapi.progress.BackgroundTaskQueue; //导入依赖的package包/类
private BinaryDiffDetailsPanel(Project project, BackgroundTaskQueue queue, final Change change) {
  super(project, "Loading change content", queue);
  myProject = project;
  myFilePath = ChangesUtil.getFilePath(change);
  myRequestFromChange = new BinaryDiffRequestFromChange(myProject);
  myChangeListManager = ChangeListManager.getInstance(myProject);

  myPanel = DiffManager.getInstance().createDiffPanel(null, myProject, this, BinaryDiffTool.INSTANCE);
  myPanel.enableToolbar(false);
  myPanel.removeStatusBar();
  DiffPanelOptions o = ((DiffPanelEx)myPanel).getOptions();
  o.setRequestFocusOnNewContent(false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:VcsChangeDetailsManager.java

示例8: FragmentedDiffDetailsPanel

import com.intellij.openapi.progress.BackgroundTaskQueue; //导入依赖的package包/类
private FragmentedDiffDetailsPanel(Project project, BackgroundTaskQueue queue, final Change change, JComponent parent) {
  super(project, "Loading change content", queue);
  myProject = project;
  myFilePath = ChangesUtil.getFilePath(change);
  myRequestFromChange = new FragmentedDiffRequestFromChange(project);
  myChangeListManager = ChangeListManager.getInstance(project);
  myDiffPanel = new ChangesFragmentedDiffPanel(project, changeDescription(change), parent);
  myDiffPanel.buildUi();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:VcsChangeDetailsManager.java

示例9: SvnTreeConflictDiffViewer

import com.intellij.openapi.progress.BackgroundTaskQueue; //导入依赖的package包/类
public SvnTreeConflictDiffViewer(@NotNull DiffContext context, @NotNull SvnTreeConflictDiffRequest request) {
  myContext = context;
  myRequest = request;

  myQueue = new BackgroundTaskQueue(myContext.getProject(), "Loading change details");

  // We don't need to listen on File/Document, because panel always will be the same for a single change (@see myDelegate.isStillValid())
  // And if Change will change - we'll create new DiffRequest and DiffViewer
  myDelegate =
    new TreeConflictRefreshablePanel(myContext.getProject(), "Loading tree conflict details", myQueue, myRequest.getChange());
  myDelegate.refresh();
  myPanel.setContent(myDelegate.getPanel());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:SvnTreeConflictDiffRequestProvider.java

示例10: TreeConflictRefreshablePanel

import com.intellij.openapi.progress.BackgroundTaskQueue; //导入依赖的package包/类
public TreeConflictRefreshablePanel(Project project, String loadingTitle, BackgroundTaskQueue queue, Change change) {
  super(project, loadingTitle, queue);
  myVcs = SvnVcs.getInstance(project);
  assert change instanceof ConflictedSvnChange;
  myChange = (ConflictedSvnChange) change;
  myPath = ChangesUtil.getFilePath(myChange);
  myRightRevisionsList = new TLongArrayList();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:TreeConflictRefreshablePanel.java

示例11: comment

import com.intellij.openapi.progress.BackgroundTaskQueue; //导入依赖的package包/类
@Override
public RefreshablePanel comment(Change change, JComponent parent, BackgroundTaskQueue queue) {
  return new RefreshablePanel() {
    @Override
    public boolean refreshDataSynch() {
      return true;
    }

    @Override
    public void dataChanged() {
    }

    @Override
    public void refresh() {
    }

    @Override
    public JPanel getPanel() {
      return UIVcsUtil.infoPanel("Technical record", "This change is recorded because its target file was deleted,\nand some parent directory was copied (or moved) into the new place.");
    }

    @Override
    public void away() {
    }

    @Override
    public boolean isStillValid(Object o) {
      return ((Change) o).isPhantom();
    }

    @Override
    public void dispose() {
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:SvnPhantomChangeDetailsProvider.java

示例12: DetailsCache

import com.intellij.openapi.progress.BackgroundTaskQueue; //导入依赖的package包/类
public DetailsCache(final Project project,
                    final UIRefresh uiRefresh,
                    final DetailsLoaderImpl detailsLoader,
                    final BackgroundTaskQueue queue) {
  myProject = project;
  myDetailsLoader = detailsLoader;
  myQueue = queue;
  myStash = new HashMap<VirtualFile, Map<AbstractHash,String>>();
  myRefresh = uiRefresh;
  myLock = new Object();
  myCache = new SLRUMap<Pair<VirtualFile, AbstractHash>, GitHeavyCommit>(ourSize, 150);
  myBranches = new SLRUMap<Pair<VirtualFile, AbstractHash>, List<String>>(20, 20);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:DetailsCache.java

示例13: DetailsLoaderImpl

import com.intellij.openapi.progress.BackgroundTaskQueue; //导入依赖的package包/类
public DetailsLoaderImpl(Project project, BackgroundTaskQueue queue) {
  myQueue = queue;
  myProject = project;
  myLoadIdsGatherer = new HashMap<VirtualFile, CommitIdsHolder<AbstractHash>>();
  myAccesses = new HashMap<VirtualFile, LowLevelAccess>();
  myRefs = new HashMap<VirtualFile, CachedRefs>();
  myLock = new Object();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:DetailsLoaderImpl.java

示例14: Worker

import com.intellij.openapi.progress.BackgroundTaskQueue; //导入依赖的package包/类
private Worker(@Nullable final Project project,
               final VirtualFile virtualFile,
               final LowLevelAccess access,
               final DetailsCache detailsCache, final BackgroundTaskQueue queue) {
  super(project, "Load git commits details", false, BackgroundFromStartOption.getInstance());
  myVirtualFile = virtualFile;
  myAccess = access;
  myDetailsCache = detailsCache;
  myQueue = queue;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:DetailsLoaderImpl.java

示例15: GitLogAssembler

import com.intellij.openapi.progress.BackgroundTaskQueue; //导入依赖的package包/类
public GitLogAssembler(final Project project, boolean projectScope, final GitCommitsSequentially gitCommitsSequentially) {
  myProject = project;
  myProjectScope = projectScope;
  myMediator = new MediatorImpl(myProject, gitCommitsSequentially);

  myGitLogUI = new GitLogUI(myProject, myMediator);
  myTableModel = myGitLogUI.getTableModel();

  final BackgroundTaskQueue queue = new BackgroundTaskQueue(project, "Git log details");
  myDetailsLoader = new DetailsLoaderImpl(myProject, queue);
  myDetailsCache = new DetailsCache(myProject, myGitLogUI.getUIRefresh(), myDetailsLoader, queue);
  myDetailsLoader.setDetailsCache(myDetailsCache);
  myGitLogUI.setDetailsCache(myDetailsCache);
  myGitLogUI.createMe();
  myGitLogUI.setProjectScope(projectScope);

  // modality state?
  myLoadController = new LoadController(myProject, myMediator, myDetailsCache, gitCommitsSequentially);

  myMediator.setLoader(myLoadController);
  myMediator.setTableModel(myTableModel);
  myMediator.setUIRefresh(myGitLogUI.getRefreshObject());
  myMediator.setDetailsLoader(myDetailsLoader);

  myTableModel.setCache(myDetailsCache);
  Disposer.register(this, myGitLogUI);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:28,代码来源:GitLogAssembler.java


注:本文中的com.intellij.openapi.progress.BackgroundTaskQueue类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。