本文整理汇总了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();
}
});
}
示例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);
}
});
}
示例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();
}
});
}
示例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);
}
示例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();
}
});
}
示例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
}
示例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);
}
示例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();
}
示例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());
}
示例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();
}
示例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() {
}
};
}
示例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);
}
示例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();
}
示例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;
}
示例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);
}