org.eclipse.jface.dialogs.ProgressIndicator Java Examples

The following examples show how to use org.eclipse.jface.dialogs.ProgressIndicator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UpdateProgressMonitor.java    From offspring with MIT License 5 votes vote down vote up
@Override
public void beginTask(final String name, final int totalWork) {
  sync.syncExec(new Runnable() {

    @Override
    public void run() {
      dialog.showProgressIndicator();
      ProgressIndicator p = dialog.getProgressIndicator();
      if (p != null && !p.isDisposed()) {
        p.beginTask(totalWork);
        p.setToolTipText(name);
      }
    }
  });
}
 
Example #2
Source File: UpdateProgressMonitor.java    From offspring with MIT License 5 votes vote down vote up
@Override
public void worked(final int work) {
  sync.syncExec(new Runnable() {

    @Override
    public void run() {
      ProgressIndicator p = dialog.getProgressIndicator();
      if (p != null && !p.isDisposed()) {
        p.worked(work);
      }
    }
  });
}
 
Example #3
Source File: UpdateProgressMonitor.java    From offspring with MIT License 5 votes vote down vote up
@Override
public void done() {
  sync.syncExec(new Runnable() {

    @Override
    public void run() {
      ProgressIndicator p = dialog.getProgressIndicator();
      if (p != null && !p.isDisposed()) {
        p.sendRemainingWork();
      }
      dialog.hideProgressIndicator();
    }
  });
}
 
Example #4
Source File: StartupDialog.java    From offspring with MIT License 5 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
  Composite container = (Composite) super.createDialogArea(parent);

  GridLayout layout = new GridLayout(1, false);
  layout.horizontalSpacing = 15;
  layout.marginTop = 10;
  layout.marginLeft = 10;

  GridData gd = new GridData(GridData.FILL, GridData.FILL, false, true);
  gd.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);

  mainContainer = new Composite(container, SWT.NONE);
  mainContainer.setLayoutData(gd);
  mainContainer.setLayout(layout);

  messageLabel = new Label(mainContainer, SWT.WRAP);
  messageLabel.setText("Initializing");
  GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).grab(true, false)
      .applyTo(messageLabel);

  new Label(mainContainer, SWT.NONE);

  progressBar = new ProgressIndicator(mainContainer, SWT.SMOOTH);
  GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).grab(true, false)
      .applyTo(progressBar);

  mainContainer.layout();
  return container;
}
 
Example #5
Source File: StartupProgressMonitor.java    From offspring with MIT License 5 votes vote down vote up
@Override
public void beginTask(final String name, final int totalWork) {
  sync.syncExec(new Runnable() {

    @Override
    public void run() {
      ProgressIndicator p = dialog.getProgressIndicator();
      if (p != null && !p.isDisposed()) {
        p.beginAnimatedTask();
        dialog.setStatus(name);
      }
    }
  });
}
 
Example #6
Source File: StartupProgressMonitor.java    From offspring with MIT License 5 votes vote down vote up
@Override
public void worked(final int work) {
  sync.syncExec(new Runnable() {

    @Override
    public void run() {
      ProgressIndicator p = dialog.getProgressIndicator();
      if (p != null && !p.isDisposed()) {
        p.worked(work);
      }
    }
  });
}
 
