本文整理汇总了Java中org.eclipse.swt.widgets.Scale.setToolTipText方法的典型用法代码示例。如果您正苦于以下问题:Java Scale.setToolTipText方法的具体用法?Java Scale.setToolTipText怎么用?Java Scale.setToolTipText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Scale
的用法示例。
在下文中一共展示了Scale.setToolTipText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createScale
import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
/**
* Creates the scale or slider widget that can be used to quickly traverse
* the timesteps.
*
* @param parent
* The parent Composite for this widget. Assumed not to be
* {@code null}.
* @return The new widget.
*/
private Scale createScale(Composite parent) {
final Scale scale = new Scale(this, SWT.HORIZONTAL);
scale.setMinimum(0);
scale.setIncrement(1);
scale.setMaximum(0);
scale.setToolTipText("Traverses the timesteps");
scale.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
// Disable playback.
setPlayback(false, e);
// Get the timestep from the scale widget.
if (setValidTimestep(scale.getSelection())) {
notifyListeners(e);
}
}
});
return scale;
}
示例2: SliderImpl
import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
public SliderImpl(final Object parentUiReference, final ISliderSetupSpi setup, final SwtImageRegistry imageRegistry) {
super(new Scale((Composite) parentUiReference, getStyle(setup)), imageRegistry);
this.orientation = setup.getOrientation();
final Scale scale = getUiReference();
scale.setMaximum(setup.getMaximum());
scale.setMinimum(setup.getMinimum());
scale.setSelection(setup.getMinimum());
scale.setPageIncrement(setup.getTickSpacing());
scale.setToolTipText(setup.getToolTipText());
scale.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
fireInputChanged(getSelection());
}
});
}
示例3: createComponent
import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
protected void createComponent(Composite parent) {
composite = section.getWidgetFactory().createComposite(parent);
RowLayout layout = new RowLayout(SWT.HORIZONTAL);
layout.wrap = true;
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.center = true;
composite.setLayout(layout);
scale = new Scale(composite, SWT.HORIZONTAL);
scale.setMinimum(0);
scale.setMaximum(100);
scale.setIncrement(1);
scale.setPageIncrement(5);
RowData rd = new RowData();
rd.width = 100;
scale.setLayoutData(rd);
scale.setToolTipText(pDescriptor.getDescription());
scale.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (!isRefresh)
ftext.setText("" + (scale.getSelection() / 100f));
}
});
super.createComponent(composite);
}
示例4: createSlider
import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
private void createSlider (final String metricKey, Composite parent)
{
MetricsDetails md = SomoxConfigurationUtil.getMetricDescription(metricKey);
Label lblName = new Label(parent, SWT.NONE);
GridData gd_lblNewLabel = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
lblName.setLayoutData(gd_lblNewLabel);
lblName.setText(" "+md.metricLabel);
Label lblValue = new Label(parent, SWT.BORDER);
lblValue.setAlignment(SWT.CENTER);
GridData gd_lblNewLabel_1 = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_lblNewLabel_1.widthHint = 30;
gd_lblNewLabel_1.minimumWidth = 50;
lblValue.setLayoutData(gd_lblNewLabel_1);
final Scale scale = new Scale(parent, SWT.NONE);
GridData gd_scale = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_scale.widthHint = 120;
scale.setLayoutData(gd_scale);
scale.setMinimum(1);
bindingContext.bindValue(
WidgetProperties.text().observe(lblValue),
WidgetProperties.selection().observe(scale),
null, null);
scale.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
// TODO: Use batch executor
SomoxConfigurationUtil.setMetricValueByKey(metricKey, scale.getSelection()/100d, alternative.getSomoxConfiguration());
SomoxConfigurationUtil.persistMetricValue(metricKey, scale.getSelection()/100d, alternative);
}
});
lblName.setToolTipText(md.metricExplanantion);
lblValue.setToolTipText(md.metricExplanantion);
scale.setToolTipText(md.metricExplanantion);
mapScales.put(metricKey, scale);
}