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


Java Spinner.setToolTipText方法代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.Spinner.setToolTipText方法的典型用法代码示例。如果您正苦于以下问题:Java Spinner.setToolTipText方法的具体用法?Java Spinner.setToolTipText怎么用?Java Spinner.setToolTipText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.widgets.Spinner的用法示例。


在下文中一共展示了Spinner.setToolTipText方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createWidgets

import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
@Override
protected void createWidgets(String text, String toolTip, Integer initialValue) {
	lbl = new Label(this, SWT.NONE);
	lbl.setText(text);

	spinner = new Spinner(this, SWT.CHECK);
	spinner.setToolTipText(toolTip);
	spinner.addModifyListener(new ModifyListener() {
		@Override
		public void modifyText(ModifyEvent e) {
			Integer value = spinner.getSelection();
			if (value != getValue()) {
				setValue(value, false);
			}
		}
	});
}
 
开发者ID:turnus,项目名称:turnus,代码行数:18,代码来源:WidgetSpinnerInteger.java

示例2: createWidgets

import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
@Override
protected void createWidgets(String text, String toolTip, Double initialValue) {
	lbl = new Label(this, SWT.NONE);
	lbl.setText(text);

	spinner = new Spinner(this, SWT.CHECK);
	spinner.setToolTipText(toolTip);
	spinner.addModifyListener(new ModifyListener() {
		@Override
		public void modifyText(ModifyEvent e) {
			double value = spinner.getSelection() / scale;
			if (value != getValue()) {
				setValue(value, false);
			}
		}
	});

}
 
开发者ID:turnus,项目名称:turnus,代码行数:19,代码来源:WidgetSpinnerDecimal.java

示例3: createFormContent

import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
@Override
protected void createFormContent(IManagedForm mform) {
	mform.getForm().setText("Guide Position");

	FormToolkit toolkit = mform.getToolkit();

	mform.getForm().getBody().setLayout(new GridLayout(4, false));

	toolkit.createLabel(mform.getForm().getBody(), "Guide Position"); //$NON-NLS-1$
	final Spinner width = new Spinner(mform.getForm().getBody(), SWT.BORDER);
	width.setValues(w, 0, Integer.MAX_VALUE, 0, 1, 10);
	width.setToolTipText("Guide Position");
	width.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			w = width.getSelection();
		}
	});
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:20,代码来源:CreateGuideAction.java

示例4: createUI_20_RecentEntries

import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private void createUI_20_RecentEntries(final Composite parent) {

		final Composite container = new Composite(parent, SWT.NONE);
		GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
		GridLayoutFactory.fillDefaults().numColumns(2).applyTo(container);
		{

			/*
			 * number of recent tour types
			 */
			final Label label = new Label(container, NONE);
			label.setText(Messages.Pref_Appearance_NumberOfRecent_TourTypes);
			label.setToolTipText(Messages.Pref_Appearance_NumberOfRecent_TourTypes_Tooltip);

			// spinner
			_spinnerRecentTourTypes = new Spinner(container, SWT.BORDER);
			GridDataFactory.fillDefaults()//
					.hint(_hintDefaultSpinnerWidth, SWT.DEFAULT)
					.align(SWT.BEGINNING, SWT.CENTER)
					.applyTo(_spinnerRecentTourTypes);
			_spinnerRecentTourTypes.setToolTipText(Messages.Pref_Appearance_NumberOfRecent_TourTypes_Tooltip);
			_spinnerRecentTourTypes.setMinimum(0);
			_spinnerRecentTourTypes.setMaximum(9);
			_spinnerRecentTourTypes.addSelectionListener(_defaultSelectionAdapter);
			_spinnerRecentTourTypes.addMouseWheelListener(_defaultMouseWheelListener);
		}
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:28,代码来源:PrefPageAppearance.java

示例5: createUI_20_ImageSize

import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
/**
 * spinner: thumb size
 */
private void createUI_20_ImageSize(final Composite parent) {

	_spinnerThumbSize = new Spinner(parent, SWT.BORDER);
	GridDataFactory.fillDefaults() //
			.align(SWT.BEGINNING, SWT.FILL)
			.applyTo(_spinnerThumbSize);
	_spinnerThumbSize.setMinimum(ImageGallery.MIN_GALLERY_ITEM_WIDTH);
	_spinnerThumbSize.setMaximum(ImageGallery.MAX_GALLERY_ITEM_WIDTH);
	_spinnerThumbSize.setIncrement(1);
	_spinnerThumbSize.setPageIncrement(50);
	_spinnerThumbSize.setToolTipText(UI.IS_OSX
			? Messages.Pic_Dir_Spinner_ThumbnailSize_Tooltip_OSX
			: Messages.Pic_Dir_Spinner_ThumbnailSize_Tooltip);
	_spinnerThumbSize.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(final SelectionEvent e) {
			_imageGallery.setThumbnailSize(_spinnerThumbSize.getSelection());
		}
	});
	_spinnerThumbSize.addMouseWheelListener(new MouseWheelListener() {
		public void mouseScrolled(final MouseEvent event) {
			Util.adjustSpinnerValueOnMouseScroll(event);
			_imageGallery.setThumbnailSize(_spinnerThumbSize.getSelection());
		}
	});
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:30,代码来源:GalleryActionBar.java

