本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}