当前位置: 首页>>代码示例>>Java>>正文


Java Scale.setToolTipText方法代码示例

本文整理汇总了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;
}
 
开发者ID:eclipse,项目名称:eavp,代码行数:33,代码来源:TimeSliderComposite.java

示例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());
        }
    });
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:21,代码来源:SliderImpl.java

示例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);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:29,代码来源:SPTransparency.java

示例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);
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:46,代码来源:SomoxConfigurationComposite.java


注:本文中的org.eclipse.swt.widgets.Scale.setToolTipText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。