本文整理汇总了Java中com.intellij.openapi.progress.ProgressIndicator.popState方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressIndicator.popState方法的具体用法?Java ProgressIndicator.popState怎么用?Java ProgressIndicator.popState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.progress.ProgressIndicator
的用法示例。
在下文中一共展示了ProgressIndicator.popState方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void init() {
long start = System.currentTimeMillis();
final ProgressIndicator progressIndicator = isDefault() ? null : ProgressIndicatorProvider.getGlobalProgressIndicator();
if (progressIndicator != null) {
progressIndicator.pushState();
}
super.init(progressIndicator);
if (progressIndicator != null) {
progressIndicator.popState();
}
long time = System.currentTimeMillis() - start;
LOG.info(getComponentConfigCount() + " project components initialized in " + time + " ms");
getMessageBus().syncPublisher(ProjectLifecycleListener.TOPIC).projectComponentsInitialized(this);
//noinspection SynchronizeOnThis
synchronized (this) {
myProjectManagerListener = new MyProjectManagerListener();
myProjectManager.addProjectManagerListener(this, myProjectManagerListener);
}
}
示例2: copyToMirror
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@NotNull
private File copyToMirror(@NotNull File original, @NotNull File mirror) {
ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
if (progress != null) {
progress.pushState();
progress.setText(VfsBundle.message("jar.copy.progress", original.getPath()));
progress.setFraction(0);
}
try {
FileUtil.copy(original, mirror);
}
catch (final IOException e) {
reportIOErrorWithJars(original, mirror, e);
return original;
}
if (progress != null) {
progress.popState();
}
return mirror;
}
示例3: processQuery
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void processQuery(@NotNull SchemaTypeParentsSearch.SearchParameters parameters, @NotNull Processor<SchemaTypeDef> consumer) {
SchemaTypeDef baseType = parameters.schemaTypeDef;
ProgressIndicator progress = ProgressIndicatorProvider.getGlobalProgressIndicator();
if (progress != null) {
progress.pushState();
String typeName = ApplicationManager.getApplication().runReadAction((Computable<String>) baseType::getName);
progress.setText(typeName == null ?
"Searching for parents" : "Searching for parents of " + typeName
);
}
try {
processParents(consumer, baseType, parameters);
} finally {
if (progress != null) progress.popState();
}
}
示例4: processQuery
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void processQuery(@NotNull SchemaTypeInheritorsSearch.SearchParameters parameters, @NotNull Processor<SchemaTypeDef> consumer) {
SchemaTypeDef baseType = parameters.schemaTypeDef;
ProgressIndicator progress = ProgressIndicatorProvider.getGlobalProgressIndicator();
if (progress != null) {
progress.pushState();
String typeName = ApplicationManager.getApplication().runReadAction((Computable<String>) baseType::getName);
progress.setText(typeName == null ?
"Searching for inheritors" : "Searching for inheritors of " + typeName
);
}
try {
processInheritors(consumer, baseType, parameters);
} finally {
if (progress != null) progress.popState();
}
}
示例5: processQuery
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void processQuery(@NotNull ClassInheritorsSearch.SearchParameters parameters, @NotNull Processor<PsiClass> consumer) {
final PsiClass baseClass = parameters.getClassToProcess();
final SearchScope searchScope = parameters.getScope();
LOG.assertTrue(searchScope != null);
ProgressIndicator progress = ProgressIndicatorProvider.getGlobalProgressIndicator();
if (progress != null) {
progress.pushState();
String className = ApplicationManager.getApplication().runReadAction(new Computable<String>() {
@Override
public String compute() {
return baseClass.getName();
}
});
progress.setText(className != null ?
PsiBundle.message("psi.search.inheritors.of.class.progress", className) :
PsiBundle.message("psi.search.inheritors.progress"));
}
processInheritors(consumer, baseClass, searchScope, parameters);
if (progress != null) {
progress.popState();
}
}
示例6: addClassesUsages
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
private static boolean addClassesUsages(@NotNull PsiPackage aPackage,
@NotNull final JavaPackageFindUsagesOptions options,
@NotNull final Processor<UsageInfo> processor) {
ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
if (progress != null){
progress.pushState();
}
List<PsiClass> classes = new ArrayList<PsiClass>();
addClassesInPackage(aPackage, options.isIncludeSubpackages, classes);
for (final PsiClass aClass : classes) {
if (progress != null) {
String name = ApplicationManager.getApplication().runReadAction(new Computable<String>() {
@Override
public String compute() {
return aClass.getName();
}
});
progress.setText(FindBundle.message("find.searching.for.references.to.class.progress", name));
progress.checkCanceled();
}
boolean success = ReferencesSearch.search(new ReferencesSearch.SearchParameters(aClass, options.searchScope, false, options.fastTrack)).forEach(new ReadActionProcessor<PsiReference>() {
@Override
public boolean processInReadAction(final PsiReference psiReference) {
return addResult(psiReference, options, processor);
}
});
if (!success) return false;
}
if (progress != null){
progress.popState();
}
return true;
}
示例7: executeCompileTasks
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
private boolean executeCompileTasks(final CompileContext context, final boolean beforeTasks) {
if (myProject.isDisposed()) {
return false;
}
final CompilerManager manager = CompilerManager.getInstance(myProject);
final ProgressIndicator progressIndicator = context.getProgressIndicator();
progressIndicator.pushState();
try {
CompileTask[] tasks = beforeTasks ? manager.getBeforeTasks() : manager.getAfterTasks();
if (tasks.length > 0) {
progressIndicator.setText(beforeTasks
? CompilerBundle.message("progress.executing.precompile.tasks")
: CompilerBundle.message("progress.executing.postcompile.tasks"));
for (CompileTask task : tasks) {
if (!task.execute(context)) {
return false;
}
}
}
}
finally {
progressIndicator.popState();
StatusBar statusBar = WindowManager.getInstance().getStatusBar(myProject);
if (statusBar != null) {
statusBar.setInfo("");
}
if (progressIndicator instanceof CompilerTask) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
public void run() {
((CompilerTask)progressIndicator).showCompilerContent();
}
});
}
}
return true;
}
示例8: processGlobalRequestsOptimized
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
private boolean processGlobalRequestsOptimized(@NotNull MultiMap<Set<IdIndexEntry>, RequestWithProcessor> singles,
@NotNull ProgressIndicator progress,
@NotNull final Map<RequestWithProcessor, Processor<PsiElement>> localProcessors) {
if (singles.isEmpty()) {
return true;
}
if (singles.size() == 1) {
final Collection<? extends RequestWithProcessor> requests = singles.values();
if (requests.size() == 1) {
final RequestWithProcessor theOnly = requests.iterator().next();
return processSingleRequest(theOnly.request, theOnly.refProcessor);
}
}
progress.pushState();
progress.setText(PsiBundle.message("psi.scanning.files.progress"));
boolean result;
try {
// intersectionCandidateFiles holds files containing words from all requests in `singles` and words in corresponding container names
final MultiMap<VirtualFile, RequestWithProcessor> intersectionCandidateFiles = createMultiMap();
// restCandidateFiles holds files containing words from all requests in `singles` but EXCLUDING words in corresponding container names
final MultiMap<VirtualFile, RequestWithProcessor> restCandidateFiles = createMultiMap();
collectFiles(singles, progress, intersectionCandidateFiles, restCandidateFiles);
if (intersectionCandidateFiles.isEmpty() && restCandidateFiles.isEmpty()) {
return true;
}
final Set<String> allWords = new TreeSet<String>();
for (RequestWithProcessor singleRequest : localProcessors.keySet()) {
allWords.add(singleRequest.request.word);
}
progress.setText(PsiBundle.message("psi.search.for.word.progress", getPresentableWordsDescription(allWords)));
if (intersectionCandidateFiles.isEmpty()) {
result = processCandidates(localProcessors, restCandidateFiles, progress, restCandidateFiles.size(), 0);
}
else {
int totalSize = restCandidateFiles.size() + intersectionCandidateFiles.size();
result = processCandidates(localProcessors, intersectionCandidateFiles, progress, totalSize, 0);
if (result) {
result = processCandidates(localProcessors, restCandidateFiles, progress, totalSize, intersectionCandidateFiles.size());
}
}
}
finally {
progress.popState();
}
return result;
}