本文整理汇总了Java中org.eclipse.swt.widgets.ProgressBar.setSelection方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressBar.setSelection方法的具体用法?Java ProgressBar.setSelection怎么用?Java ProgressBar.setSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.ProgressBar
的用法示例。
在下文中一共展示了ProgressBar.setSelection方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fill
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
public void fill(Composite parent) {
super.fill(parent);
Composite container = new Composite(parent, SWT.NONE);
GridLayout gl = new GridLayout(2, false);
gl.marginWidth = 5;
gl.marginHeight = 3;
container.setLayout(gl);
progressBar = new ProgressBar(container, SWT.SMOOTH);
GridData gdPprogressBar = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
gdPprogressBar.heightHint = 16;
gdPprogressBar.widthHint = 130;
progressBar.setLayoutData(gdPprogressBar);
progressBar.setMinimum(0); // 最小值
progressBar.setMaximum(100);// 最大值
progressBar.setSelection(progressValue);
progressBar.setToolTipText(defaultMessage);
label = new Label(container, SWT.None);
label.setText(progressValue + "%");
StatusLineLayoutData data = new StatusLineLayoutData();
container.setLayoutData(data);
}
示例2: createControl
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
Composite container = GUIHelper.createComposite(parent, 1);
setControl(container);
txtLogConsole = GUIHelper.createText(container, new GridData(GridData.FILL_BOTH),
SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
progressBar = new ProgressBar(container, SWT.SMOOTH | SWT.HORIZONTAL);
progressBar.setSelection(0);
progressBar.setMaximum(100);
GridData progressGd = new GridData(GridData.FILL_HORIZONTAL);
progressGd.heightHint = 40;
progressBar.setLayoutData(progressGd);
}
示例3: createControl
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
Composite container = GUIHelper.createComposite(parent, 1);
setControl(container);
txtLogConsole = GUIHelper.createText(container, new GridData(GridData.FILL_BOTH),
SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
txtLogConsole.setTopIndex(txtLogConsole.getLineCount() - 1);
progressBar = new ProgressBar(container, SWT.SMOOTH | SWT.INDETERMINATE);
progressBar.setSelection(0);
progressBar.setMaximum(100);
GridData progressGd = new GridData(GridData.FILL_HORIZONTAL);
progressGd.heightHint = 40;
// progressGd.widthHint = 780;
progressBar.setLayoutData(progressGd);
}
开发者ID:Pardus-LiderAhenk,项目名称:lider-ahenk-installer,代码行数:18,代码来源:DatabaseClusterInstallationStatus.java
示例4: createControl
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
Composite container = GUIHelper.createComposite(parent, 1);
setControl(container);
txtLogConsole = GUIHelper.createText(container, new GridData(GridData.FILL_BOTH),
SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
txtLogConsole.setTopIndex(txtLogConsole.getLineCount() - 1);
progressBar = new ProgressBar(container, SWT.SMOOTH | SWT.INDETERMINATE);
progressBar.setSelection(0);
progressBar.setMaximum(100);
GridData progressGd = new GridData(GridData.FILL_HORIZONTAL);
progressGd.heightHint = 40;
// progressGd.widthHint = 780;
progressBar.setLayoutData(progressGd);
}
示例5: createControl
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
Composite container = GUIHelper.createComposite(parent, 1);
setControl(container);
txtLogConsole = GUIHelper.createText(container, new GridData(GridData.FILL_BOTH),
SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
progressBar = new ProgressBar(container, SWT.SMOOTH | SWT.HORIZONTAL);
progressBar.setSelection(0);
progressBar.setMaximum(100);
GridData progressGd = new GridData(GridData.FILL_HORIZONTAL);
progressGd.heightHint = 40;
// progressGd.widthHint = 780;
progressBar.setLayoutData(progressGd);
}
示例6: createControl
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
mainContainer = GUIHelper.createComposite(parent, 1);
setControl(mainContainer);
txtLogConsole = GUIHelper.createText(mainContainer, new GridData(GridData.FILL_BOTH),
SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
progressBar = new ProgressBar(mainContainer, SWT.SMOOTH | SWT.HORIZONTAL);
progressBar.setSelection(0);
progressBar.setMaximum(100);
GridData progressGd = new GridData(GridData.FILL_HORIZONTAL);
progressGd.heightHint = 40;
progressBar.setLayoutData(progressGd);
}
示例7: createDialogArea
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
private Control createDialogArea(Composite shell) {
GridLayout layout = new GridLayout();
layout.numColumns = 1;
shell.setLayout(layout);
lblStep = new Label(shell, SWT.NONE);
lblStep.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
lblStep.setText("Step 1 / 999");
lblMessage = new Label(shell, SWT.NONE);
lblMessage.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
lblMessage.setText("Idle");
pbProg = new ProgressBar(shell, SWT.SMOOTH | SWT.INDETERMINATE);
pbProg.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
pbProg.setMaximum(1000);
pbProg.setSelection(0);
pbProg.setSelection(256);
final Label lblSeparator = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
lblSeparator.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
txtLog = new Text(shell, SWT.MULTI
| SWT.BORDER
| SWT.H_SCROLL
| SWT.V_SCROLL);
txtLog.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
txtLog.setEditable(false);
txtLog.setBackground(new Color(shell.getDisplay(), 10,10,10));
txtLog.setForeground(new Color(shell.getDisplay(), 200,200,200));
shell.layout();
return shell;
}
示例8: addProgressBar
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
private static void addProgressBar(int index, String key, int count) {
Table table = tableViewerCase.getTable();
TableItem ti = table.getItem(index);
ProgressBar bar = new ProgressBar(table, SWT.HORIZONTAL | SWT.SMOOTH);
bar.setSelection(0);
bar.setMinimum(0);
bar.setMaximum(count);
TableEditor tabEditor = new TableEditor(table);
tabEditor.grabHorizontal = editor.grabVertical = true;
tabEditor.setEditor(bar, ti, 3);
htProgress.put(key, bar);
}
示例9: setProgressBarCount
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
public static void setProgressBarCount(String sn, String taskName, String scriptName) {
String key = sn + "." + taskName + "." + scriptName;
if (htProgress.containsKey(key)) {
ProgressBar bar = htProgress.get(key);
int max = bar.getMaximum();
//cycle
if (max == bar.getSelection()) {
bar.setSelection(0);
}
bar.setSelection(bar.getSelection() + 1);
}
}
示例10: setProgressBarMax
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
public static void setProgressBarMax(String sn, String taskName, String scriptName) {
String key = sn + "." + taskName + "." + scriptName;
if (htProgress.containsKey(key)) {
ProgressBar bar = htProgress.get(key);
int max = htProgress.get(key).getMaximum();
bar.setSelection(max);
}
}
示例11: setProgress
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
public static void setProgress(boolean indeterminate, String title, String currentAction) {
// progressBar.dispose();
progressBar = new ProgressBar(composite, SWT.INDETERMINATE);
progressBar.setSelection(50);
setProgressTitle(title);
setCurrentAction(currentAction);
composite.redraw();
composite.update();
updateProgressBar();
}
示例12: createPartControl
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
@Override
public void createPartControl(Composite parent) {
composite = new Composite(parent, SWT.NONE);
composite.setLayout(new BorderLayout(0, 0));
final Composite composite_1 = new Composite(composite, SWT.NONE);
composite_1.moveAbove(null);
composite_1.setLayout(new GridLayout(2, false));
lblTitle = new Label(composite_1, SWT.NONE);
lblTitle.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
lblTitle.setText("No operations to display at this time.");
progressBar = new ProgressBar(composite_1, SWT.NONE);
// gd_progressBar.heightHint = 25;
progressBar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
progressBar.setSelection(0);
// progressBar.setState(SWT.ERROR);
// Button btnCancel = new Button(composite_1, SWT.NO_BACKGROUND);
// btnCancel.setImage(ResourceManager.getPluginImage("de.umg.mi.idrt.ioe", "images/terminate_co.gif"));
// btnCancel.addSelectionListener(new SelectionListener() {
//
// @Override
// public void widgetSelected(SelectionEvent e) {
// }
//
// @Override
// public void widgetDefaultSelected(SelectionEvent e) {
// }
// });
lblCurrentAction = new Label(composite_1, SWT.NONE);
lblCurrentAction.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
lblCurrentAction.setText("");
composite.redraw();
composite.layout();
}
示例13: createProgressComposite
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
/*******************************************************
* Creates the progress bar composite. This will help the user know that the
* tool is working and making progress
*
* @param parent
* The parent composite
*******************************************************/
private void createProgressComposite(Composite parent)
{
// The container of this group
Composite progressComp = new Composite(parent, SWT.BORDER);
progressComp.setLayout(new GridLayout(1, true));
progressComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
// The label to tell the user about the current state
Label label = new Label(progressComp, SWT.NONE);
label.setText("Testing ...");
label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
// The progress bar
ProgressBar progBar = new ProgressBar(progressComp, SWT.NONE);
progBar.setMaximum(100);
progBar.setMinimum(0);
progBar.setSelection(0);
progBar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
// Initially hide them
label.setVisible(false);
progBar.setVisible(false);
// Create the progress updater
mProgressUpdater = new ProgressUpdater(progBar, label);
}
示例14: createProgressComposite
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
/*******************************************************
* Creates the progress bar composite. This will help the user know that the
* tool is working and making progress
*
* @param parent
* The parent composite
*******************************************************/
private void createProgressComposite(Composite parent)
{
// The container of this group
Composite progressComp = new Composite(parent, SWT.BORDER);
progressComp.setLayout(new GridLayout(1, true));
progressComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
// The label to tell the user about the current state
Label label = new Label(progressComp, SWT.NONE);
label.setText("Testing ...");
label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
// The progress bar
ProgressBar progBar = new ProgressBar(progressComp, SWT.NONE);
progBar.setMaximum(100);
progBar.setMinimum(0);
progBar.setSelection(0);
progBar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
// Initially hide them
label.setVisible(false);
progBar.setVisible(false);
// Create the progress updater
mProgressUpdater = new ProgressUpdater(progBar, label);
}
示例15: setProgress
import org.eclipse.swt.widgets.ProgressBar; //导入方法依赖的package包/类
/**
* Helper method for runRepGen stuff
* @param progress
* @param value
* @param text
* @param str
*/
protected void setProgress(ProgressBar progress, int value, Text text, String str){
if( progress != null && !progress.isDisposed() )
progress.setSelection(value);
if( text != null && str != null && !text.isDisposed())
text.setText(str.replace("\r", "\n"));
}