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


Java FieldDecorationRegistry.DEC_INFORMATION属性代码示例

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


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

示例1: getImage

/**
 * Returns an image to display in a ControlDecoration which is appropriate
 * for the given status. The default implementation of this method returns
 * an image according to <code>status.getSeverity()</code>:
 * <ul>
 * <li>IStatus.OK => No image
 * <li>IStatus.INFO => FieldDecorationRegistry.DEC_INFORMATION
 * <li>IStatus.WARNING => FieldDecorationRegistry.DEC_WARNING
 * <li>IStatus.ERROR => FieldDecorationRegistry.DEC_ERROR
 * <li>IStatus.CANCEL => FieldDecorationRegistry.DEC_ERROR
 * <li>Other => No image
 * </ul>
 * 
 * @param status
 *            the status object.
 * @return an image to display in a ControlDecoration which is appropriate
 *         for the given status.
 */
protected Image getImage(IStatus status)
{
	if (status == null) return null;

	String fieldDecorationID = null;
	switch (status.getSeverity())
	{
		case IStatus.INFO:
			fieldDecorationID = FieldDecorationRegistry.DEC_INFORMATION;
			break;
		case IStatus.WARNING:
			fieldDecorationID = FieldDecorationRegistry.DEC_WARNING;
			break;
		case IStatus.ERROR:
		case IStatus.CANCEL:
			fieldDecorationID = FieldDecorationRegistry.DEC_ERROR;
			break;
	}

	FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(fieldDecorationID);
	return fieldDecoration == null ? null : fieldDecoration.getImage();
}
 
开发者ID:cplutte,项目名称:bts,代码行数:40,代码来源:BackgroundControlDecorationUpdater.java

示例2: determineImage

private Image determineImage(int severity) {
	String id = "";
	switch (severity) {
	case IStatus.INFO:
		id = FieldDecorationRegistry.DEC_INFORMATION;
		break;
	case IStatus.WARNING:
		id = FieldDecorationRegistry.DEC_WARNING;
		break;
	case IStatus.ERROR:
		id = FieldDecorationRegistry.DEC_ERROR;
		break;
	default:
		Logger logger = Logger.getLogger(EMFDetailFormPart.class);
		logger.warn("unexpected status for validation failure: " + severity);
		id = FieldDecorationRegistry.DEC_ERROR;
	}
	return FieldDecorationRegistry.getDefault().getFieldDecoration(id).getImage();
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:19,代码来源:EMFDetailUtils.java

示例3: getImage

/**
 * Returns an image to display in a ControlDecoration which is appropriate
 * for the given status. The default implementation of this method returns
 * an image according to <code>status.getSeverity()</code>:
 * <ul>
 * <li>IStatus.OK => No image
 * <li>IStatus.INFO => FieldDecorationRegistry.DEC_INFORMATION
 * <li>IStatus.WARNING => FieldDecorationRegistry.DEC_WARNING
 * <li>IStatus.ERROR => FieldDecorationRegistry.DEC_ERROR
 * <li>IStatus.CANCEL => FieldDecorationRegistry.DEC_ERROR
 * <li>Other => No image
 * </ul>
 * 
 * @param status
 *            the status object.
 * @return an image to display in a ControlDecoration which is appropriate
 *         for the given status.
 */
protected Image getImage(IStatus status) {
	if (status == null)
		return null;

	String fieldDecorationID = null;
	switch (status.getSeverity()) {
	case IStatus.INFO:
		fieldDecorationID = FieldDecorationRegistry.DEC_INFORMATION;
		break;
	case IStatus.WARNING:
		fieldDecorationID = FieldDecorationRegistry.DEC_WARNING;
		break;
	case IStatus.ERROR:
	case IStatus.CANCEL:
		fieldDecorationID = FieldDecorationRegistry.DEC_ERROR;
		break;
	}

	FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault()
			.getFieldDecoration(fieldDecorationID);
	return fieldDecoration == null ? null : fieldDecoration.getImage();
}
 
开发者ID:gulliverrr,项目名称:hestia-engine-dev,代码行数:40,代码来源:ControlDecorationUpdater.java

示例4: getImage

/**
 * Returns an image to display in a ControlDecoration which is appropriate for the given status. The default
 * implementation of this method returns an image according to <code>status.getSeverity()</code>:
 * <ul>
 * <li>IStatus.OK => No image
 * <li>IStatus.INFO => FieldDecorationRegistry.DEC_INFORMATION
 * <li>IStatus.WARNING => FieldDecorationRegistry.DEC_WARNING
 * <li>IStatus.ERROR => FieldDecorationRegistry.DEC_ERROR
 * <li>IStatus.CANCEL => FieldDecorationRegistry.DEC_ERROR
 * <li>Other => No image
 * </ul>
 * 
 * @param status the status object.
 * @return an image to display in a ControlDecoration which is appropriate for the given status.
 */
protected Image getImage(IStatus status) {
	if (status == null)
		return null;

	String fieldDecorationID = null;
	switch (status.getSeverity()) {
	case IStatus.INFO:
		fieldDecorationID = FieldDecorationRegistry.DEC_INFORMATION;
		break;
	case IStatus.WARNING:
		fieldDecorationID = FieldDecorationRegistry.DEC_WARNING;
		break;
	case IStatus.ERROR:
	case IStatus.CANCEL:
		fieldDecorationID = FieldDecorationRegistry.DEC_ERROR;
		break;
	}

	FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
			fieldDecorationID);
	return fieldDecoration == null ? null : fieldDecoration.getImage();
}
 
开发者ID:gulliverrr,项目名称:hestia-engine-dev,代码行数:37,代码来源:DataBindings.java


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