Examples of ProgressIndicator


Examples of com.intellij.openapi.progress.ProgressIndicator

            progressIndicator.setText(description);
        }
    }

    public static void setSubtaskDescription(String subtaskDescription) {
        ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();
        if (progressIndicator != null) {
            progressIndicator.setText2(subtaskDescription);
        }
    }
View Full Code Here

Examples of com.intellij.openapi.progress.ProgressIndicator

            progressIndicator.setText2(subtaskDescription);
        }
    }

    public static boolean isCancelled() {
        ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();
        return progressIndicator != null && progressIndicator.isCanceled();
    }
View Full Code Here

Examples of com.intellij.openapi.progress.ProgressIndicator

          return true;
        }
      }
    };

    final ProgressIndicator indicator = FindUsagesManager.startProcessUsages(handler, handler.getPrimaryElements(), handler.getSecondaryElements(), collect, options, new Runnable() {
      @Override
      public void run() {
        ApplicationManager.getApplication().invokeLater(new Runnable() {
          @Override
          public void run() {
            Disposer.dispose(processIcon);
            Container parent = processIcon.getParent();
            parent.remove(processIcon);
            parent.repaint();
            pingEDT.ping(); // repaint title
            synchronized (usages) {
              if (visibleNodes.isEmpty()) {
                if (usages.isEmpty()) {
                  String text = UsageViewBundle.message("no.usages.found.in", searchScopePresentableName(options, project));
                  showHint(text, editor, popupPosition, handler, maxUsages, options);
                  popup.cancel();
                }
                else {
                  // all usages filtered out
                }
              }
              else if (visibleNodes.size() == 1) {
                if (usages.size() == 1) {
                  //the only usage
                  Usage usage = visibleNodes.iterator().next().getUsage();
                  usage.navigate(true);
                  //String message = UsageViewBundle.message("show.usages.only.usage", searchScopePresentableName(options, project));
                  //navigateAndHint(usage, message, handler, popupPosition, maxUsages, options);
                  popup.cancel();
                }
                else {
                  assert usages.size() > 1 : usages;
                  // usage view can filter usages down to one
                  Usage visibleUsage = visibleNodes.iterator().next().getUsage();
                  if (areAllUsagesInOneLine(visibleUsage, usages)) {
                    String hint = UsageViewBundle.message("all.usages.are.in.this.line", usages.size(), searchScopePresentableName(options, project));
                    navigateAndHint(visibleUsage, hint, handler, popupPosition, maxUsages, options);
                    popup.cancel();
                  }
                }
              }
              else {
                String title = presentation.getTabText();
                boolean shouldShowMoreSeparator = visibleNodes.contains(MORE_USAGES_SEPARATOR_NODE);
                String fullTitle = getFullTitle(usages, title, shouldShowMoreSeparator, visibleNodes.size() - (shouldShowMoreSeparator ? 1 : 0), false);
                ((AbstractPopup)popup).setCaption(fullTitle);
              }
            }
          }
        }, project.getDisposed());
      }
    });
    Disposer.register(popup, new Disposable() {
      @Override
      public void dispose() {
        indicator.cancel();
      }
    });
  }
View Full Code Here

