• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ProgressWindow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.openapi.progress.util.ProgressWindow的典型用法代码示例。如果您正苦于以下问题:Java ProgressWindow类的具体用法?Java ProgressWindow怎么用?Java ProgressWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ProgressWindow类属于com.intellij.openapi.progress.util包,在下文中一共展示了ProgressWindow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: uploadExercise

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
public void uploadExercise(Project project) {

        new ButtonInputListener().receiveSubmit();

        ProgressWindow window =
                ProgressWindowMaker.make(
                        "Uploading exercise, this may take several minutes",
                        project,
                        true,
                        true,
                        true);
        CoreProgressObserver observer = new CoreProgressObserver(window);
        FileDocumentManager.getInstance().saveAllDocuments();

        callExerciseUploadService(project, observer, window);
    }
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:17,代码来源:UploadExerciseAction.java


示例2: callExerciseUploadService

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
private void callExerciseUploadService(
        Project project, CoreProgressObserver observer, ProgressWindow window) {

    new ExerciseUploadingService()
            .startUploadExercise(
                    project,
                    TmcCoreHolder.get(),
                    new ObjectFinder(),
                    new CheckForExistingExercises(),
                    new SubmissionResultHandler(),
                    TmcSettingsManager.get(),
                    new CourseAndExerciseManager(),
                    new ThreadingService(),
                    new TestRunningService(),
                    observer,
                    window);
}
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:18,代码来源:UploadExerciseAction.java


示例3: startDownloadExercise

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
private void startDownloadExercise(Project project, boolean downloadAll) throws Exception {
    ProgressWindow window =
            ProgressWindowMaker.make(
                    "Downloading exercises, this may take several minutes",
                    project,
                    true,
                    true,
                    true);
    ExerciseDownloadingService
            .startDownloadExercise(
                    TmcCoreHolder.get(),
                    TmcSettingsManager.get(),
                    new CheckForExistingExercises(),
                    new ObjectFinder(),
                    new ThreadingService(),
                    project,
                    downloadAll,
                    window);
}
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:20,代码来源:DownloadExerciseAction.java


示例4: runTests

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
public void runTests(
        final Exercise exercise,
        Project project,
        ThreadingService threadingService,
        ObjectFinder finder) {
    logger.info("Starting to run tests for current project. @TestRunningService");

    ProgressWindow window =
            ProgressWindowMaker.make("Running tests", project, true, true, true);
    CoreProgressObserver observer = new CoreProgressObserver(window);

    if (exercise != null) {
        prepareThreadForRunningTests(
                exercise, project, threadingService, finder, window, observer);
    } else {
        Exception exception = new Exception();
        logger.warn(
                "Running tests failed, exercise {} was not "
                        + "recognized. @TestRunningService",
                exercise,
                exception);
        new ErrorMessageService()
                .showErrorMessage(
                        exception, "Running tests failed, exercise was not recognized", true);
    }
}
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:27,代码来源:TestRunningService.java


示例5: startDownloadExercise

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
public static void startDownloadExercise(
        final TmcCore core,
        final SettingsTmc settings,
        final CheckForExistingExercises checker,
        ObjectFinder objectFinder,
        ThreadingService threadingService,
        Project project,
        boolean downloadAll,
        ProgressWindow window) {

    logger.info(
            "Preparing to start checking for available exercises."
                    + "@ExerciseDownloadingService");
    Thread run = checkAvailableExercises(core, settings, checker, objectFinder, downloadAll);
    threadingService.runWithNotification(run, project, window);
}
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:17,代码来源:ExerciseDownloadingService.java


示例6: addFunctionalityToRefreshButton

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
@NotNull
private JButton addFunctionalityToRefreshButton() {
    logger.info("Adding functionality to refresh projects button. "
            + "@ProjectListWindow");
    JButton refreshButton = new JButton(TmcIcons.REFRESH);
    refreshButton.setBorderPainted(true);
    refreshButton.setEnabled(true);

    ProgressWindow window = ProgressWindowMaker.make("Refreshing project list",
            new ObjectFinder().findCurrentProject(), false, true, true);

    refreshButton.addActionListener(actionEvent -> {
        ThreadingService threadingService = new ThreadingService();
        threadingService.runWithNotification(
                new Thread(() -> refreshProjectList()),
                new ObjectFinder().findCurrentProject(),
                window);
    });

    return refreshButton;
}
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:22,代码来源:ProjectListWindow.java