示例6: createInput

import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
@Override
public void createInput(Composite parent, final IParameter param, final Map<String, Object> params) {
	super.createInput(parent, param, params);
	Class<?> valueClass = param.getValueClass();
	if (Number.class.isAssignableFrom(param.getValueClass())) {
		min = 0;
		max = 0;
		digits = 0;
		increment = 1;
		pageIncrement = 10;
		if (valueClass.equals(Integer.class)) {
			min = Integer.MIN_VALUE;
			max = Integer.MAX_VALUE;
		} else if (valueClass.equals(Short.class)) {
			min = (int) Short.MIN_VALUE;
			max = (int) Short.MAX_VALUE;
		} else if (valueClass.equals(Byte.class)) {
			min = (int) Byte.MIN_VALUE;
			max = (int) Byte.MAX_VALUE;
		}

		num = new Spinner(parent, SWT.BORDER);
		num.addFocusListener(focusListener);
		num.setToolTipText(VParameters.createToolTip(param));
		updateInput();
		final ModifyListener listener2 = new ModifyListener() {

			public void modifyText(ModifyEvent e) {
				num.removeModifyListener(this);
				Number n = null;
				if (param.getValueClass().equals(Integer.class)) {
					n = new Integer(Misc.nvl(num.getText()));
				} else if (param.getValueClass().equals(Byte.class)) {
					n = new Byte(Misc.nvl(num.getText()));
				} else if (param.getValueClass().equals(Short.class)) {
					n = new Short(Misc.nvl(num.getText()));
				}
				updateModel(n);
				updateInput();
				num.addModifyListener(this);
			}
		};
		num.addModifyListener(listener2);

		if (param.getMinValue() != null) {
			int minval = new Integer(param.getMinValue()).intValue();
			if (!param.isStrictMin())
				minval++;
			num.setMinimum(minval);
		}
		if (param.getMaxValue() != null) {
			int maxval = new Integer(param.getMaxValue()).intValue();
			if (!param.isStrictMax())
				maxval--;
			num.setMaximum(maxval);
		}

		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
		gd.horizontalIndent = 8;
		num.setLayoutData(gd);

		setMandatory(param, num);
		setNullable(param, num);
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:66,代码来源:NumericInput.java

示例7: createUI_10_Tagging

import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private void createUI_10_Tagging(final Composite parent) {

		final Group group = new Group(parent, SWT.NONE);
		GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
		group.setText(Messages.Pref_Appearance_Group_Tagging);
		GridLayoutFactory.swtDefaults().numColumns(2).applyTo(group);
		{
			/*
			 * number of recent tags
			 */
			final Label label = new Label(group, NONE);
			label.setText(Messages.pref_appearance_number_of_recent_tags);
			label.setToolTipText(Messages.pref_appearance_number_of_recent_tags_tooltip);

			// spinner
			_spinnerRecentTags = new Spinner(group, SWT.BORDER);
			GridDataFactory.fillDefaults()//
					.hint(_hintDefaultSpinnerWidth, SWT.DEFAULT)
					.align(SWT.BEGINNING, SWT.CENTER)
					.applyTo(_spinnerRecentTags);
			_spinnerRecentTags.setToolTipText(Messages.pref_appearance_number_of_recent_tags_tooltip);
			_spinnerRecentTags.setMinimum(0);
			_spinnerRecentTags.setMaximum(9);
			_spinnerRecentTags.addSelectionListener(_defaultSelectionAdapter);
			_spinnerRecentTags.addMouseWheelListener(_defaultMouseWheelListener);

			/*
			 * autoopen tagging
			 */
//				eclipse 3.7 supports this feature
//				if (_isOSX) {
//					// label: OSX is not supported, feature is not working
//					final Label label = new Label(container, SWT.WRAP);
//					GridDataFactory.fillDefaults().span(3, 1).applyTo(label);
//					label.setText(Messages.Pref_Appearance_Label_NoOSXSupport);
//				}
			_chkAutoOpenTagging = new Button(group, SWT.CHECK);
			GridDataFactory.fillDefaults().span(2, 1).applyTo(_chkAutoOpenTagging);
			_chkAutoOpenTagging.setText(Messages.Pref_Appearance_Check_AutoOpenTagging);
			_chkAutoOpenTagging.addSelectionListener(_defaultSelectionAdapter);
			_chkAutoOpenTagging.setToolTipText(Messages.Pref_Appearance_Label_AutoOpenTagging_Tooltip);

			final Composite autoTagContainer = new Composite(group, SWT.NONE);
			GridDataFactory.fillDefaults().grab(false, false).indent(16, 0).span(2, 1).applyTo(autoTagContainer);
			GridLayoutFactory.fillDefaults().numColumns(3).applyTo(autoTagContainer);
			{

				// label: delay
				_lblAutoTagDelay = new Label(autoTagContainer, SWT.NONE);
				_lblAutoTagDelay.setText(Messages.Pref_Appearance_Label_AutoOpenTaggingDelay);
				_lblAutoTagDelay.setToolTipText(Messages.Pref_Appearance_Label_AutoOpenTagging_Tooltip);

				// spinner
				_spinnerAutoOpenDelay = new Spinner(autoTagContainer, SWT.BORDER);
				GridDataFactory.fillDefaults()//
						.hint(_hintDefaultSpinnerWidth, SWT.DEFAULT)
						.align(SWT.BEGINNING, SWT.CENTER)
						.applyTo(_spinnerAutoOpenDelay);
				_spinnerAutoOpenDelay.setMinimum(0);
				_spinnerAutoOpenDelay.setMaximum(3000);
				_spinnerAutoOpenDelay.addSelectionListener(_defaultSelectionAdapter);
				_spinnerAutoOpenDelay.addMouseWheelListener(_defaultMouseWheelListener);

				// label: ms
				_lblAutoOpenMS = new Label(autoTagContainer, SWT.NONE);
				_lblAutoOpenMS.setText(UI.UNIT_MS);

				// check: show animation
				_chkTaggingAnimation = new Button(autoTagContainer, SWT.CHECK);
				GridDataFactory.fillDefaults().span(3, 1).applyTo(_chkTaggingAnimation);
				_chkTaggingAnimation.setText(Messages.Pref_Appearance_Check_TaggingAnimation);
				_chkTaggingAnimation.addSelectionListener(_defaultSelectionAdapter);
			}
		}
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:76,代码来源:PrefPageAppearance.java

示例8: createUI_20_ActionBar

import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private void createUI_20_ActionBar(final Composite parent) {

		GridLayoutFactory.fillDefaults().applyTo(parent);

		final Composite container = new Composite(parent, SWT.NONE);
		GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
		GridLayoutFactory.fillDefaults().numColumns(2).applyTo(container);
//		container.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
		{
			/*
			 * create gallery toolbar
			 */
			_galleryToolbarControl = new ToolBar(container, SWT.FLAT);
			GridDataFactory.fillDefaults()//
					.align(SWT.END, SWT.FILL)
					.grab(true, false)
					.applyTo(_galleryToolbarControl);

			/*
			 * spinner: resize image
			 */
			_spinnerResizeImage = new Spinner(container, SWT.BORDER);
			GridDataFactory.fillDefaults() //
					.applyTo(_spinnerResizeImage);
			_spinnerResizeImage.setMinimum(GALLERY_MIN_IMAGE_SIZE);
			_spinnerResizeImage.setMaximum(GALLERY_MAX_IMAGE_SIZE);
			_spinnerResizeImage.setToolTipText(UI.IS_OSX
					? Messages.FullScreen_ImageViewer_Spinner_ResizeImage_Tooltip_OSX
					: Messages.FullScreen_ImageViewer_Spinner_ResizeImage_Tooltip);

			_spinnerResizeImage.addSelectionListener(new SelectionAdapter() {

				@Override
				public void widgetSelected(final SelectionEvent e) {
					onSelectResizeImage();
				}
			});
			_spinnerResizeImage.addMouseWheelListener(new MouseWheelListener() {
				public void mouseScrolled(final MouseEvent event) {
					Util.adjustSpinnerValueOnMouseScroll(event);
					onSelectResizeImage();
				}
			});

		}
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:47,代码来源:FullScreenPhotoGallery.java

示例9: createUI_16_MinSizeBorder

import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private void createUI_16_MinSizeBorder(final Composite parent) {

		/*
		 * label: display text when thumbnail min size
		 */
		Label label = new Label(parent, SWT.NONE);
		GridDataFactory.fillDefaults()//
				.align(SWT.BEGINNING, SWT.CENTER)
				.applyTo(label);
		label.setText(Messages.PrefPage_Photo_Viewer_Label_MinSizeBorder);

		final Composite container = new Composite(parent, SWT.NONE);
		GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
		GridLayoutFactory.fillDefaults().numColumns(2).applyTo(container);
//		container.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
		{
			/*
			 * spinner: thumbnail size
			 */
			_spinnerImageBorderSize = new Spinner(container, SWT.BORDER);
			GridDataFactory.fillDefaults() //
					.align(SWT.BEGINNING, SWT.FILL)
					.hint(convertWidthInCharsToPixels(5), SWT.DEFAULT)
					.applyTo(_spinnerImageBorderSize);
			_spinnerImageBorderSize.setMinimum(BORDER_MIN_SIZE);
			_spinnerImageBorderSize.setMaximum(BORDER_MAX_SIZE);
			_spinnerImageBorderSize.setToolTipText(Messages.PrefPage_Photo_Viewer_Label_MinSizeBorder_Tooltip);

			_spinnerImageBorderSize.addSelectionListener(_viewerUISelectionListener);
			_spinnerImageBorderSize.addMouseWheelListener(new MouseWheelListener() {
				@Override
				public void mouseScrolled(final MouseEvent event) {
					Util.adjustSpinnerValueOnMouseScroll(event);
					_isImageViewerUIModified = true;
				}
			});

			/*
			 * label: unit
			 */
			label = new Label(container, SWT.NONE);
			GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).applyTo(label);
			label.setText(Messages.App_Unit_Pixel);
		}
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:46,代码来源:PrefPagePhotoDirectory.java

示例10: createUI_18_MinSizeText

import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private void createUI_18_MinSizeText(final Composite parent) {

		/*
		 * label: display text when thumbnail min size
		 */
		Label label = new Label(parent, SWT.NONE);
		GridDataFactory.fillDefaults()//
				.align(SWT.BEGINNING, SWT.CENTER)
				.applyTo(label);
		label.setText(Messages.PrefPage_Photo_Viewer_Label_MinSizeText);

		final Composite container = new Composite(parent, SWT.NONE);
		GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
		GridLayoutFactory.fillDefaults().numColumns(2).applyTo(container);
//		container.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
		{
			/*
			 * spinner: thumbnail size
			 */
			_spinnerTextMinThumbSize = new Spinner(container, SWT.BORDER);
			GridDataFactory.fillDefaults() //
					.align(SWT.BEGINNING, SWT.FILL)
					.hint(convertWidthInCharsToPixels(5), SWT.DEFAULT)
					.applyTo(_spinnerTextMinThumbSize);
			_spinnerTextMinThumbSize.setMinimum(PhotoGallery.MIN_GALLERY_ITEM_WIDTH);
			_spinnerTextMinThumbSize.setMaximum(PhotoGallery.MAX_GALLERY_ITEM_WIDTH);
			_spinnerTextMinThumbSize.setToolTipText(Messages.PrefPage_Photo_Viewer_Label_MinSizeText_Tooltip);

			_spinnerTextMinThumbSize.addSelectionListener(_viewerUISelectionListener);
			_spinnerTextMinThumbSize.addMouseWheelListener(new MouseWheelListener() {
				@Override
				public void mouseScrolled(final MouseEvent event) {
					Util.adjustSpinnerValueOnMouseScroll(event);
					_isImageViewerUIModified = true;
				}
			});

			/*
			 * label: unit
			 */
			label = new Label(container, SWT.NONE);
			GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).applyTo(label);
			label.setText(Messages.App_Unit_Pixel);
		}
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:46,代码来源:PrefPagePhotoDirectory.java

示例11: createUI_26_DisplayImageQuality

import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private void createUI_26_DisplayImageQuality(final Composite parent) {

		/*
		 * checkbox: enable/disable high quality
		 */
		_chkIsHighImageQuality = new Button(parent, SWT.CHECK);
		GridDataFactory.fillDefaults().span(2, 1).applyTo(_chkIsHighImageQuality);
		_chkIsHighImageQuality.setText(Messages.PrefPage_Photo_Viewer_Checkbox_ShowHighQuality);
		_chkIsHighImageQuality.setToolTipText(Messages.PrefPage_Photo_Viewer_Checkbox_ShowHighQuality_Tooltip);
		_chkIsHighImageQuality.addSelectionListener(_viewerUISelectionListener);

		/*
		 * label: thumbnail size
		 */
		_lblThumbSize = new Label(parent, SWT.NONE);
		GridDataFactory.fillDefaults()//
				.align(SWT.BEGINNING, SWT.CENTER)
				.indent(16, 0)
				.applyTo(_lblThumbSize);
		_lblThumbSize.setText(Messages.PrefPage_Photo_Viewer_Label_HQThumbnailSize);

		final Composite container = new Composite(parent, SWT.NONE);
		GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
		GridLayoutFactory.fillDefaults().numColumns(2).applyTo(container);
//		container.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
		{
			/*
			 * spinner: thumbnail size
			 */
			_spinnerThumbSize = new Spinner(container, SWT.BORDER);
			GridDataFactory.fillDefaults() //
					.align(SWT.BEGINNING, SWT.FILL)
					.applyTo(_spinnerThumbSize);
			_spinnerThumbSize.setMinimum(PhotoGallery.MIN_GALLERY_ITEM_WIDTH);
			_spinnerThumbSize.setMaximum(PhotoGallery.MAX_GALLERY_ITEM_WIDTH);
			_spinnerThumbSize.setToolTipText(Messages.PrefPage_Photo_Viewer_Label_HQThumbnailSize_Tooltip);

			_spinnerThumbSize.addSelectionListener(_viewerUISelectionListener);
			_spinnerThumbSize.addMouseWheelListener(new MouseWheelListener() {
				@Override
				public void mouseScrolled(final MouseEvent event) {
					Util.adjustSpinnerValueOnMouseScroll(event);
					_isImageViewerUIModified = true;
				}
			});

			/*
			 * label: unit
			 */
			_lblThumbSizeUnit = new Label(container, SWT.NONE);
			GridDataFactory.fillDefaults()//
					.align(SWT.BEGINNING, SWT.CENTER)
					.applyTo(_lblThumbSizeUnit);
			_lblThumbSizeUnit.setText(Messages.App_Unit_Pixel);
		}
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:57,代码来源:PrefPagePhotoDirectory.java


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