當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。