List of usage examples for org.eclipse.jface.dialogs ProgressIndicator ProgressIndicator
public ProgressIndicator(Composite parent)
From source file:org.org.eclipse.core.utils.platform.dialogs.selection.ProgressMonitorDialog.java
License:Open Source License
protected Control createDialogArea(Composite parent) { setMessage(DEFAULT_TASKNAME);// ww w. java 2 s . co m createMessageArea(parent); // Only set for backwards compatibility taskLabel = messageLabel; // progress indicator progressIndicator = new ProgressIndicator(parent); GridData gd = new GridData(); gd.heightHint = convertVerticalDLUsToPixels(BAR_DLUS); gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; gd.horizontalSpan = 2; progressIndicator.setLayoutData(gd); progressIndicator.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); progressIndicator.setBackground(JFaceColors.getBannerBackground(parent.getDisplay())); // label showing current task subTaskLabel = new Label(parent, SWT.LEFT | SWT.WRAP); gd = new GridData(GridData.FILL_HORIZONTAL); gd.heightHint = convertVerticalDLUsToPixels(LABEL_DLUS); gd.horizontalSpan = 2; subTaskLabel.setLayoutData(gd); subTaskLabel.setFont(parent.getFont()); subTaskLabel.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); subTaskLabel.setBackground(JFaceColors.getBannerBackground(parent.getDisplay())); return parent; }
From source file:org.springsource.ide.eclipse.commons.frameworks.ui.internal.plugins.ProgressIndicatorWithStop.java
License:Open Source License
protected void createStatusArea(Composite parent) { if (parent == null) { return;//from w w w. ja v a 2s .c om } Composite statusArea = new Composite(parent, SWT.NONE); GridLayoutFactory.fillDefaults().numColumns(3).applyTo(statusArea); GridDataFactory.fillDefaults().grab(true, false).applyTo(statusArea); refreshLabel = new Label(statusArea, SWT.CENTER); GridDataFactory.fillDefaults().grab(false, false).align(SWT.LEFT, SWT.CENTER).applyTo(refreshLabel); refreshLabel.setText(progressMessage != null ? progressMessage : ""); refreshProgressIndicator = new ProgressIndicator(statusArea); GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).grab(true, false) .applyTo(refreshProgressIndicator); toolBar = new ToolBar(statusArea, SWT.FLAT | SWT.NO_FOCUS); GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).grab(true, false).applyTo(toolBar); if (isCancellable) { ToolItem item = new ToolItem(toolBar, SWT.NONE); item.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_ELCL_STOP)); item.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { stop(); } }); } setControlVisibility(false); }
From source file:org.talend.sqlbuilder.ui.SQLBuilderDialog.java
License:Open Source License
/** * Create contents of the button bar./*from w ww .java 2 s .c o m*/ * * @param parent */ protected void createButtonsForButtonBar(Composite parent) { GridData data = new GridData(GridData.FILL_HORIZONTAL); parent.setLayoutData(data); // increment the number of columns in the button bar GridLayout layout = (GridLayout) parent.getLayout(); layout.makeColumnsEqualWidth = false; layout.numColumns = 4; GridData gd = new GridData(GridData.FILL_HORIZONTAL); progressIndicator = new ProgressIndicator(parent); progressIndicator.setLayoutData(gd); gd = new GridData(); gd.widthHint = 200; Label l = new Label(parent, SWT.NONE); l.setLayoutData(gd); // OK and Cancel buttons createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); }
From source file:uk.ac.gda.client.hrpd.views.EpicsProcessProgressMonitor.java
License:Open Source License
public EpicsProcessProgressMonitor(Composite parent, int style, boolean allowStopButton) { super(parent, style); GridLayout layout = new GridLayout(); layout.marginHeight = 0;/*ww w . jav a2 s .co m*/ layout.marginWidth = 0; layout.verticalSpacing = 0; layout.horizontalSpacing = 0; this.setLayout(layout); // Build the separator line Label separator = new Label(this, SWT.HORIZONTAL | SWT.SEPARATOR); separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); // Insert a progress monitor Composite progressMonitor = new Composite(this, SWT.NONE); GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false); progressMonitor.setLayoutData(data); progressMonitor.setLayout(new GridLayout(2, false)); progressIndicator = new ProgressIndicator(progressMonitor); GridData gd = new GridData(); gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; gd.grabExcessVerticalSpace = false; gd.verticalAlignment = GridData.CENTER; // gd.heightHint = progressIndicatorHeight; if (allowStopButton) { gd.horizontalSpan = 1; } else { gd.horizontalSpan = 2; } progressIndicator.setLayoutData(gd); if (allowStopButton) { stopButton = createCancelButton(progressMonitor); } fLabel = new Label(this, SWT.LEFT); fLabel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1)); }
From source file:uk.ac.gda.epics.client.mythen.views.EpicsDetectorProgressMonitor.java
License:Open Source License
public EpicsDetectorProgressMonitor(Composite parent, int style, boolean allowStopButton) { super(parent, style); GridLayout layout = new GridLayout(); layout.marginHeight = 0;// w ww . j av a 2 s . co m layout.marginWidth = 0; layout.verticalSpacing = 0; layout.horizontalSpacing = 0; this.setLayout(layout); // Build the separator line Label separator = new Label(this, SWT.HORIZONTAL | SWT.SEPARATOR); separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); // Insert a progress monitor Composite progressMonitor = new Composite(this, SWT.NONE); GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false); progressMonitor.setLayoutData(data); progressMonitor.setLayout(new GridLayout(2, false)); progressIndicator = new ProgressIndicator(progressMonitor); GridData gd = new GridData(); gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; gd.grabExcessVerticalSpace = false; gd.verticalAlignment = GridData.CENTER; // gd.heightHint = progressIndicatorHeight; if (allowStopButton) { gd.horizontalSpan = 1; } else { gd.horizontalSpan = 2; } progressIndicator.setLayoutData(gd); if (allowStopButton) { stopButton = createCancelButton(progressMonitor); } fLabel = new Label(this, SWT.LEFT); fLabel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1)); }