⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fielddecoration.java

📁 jfa2ce 源码帮助开发人员更好的理解运用
💻 JAVA
字号:
/******************************************************************************* * Copyright (c) 2005, 2006 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: *     IBM Corporation - initial API and implementation *******************************************************************************/package org.eclipse.jface.fieldassist;import org.eclipse.swt.graphics.Image;/** * FieldDecoration is a simple data structure class for specifying a decoration * for a field. A decoration may be rendered in different ways depending on the * type of field it is used with. *  * @see FieldDecorationRegistry * @see DecoratedField *  * @since 3.2 */public class FieldDecoration {	/*	 * The image to be shown in the decoration.	 */	private Image image;	/*	 * The description to show in the decoration's hover.	 */	private String description;	/**	 * Create a decoration for a field with the specified image and description	 * text.	 * 	 * @param image	 *            the image shown in the decoration. A <code>null</code> image	 *            will result in a blank decoration, which may be used to	 *            reserve space near the field.	 * @param description	 *            the description shown when the user hovers over the	 *            decoration. A <code>null</code> description indicates that	 *            there will be no hover for the decoration.	 */	public FieldDecoration(Image image, String description) {		this.image = image;		this.description = description;	}	/**	 * Return the image shown in the decoration, or <code>null</code> if no	 * image is specified.	 * 	 * @return the image shown in the decoration. A return value of	 *         <code>null</code> signifies a blank decoration.	 */	public Image getImage() {		return image;	}	/**	 * Set the image shown in the decoration, or <code>null</code> if no image	 * is specified. It is up to the caller to update any decorated fields that	 * are showing the description in order to display the new image.	 * 	 * @param image	 *            the image shown in the decoration. A value of	 *            <code>null</code> signifies a blank decoration.	 * 	 * @see DecoratedField#updateDecoration(FieldDecoration)	 */	public void setImage(Image image) {		this.image = image;	}	/**	 * Return the description for the decoration shown when the user hovers over	 * the decoration.	 * 	 * @return the String description of the decoration. A return value of	 *         <code>null</code> indicates that no description will be shown.	 * 	 * @see DecoratedField#updateDecoration(FieldDecoration)	 */	public String getDescription() {		return description;	}	/**	 * Set the description for the decoration shown when the user hovers over	 * the decoration. It is up to the caller to update any decorated fields	 * showing the description.	 * 	 * @param description	 *            the String description of the decoration. A value of	 *            <code>null</code> indicates that no description will be	 *            shown.	 */	public void setDescription(String description) {		this.description = description;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -