• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ColorProgressBar类的典型用法和代码示例

java 2次浏览

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

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

示例1: buildSpecificationFile

点赞 3

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
@NotNull
private File buildSpecificationFile() throws ExecutionException {
    try {
        File specificationFile = livingDocFileManager.createSpecificationFile();

        LivingDocConnector livingDocConnector = LivingDocConnector.newInstance(ProjectSettings.getInstance(runConfiguration.getProject()));
        livingDocConnector.printSpecification(runConfiguration, specificationFile);

        return specificationFile;

    } catch (Exception e) {
        runConfiguration.getStatusLine().setText(e.getMessage());
        runConfiguration.getStatusLine().setStatusColor(ColorProgressBar.RED);
        runConfiguration.getStatusLine().setFraction(100d);

        LOG.error(e);
        throw new ExecutionException(e);
    }
}
 

开发者ID:testIT-LivingDoc,
项目名称:livingdoc-intellij,
代码行数:20,
代码来源:RunProfileStateLivingDoc.java

示例2: processTerminated

点赞 3

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
@Override
public void processTerminated(ProcessEvent processEvent) {

    executionCounter.setEndTime(System.currentTimeMillis());

    if (processEvent.getExitCode() == 0) {
        try {
            LivingDocExecution execution = getLivingDocExecution();

            updateStatusLine(execution);

            File resultFile = loadResultFile(execution);

            BrowserLauncher browser = new BrowserLauncherImpl();
            browser.open(resultFile.getPath());

        } catch (IOException | LivingDocException e) {
            LOG.error(e);
        }
    } else {
        statusLine.setText(I18nSupport.getValue("run.execution.error.process"));
        statusLine.setStatusColor(ColorProgressBar.RED);
        statusLine.setFraction(100d);
    }
}
 

开发者ID:testIT-LivingDoc,
项目名称:livingdoc-intellij,
代码行数:26,
代码来源:ProcessListenerLivingDoc.java

示例3: onTestingStarted

点赞 3

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
/**
 * Returns root node, fake parent suite for all tests and suites
 *
 * @param testsRoot
 * @return
 */
public void onTestingStarted(@NotNull SMTestProxy.SMRootTestProxy testsRoot) {
  myAnimator.setCurrentTestCase(myTestsRootNode);
  myTreeBuilder.updateFromRoot();

  // Status line
  myStatusLine.setStatusColor(ColorProgressBar.GREEN);

  // Tests tree
  selectAndNotify(myTestsRootNode);

  myStartTime = System.currentTimeMillis();
  boolean printTestingStartedTime = true;
  if (myProperties instanceof SMTRunnerConsoleProperties) {
    printTestingStartedTime = ((SMTRunnerConsoleProperties)myProperties).isPrintTestingStartedTime();
  }
  if (printTestingStartedTime) {
    myTestsRootNode.addSystemOutput("Testing started at " + DateFormatUtil.formatTime(myStartTime) + " ...\n");
  }

  updateStatusLabel(false);

  // TODO : show info - "Loading..." msg

  fireOnTestingStarted();
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:32,
代码来源:SMTestRunnerResultsForm.java

示例4: onProcessStarted

点赞 3

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
public void onProcessStarted(final ProcessHandler process) {
  if (myTestsBuilt) return;
  process.addProcessListener(new ProcessAdapter() {
    @Override
    public void processTerminated(ProcessEvent event) {
      process.removeProcessListener(this);
      ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override
        public void run() {
          myStateInfo.setTerminated(myState);
          if (!myTestsBuilt && myProgressBar.getValue() == 0) {
            setStatusColor(ColorProgressBar.RED);
            setFraction(1.0);
            myState.append(ExecutionBundle.message("junit.running.info.failed.to.start.error.message"));
          }
        }
      });
    }
  });
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:21,
代码来源:JUnitStatusLine.java

示例5: onTestingStarted

点赞 3

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
/**
 * Returns root node, fake parent suite for all tests and suites
 *
 * @param testsRoot
 * @return
 */
