本文整理汇总了Java中com.intellij.openapi.progress.ProgressIndicator.setText2方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressIndicator.setText2方法的具体用法?Java ProgressIndicator.setText2怎么用?Java ProgressIndicator.setText2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.progress.ProgressIndicator
的用法示例。
在下文中一共展示了ProgressIndicator.setText2方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAnalysisOutput
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@NotNull
private String getAnalysisOutput(@NotNull final ProgressIndicator progressIndicator) throws Exception {
final List<String> gradlewCommand = System.getProperty("os.name").startsWith("Windows")
? Arrays.asList("cmd", "/c", "gradlew.bat", "staticAnalys")
: Arrays.asList("./gradlew", "staticAnalys");
gradlewProcess = new ProcessBuilder(gradlewCommand)
.directory(new File(project.getBasePath()))
.redirectErrorStream(true)
.start();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(gradlewProcess.getInputStream()));
StringBuilder analysisOutputBuilder = new StringBuilder();
String outputLine;
while ((outputLine = bufferedReader.readLine()) != null) {
progressIndicator.setText2(outputLine);
progressIndicator.checkCanceled();
analysisOutputBuilder.append(outputLine);
analysisOutputBuilder.append('\n');
}
return analysisOutputBuilder.toString();
}
示例2: download
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
private boolean download(ProgressIndicator progressIndicator, URL url, File outputFile, String version) {
try {
HttpURLConnection httpConnection = (HttpURLConnection) (url.openConnection());
long completeFileSize = httpConnection.getContentLength();
java.io.BufferedInputStream in = new java.io.BufferedInputStream(httpConnection.getInputStream());
java.io.FileOutputStream fos = new java.io.FileOutputStream(outputFile);
java.io.BufferedOutputStream bout = new BufferedOutputStream(fos, BUFFER_SIZE);
byte[] data = new byte[BUFFER_SIZE];
long downloadedFileSize = 0;
int x;
while (!progressIndicator.isCanceled() && (x = in.read(data, 0, BUFFER_SIZE)) >= 0) {
downloadedFileSize += x;
// calculate progress
final double currentProgress = ((double) downloadedFileSize) / ((double) completeFileSize);
progressIndicator.setFraction(currentProgress);
progressIndicator.setText2(Math.ceil(downloadedFileSize / (1024 * 1024)) + "/" + (Math.ceil(completeFileSize / (1024 * 1024)) + " MB"));
bout.write(data, 0, x);
}
bout.close();
in.close();
} catch (IOException e) {
Messages.showErrorDialog("An error occurred while trying to download " + version + ".\n" + e.getMessage(), "Mule SDK Download Error");
return false;
}
return !progressIndicator.isCanceled();
}
示例3: run
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
public void run(@NotNull ProgressIndicator indicator) {
indicator.setIndeterminate(true);
indicator.setText2(VcsBundle.message("commit.wait.util.synched.text"));
synchronized (myLock) {
if (myStarted) {
LOG.error("Waiter running under progress being started again.");
return;
}
myStarted = true;
while (! myDone) {
try {
// every second check whether we are canceled
myLock.wait(500);
}
catch (InterruptedException e) {
// ok
}
indicator.checkCanceled();
}
}
}
示例4: run
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void run(@NotNull ProgressIndicator indicator) {
try {
//indicator.setText2("Checking and possibly creating database");
indicator.setText2("Updating VCS and roots");
final MultiMap<String, String> map = new MultiMap<String, String>();
myCachesHolder.iterateAllRepositoryLocations(new PairProcessor<RepositoryLocation, AbstractVcs>() {
@Override
public boolean process(RepositoryLocation location, AbstractVcs vcs) {
map.putValue(vcs.getName(), location2string(location));
return true;
}
});
myDbUtil.checkVcsRootsAreTracked(map);
}
catch (VcsException e) {
LOG.info(e);
myException = e;
}
}
示例5: 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;
}
示例6: doCopy
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
private void doCopy(final SVNURL src, final SVNURL dst, final boolean move, final String comment) {
final Ref<Exception> exception = new Ref<Exception>();
Runnable command = new Runnable() {
public void run() {
ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
if (progress != null) {
progress.setText((move ? SvnBundle.message("progress.text.browser.moving", src) : SvnBundle.message("progress.text.browser.copying", src)));
progress.setText2(SvnBundle.message("progress.text.browser.remote.destination", dst));
}
SvnVcs vcs = SvnVcs.getInstance(myProject);
try {
vcs.getFactoryFromSettings().createCopyMoveClient().copy(SvnTarget.fromURL(src), SvnTarget.fromURL(dst), SVNRevision.HEAD, true,
move, comment, null);
}
catch (VcsException e) {
exception.set(e);
}
}
};
String progressTitle = move ? SvnBundle.message("progress.title.browser.move") : SvnBundle.message("progress.title.browser.copy");
ProgressManager.getInstance().runProcessWithProgressSynchronously(command, progressTitle, false, myProject);
if (!exception.isNull()) {
Messages.showErrorDialog(exception.get().getMessage(), SvnBundle.message("message.text.error"));
}
}
示例7: createLogHandler
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@NotNull
private LogEntryConsumer createLogHandler(final SVNRevision fromIncluding,
final SVNRevision toIncluding,
final boolean includingYoungest,
final boolean includeOldest, final List<CommittedChangeList> result) {
return new LogEntryConsumer() {
@Override
public void consume(LogEntry logEntry) {
if (myProject.isDisposed()) throw new ProcessCanceledException();
final ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
if (progress != null) {
progress.setText2(SvnBundle.message("progress.text2.processing.revision", logEntry.getRevision()));
progress.checkCanceled();
}
if ((!includingYoungest) && (logEntry.getRevision() == fromIncluding.getNumber())) {
return;
}
if ((!includeOldest) && (logEntry.getRevision() == toIncluding.getNumber())) {
return;
}
result.add(new SvnChangeList(myVcs, myLocation, logEntry, myRepositoryRoot.toString()));
}
};
}
示例8: postAdditionalFiles
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
private static void postAdditionalFiles(Course course, @NotNull final Project project, int id) {
final Lesson lesson = CCUtils.createAdditionalLesson(course, project);
if (lesson != null) {
final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
if (indicator != null) {
indicator.setText2("Publishing additional files");
}
final int sectionId = postModule(id, 2, EduNames.PYCHARM_ADDITIONAL, project);
final int lessonId = postLesson(project, lesson);
postUnit(lessonId, 1, sectionId, project);
}
}
示例9: generateDictionary
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
private void generateDictionary(final Project project, final Collection<VirtualFile> folderPaths, final String outFile,
final ProgressIndicator progressIndicator) {
final HashSet<String> seenNames = new HashSet<String>();
// Collect stuff
for (VirtualFile folder : folderPaths) {
progressIndicator.setText2("Scanning folder: " + folder.getPath());
final PsiManager manager = PsiManager.getInstance(project);
processFolder(seenNames, manager, folder);
}
if (seenNames.isEmpty()) {
LOG.info(" No new words was found.");
return;
}
final StringBuilder builder = new StringBuilder();
// Sort names
final ArrayList<String> names = new ArrayList<String>(seenNames);
Collections.sort(names);
for (String name : names) {
if (builder.length() > 0){
builder.append("\n");
}
builder.append(name);
}
try {
final File dictionaryFile = new File(outFile);
FileUtil.createIfDoesntExist(dictionaryFile);
final FileWriter writer = new FileWriter(dictionaryFile.getPath());
try {
writer.write(builder.toString());
}
finally {
writer.close();
}
}
catch (IOException e) {
LOG.error(e);
}
}
示例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: getFileCount
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
public int getFileCount() {
if (myFilesSet == null) initFilesSet();
final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
if (indicator != null) { //clear text after building analysis scope set
indicator.setText("");
indicator.setText2("");
}
return myFilesSet.size();
}
示例12: initializeProgress
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
private void initializeProgress() {
ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
if (indicator != null) {
indicator.setText(IdeBundle.message("loading.editors"));
indicator.setText2("");
indicator.setIndeterminate(false);
indicator.setFraction(0);
myProgressMaximum = countFiles(mySplittersElement);
myCurrentProgress = 0;
}
}
示例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: generateSkeletonsForList
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
private boolean generateSkeletonsForList(@NotNull final PySkeletonRefresher refresher,
ProgressIndicator indicator,
@Nullable final String currentBinaryFilesPath) throws InvalidSdkException {
final PySkeletonGenerator generator = new PySkeletonGenerator(refresher.getSkeletonsPath(), mySdk, currentBinaryFilesPath);
indicator.setIndeterminate(false);
final String homePath = mySdk.getHomePath();
if (homePath == null) return false;
GeneralCommandLine cmd = PythonHelper.EXTRA_SYSPATH.newCommandLine(homePath, Lists.newArrayList(myQualifiedName));
final ProcessOutput runResult = PySdkUtil.getProcessOutput(cmd,
new File(homePath).getParent(),
PythonSdkType.getVirtualEnvExtraEnv(homePath), 5000
);
if (runResult.getExitCode() == 0 && !runResult.isTimeout()) {
final String extraPath = runResult.getStdout();
final PySkeletonGenerator.ListBinariesResult binaries = generator.listBinaries(mySdk, extraPath);
final List<String> names = Lists.newArrayList(binaries.modules.keySet());
Collections.sort(names);
final int size = names.size();
for (int i = 0; i != size; ++i) {
final String name = names.get(i);
indicator.setFraction((double)i / size);
if (needBinaryList(name)) {
indicator.setText2(name);
final PySkeletonRefresher.PyBinaryItem item = binaries.modules.get(name);
final String modulePath = item != null ? item.getPath() : "";
//noinspection unchecked
refresher.generateSkeleton(name, modulePath, new ArrayList<String>(), Consumer.EMPTY_CONSUMER);
}
}
}
return true;
}
示例15: setIndicator
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
public synchronized void setIndicator(ProgressIndicator i) {
i.setText(myIndicator.getText());
i.setText2(myIndicator.getText2());
i.setFraction(myIndicator.getFraction());
if (i.isCanceled()) i.cancel();
myIndicator = i;
}