Example #7
Source File: DartProjectPage.java    From dartboard with Eclipse Public License 2.0 4 votes vote down vote up
private void createAdditionalControls(Composite parent) {
	Group dartGroup = new Group(parent, SWT.NONE);
	dartGroup.setFont(parent.getFont());
	dartGroup.setText(Messages.NewProject_Group_Label);
	dartGroup.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
	dartGroup.setLayout(new GridLayout(2, false));

	Label labelSdkLocation = new Label(dartGroup, SWT.NONE);
	labelSdkLocation.setText(Messages.Preference_SDKLocation_Dart);
	GridDataFactory.swtDefaults().applyTo(labelSdkLocation);

	Label sdkLocation = new Label(dartGroup, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, false).applyTo(sdkLocation);
	sdkLocation.setText(preferences.getString(GlobalConstants.P_SDK_LOCATION_DART));

	// ------------------------------------------
	Group stagehandGroup = new Group(parent, SWT.NONE);
	stagehandGroup.setFont(parent.getFont());
	stagehandGroup.setText(Messages.NewProject_Stagehand_Title);
	stagehandGroup.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
	stagehandGroup.setLayout(new GridLayout(1, false));

	useStagehandButton = new Button(stagehandGroup, SWT.CHECK);
	GridDataFactory.fillDefaults().grab(true, false).applyTo(useStagehandButton);
	useStagehandButton.setEnabled(false);

	stagehandTemplates = new Combo(stagehandGroup, SWT.READ_ONLY);
	stagehandTemplates.setEnabled(useStagehandButton.getSelection());
	GridDataFactory.fillDefaults().grab(true, false).applyTo(stagehandTemplates);

	useStagehandButton.setText(Messages.NewProject_Stagehand_UseStagehandButtonText);
	useStagehandButton.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			// Enable/Disable the stagehand templates list if the button is
			// checked/unchecked
			stagehandTemplates.setEnabled(useStagehandButton.getSelection());
			if (stagehandTemplates.getSelectionIndex() == -1) {
				stagehandTemplates.select(0);
			}
		}
	});

	ProgressIndicator indicator = new ProgressIndicator(stagehandGroup);
	GridDataFactory.fillDefaults().grab(true, false).applyTo(indicator);
	indicator.beginAnimatedTask();

	Job.create(Messages.NewProject_Stagehand_FetchStagehand, monitor -> {
		templates = StagehandService.getStagehandTemplates();

		Display.getDefault().asyncExec(() -> {
			if (!indicator.isDisposed()) {
				indicator.done();
			}
			if (!stagehandTemplates.isDisposed()) {
				templates.forEach(str -> stagehandTemplates.add(str.getDisplayName()));
				useStagehandButton.setEnabled(true);
			}
		});
	}).schedule();
}
 
Example #8
Source File: APICloudSplashHandler.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
public ProgressIndicator getProgressIndicator() {
	return fProgressIndicator;
}
 
Example #9
Source File: UpdateDialog.java    From offspring with MIT License 4 votes vote down vote up
public ProgressIndicator getProgressIndicator() {
  return progressBar;
}
 
Example #10
Source File: UpdateDialog.java    From offspring with MIT License 4 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
  Composite container = (Composite) super.createDialogArea(parent);

  GridLayout layout = new GridLayout(1, false);
  layout.horizontalSpacing = 15;
  layout.marginTop = 10;
  layout.marginLeft = 10;

  GridData gd = new GridData(GridData.FILL, GridData.FILL, false, true);
  gd.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);

  mainContainer = new Composite(container, SWT.NONE);
  mainContainer.setLayoutData(gd);
  mainContainer.setLayout(layout);

  messageLabel = new Label(mainContainer, SWT.WRAP);
  messageLabel.setText("...");
  GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).grab(true, false)
      .applyTo(messageLabel);

  installButton = new Button(mainContainer, SWT.PUSH);
  installButton.setText("Install Updates");
  installButton.setVisible(false);
  installButton.addSelectionListener(new SelectionAdapter() {

    @Override
    public void widgetSelected(SelectionEvent e) {
      installUpdates = true;
      hideInstallButton();
    }
  });
  GridDataFactory.swtDefaults().exclude(true).applyTo(installButton);

  progressBarComposite = new Composite(mainContainer, SWT.NONE);
  progressBarComposite.setVisible(false);
  GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).grab(true, true)
      .exclude(true).applyTo(progressBarComposite);
  GridLayoutFactory.fillDefaults().numColumns(1)
      .applyTo(progressBarComposite);

  progressBar = new ProgressIndicator(progressBarComposite, SWT.SMOOTH);
  GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL)
      .applyTo(progressBar);

  mainContainer.layout();
  return container;
}
 
Example #11
Source File: StartupDialog.java    From offspring with MIT License 4 votes vote down vote up
public ProgressIndicator getProgressIndicator() {
  return progressBar;
}
 
Example #12
Source File: BOSSplashHandler.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
public ProgressIndicator getProgressIndicator() {
    return fProgressIndicator;
}