示例7: afterUploadingExercisesTheCourseIsUpdated

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
@Test
public void afterUploadingExercisesTheCourseIsUpdated() {
    ObjectFinder finder = mock(ObjectFinder.class);
    CheckForExistingExercises checker = mock(CheckForExistingExercises.class);
    SettingsTmc settings = mock(SettingsTmc.class);
    ThreadingService threadingService = mock(ThreadingService.class);
    Course course = new Course("home");

    Project project = mock(Project.class);
    when(project.getBasePath()).thenReturn("/home/user");

    CourseAndExerciseManager mockCourseAndExerciseManager = mock(CourseAndExerciseManager.class);
    when(mockCourseAndExerciseManager.isCourseInDatabase(course.getName())).thenReturn(true);

    ProgressWindow window = mock(ProgressWindow.class);
    CoreProgressObserver observer = mock(CoreProgressObserver.class);

    new ExerciseUploadingService().startUploadExercise(project, mock(TmcCore.class), finder, checker,
            mock(SubmissionResultHandler.class), settings,
            mockCourseAndExerciseManager, threadingService, mock(TestRunningService.class),
            observer, window);

    verify(threadingService).runWithNotification(any(Runnable.class), any(Project.class), any(ProgressWindow.class));
    verify(mockCourseAndExerciseManager).updateSingleCourse(course.getName(),
            checker, finder, settings);
}
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:27,代码来源:UploadExerciseServiceTest.java