Examples of com.intellij.openapi.progress.ProgressIndicator

      Thread.sleep(500);
    } catch (final InterruptedException ignore) {
      Thread.interrupted();
    }
    //monitor.done();
    final ProgressIndicator progressIndicator = _findBugsTask.getProgressIndicator();
    if (progressIndicator != null) {
      progressIndicator.finishNonCancelableSection();
    }

    if (_isInspectionRun) {
      EventManagerImpl.getInstance().fireEvent(new BugReporterInspectionEventImpl(org.twodividedbyzero.idea.findbugs.common.event.types.BugReporterInspectionEvent.Operation.ANALYSIS_FINISHED, null, getBugCollection(), _project.getName(), _findBugsProject));
    } else {
View Full Code Here

Examples of com.intellij.openapi.progress.ProgressIndicator

    return _bugCollection;
  }


  public void observeClass(final ClassDescriptor classDescriptor) {
    final ProgressIndicator progressIndicator = _findBugsTask.getProgressIndicator();
    if (progressIndicator != null && progressIndicator.isCanceled()) {
      // causes break in FindBugs main loop
      Thread.currentThread().interrupt();

      if (_isInspectionRun) {
        EventManagerImpl.getInstance().fireEvent(new BugReporterInspectionEventImpl(org.twodividedbyzero.idea.findbugs.common.event.types.BugReporterInspectionEvent.Operation.ANALYSIS_ABORTED, _project.getName()));
View Full Code Here

Examples of com.intellij.openapi.progress.ProgressIndicator

  public void onEvent(@NotNull final BugReporterEvent event) {
    switch (event.getOperation()) {
      case ANALYSIS_STARTED:
        break;
      case ANALYSIS_ABORTED:
        final ProgressIndicator progressIndicator = _bugReporter.getFindBugsTask().getProgressIndicator();
        if (progressIndicator != null) {
          progressIndicator.cancel();
        }
        unregisterEventListener();
        break;
      case ANALYSIS_FINISHED:
        unregisterEventListener();
View Full Code Here

Examples of com.intellij.openapi.progress.ProgressIndicator

    setIndicatorText(text, null);
  }


  public void setIndicatorText2(final String text2) {
    final ProgressIndicator progressIndicator = getProgressIndicator();
    if (progressIndicator != null) {
      progressIndicator.setText2(text2);
    }
  }
View Full Code Here

Examples of com.intellij.openapi.progress.ProgressIndicator

    }
  }


  void setIndicatorText(final String text, @Nullable final String text2) {
    final ProgressIndicator progressIndicator = getProgressIndicator();
    if (progressIndicator != null) {
      progressIndicator.setText(text);

      if (text2 != null && text2.isEmpty() || text2 != null) {
        progressIndicator.setText(text2);
      }
    }
  }
View Full Code Here

Examples of com.lightcrafts.utils.ProgressIndicator

            folder,
            100,
            FileCacheFactory.get(folder),
            true,
            ImageDatumComparator.Name,
            new ProgressIndicator() {
                int count;
                public void incrementBy(int delta) {
                    count += delta;
                    System.out.println(count);
                }
View Full Code Here

Examples of com.lightcrafts.utils.ProgressIndicator

            TIFF_PLANAR_CONFIGURATION, TIFF_PLANAR_CONFIGURATION_CHUNKY
        );
        setIntField( TIFF_ROWS_PER_STRIP, stripHeight );
        setIntField( TIFF_SAMPLES_PER_PIXEL, bands );

        final ProgressIndicator indicator;
        if ( thread != null ) {
            indicator = thread.getProgressIndicator();
            if ( indicator != null )
                indicator.setMaximum( imageHeight );
        } else
            indicator = null;

        // Allocate the output buffer only once
        final SampleModel sm =
            image.getSampleModel().createCompatibleSampleModel(
                imageWidth, stripHeight
            );
        final WritableRaster outBuffer;
        if (dataType == DataBuffer.TYPE_BYTE)
            outBuffer = new ByteInterleavedRaster(sm, new Point(0, 0));
        else
            outBuffer = new ShortInterleavedRaster(sm, new Point(0, 0));

        int stripIndex = 0;
        for ( int y = 0; y < imageHeight; y += stripHeight ) {
            if ( thread != null && thread.isCanceled() )
                return;

            final int currentStripHeight = Math.min( stripHeight, imageHeight - y );

            // Create a child raster of the out buffer for the current strip
            final WritableRaster raster = outBuffer.createWritableChild(0, 0, imageWidth, currentStripHeight, 0, y, null);

            // Prefetch tiles, uses all CPUs
            if (image instanceof PlanarImage)
                ((PlanarImage) image).getTiles(((PlanarImage) image).getTileIndices(raster.getBounds()));

            image.copyData(raster);

            int offset;
            if (raster instanceof ByteInterleavedRaster) {
                final ByteInterleavedRaster interleaved =
                    (ByteInterleavedRaster) raster;

                final int[] offsets = interleaved.getDataOffsets();
                offset = offsets[0];
                for (int i = 1; i < offsets.length; i++)
                    offset = Math.min(offset, offsets[i]);

                final DataBufferByte db = (DataBufferByte)raster.getDataBuffer();

                final int written = writeStripByte( stripIndex, db.getData(), offset, bands * imageWidth * currentStripHeight );

                if ( written != bands * imageWidth * currentStripHeight )
                    throw new LCImageLibException(
                        "something is wrong: " + written + " != " +
                        (bands * imageWidth * currentStripHeight)
                    );
            } else {
                final ShortInterleavedRaster interleaved =
                    (ShortInterleavedRaster) raster;

                final int[] offsets = interleaved.getDataOffsets();
                offset = offsets[0];
                for (int i = 1; i < offsets.length; i++)
                    offset = Math.min(offset, offsets[i]);

                final DataBufferUShort db = (DataBufferUShort) raster.getDataBuffer();

                final int written = writeStripShort( stripIndex, db.getData(), offset, 2 * bands * imageWidth * currentStripHeight );

                if ( written != 2 * bands * imageWidth * currentStripHeight )
                    throw new LCImageLibException(
                        "something is wrong: " + written + " != " + (2 * bands * imageWidth * currentStripHeight)
                    );
            }
            stripIndex++;
            if ( indicator != null )
                indicator.incrementBy( currentStripHeight );
        }

        if ( indicator != null )
            indicator.setIndeterminate( true );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.