public void onTestingStarted(@NotNull SMTestProxy.SMRootTestProxy testsRoot) {
  myAnimator.setCurrentTestCase(myTestsRootNode);

  // Status line
  myStatusLine.setStatusColor(ColorProgressBar.GREEN);

  // Tests tree
  selectAndNotify(myTestsRootNode);

  myStartTime = System.currentTimeMillis();
  myTestsRootNode.addSystemOutput("Testing started at "
                                  + DateFormatUtil.formatTime(myStartTime)
                                  + " ...\n");

  updateStatusLabel(false);

  // TODO : show info - "Loading..." msg

  fireOnTestingStarted();
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:27,
代码来源:SMTestRunnerResultsForm.java

示例6: updateStatusLabel

点赞 3

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
private void updateStatusLabel(final boolean testingFinished) {
  if (myTestsFailuresCount > 0) {
    myStatusLine.setStatusColor(ColorProgressBar.RED);
  }
  else if (myContainsIgnoredTests) {
    myStatusLine.setStatusColor(DARK_YELLOW);
  }

  if (testingFinished) {
    if (myTestsTotal == 0) {
      myStatusLine.setStatusColor(myTestsRootNode.wasLaunched() || !myTestsRootNode.isTestsReporterAttached()
                                  ? JBColor.LIGHT_GRAY
                                  : ColorProgressBar.RED);
    }
    // else color will be according failed/passed tests
  }

  // launchedAndFinished - is launched and not in progress. If we remove "launched' that onTestingStarted() before
  // initializing will be "launchedAndFinished"
  final boolean launchedAndFinished = myTestsRootNode.wasLaunched() && !myTestsRootNode.isInProgress();
  myStatusLine.setText(TestsPresentationUtil.getProgressStatus_Text(myStartTime, myEndTime,
                                                                    myTestsTotal, myTestsCurrentCount,
                                                                    myTestsFailuresCount, myMentionedCategories,
                                                                    launchedAndFinished));
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:26,
代码来源:SMTestRunnerResultsForm.java

示例7: onProcessStarted

点赞 3

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
public void onProcessStarted(final ProcessHandler process) {
  if (myTestsBuilt) return;
  process.addProcessListener(new ProcessAdapter() {
    public void processTerminated(ProcessEvent event) {
      process.removeProcessListener(this);
      ApplicationManager.getApplication().invokeLater(new Runnable() {
        public void run() {
          myStateInfo.setTerminated(myState);
          if (!myTestsBuilt && myProgressBar.getFraction() == 0.0) {
            myProgressBar.setColor(ColorProgressBar.RED);
            myProgressBar.setFraction(1.0);
            myState.setText(ExecutionBundle.message("junit.runing.info.failed.to.start.error.message"));
          }
        }
      });
    }
  });
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:19,
代码来源:JUnitStatusLine.java

示例8: updateStatusLabel

点赞 3

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
private void updateStatusLabel(final boolean testingFinished) {
  if (myFailedTestCount > 0) {
    myStatusLine.setStatusColor(ColorProgressBar.RED);
  }

  if (testingFinished) {
    if (myTotalTestCount == 0) {
      myStatusLine.setStatusColor(myTestsRootNode.wasLaunched() || !myTestsRootNode.isTestsReporterAttached() ? JBColor.LIGHT_GRAY : ColorProgressBar.RED);
    }
    // else color will be according failed/passed tests
  }

  // launchedAndFinished - is launched and not in progress. If we remove "launched' that onTestingStarted() before
  // initializing will be "launchedAndFinished"
  final boolean launchedAndFinished = myTestsRootNode.wasLaunched() && !myTestsRootNode.isInProgress();
  if (!TestsPresentationUtil.hasNonDefaultCategories(myMentionedCategories)) {
    myStatusLine.formatTestMessage(myTotalTestCount, myFinishedTestCount, myFailedTestCount, myIgnoredTestCount, myTestsRootNode.getDuration(), myEndTime);
  }
  else {
    myStatusLine.setText(TestsPresentationUtil.getProgressStatus_Text(myStartTime, myEndTime, myTotalTestCount, myFinishedTestCount, myFailedTestCount,
                                                                      myMentionedCategories, launchedAndFinished));
  }
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:24,
代码来源:SMTestRunnerResultsForm.java

示例9: startNotified

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
@Override
public void startNotified(ProcessEvent event) {

    if (executionCounter.getStartTime() == 0) {
        // Set the start time only the first time.
        executionCounter.setStartTime(System.currentTimeMillis());
    }
    SwingUtilities.invokeLater(() -> {
        statusLine.setText(I18nSupport.getValue("run.execution.running.label"));
        statusLine.setStatusColor(ColorProgressBar.GREEN);
        statusLine.setFraction(0d);
    });
}
 

开发者ID:testIT-LivingDoc,
项目名称:livingdoc-intellij,
代码行数:14,
代码来源:ProcessListenerLivingDoc.java

示例10: updateStatusLabel

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
private void updateStatusLabel(final boolean testingFinished) {
  if (myFailedTestCount > 0) {
    myStatusLine.setStatusColor(ColorProgressBar.RED);
  }

  if (testingFinished) {
    if (myTotalTestCount == 0) {
      myStatusLine.setStatusColor(myTestsRootNode.wasLaunched() || !myTestsRootNode.isTestsReporterAttached()
                                  ? JBColor.LIGHT_GRAY
                                  : ColorProgressBar.RED);
    }
    // else color will be according failed/passed tests
  }

  // launchedAndFinished - is launched and not in progress. If we remove "launched' that onTestingStarted() before
  // initializing will be "launchedAndFinished"
  final boolean launchedAndFinished = myTestsRootNode.wasLaunched() && !myTestsRootNode.isInProgress();
  if (!TestsPresentationUtil.hasNonDefaultCategories(myMentionedCategories)) {
    myStatusLine.formatTestMessage(myTotalTestCount, myFinishedTestCount, myFailedTestCount, myIgnoredTestCount, myTestsRootNode.getDuration(), myEndTime);
  }
  else {
    myStatusLine.setText(TestsPresentationUtil.getProgressStatus_Text(myStartTime, myEndTime,
                                                                      myTotalTestCount, myFinishedTestCount,
                                                                      myFailedTestCount, myMentionedCategories,
                                                                      launchedAndFinished));
  }
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:28,
代码来源:SMTestRunnerResultsForm.java

示例11: testCustomProgress_Failure

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
public void testCustomProgress_Failure() {
  myResultsViewer.onCustomProgressTestsCategory("foo", 4);

  final SMTestProxy test1 = createTestProxy("some_test1", myTestsRootNode);
  myResultsViewer.onTestStarted(test1);
  myResultsViewer.onCustomProgressTestStarted();

  myResultsViewer.onTestFailed(test1);
  assertEquals(0, myResultsViewer.getFailedTestCount());

  myResultsViewer.onCustomProgressTestFailed();
  assertEquals(1, myResultsViewer.getFailedTestCount());

  assertEquals(ColorProgressBar.RED, myResultsViewer.getTestsStatusColor());
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:16,
代码来源:SMTestRunnerResultsFormTest.java

示例12: testProgressBar_Ignored

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
public void testProgressBar_Ignored() {
  final SMTestProxy test1 = createTestProxy("some_test1", myTestsRootNode);
  myResultsViewer.onTestStarted(test1);
  myResultsViewer.performUpdate();
  myResultsViewer.onTestIgnored(test1);
  myResultsViewer.performUpdate();
  assertEquals(0, myResultsViewer.getFailedTestCount());
  assertEquals(1, myResultsViewer.getIgnoredTestCount());

  assertEquals(ColorProgressBar.GREEN, myResultsViewer.getTestsStatusColor());
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:12,
代码来源:SMTestRunnerResultsFormTest.java

示例13: testCustomProgress_NotRun_ReporterAttached

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
public void testCustomProgress_NotRun_ReporterAttached() {
  myResultsViewer.onTestingStarted(myTestsRootNode);
  myTestsRootNode.setTestsReporterAttached();
  myResultsViewer.onTestingFinished(myTestsRootNode);

  // e.g. reporter attached but tests were actually launched
  // seems cannot happen in current implementation but is expected behaviour
  // for future
  assertEquals(ColorProgressBar.RED, myResultsViewer.getTestsStatusColor());
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:11,
代码来源:SMTestRunnerResultsFormTest.java

示例14: testCustomProgress_Terminated_SmthFailed

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
public void testCustomProgress_Terminated_SmthFailed() {
  myResultsViewer.onTestingStarted(myTestsRootNode);

  final SMTestProxy test1 = createTestProxy("some_test1", myTestsRootNode);
  myResultsViewer.onTestStarted(test1);
  myResultsViewer.onTestFailed(test1);
  myResultsViewer.onTestStarted(createTestProxy("some_test2", myTestsRootNode));
  myResultsViewer.onTestingFinished(myTestsRootNode);

  assertEquals(ColorProgressBar.RED, myResultsViewer.getTestsStatusColor());
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:12,
代码来源:SMTestRunnerResultsFormTest.java

示例15: TestStatusLine

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
public TestStatusLine() {
  super(new BorderLayout());
  myProgressPanel = new JPanel(new GridBagLayout());
  add(myProgressPanel, BorderLayout.WEST);
  myProgressBar.setMaximum(100);
  myProgressPanel.add(myProgressBar, new GridBagConstraints(0, 0, 0, 0, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
                                                            new Insets(2, 8, 0, 8), 0, 0));
  setStatusColor(ColorProgressBar.GREEN);
  add(myState, BorderLayout.CENTER);
  myState.append(ExecutionBundle.message("junit.runing.info.starting.label"));
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:12,
代码来源:TestStatusLine.java

示例16: finish

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
public void finish(final boolean started) {
  if (start > 0) {
    end = System.currentTimeMillis();
  }
  LvcsHelper.addLabel(this);

  SwingUtilities.invokeLater(new Runnable() {
    public void run() {
      animator.stopMovie();
      updateStatusLine();
      if (total > count || myStatus == MessageHelper.SKIPPED_TEST) {
        myStatusLine.setStatusColor(ColorProgressBar.YELLOW);
      }
      else if (myStatus == MessageHelper.FAILED_TEST) {
        myStatusLine.setStatusColor(ColorProgressBar.RED);
      }
      else {
        myStatusLine.setStatusColor(ColorProgressBar.GREEN);
      }
      rootNode.setInProgress(false);
      if (TestNGConsoleProperties.SELECT_FIRST_DEFECT.value(myProperties)) {
        selectTest(rootNode.getFirstDefect());
      }
      else {
        final DefaultMutableTreeNode node = treeBuilder.getNodeForElement(rootNode);
        if (node != null && myLastSelected == null) {
          tree.getSelectionModel().setSelectionPath(new TreePath(node));
        }
      }
      tree.repaint();
      if (total > 0 ||
          !ResetConfigurationModuleAdapter.tryWithAnotherModule(configuration, getProperties().isDebug())) {
        TestsUIUtil.notifyByBalloon(project, started, rootNode, getProperties(), "in " + getTime());
      }
    }
  });
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:38,
代码来源:TestNGResults.java

示例17: onRunnerStateChanged

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
@Override
public void onRunnerStateChanged(final StateEvent event) {
  if (!event.isRunning()) {
    final CompletionEvent completionEvent = (CompletionEvent) event;
    myStateInfo.setDone(completionEvent);
    myProgress.setDone(completionEvent);
    if (completionEvent.isTerminated() && !myProgress.hasDefects()) {
      setStatusColor(ColorProgressBar.YELLOW);
    }
    updateCounters();
  }
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:13,
代码来源:JUnitStatusLine.java

示例18: updateCounters

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
private void updateCounters() {
  myStateInfo.updateCounters(myProgress);
  setFraction(myStateInfo.getCompletedPercents());
  if (myProgress.hasDefects()) {
    setStatusColor(ColorProgressBar.RED);
  }
  myStateInfo.updateLabel(myState);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:9,
代码来源:JUnitStatusLine.java

示例19: testCustomProgress_Failure

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
public void testCustomProgress_Failure() {
  myResultsViewer.onCustomProgressTestsCategory("foo", 4);

  final SMTestProxy test1 = createTestProxy("some_test1", myTestsRootNode);
  myResultsViewer.onTestStarted(test1);
  myResultsViewer.onCustomProgressTestStarted();

  myResultsViewer.onTestFailed(test1);
  assertEquals(0, myResultsViewer.getTestsFailuresCount());

  myResultsViewer.onCustomProgressTestFailed();
  assertEquals(1, myResultsViewer.getTestsFailuresCount());

  assertEquals(ColorProgressBar.RED, myResultsViewer.getTestsStatusColor());
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:16,
代码来源:SMTestRunnerResultsFormTest.java

示例20: TestStatusLine

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
public TestStatusLine() {
  super(new GridLayout(1, 2));
  add(myState);
  final JPanel progressPanel = new JPanel(new GridBagLayout());
  add(progressPanel);
  progressPanel.add(myProgressBar, new GridBagConstraints(0, 0, 0, 0, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
  myProgressBar.setColor(ColorProgressBar.GREEN);
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:9,
代码来源:TestStatusLine.java

示例21: finish

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
public void finish() {
  if (start > 0) {
    end = System.currentTimeMillis();
  }
  LvcsHelper.addLabel(this);

  SwingUtilities.invokeLater(new Runnable() {
    public void run() {
      animator.stopMovie();
      updateStatusLine();
      if (total > count || myStatus == MessageHelper.SKIPPED_TEST) {
        myStatusLine.setStatusColor(ColorProgressBar.YELLOW);
      }
      else if (myStatus == MessageHelper.FAILED_TEST) {
        myStatusLine.setStatusColor(ColorProgressBar.RED);
      }
      else {
        myStatusLine.setStatusColor(ColorProgressBar.GREEN);
      }
      rootNode.setInProgress(false);
      if (TestNGConsoleProperties.SELECT_FIRST_DEFECT.value(myProperties)) {
        selectTest(rootNode.getFirstDefect());
      }
      else {
        final DefaultMutableTreeNode node = treeBuilder.getNodeForElement(rootNode);
        if (node != null && myLastSelected == null) {
          tree.getSelectionModel().setSelectionPath(new TreePath(node));
        }
      }
      tree.repaint();
    }
  });
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:34,
代码来源:TestNGResults.java

示例22: onRunnerStateChanged

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
public void onRunnerStateChanged(final StateEvent event) {
  if (!event.isRunning()) {
    final CompletionEvent completionEvent = (CompletionEvent) event;
    myStateInfo.setDone(completionEvent);
    myProgress.setDone(completionEvent);
    if (completionEvent.isTerminated() && !myProgress.hasDefects()) {
      myProgressBar.setColor(ColorProgressBar.YELLOW);
    }
    updateCounters();
  }
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:12,
代码来源:JUnitStatusLine.java

示例23: updateCounters

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
private void updateCounters() {
  myStateInfo.updateCounters(myProgress);
  myProgressBar.setFraction(myStateInfo.getComplitedPercents());
  if (myProgress.hasDefects()) {
    myProgressBar.setColor(ColorProgressBar.RED);
  }
  myStateInfo.updateLabel(myState);
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:9,
代码来源:JUnitStatusLine.java

示例24: onTestingStarted

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
/**
 * Returns root node, fake parent suite for all tests and suites
 *
 * @param testsRoot
 * @return
 */
@Override
public void onTestingStarted(@Nonnull SMTestProxy.SMRootTestProxy testsRoot) {
  myAnimator.setCurrentTestCase(myTestsRootNode);
  myTreeBuilder.updateFromRoot();

  // Status line
  myStatusLine.setStatusColor(ColorProgressBar.GREEN);

  // Tests tree
  selectAndNotify(myTestsRootNode);

  myStartTime = System.currentTimeMillis();
  boolean printTestingStartedTime = true;
  if (myProperties instanceof SMTRunnerConsoleProperties) {
    printTestingStartedTime = ((SMTRunnerConsoleProperties)myProperties).isPrintTestingStartedTime();
  }
  if (printTestingStartedTime) {
    myTestsRootNode.addSystemOutput("Testing started at " + DateFormatUtil.formatTime(myStartTime) + " ...\n");
  }

  updateStatusLabel(false);

  // TODO : show info - "Loading..." msg

  fireOnTestingStarted();
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:33,
代码来源:SMTestRunnerResultsForm.java

示例25: resetStatusLine

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
private void resetStatusLine() {
    statusLine.setText("");
    statusLine.setStatusColor(ColorProgressBar.GREEN);
    statusLine.setFraction(0d);
}
 

开发者ID:testIT-LivingDoc,
项目名称:livingdoc-intellij,
代码行数:6,
代码来源:ToolWindowPanel.java

示例26: updateStatusLine

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
private void updateStatusLine(final LivingDocExecution execution) {

        if (!hasError && (execution.hasException() || execution.hasFailed())) {
            hasError = true;
        }

        executionCounter.setTotalErrors(executionCounter.getTotalErrors() + execution.getErrors());
        executionCounter.setFailuresCount(executionCounter.getFailuresCount() + execution.getFailures());
        executionCounter.setFinishedTestsCount(executionCounter.getFinishedTestsCount() + execution.getSuccess());
        executionCounter.setIgnoreTestsCount(executionCounter.getIgnoreTestsCount() + execution.getIgnored());

        SwingUtilities.invokeLater(() -> {

            if (hasError) {
                runConfiguration.getStatusLine().setStatusColor(ColorProgressBar.RED);

            } else if (executionCounter.getIgnoreTestsCount() >= 1 || executionCounter.getFailuresCount() >= 1 || executionCounter.getTotalErrors() >= 1) {
                runConfiguration.getStatusLine().setStatusColor(ColorProgressBar.YELLOW);

            } else {
                ToolWindow toolWindow = ToolWindowManager.getInstance(runConfiguration.getProject())
                        .getToolWindow(PluginProperties.getValue("toolwindows.id"));
                toolWindow.activate(null);
            }

            int testsTotal = executionCounter.getFinishedTestsCount() + executionCounter.getTotalErrors()
                    + executionCounter.getFailuresCount() + executionCounter.getIgnoreTestsCount();

            Long duration = executionCounter.getEndTime() - executionCounter.getStartTime();

            statusLine.formatTestMessage(
                    testsTotal,
                    executionCounter.getFinishedTestsCount(),
                    executionCounter.getFailuresCount(),
                    executionCounter.getIgnoreTestsCount(),
                    duration,
                    executionCounter.getEndTime());

            statusLine.setFraction(1d);

            runConfiguration.getSelectedNode().setIcon(RepositoryViewUtils.getResultIcon(hasError, runConfiguration.getSelectedNode()));
        });
    }
 

开发者ID:testIT-LivingDoc,
项目名称:livingdoc-intellij,
代码行数:44,
代码来源:ProcessListenerLivingDoc.java

示例27: onTestingFinished

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
public void onTestingFinished(@NotNull SMTestProxy.SMRootTestProxy testsRoot) {
  myEndTime = System.currentTimeMillis();

  if (myTotalTestCount == 0) {
    myTotalTestCount = myStartedTestCount;
    myStatusLine.setFraction(1);
  }

  updateStatusLabel(true);
  updateIconProgress(true);

  myAnimator.stopMovie();
  myTreeBuilder.updateFromRoot();

  LvcsHelper.addLabel(this);


  final Runnable onDone = new Runnable() {
    @Override
    public void run() {
      myTestsRunning = false;
      final boolean sortByDuration = TestConsoleProperties.SORT_BY_DURATION.value(myProperties);
      if (sortByDuration) {
        myTreeBuilder.setStatisticsComparator(myProperties, sortByDuration);
      }
    }
  };
  if (myLastSelected == null) {
    selectAndNotify(myTestsRootNode, onDone);
  }
  else {
    onDone.run();
  }

  fireOnTestingFinished();
  
  if (testsRoot.wasTerminated() && myStatusLine.getStatusColor() == ColorProgressBar.GREEN) {
    myStatusLine.setStatusColor(JBColor.LIGHT_GRAY);
  }

  if (testsRoot.isEmptySuite() &&
      testsRoot.isTestsReporterAttached() &&
      myProperties instanceof SMTRunnerConsoleProperties &&
      ((SMTRunnerConsoleProperties)myProperties).fixEmptySuite()) {
    return;
  }
  final TestsUIUtil.TestResultPresentation presentation = new TestsUIUtil.TestResultPresentation(testsRoot, myStartTime > 0, null)
    .getPresentation(myFailedTestCount, 
                     Math.max(0, myFinishedTestCount - myFailedTestCount - myIgnoredTestCount), 
                     myTotalTestCount - myFinishedTestCount, 
                     myIgnoredTestCount);
  TestsUIUtil.notifyByBalloon(myProperties.getProject(), testsRoot, myProperties, presentation);
  addToHistory(testsRoot, myProperties, this);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:55,
代码来源:SMTestRunnerResultsForm.java

示例28: addTestResult

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
public void addTestResult(final TestResultMessage result, int exceptionMark) {
  TestProxy testCase;
  synchronized (started) {
    final List<TestProxy> dups = started.get(result);
    testCase = dups == null || dups.isEmpty() ? null : dups.remove(0);
  }
  if (testCase == null) {
    final PsiElement element = getPackageClassNodeFor(result).getPsiElement();
    if (element instanceof PsiClass) {
      final PsiMethod[] methods = ApplicationManager.getApplication().runReadAction(
        new Computable<PsiMethod[]>() {
          public PsiMethod[] compute() {
            return ((PsiClass)element).findMethodsByName(result.getMethod(), true);
          }
        }
      );
      if (methods.length > 0 &&
          methods[0] != null &&
          !AnnotationUtil.isAnnotated(methods[0], Arrays.asList(TestNGUtil.CONFIG_ANNOTATIONS_FQN))) {
        for (List<TestProxy> proxies : started.values()) {
          if (proxies != null) {
            for (TestProxy proxy : proxies) {
              if (methods[0].equals(proxy.getPsiElement())) {
                testCase = proxy;
                break;
              }
            }
          }
        }
        if (testCase == null) {
          testCase = testStarted(result, false);
          testCase.appendStacktrace(result);
        }
      }
    }
  }

  if (testCase != null) {
    testCase.setResultMessage(result);
    testCase.setTearDownFailure(failedToStart != null);
    failedToStart = null;

    if (result.getResult() == MessageHelper.FAILED_TEST) {
      failed.add(testCase);
    }
    model.addTestResult(result);
  }
  else {
    //do not remember testresultmessage: test hierarchy is not set
    testCase = new TestProxy(TestProxy.toDisplayText(result, project));
    testCase.appendStacktrace(result);
    if (failedToStart != null) {
      failedToStart.addChild(testCase);
      failedToStart.setTearDownFailure(true);
    }
    else {
      failedToStart = testCase;
    }
  }

  testCase.setExceptionMark(exceptionMark);
  AbstractTestProxy.flushOutput(testCase);

  if (result.getResult() == MessageHelper.FAILED_TEST) {
    myStatusLine.setStatusColor(ColorProgressBar.RED);
    myStatus = MessageHelper.FAILED_TEST;
  }
  else if (result.getResult() == MessageHelper.SKIPPED_TEST && myStatus == MessageHelper.PASSED_TEST) {
    myStatus = MessageHelper.SKIPPED_TEST;
  }
  myStatusLine.setFraction((double)count / total);
  updateStatusLine();
  TestsUIUtil.showIconProgress(project, count, total, failed.size(), false);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:75,
代码来源:TestNGResults.java

示例29: setModel

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
public void setModel(final JUnitRunningModel model) {
  myTestsBuilt = true;
  myProgressBar.setForeground(ColorProgressBar.GREEN);
  model.addListener(new TestProgressListener(model.getProgress()));
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:6,
代码来源:JUnitStatusLine.java

示例30: paintDeterminate

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
@Override
protected void paintDeterminate(final Graphics g, final JComponent c) {
  final Graphics2D g2 = (Graphics2D) g.create();

  try {
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);

    final Rectangle r = new Rectangle(progressBar.getSize());
    if (c.isOpaque()) {
      g2.setColor(c.getParent().getBackground());
      g2.fill(r);
    }

    final Insets i = progressBar.getInsets();
    JBInsets.removeFrom(r, i);
    final int amountFull = getAmountFull(i, r.width, r.height);

    final Shape fullShape;
    final Shape coloredShape;
    final int orientation = progressBar.getOrientation();
    if (orientation == SwingConstants.HORIZONTAL) {
      final int pHeight = progressBar.getPreferredSize().height;
      final float yOffset = r.y + (r.height - pHeight) / 2.0f;

      fullShape = getShapedRect(r.x, yOffset, r.width, pHeight, pHeight);
      coloredShape = getShapedRect(r.x, yOffset, amountFull, pHeight, pHeight);
    } else {
      final int pWidth = progressBar.getPreferredSize().width;
      final float xOffset = r.x + (r.width - pWidth) / 2.0f;

      fullShape = getShapedRect(xOffset, r.y, pWidth, r.height, pWidth);
      coloredShape = getShapedRect(xOffset, r.y, pWidth, amountFull, pWidth);
    }
    g2.setColor(getRemainderColor());
    g2.fill(fullShape);

    // Use foreground color as a reference, don't use it directly. This is done for compatibility reason.
    // Colors are hardcoded in UI delegates by design. If more colors are needed contact designers.
    final Color foreground = progressBar.getForeground();
    if (foreground == ColorProgressBar.RED) {
      g2.setColor(RED);
    } else if (foreground == ColorProgressBar.GREEN) {
      g2.setColor(GREEN);
    } else {
      g2.setColor(getFinishedColor());
    }
    g2.fill(coloredShape);

    // Paint text
    if (progressBar.isStringPainted()) {
      paintString(g, i.left, i.top, r.width, r.height, amountFull, i);
    }
  } finally {
    g2.dispose();
  }
}
 

开发者ID:ChrisRM,
项目名称:material-theme-jetbrains,
代码行数:58,
代码来源:MTProgressBarUI.java

示例31: addTestResult

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
public void addTestResult(final TestResultMessage result, int exceptionMark) {
  TestProxy testCase;
  synchronized (started) {
    final List<TestProxy> dups = started.get(result);
    testCase = dups == null || dups.isEmpty() ? null : dups.remove(0);
  }
  if (testCase == null) {
    final PsiElement element = getPackageClassNodeFor(result).getPsiElement();
    if (element instanceof PsiClass) {
      final PsiMethod[] methods = ApplicationManager.getApplication().runReadAction(
        new Computable<PsiMethod[]>() {
          public PsiMethod[] compute() {
            return ((PsiClass)element).findMethodsByName(result.getMethod(), true);
          }
        }
      );
      if (methods.length > 0 &&
          methods[0] != null &&
          !AnnotationUtil.isAnnotated(methods[0], Arrays.asList(TestNGUtil.CONFIG_ANNOTATIONS_FQN))) {
        for (List<TestProxy> proxies : started.values()) {
          if (proxies != null) {
            for (TestProxy proxy : proxies) {
              if (methods[0].equals(proxy.getPsiElement())) {
                testCase = proxy;
                break;
              }
            }
          }
        }
        if (testCase == null) {
          testCase = testStarted(result, false);
          testCase.appendStacktrace(result);
        }
      }
    }
  }

  if (testCase != null) {
    testCase.setResultMessage(result);
    testCase.setTearDownFailure(failedToStart != null);
    failedToStart = null;

    if (result.getResult() == MessageHelper.FAILED_TEST) {
      failed.add(testCase);
    }
    model.addTestResult(result);
  }
  else {
    //do not remember testresultmessage: test hierarchy is not set
    testCase = new TestProxy(TestProxy.toDisplayText(result, project));
    testCase.appendStacktrace(result);
    if (failedToStart != null) {
      failedToStart.addChild(testCase);
      failedToStart.setTearDownFailure(true);
    }
    else {
      failedToStart = testCase;
    }
  }

  testCase.setExceptionMark(exceptionMark);
  AbstractTestProxy.flushOutput(testCase);

  if (result.getResult() == MessageHelper.FAILED_TEST) {
    myStatusLine.setStatusColor(ColorProgressBar.RED);
    myStatus = MessageHelper.FAILED_TEST;
  }
  else if (result.getResult() == MessageHelper.SKIPPED_TEST && myStatus == MessageHelper.PASSED_TEST) {
    myStatus = MessageHelper.SKIPPED_TEST;
  }
  myStatusLine.setFraction((double)count / total);
  updateStatusLine();
  TestsUIUtil.showIconProgress(project, count, total, failed.size());
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:75,
代码来源:TestNGResults.java

示例32: setModel

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
public void setModel(final JUnitRunningModel model) {
  myTestsBuilt = true;
  myProgressBar.setColor(ColorProgressBar.GREEN);
  model.addListener(new TestProgressListener(model.getProgress()));
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:6,
代码来源:JUnitStatusLine.java

示例33: onTestingFinished

点赞 2

import com.intellij.openapi.progress.util.ColorProgressBar; //导入依赖的package包/类
@Override
public void onTestingFinished(@Nonnull SMTestProxy.SMRootTestProxy testsRoot) {
  myEndTime = System.currentTimeMillis();

  if (myTotalTestCount == 0) {
    myTotalTestCount = myStartedTestCount;
    myStatusLine.setFraction(1);
  }

  updateStatusLabel(true);
  updateIconProgress(true);

  myAnimator.stopMovie();
  myTreeBuilder.updateFromRoot();

  LvcsHelper.addLabel(this);


  final Runnable onDone = new Runnable() {
    @Override
    public void run() {
      myTestsRunning = false;
      final boolean sortByDuration = TestConsoleProperties.SORT_BY_DURATION.value(myProperties);
      if (sortByDuration) {
        myTreeBuilder.setStatisticsComparator(myProperties, sortByDuration);
      }
    }
  };
  if (myLastSelected == null) {
    selectAndNotify(myTestsRootNode, onDone);
  }
  else {
    onDone.run();
  }

  fireOnTestingFinished();

  if (testsRoot.wasTerminated() && myStatusLine.getStatusColor() == ColorProgressBar.GREEN) {
    myStatusLine.setStatusColor(JBColor.LIGHT_GRAY);
  }

  if (testsRoot.isEmptySuite() &&
      testsRoot.isTestsReporterAttached() &&
      myProperties instanceof SMTRunnerConsoleProperties &&
      ((SMTRunnerConsoleProperties)myProperties).fixEmptySuite()) {
    return;
  }
  final TestsUIUtil.TestResultPresentation presentation = new TestsUIUtil.TestResultPresentation(testsRoot, myStartTime > 0, null)
          .getPresentation(myFailedTestCount, Math.max(0, myFinishedTestCount - myFailedTestCount - myIgnoredTestCount),
                           myTotalTestCount - myFinishedTestCount, myIgnoredTestCount);
  TestsUIUtil.notifyByBalloon(myProperties.getProject(), testsRoot, myProperties, presentation);
  addToHistory(testsRoot, myProperties, this);
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:54,
代码来源:SMTestRunnerResultsForm.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)