示例8: waitForFileWatcher

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
private static void waitForFileWatcher(@NotNull ProgressIndicator indicator) {
  LocalFileSystem fs = LocalFileSystem.getInstance();
  if (!(fs instanceof LocalFileSystemImpl)) return;

  final FileWatcher watcher = ((LocalFileSystemImpl)fs).getFileWatcher();
  if (!watcher.isOperational() || !watcher.isSettingRoots()) return;

  LOG.info("FW/roots waiting started");
  indicator.setIndeterminate(true);
  indicator.setText(ProjectBundle.message("project.load.waiting.watcher"));
  if (indicator instanceof ProgressWindow) {
    ((ProgressWindow)indicator).setCancelButtonText(CommonBundle.message("button.skip"));
  }
  while (watcher.isSettingRoots() && !indicator.isCanceled()) {
    TimeoutUtil.sleep(10);
  }
  LOG.info("FW/roots waiting finished");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ProjectManagerImpl.java


示例9: waitForFileWatcher

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
private void waitForFileWatcher(@NotNull Project project) {
  LocalFileSystem fs = LocalFileSystem.getInstance();
  if (!(fs instanceof LocalFileSystemImpl)) return;

  final FileWatcher watcher = ((LocalFileSystemImpl)fs).getFileWatcher();
  if (!watcher.isOperational() || !watcher.isSettingRoots()) return;

  LOG.info("FW/roots waiting started");
  Task.Modal task = new Task.Modal(project, ProjectBundle.message("project.load.progress"), true) {
    @Override
    public void run(@NotNull ProgressIndicator indicator) {
      indicator.setIndeterminate(true);
      indicator.setText(ProjectBundle.message("project.load.waiting.watcher"));
      if (indicator instanceof ProgressWindow) {
        ((ProgressWindow)indicator).setCancelButtonText(CommonBundle.message("button.skip"));
      }
      while (watcher.isSettingRoots() && !indicator.isCanceled()) {
        TimeoutUtil.sleep(10);
      }
      LOG.info("FW/roots waiting finished");
    }
  };
  myProgressManager.run(task);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:ProjectManagerImpl.java


示例10: rediff

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
@RequiredDispatchThread
public void rediff(boolean trySync) {
  if (isDisposed()) return;
  abortRediff();

  fireEvent(EventType.BEFORE_REDIFF);
  onBeforeRediff();

  boolean forceEDT = forceRediffSynchronously();
  int waitMillis = trySync || tryRediffSynchronously() ? ProgressWindow.DEFAULT_PROGRESS_DIALOG_POSTPONE_TIME_MILLIS : 0;

  myTaskExecutor.executeAndTryWait(
          indicator -> {
            final Runnable callback = performRediff(indicator);
            return () -> {
              callback.run();
              onAfterRediff();
              fireEvent(EventType.AFTER_REDIFF);
            };
          },
          this::onSlowRediff, waitMillis, forceEDT
  );
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:DiffViewerBase.java


示例11: executeProcessUnderProgress

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
@Override
public void executeProcessUnderProgress(@Nonnull Runnable process, ProgressIndicator progress) throws ProcessCanceledException {
  if (progress instanceof ProgressWindow) myCurrentUnsafeProgressCount.incrementAndGet();

  CheckCanceledHook hook = progress instanceof PingProgress && ApplicationManager.getApplication().isDispatchThread()
                           ? p -> { ((PingProgress)progress).interact(); return true; }
                           : null;
  if (hook != null) addCheckCanceledHook(hook);

  try {
    super.executeProcessUnderProgress(process, progress);
  }
  finally {
    if (progress instanceof ProgressWindow) myCurrentUnsafeProgressCount.decrementAndGet();
    if (hook != null) removeCheckCanceledHook(hook);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:ProgressManagerImpl.java


示例12: runProcessWithProgress

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
public static void runProcessWithProgress(Project project, Runnable runnable) {
        ProgressWindow progressIndicator = new ProgressWindow(false, project);
        progressIndicator.setIndeterminate(true);

        runSync(project, runnable);
//        runAsync(project, runnable, progressIndicator);
    }
 
开发者ID:CeH9,项目名称:PackageTemplates,代码行数:8,代码来源:ProgressHelper.java


示例13: runWithNotification

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
public void runWithNotification(
        final Runnable run, Project project, ProgressWindow progressWindow) {
    logger.info("Processing runWithNotification. @ThreadingService");

    ApplicationManager.getApplication()
            .executeOnPooledThread(
                    () -> ProgressManager.getInstance().runProcess(run, progressWindow));
}
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:9,代码来源:ThreadingService.java


示例14: make

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
public static ProgressWindow make(
        String title,
        Project project,
        boolean cancelable,
        boolean hidable,
        boolean indeterminate) {
    logger.info("Creating progress window. @ProgressWindowMaker");
    ProgressWindow progressWindow = new ProgressWindow(cancelable, hidable, project);
    progressWindow.setIndeterminate(indeterminate);
    progressWindow.setTitle(title);
    progressWindow.setDelayInMillis(500);

    return progressWindow;
}
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:15,代码来源:ProgressWindowMaker.java


示例15: startDownloading

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
public static void startDownloading(List<Exercise> exercises) {
    logger.info("Preparing to start downloading exercises. @ExerciseDownloadingService");
    ProgressWindow window =
            ProgressWindowMaker.make(
                    "Downloading exercises, this may take a while",
                    new ObjectFinder().findCurrentProject(),
                    true,
                    true,
                    false);
    CoreProgressObserver observer = new CoreProgressObserver(window);
    Thread run = downloadSelectedExercises(TmcCoreHolder.get(), exercises, observer);
    ThreadingService threadingService = new ThreadingService();
    Project project = new ObjectFinder().findCurrentProject();
    threadingService.runWithNotification(run, project, window);
}
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:16,代码来源:ExerciseDownloadingService.java


示例16: actionPerformed

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
    final Project project = e.getProject();
    final VirtualFile[] files = e.getData(PlatformDataKeys.VIRTUAL_FILE_ARRAY);

    ProjectSettingsController projectSettingsController = new ProjectSettingsController(project);

    String currentEnvironment = projectSettingsController.getNsEnvironment();

    NSAccount nsAccount = projectSettingsController.getNSAccountForProject();

    if (nsAccount == null) {
        return;
    }

    final NSClient nsClient;

    try {
        nsClient = new NSClient(nsAccount, currentEnvironment);
    } catch (Exception ex) {
        JOptionPane.showMessageDialog(null, "Error creating NSClient", "ERROR", JOptionPane.ERROR_MESSAGE);
        return;
    }

    RunnableBackgroundableWrapper wrapper = new RunnableBackgroundableWrapper(e.getProject(), "", new UploadTask(project, files, nsClient, projectSettingsController));
    ProgressWindow progressIndicator = new ProgressWindow(true, project);
    progressIndicator.setIndeterminate(true);

    ProgressManager.getInstance().runProcessWithProgressAsynchronously(wrapper, progressIndicator);
}
 
开发者ID:Topher84,项目名称:NetSuite-Tools-For-WebStorm,代码行数:31,代码来源:UploadAction.java


示例17: actionPerformed

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
    final Project project = e.getProject();
    final VirtualFile[] files = e.getData(PlatformDataKeys.VIRTUAL_FILE_ARRAY);

    ProjectSettingsController projectSettingsController = new ProjectSettingsController(project);

    String currentEnvironment = projectSettingsController.getNsEnvironment();

    NSAccount nsAccount = projectSettingsController.getNSAccountForProject();

    if (nsAccount == null) {
        return;
    }

    final NSClient nsClient;

    try {
        nsClient = new NSClient(nsAccount, currentEnvironment);
    } catch (Exception ex) {
        JOptionPane.showMessageDialog(null, "Error creating NSClient", "ERROR", JOptionPane.ERROR_MESSAGE);
        return;
    }

    RunnableBackgroundableWrapper wrapper = new RunnableBackgroundableWrapper(e.getProject(), "", new CompareWithFileCabinetTask(project, files, nsClient, projectSettingsController));
    ProgressWindow progressIndicator = new ProgressWindow(true, project);
    progressIndicator.setIndeterminate(true);

    ProgressManager.getInstance().runProcessWithProgressAsynchronously(wrapper, progressIndicator);
}
 
开发者ID:Topher84,项目名称:NetSuite-Tools-For-WebStorm,代码行数:31,代码来源:CompareWithFileCabinetAction.java


示例18: scheduleRediff

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
@CalledInAwt
public final void scheduleRediff() {
  if (isDisposed()) return;

  abortRediff();
  myTaskAlarm.addRequest(new Runnable() {
    @Override
    public void run() {
      rediff();
    }
  }, ProgressWindow.DEFAULT_PROGRESS_DIALOG_POSTPONE_TIME_MILLIS);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:DiffViewerBase.java


示例19: rediff

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
@CalledInAwt
public void rediff(boolean trySync) {
  if (isDisposed()) return;
  abortRediff();

  fireEvent(EventType.BEFORE_REDIFF);
  onBeforeRediff();

  // most of performRediff implementations take ReadLock inside. If EDT is holding write lock - this will never happen,
  // and diff will not be calculated. This could happen for diff from FileDocumentManager.
  boolean forceEDT = ApplicationManager.getApplication().isWriteAccessAllowed();

  int waitMillis = trySync || tryRediffSynchronously() ? ProgressWindow.DEFAULT_PROGRESS_DIALOG_POSTPONE_TIME_MILLIS : 0;

  myTaskExecutor.executeAndTryWait(
    new Function<ProgressIndicator, Runnable>() {
      @Override
      public Runnable fun(final ProgressIndicator indicator) {
        final Runnable callback = performRediff(indicator);
        return new Runnable() {
          @Override
          public void run() {
            callback.run();
            onAfterRediff();
            fireEvent(EventType.AFTER_REDIFF);
          }
        };
      }
    },
    new Runnable() {
      @Override
      public void run() {
        onSlowRediff();
      }
    },
    waitMillis, forceEDT
  );
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:DiffViewerBase.java


示例20: setCancelButtonText

import com.intellij.openapi.progress.util.ProgressWindow; //导入依赖的package包/类
@Override
public void setCancelButtonText(String cancelButtonText) {
  ProgressIndicator progressIndicator = getProgressIndicator();
  if (progressIndicator != null) {
    if (progressIndicator instanceof SmoothProgressAdapter && cancelButtonText != null) {
      ProgressIndicator original = ((SmoothProgressAdapter)progressIndicator).getOriginalProgressIndicator();
      if (original instanceof ProgressWindow) {
        ((ProgressWindow)original).setCancelButtonText(cancelButtonText);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ProgressManagerImpl.java



注:本文中的com.intellij.openapi.progress.util.ProgressWindow类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Slf4jImpl类代码示例发布时间:2022-05-23
下一篇:
Java DynamoDBEmbedded类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap