Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.ProgressBar


    data.left   = new FormAttachment(0,0);
    data.top  = new FormAttachment(cancel_button,0, SWT.CENTER);

    label.setLayoutData( data );

    final ProgressBar progress = new ProgressBar(parent, SWT.NULL );
   
    progress.setMinimum( 0 );
    progress.setMaximum( 100 );
    progress.setSelection( 0 );
   
   
    data = new FormData();
    data.left   = new FormAttachment(label,4);
    data.top  = new FormAttachment(cancel_button, 0, SWT.CENTER);
    data.right  = new FormAttachment(cancel_button,-4);

    progress.setLayoutData( data );
   
    parent.layout( true, true );
   
    new AEThread2( "SimpleInstallerUI", true )
    {
      public void
      run()
      {
        try{
          Update[] updates = instance.getUpdates();

          for ( Update update: updates ){
           
            String  name = update.getName();
           
            int  pos = name.indexOf('/');
           
            if ( pos >= 0 ){
             
              name = name.substring( pos+1 );
            }
           
            setLabel( name );

            ResourceDownloader[] downloaders = update.getDownloaders();
           
            for ( ResourceDownloader downloader: downloaders ){
             
              synchronized( SimpleInstallUI.this ){
               
                if ( cancelled ){
                 
                  return;
                }
               
                current_downloader = downloader;
              }
             
              setProgress( 0 );
             
              downloader.addListener(
                new ResourceDownloaderAdapter()
                {
                  public void
                  reportPercentComplete(
                    ResourceDownloader  downloader,
                    int          percentage )
                  {
                    setProgress( percentage );
                  }
                 
                  public void
                  reportAmountComplete(
                    ResourceDownloader  downloader,
                    long        amount )
                  {
                   
                  }
                });
             
              downloader.download();
            }
          }
         
          boolean  restart_required = false;
         
          for (int i=0;i<updates.length;i++){
   
            if ( updates[i].getRestartRequired() == Update.RESTART_REQUIRED_YES ){
             
              restart_required = true;
            }
          }
         
          if ( restart_required ){
           
            monitor.handleRestart();
          }
        }catch( Throwable e ){
         
          Debug.out( "Install failed", e );
         
          instance.cancel();
        }
      }
     
      protected void
      setLabel(
        final String    str )
      {
        Utils.execSWTThread(
          new Runnable()
          {
            public void
            run()
            {
              if (label != null && !label.isDisposed()) {
                label.setText( str );
                label.getParent().layout();
              }
            }
          });
      }
     
      protected void
      setProgress(
        final int    percent )
      {
        Utils.execSWTThread(
          new Runnable()
          {
            public void
            run()
            {
              if (progress != null && !progress.isDisposed()) {
                progress.setSelection( percent );
              }
            }
          });
      }
    }.start();
View Full Code Here


   * @param image an <code>Image</code> to display; may be null
   */
  public AZProgressBar(Composite parent, boolean isIndeterminate) {
    super(parent, SWT.NULL);

    incrementalProgressBar = new ProgressBar(this, SWT.HORIZONTAL);
    indeterminateProgressBar = new ProgressBar(this, SWT.HORIZONTAL
        | SWT.INDETERMINATE);

    stack = new StackLayout();
    setLayout(stack);
    pack();
View Full Code Here

        skin.createSkinObject("dlg.register.install", "dlg.register.install",
            soExtra);

        SWTSkinObjectContainer soProgressBar = (SWTSkinObjectContainer) skin.getSkinObject("progress-bar");
        if (soProgressBar != null) {
          progressBar = new ProgressBar(soProgressBar.getComposite(),
              SWT.HORIZONTAL);
          progressBar.setMinimum(0);
          progressBar.setMaximum(100);
          progressBar.setLayoutData(Utils.getFilledFormData());
        }
View Full Code Here

    name.addListener(SWT.Selection, sortListener);
    popularity.addListener(SWT.Selection, sortListener);
   
    animatedImage = new AnimatedImage(loadingPanel);
    loadingText = new Label(loadingPanel,SWT.WRAP | SWT.CENTER);
    loadingProgress = new ProgressBar(loadingPanel,SWT.HORIZONTAL);
   
    animatedImage.setImageFromName("spinner_big");
    String contentName = "Dummy";
    if(download != null) {
      contentName = download.getDisplayName();
View Full Code Here

        skin.createSkinObject("dlg.register.install", "dlg.register.install",
            soExtra);

        SWTSkinObjectContainer soProgressBar = (SWTSkinObjectContainer) skin.getSkinObject("progress-bar");
        if (soProgressBar != null) {
          progressBar = new ProgressBar(soProgressBar.getComposite(),
              SWT.HORIZONTAL);
          progressBar.setMinimum(0);
          progressBar.setMaximum(100);
          progressBar.setLayoutData(Utils.getFilledFormData());
        }
View Full Code Here

        skin.createSkinObject("dlg.register.install", "dlg.register.install",
            soExtra);

        SWTSkinObjectContainer soProgressBar = (SWTSkinObjectContainer) skin.getSkinObject("progress-bar");
        if (soProgressBar != null) {
          progressBar = new ProgressBar(soProgressBar.getComposite(),
              SWT.HORIZONTAL);
          progressBar.setMinimum(0);
          progressBar.setMaximum(100);
          progressBar.setLayoutData(Utils.getFilledFormData());
        }
View Full Code Here

    lblInUse = new Label(gCacheGeneral,SWT.NULL);
    gridData = new GridData();
    gridData.widthHint = 100;
    lblInUse.setLayoutData(gridData);
   
    pbInUse =  new ProgressBar(gCacheGeneral,SWT.HORIZONTAL);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.verticalSpan = 2;
    pbInUse.setLayoutData(gridData);
    pbInUse.setMinimum(0);
    pbInUse.setMaximum(1000);
View Full Code Here

    lblAvgSizeFromCache = new Label(gCacheReads,SWT.NULL);
    gridData = new GridData();
    gridData.widthHint = 100;
    lblAvgSizeFromCache.setLayoutData(gridData);
   
    pbReads =  new ProgressBar(gCacheReads,SWT.HORIZONTAL);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.verticalSpan = 2;
    pbReads.setLayoutData(gridData);
    pbReads.setMinimum(0);
    pbReads.setMaximum(1000);
View Full Code Here

    lblAvgSizeToCache = new Label(gCacheWrites,SWT.NULL);
    gridData = new GridData();
    gridData.widthHint = 100;
    lblAvgSizeToCache.setLayoutData(gridData);
   
    pbWrites =  new ProgressBar(gCacheWrites,SWT.HORIZONTAL);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.verticalSpan = 2;
    pbWrites.setLayoutData(gridData);
    pbWrites.setMinimum(0);
    pbWrites.setMaximum(1000);
View Full Code Here

          currentTask = new Label(shell,SWT.BORDER);
          GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
          currentTask.setLayoutData(gridData);
          currentTask.setBackground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_WHITE));
         
          progress_bar = new ProgressBar(shell,SWT.HORIZONTAL);
          progress_bar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
          progress_bar.setMinimum(0);
          progress_bar.setMaximum(100);
         
          shell.setText(JMConstants.JMULE_FULL_NAME);
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.ProgressBar

Copyright © 2018 www.massapicom. 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.