本文整理匯總了Java中com.intellij.openapi.progress.ProgressIndicator.setText方法的典型用法代碼示例。如果您正苦於以下問題:Java ProgressIndicator.setText方法的具體用法?Java ProgressIndicator.setText怎麽用?Java ProgressIndicator.setText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.progress.ProgressIndicator
的用法示例。
在下文中一共展示了ProgressIndicator.setText方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addRecursively
import com.intellij.openapi.progress.ProgressIndicator; //導入方法依賴的package包/類
private static void addRecursively(@NotNull final SvnVcs activeVcs, @NotNull final ClientFactory factory, final VirtualFile file)
throws VcsException {
final SvnExcludingIgnoredOperation operation = new SvnExcludingIgnoredOperation(activeVcs.getProject(), new SvnExcludingIgnoredOperation.Operation() {
public void doOperation(final VirtualFile virtualFile) throws VcsException {
final File ioFile = new File(virtualFile.getPath());
final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
if (indicator != null) {
indicator.checkCanceled();
indicator.setText(SvnBundle.message("share.or.import.add.progress.text", virtualFile.getPath()));
}
factory.createAddClient().add(ioFile, Depth.EMPTY, false, false, true, null);
}
}, Depth.INFINITY);
operation.execute(file);
}
示例2: perform
import com.intellij.openapi.progress.ProgressIndicator; //導入方法依賴的package包/類
@NotNull
@Override
protected File perform(@NotNull ProgressIndicator indicator, @NotNull File destination) throws WizardException {
indicator.setText("Installing Android SDK");
try {
FileUtil.ensureExists(destination);
if (!FileUtil.filesEqual(destination.getCanonicalFile(), myRepo.getCanonicalFile())) {
SdkMerger.mergeSdks(myRepo, destination, indicator);
myRepoWasMerged = true;
}
myContext.print(String.format("Android SDK was installed to %1$s\n", destination), ConsoleViewContentType.SYSTEM_OUTPUT);
return destination;
}
catch (IOException e) {
throw new WizardException(e.getMessage(), e);
}
finally {
indicator.stop();
}
}
示例3: iteration
import com.intellij.openapi.progress.ProgressIndicator; //導入方法依賴的package包/類
@Override
public boolean iteration() {
popUntilCurrentTaskUnfinishedOrNull();
if (myCurrentTask != null) {
ProgressIndicator indicator = myProgressTask.getIndicator();
if (indicator != null) {
if (myProgressText != null) indicator.setText(myProgressText);
if (myProgressText2 != null) indicator.setText2(myProgressText2);
indicator.setFraction((double)myIterationsFinished++ / myTotalIterations);
}
myCurrentTask.iteration();
}
return true;
}
示例4: cancel
import com.intellij.openapi.progress.ProgressIndicator; //導入方法依賴的package包/類
@Override
public boolean cancel(@NotNull final ProgressIndicator indicator, @NotNull ExternalSystemTaskNotificationListener... listeners) {
indicator.setIndeterminate(true);
ExternalSystemTaskNotificationListenerAdapter adapter = new ExternalSystemTaskNotificationListenerAdapter() {
@Override
public void onStatusChange(@NotNull ExternalSystemTaskNotificationEvent event) {
indicator.setText(wrapProgressText(event.getDescription()));
}
};
final ExternalSystemTaskNotificationListener[] ls;
if (listeners.length > 0) {
ls = ArrayUtil.append(listeners, adapter);
}
else {
ls = new ExternalSystemTaskNotificationListener[]{adapter};
}
return cancel(ls);
}
示例5: doDelete
import com.intellij.openapi.progress.ProgressIndicator; //導入方法依賴的package包/類
private boolean doDelete(final SVNURL url, final String comment) {
final Ref<Exception> exception = new Ref<Exception>();
final Project project = myBrowserComponent.getProject();
Runnable command = new Runnable() {
public void run() {
ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
if (progress != null) {
progress.setText(SvnBundle.message("progres.text.deleting", url.toString()));
}
SvnVcs vcs = SvnVcs.getInstance(project);
try {
vcs.getFactoryFromSettings().createDeleteClient().delete(url, comment);
}
catch (VcsException e) {
exception.set(e);
}
}
};
ProgressManager.getInstance().runProcessWithProgressSynchronously(command, SvnBundle.message("progress.title.browser.delete"), false, project);
if (!exception.isNull()) {
Messages.showErrorDialog(exception.get().getMessage(), SvnBundle.message("message.text.error"));
}
return exception.isNull();
}
示例6: processFiles
import com.intellij.openapi.progress.ProgressIndicator; //導入方法依賴的package包/類
protected List<VcsException> processFiles(final AbstractVcs vcs, final List<FilePath> files) {
RollbackEnvironment environment = vcs.getRollbackEnvironment();
if (environment == null) return Collections.emptyList();
final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
if (indicator != null) {
indicator.setText(vcs.getDisplayName() + ": performing rollback...");
}
final List<VcsException> result = new ArrayList<VcsException>(0);
try {
environment.rollbackMissingFileDeletion(files, result, new RollbackProgressModifier(files.size(), indicator));
}
catch (ProcessCanceledException e) {
// for files refresh
}
LocalFileSystem.getInstance().refreshIoFiles(ChangesUtil.filePathsToFiles(files));
return result;
}
示例7: 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();
}
}
示例8: customRefresh
import com.intellij.openapi.progress.ProgressIndicator; //導入方法依賴的package包/類
public void customRefresh() {
final List<Change> toRefresh = new ArrayList<Change>();
ChangesUtil.processChangesByVcs(myProject, myIncludedChanges, new ChangesUtil.PerVcsProcessor<Change>() {
@Override
public void process(AbstractVcs vcs, List<Change> items) {
CheckinEnvironment ce = vcs.getCheckinEnvironment();
if (ce != null && ce.isRefreshAfterCommitNeeded()) {
toRefresh.addAll(items);
}
}
});
if (toRefresh.isEmpty()) {
return;
}
final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
if (indicator != null) {
indicator.setText(VcsBundle.message("commit.dialog.refresh.files"));
}
RefreshVFsSynchronously.updateChanges(toRefresh);
}
示例9: getConnectionInputStreamWithException
import com.intellij.openapi.progress.ProgressIndicator; //導入方法依賴的package包/類
public static InputStream getConnectionInputStreamWithException(@NotNull URLConnection connection, @NotNull ProgressIndicator pi)
throws IOException {
InputStreamGetter getter = new InputStreamGetter(connection);
final Future<?> getterFuture = ApplicationManager.getApplication().executeOnPooledThread(getter);
while (true) {
pi.checkCanceled();
try {
try {
getterFuture.get(50, TimeUnit.MILLISECONDS);
}
catch (TimeoutException ignored) {
}
pi.setIndeterminate(true);
pi.setText(pi.getText());
if (getterFuture.isDone()) {
break;
}
}
catch (Exception e) {
throw new ProcessCanceledException(e);
}
}
//noinspection ThrowableResultOfMethodCallIgnored
if (getter.getException() != null) {
throw getter.getException();
}
return getter.getInputStream();
}
示例10: run
import com.intellij.openapi.progress.ProgressIndicator; //導入方法依賴的package包/類
public void run() {
ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
if (progress != null) {
progress.setText(SvnBundle.message("progress.text.loading.contents", myURL));
progress.setText2(SvnBundle.message("progress.text2.revision.information", myRevision));
}
try {
myContents = SvnUtil.getFileContents(myVCS, SvnTarget.fromURL(SvnUtil.parseUrl(myURL)), myRevision, myPegRevision);
}
catch (VcsException e) {
myException = e;
}
}
示例11: showProgressMessage
import com.intellij.openapi.progress.ProgressIndicator; //導入方法依賴的package包/類
protected void showProgressMessage(final ProgressIndicator progress, final File root) {
if (SvnConfiguration.getInstance(myVcs.getProject()).isMergeDryRun()) {
progress.setText(SvnBundle.message("progress.text.merging.dry.run.changes", root.getAbsolutePath()));
}
else {
progress.setText(SvnBundle.message("progress.text.merging.changes", root.getAbsolutePath()));
}
}
示例12: getUnzipToDir
import com.intellij.openapi.progress.ProgressIndicator; //導入方法依賴的package包/類
private static File getUnzipToDir(@Nullable ProgressIndicator progress,
@NotNull File targetDir,
boolean unwrapSingleTopLevelFolder) throws IOException {
if (progress != null) {
progress.setText("Extracting...");
}
if (unwrapSingleTopLevelFolder) {
return FileUtil.createTempDirectory("unzip-dir-", null);
}
return targetDir;
}
示例13: createUpgradeHandler
import com.intellij.openapi.progress.ProgressIndicator; //導入方法依賴的package包/類
private static ProgressTracker createUpgradeHandler(@NotNull final ProgressIndicator indicator,
@NotNull final String cleanupMessage,
@NotNull final String upgradeMessage) {
return new ProgressTracker() {
@Override
public void consume(ProgressEvent event) throws SVNException {
if (event.getFile() != null) {
if (EventAction.UPGRADED_PATH.equals(event.getAction())) {
indicator.setText2("Upgraded path " + VcsUtil.getPathForProgressPresentation(event.getFile()));
}
// fake event indicating cleanup start
if (EventAction.UPDATE_STARTED.equals(event.getAction())) {
indicator.setText(cleanupMessage);
}
// fake event indicating upgrade start
if (EventAction.UPDATE_COMPLETED.equals(event.getAction())) {
indicator.setText(upgradeMessage);
}
}
}
@Override
public void checkCancelled() throws SVNCancelException {
indicator.checkCanceled();
}
};
}
示例14: collectAndShowDuplicates
import com.intellij.openapi.progress.ProgressIndicator; //導入方法依賴的package包/類
private static void collectAndShowDuplicates(final Project project) {
final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
if (indicator != null && !indicator.isCanceled()) {
indicator.setText("Collecting project images...");
indicator.setIndeterminate(false);
final List<VirtualFile> images = new ArrayList<VirtualFile>();
for (String ext : IMAGE_EXTENSIONS) {
images.addAll(FilenameIndex.getAllFilesByExt(project, ext));
}
final Map<Long, Set<VirtualFile>> duplicates = new HashMap<Long, Set<VirtualFile>>();
final Map<Long, VirtualFile> all = new HashMap<Long, VirtualFile>();
for (int i = 0; i < images.size(); i++) {
indicator.setFraction((double)(i + 1) / (double)images.size());
final VirtualFile file = images.get(i);
if (!(file.getFileSystem() instanceof LocalFileSystem)) continue;
final long length = file.getLength();
if (all.containsKey(length)) {
if (!duplicates.containsKey(length)) {
final HashSet<VirtualFile> files = new HashSet<VirtualFile>();
files.add(all.get(length));
duplicates.put(length, files);
}
duplicates.get(length).add(file);
} else {
all.put(length, file);
}
indicator.checkCanceled();
}
showResults(project, images, duplicates, all);
}
}
示例15: updateIndicator
import com.intellij.openapi.progress.ProgressIndicator; //導入方法依賴的package包/類
private static int updateIndicator(final ProgressIndicator indicator, final int totalCount, int count, final PsiFile psiFile) {
if (indicator != null) {
if (indicator.isCanceled()) throw new ProcessCanceledException();
indicator.setFraction(((double)++count) / totalCount);
final VirtualFile virtualFile = psiFile.getVirtualFile();
if (virtualFile != null) {
indicator.setText(AnalysisScopeBundle.message("find.dependencies.progress.text", virtualFile.getPresentableUrl()));
}
}
return count;
}