Examples of ProgressBar


Examples of org.eclipse.swt.widgets.ProgressBar

    container.setLayout(LayoutUtils.createGridLayout(1, 30, 12));
    container.setLocation(0, 240);
    container.setSize(400, 60);

    /* Progress Bar */
    fBar = new ProgressBar(container, SWT.HORIZONTAL);
    fBar.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
    ((GridData) fBar.getLayoutData()).heightHint = 12;
    fBar.setMaximum(100);
    fBar.setSelection(25);

View Full Code Here

Examples of org.eclipse.swt.widgets.ProgressBar

  final Display display = new Display();
  final int[] numProgIncr = {3};
  //final Image image = new Image(display, 300, 300);
  final Image image = new Image(display, Constants.MUSTRU_HOME + File.separator + "icons" + File.separator + "mustruSplash.png");
  final Shell splash = new Shell(SWT.ON_TOP);
  final ProgressBar bar = new ProgressBar(splash, SWT.NONE);
  bar.setMaximum(numProgIncr[0]);
  Label label = new Label(splash, SWT.NONE);
  label.setImage(image);
 
  FormLayout layout = new FormLayout();
  splash.setLayout(layout);
 
  FormData labelData = new FormData();
  labelData.right = new FormAttachment(100, 0);
  labelData.bottom = new FormAttachment(100, 0);
  label.setLayoutData(labelData);
 
  FormData progressData = new FormData();
  progressData.left = new FormAttachment(0, 5);
  progressData.right = new FormAttachment(100, -5);
  progressData.bottom = new FormAttachment(100, -5);
  bar.setLayoutData(progressData);
 
  splash.pack();
  Rectangle splashRect = splash.getBounds();
  Rectangle displayRect = display.getBounds();
  int x = (displayRect.width - splashRect.width) / 2;
  int y = (displayRect.height - splashRect.height) / 2;
  splash.setLocation(x, y);
  splash.open();
 
  //*-- start the Online Index application
  display.asyncExec(
    new Runnable()
    {
      public void run()
      {
       int i = 0;
       PropertyConfigurator.configure (Constants.LOG4J_FILE); bar.setSelection(i + 1); numProgIncr[0]--;
       OnlineIndex oi = new OnlineIndex(null); oi.copyArgs(args); bar.setSelection(i + 1); numProgIncr[0]--;
       ApplicationWindow viewer = oi; bar.setSelection(i + 1); numProgIncr[0]--;
       splash.close(); image.dispose();
       viewer.setBlockOnOpen(true);
       viewer.open();    
      }
    }
View Full Code Here

Examples of org.eclipse.swt.widgets.ProgressBar

    container.setLayout(LayoutUtils.createGridLayout(1, 30, 12));
    container.setLocation(0, 240);
    container.setSize(400, 60);

    /* Progress Bar */
    fBar = new ProgressBar(container, SWT.HORIZONTAL);
    fBar.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
    ((GridData) fBar.getLayoutData()).heightHint = 12;
    fBar.setMaximum(100);
    fBar.setSelection(25);

View Full Code Here

Examples of org.eclipse.swt.widgets.ProgressBar

    GridData data = new GridData ();
    data.horizontalAlignment = GridData.CENTER;
    label.setLayoutData (data);

    // Progress
    progressBar = new ProgressBar(shell, SWT.CENTER);
    progressBar.setMinimum(0);
    progressBar.setMaximum(maxValue);
    progressBar.setSelection(0);
    progressBar.setToolTipText(message);
    data = new GridData ();
View Full Code Here

Examples of org.eclipse.swt.widgets.ProgressBar

        }
        display.timerExec(150, this);
      }
    });
    final Label status = new Label(parent, SWT.NONE);
    final ProgressBar progressBar = new ProgressBar(parent, SWT.NONE);
    FormData data = new FormData();
    data.top = new FormAttachment(0, 5);
    toolbar.setLayoutData(data);
    data = new FormData();
    data.left = new FormAttachment(0, 0);
    data.right = new FormAttachment(100, 0);
    data.top = new FormAttachment(canvas, 5, SWT.DEFAULT);
    data.bottom = new FormAttachment(status, -5, SWT.DEFAULT);
    try {
      browser = new Browser(parent, SWT.NONE);
      browser.setLayoutData(data);
    } catch (SWTError e) {
      /* Browser widget could not be instantiated */
      Label label = new Label(parent, SWT.CENTER | SWT.WRAP);
      label.setText(getResourceString("BrowserNotCreated"));
      label.setLayoutData(data);
    }
    data = new FormData();
    data.width = 24;
    data.height = 24;
    data.top = new FormAttachment(0, 5);
    data.right = new FormAttachment(100, -5);
    canvas.setLayoutData(data);
    data = new FormData();
    data.top = new FormAttachment(toolbar, 0, SWT.TOP);
    data.left = new FormAttachment(toolbar, 5, SWT.RIGHT);
    data.right = new FormAttachment(canvas, -5, SWT.DEFAULT);
    location.setLayoutData(data);
    data = new FormData();
    data.left = new FormAttachment(0, 5);
    data.right = new FormAttachment(progressBar, 0, SWT.DEFAULT);
    data.bottom = new FormAttachment(100, -5);
    status.setLayoutData(data);
    data = new FormData();
    data.right = new FormAttachment(100, -5);
    data.bottom = new FormAttachment(100, -5);
    progressBar.setLayoutData(data);
    if (browser != null) {
      itemBack.setEnabled(browser.isBackEnabled());
      itemForward.setEnabled(browser.isForwardEnabled());
      Listener listener = new Listener() {
        public void handleEvent(Event event) {
          ToolItem item = (ToolItem) event.widget;
          if (item == itemBack)
            browser.back();
          else if (item == itemForward)
            browser.forward();
          else if (item == itemStop)
            browser.stop();
          else if (item == itemRefresh)
            browser.refresh();
          else if (item == itemGo)
            browser.setUrl(location.getText());
        }
      };
      browser.addLocationListener(new LocationListener() {
        public void changed(LocationEvent event) {
          busy = true;
          if (event.top)
            location.setText(event.location);
        }
        public void changing(LocationEvent event) {
        }
      });
      browser.addProgressListener(new ProgressListener() {
        public void changed(ProgressEvent event) {
          if (event.total == 0)
            return;
          int ratio = event.current * 100 / event.total;
          progressBar.setSelection(ratio);
          busy = event.current != event.total;
          if (!busy) {
            index = 0;
            canvas.redraw();
          }
        }
        public void completed(ProgressEvent event) {
          itemBack.setEnabled(browser.isBackEnabled());
          itemForward.setEnabled(browser.isForwardEnabled());
          progressBar.setSelection(0);
          busy = false;
          index = 0;
          canvas.redraw();
        }
      });
View Full Code Here

Examples of org.eclipse.swt.widgets.ProgressBar

    Widgets.onProgressBar( null );
  }

  @Test
  public void testOnProgressBarDoesNotCache() {
    ProgressBar widget = mock( ProgressBar.class );

    ProgressBarDecorator decorator1 = Widgets.onProgressBar( widget );
    ProgressBarDecorator decorator2 = Widgets.onProgressBar( widget );

    assertNotSame( decorator1, decorator2 );
View Full Code Here

Examples of org.eclipse.swt.widgets.ProgressBar

  private ProgressBar progressBar;

  @Before
  public void setUp() {
    Shell shell = new Shell( new Display() );
    progressBar = new ProgressBar( shell, SWT.INDETERMINATE );
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.ProgressBar

     
       // Enforce horizontal only if vertical isn't set
        if ((style & SWT.VERTICAL) == 0)
            style |= SWT.HORIZONTAL;

        determinateProgressBar = new ProgressBar(this, style);
        indeterminateProgressBar = new ProgressBar(this, style
                | SWT.INDETERMINATE);
        layout = new StackLayout();
        setLayout(layout);
    }
View Full Code Here

Examples of org.eclipse.swt.widgets.ProgressBar

    sh.setBounds(x, y - 25, width, height + 135);
    sh.setBackgroundImage(im);

    sh.open();

    ProgressBar pg = new ProgressBar(sh, SWT.SMOOTH);
    pg.setMinimum(0);
    pg.setMaximum(45);
    pg.setBounds(0, sh.getClientArea().height - 20,
        sh.getClientArea().width, 20);

    for (int i = 0; i <= 45; i++) {
      try {

        Thread.sleep(20);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
      pg.setSelection(i);
    }
    // Cleanup
    pg.dispose();
    sh.dispose();
    d.dispose();
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.ProgressBar

    if (!this.tableItem.isDisposed()) {
      guiRun(new Runnable() {
        public void run() {
          SchedulerTableItem.this.progressBar.dispose();
          SchedulerTableItem.this.progressBar = new ProgressBar(table, SWT.NONE);
         
          SchedulerTableItem.this.progressSelection =
            SchedulerTableItem.this.progressBar.getMaximum();
          drawTableEntry(table, table.indexOf(SchedulerTableItem.this.tableItem));
        }
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.