Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.ProgressBar


   
    progress_label.setText("Progress: ");
    progress_label.setVisible(false);
   
   
    pb = new ProgressBar(fp_left_composite, SWT.NULL);
    gridData=new GridData(GridData.FILL_HORIZONTAL);
    pb.setLayoutData(gridData);
    pb.setMinimum(0);
    File pb_count_file = new File(oldDir);
    FILE_COUNT=0;
View Full Code Here


    totalLabelData.grabExcessHorizontalSpace = true;
    currentPositionLabel.setLayoutData(totalLabelData);
    currentPositionLabel.setAlignment(SWT.RIGHT);
    currentPositionLabel.setText(""); //$NON-NLS-1$

    progressBar = new ProgressBar(this, SWT.HORIZONTAL);
    GridData findProgressBarData = new GridData();
    findProgressBarData.heightHint = 12;
    findProgressBarData.widthHint = 35;
    progressBar.setLayoutData(findProgressBarData);
    progressBar.setMinimum(0);
View Full Code Here

public class Snippet56 {

  public static void main(String[] args) {
    final Display display = new Display();
    Shell shell = new Shell(display);
    final ProgressBar bar = new ProgressBar(shell, SWT.SMOOTH);
    Rectangle clientArea = shell.getClientArea();
    bar.setBounds(clientArea.x, clientArea.y, 200, 32);
    shell.open();
    final int maximum = bar.getMaximum();
    new Thread() {
      @Override
      public void run() {
        for (final int[] i = new int[1]; i[0] <= maximum; i[0]++) {
          try {
            Thread.sleep(100);
          } catch (Throwable th) {
          }
          if (display.isDisposed()) {
            return;
          }
          display.asyncExec(new Runnable() {
            @Override
            public void run() {
              if (bar.isDisposed()) {
                return;
              }
              bar.setSelection(i[0]);
            }
          });
        }
      }
    }.start();
View Full Code Here

      /* Password Quality Meter */
      Label passwordQuality = new Label(composite, SWT.NONE);
      passwordQuality.setText(Messages.MasterPasswordDialog_PASSWORD_QUALITY);
      passwordQuality.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, true));

      fQualityBar = new ProgressBar(composite, SWT.HORIZONTAL);
      fQualityBar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
      fQualityBar.setMinimum(0);
      fQualityBar.setMaximum(100);
    }

View Full Code Here

    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

    if(e.getSource()==button2)
    { 
      Shell fenetreFille = new Shell(shell, SWT.PRIMARY_MODAL);
      fenetreFille.setLayout(new GridLayout());
      Label lab=new Label(fenetreFille,SWT.NONE);
      ProgressBar progressbar = new ProgressBar(fenetreFille, SWT.HORIZONTAL);
      lab.setText("       Traduction in progress");
      progressbar.setMinimum(1);
      progressbar.setMaximum(100);
      progressbar.setSelection(100);
      progressbar.setSize(200,20);
      fenetreFille.setSize(200, 60);
      Rectangle rect = display.getClientArea();
      Point size = fenetreFille.getSize();
      int x = (rect.width - size.x) / 2;
      int y = (rect.height - size.y) / 2;
View Full Code Here

    });
   
    */
   
    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("Browser Not Created (" + e.toString() + ")" ));
      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);
   
    location.addFocusListener(new FocusListener() {
          public void focusGained(FocusEvent e) {}
          public void focusLost(FocusEvent e) {
              locationSelectedOnce = false;
          }
    }
    );
   
    location.addMouseListener(new  MouseListener() {
        public void mouseUp(MouseEvent e) {
            if (!locationSelectedOnce) {
                System.out.println("No text selected; selecting");
                location.selectAll();
                locationSelectedOnce = true;
            }
        }
        public void mouseDown(MouseEvent e) {}
        public void mouseDoubleClick(MouseEvent e) {}
    });
   
    if(browser != null)
    {
      itemBack.setEnabled(browser.isBackEnabled());
      itemForward.setEnabled(browser.isForwardEnabled());
      Listener listener = new Listener(){
        public void handleEvent(Event event)
        {
        //System.out.println("Event fired");
          ToolItem item = (ToolItem) event.widget;
          if (item == itemBack) {
          //System.out.println("Back pressed");
            browser.back();
          }
          else if (item == itemForward) {
          //System.out.println("Forward pressed");
            browser.forward();
          }
          else if (item == itemStop){
          //System.out.println("Stop pressed");
            browser.stop();
          }
          else if (item == itemRefresh) {
          //System.out.println("Refresh pressed");
            browser.refresh();
          }
          else if (item == itemGo) {
          //System.out.println("Go pressed");
            browser.setUrl(location.getText());
          }
          else if (item == itemHome) {
          //System.out.println("Home pressed");
            browser.setUrl(getProjectURL());
          }
        }
      };
     
      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

     * loading) or a password input field (if encrypted).
     */
    private ProgressBar createContainerWithMessage(Composite parent, String message, boolean showProgressBar,
                    boolean showPasswordField)
    {
        ProgressBar bar = null;

        container = new Composite(parent, SWT.NONE);
        container.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
        container.setLayout(new FormLayout());

        Label image = new Label(container, SWT.NONE);
        image.setBackground(container.getBackground());
        image.setImage(PortfolioPlugin.image(PortfolioPlugin.IMG_LOGO_SMALL));

        FormData data = new FormData();
        data.top = new FormAttachment(50, -50);
        data.left = new FormAttachment(50, -24);
        image.setLayoutData(data);

        if (showPasswordField)
        {
            Text pwd = createPasswordField(container);

            data = new FormData();
            data.top = new FormAttachment(image, 10);
            data.left = new FormAttachment(image, 0, SWT.CENTER);
            data.width = 100;
            pwd.setLayoutData(data);

            focus = pwd;
        }
        else if (showProgressBar)
        {
            bar = new ProgressBar(container, SWT.SMOOTH);

            data = new FormData();
            data.top = new FormAttachment(image, 10);
            data.left = new FormAttachment(50, -100);
            data.width = 200;
            bar.setLayoutData(data);
        }

        Label label = new Label(container, SWT.CENTER | SWT.WRAP);
        label.setBackground(container.getBackground());
        label.setText(message);
View Full Code Here

                Display.getDefault().syncExec(new BuildContainerRunnable()
                {
                    @Override
                    public void createContainer(Composite parent)
                    {
                        ProgressBar bar = createContainerWithMessage(
                                        parent,
                                        MessageFormat.format(Messages.MsgLoadingFile,
                                                        PortfolioPart.this.clientFile.getName()), true, false);
                        new LoadClientThread(new ProgressMonitor(bar), PortfolioPart.this, clientFile, password
                                        .toCharArray()).start();
View Full Code Here

            createContainerWithMessage(parent, MessageFormat.format(Messages.MsgOpenFile, clientFile.getName()), false,
                            true);
        }
        else
        {
            ProgressBar bar = createContainerWithMessage(parent,
                            MessageFormat.format(Messages.MsgLoadingFile, clientFile.getName()), true, false);

            new LoadClientThread(new ProgressMonitor(bar), this, clientFile, null).start();
        }
    }
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.