本文整理汇总了Java中org.eclipse.jface.viewers.DecorationOverlayIcon类的典型用法代码示例。如果您正苦于以下问题:Java DecorationOverlayIcon类的具体用法?Java DecorationOverlayIcon怎么用?Java DecorationOverlayIcon使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DecorationOverlayIcon类属于org.eclipse.jface.viewers包,在下文中一共展示了DecorationOverlayIcon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTitleImage
import org.eclipse.jface.viewers.DecorationOverlayIcon; //导入依赖的package包/类
@Override
public Image getTitleImage() {
Image image = super.getTitleImage();
try {
IEditorInput input = getEditorInput();
IResource file = ResourceUtil.getResource(input);
if (input.exists() && file != null
&& file.findMarkers(MARKER.ERROR, false, IResource.DEPTH_ZERO).length > 0) {
if (errorTitleImage == null) {
errorTitleImage = new DecorationOverlayIcon(image,
PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
ISharedImages.IMG_DEC_FIELD_ERROR), IDecoration.BOTTOM_LEFT)
.createImage();
}
return errorTitleImage;
}
} catch (CoreException e) {
Log.log(e);
}
return image;
}
示例2: decorateImage
import org.eclipse.jface.viewers.DecorationOverlayIcon; //导入依赖的package包/类
@Override
public Image decorateImage(Image image, Object element)
{
OutlineNode node = (OutlineNode) element;
Image result = null;
switch (node.getType())
{
case CATEGORY:
DecorationOverlayIcon icon = new DecorationOverlayIcon(image,
m_categoryImage, IDecoration.BOTTOM_RIGHT);
result = icon.createImage();
break;
default:
break;
}
return result;
}
示例3: getInstalledBreakpointImage
import org.eclipse.jface.viewers.DecorationOverlayIcon; //导入依赖的package包/类
private Image getInstalledBreakpointImage(BfBreakpoint breakpoint) {
ImageDescriptor defaultImageDescriptor = DebugUITools.getDefaultImageDescriptor(breakpoint);
if (this.overlayedImages.containsKey(defaultImageDescriptor)) {
return this.overlayedImages.get(defaultImageDescriptor);
}
try {
ImageDescriptor overlay = ImageDescriptor.createFromURL(new URL("platform:/plugin/org.eclipse.ui.ide/icons/full/obj16/header_complete.png"));
Image defaultImage = defaultImageDescriptor.createImage();
this.disposeImages.add(defaultImage);
ImageDescriptor overlayedDescriptor = new DecorationOverlayIcon(defaultImage, overlay, IDecoration.BOTTOM_LEFT);
Image overlayedImage = overlayedDescriptor.createImage();
this.disposeImages.add(overlayedImage);
this.overlayedImages.put(defaultImageDescriptor, overlayedImage);
return overlayedImage;
}
catch (MalformedURLException ex) {
DbgActivator.getDefault().logError("URL malformed", ex);
return null;
}
}
示例4: updateEditorImage
import org.eclipse.jface.viewers.DecorationOverlayIcon; //导入依赖的package包/类
@Override
protected void updateEditorImage(final XtextEditor editor) {
Severity severity = null;
//
// try {
severity = getSeverity(editor);
//
// } catch (ResourceException e) {
// // do nothing, emitted when a marker cannot be found
// }
ImageDescriptor descriptor = null;
if (severity == null || severity == Severity.INFO) {
descriptor = GamaIcons.create(IGamaIcons.OVERLAY_OK).descriptor();
} else if (severity == Severity.ERROR) {
descriptor = GamaIcons.create("overlay.error2").descriptor();
} else if (severity == Severity.WARNING) {
descriptor = GamaIcons.create("overlay.warning2").descriptor();
} else {
super.updateEditorImage(editor);
return;
}
final DecorationOverlayIcon decorationOverlayIcon = new DecorationOverlayIcon(editor.getDefaultImage(),
descriptor, IDecoration.BOTTOM_LEFT);
scheduleUpdateEditor(decorationOverlayIcon);
}
示例5: decorateImage
import org.eclipse.jface.viewers.DecorationOverlayIcon; //导入依赖的package包/类
public Image decorateImage(Image image, Object element)
{
Image result = null;
if (image != null && element instanceof PropertyElement)
{
PropertyElement property = (PropertyElement) element;
if (property.isClassProperty())
{
DecorationOverlayIcon decorator = new DecorationOverlayIcon(image, STATIC_OVERLAY,
IDecoration.TOP_RIGHT);
result = decorator.createImage();
}
}
return result;
}
示例6: decorateImage
import org.eclipse.jface.viewers.DecorationOverlayIcon; //导入依赖的package包/类
@Override
public Image decorateImage(Image image, Object element) {
if (element instanceof EPlanElement) {
int severity = EPlanUtils.getSeverity(element);
if (severity == IMarker.SEVERITY_ERROR) {
return new DecorationOverlayIcon(image, errorImageDescriptor, quadrant).createImage();
}
else if (severity == MarkerConstants.SEVERITY_FIXED) {
return new DecorationOverlayIcon(image, fixedImageDescriptor, quadrant).createImage();
}
else if (severity == IMarker.SEVERITY_WARNING) {
return new DecorationOverlayIcon(image, warningImageDescriptor, quadrant).createImage();
}
else if (severity == MarkerConstants.SEVERITY_WAIVED) {
return new DecorationOverlayIcon(image, waivedImageDescriptor, quadrant).createImage();
}
}
return image;
}
示例7: decorateImage
import org.eclipse.jface.viewers.DecorationOverlayIcon; //导入依赖的package包/类
@Override
public Image decorateImage(Image image, Object element) {
if (image!=null) {
if (element instanceof IProject) {
IProject project = (IProject) element;
boolean b = GW4ENature.hasGW4ENature(project);
if (b) {
DecorationOverlayIcon icon = new DecorationOverlayIcon(image, GW_DESCRIPTOR, IDecoration.TOP_LEFT);
Image ret = (Image)resourceManager.get(icon);
return ret;
}
}
}
return image;
}
示例8: getImage
import org.eclipse.jface.viewers.DecorationOverlayIcon; //导入依赖的package包/类
@Override
@SuppressWarnings("PMD.AvoidDeeplyNestedIfStmts")
public Image getImage(final Object element) {
Image image = super.getImage(element);
if (image != null) {
Pair<Object, Integer> decoration = getDecoration(element);
if (decoration != null && decoration.getFirst() != null) {
Image overlay = convertToImage(decoration.getFirst());
if (overlay != null) {
image = new DecorationOverlayIcon(image, ImageDescriptor.createFromImage(overlay), decoration.getSecond()).createImage();
}
}
}
return image;
}
示例9: getImage
import org.eclipse.jface.viewers.DecorationOverlayIcon; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public Image getImage() {
if (isOptional()) {
// No decoration
return getUndecoratedImage();
} else {
final ImageDescriptor[] descriptors = new ImageDescriptor[ValidPreferenceConstants.DECORATION_QUADRANTS_COUNT];
descriptors[IDecoration.BOTTOM_RIGHT] = ValidPreferenceConstants.LOCK_OVERLAY_IMAGE_DESCRIPTOR;
// Overlay custom image over base image
return getImageManager().createImage(new DecorationOverlayIcon(getUndecoratedImage(), descriptors));
}
}
示例10: getImage
import org.eclipse.jface.viewers.DecorationOverlayIcon; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public Image getImage() {
final Image categoryImage = getUndecoratedImage();
if (hasRules() && hasOnlyMandatoryRules()) {
final ImageDescriptor[] descriptors = new ImageDescriptor[ValidPreferenceConstants.DECORATION_QUADRANTS_COUNT];
descriptors[IDecoration.BOTTOM_RIGHT] = ValidPreferenceConstants.LOCK_OVERLAY_IMAGE_DESCRIPTOR;
// Overlay custom image over base image
return getImageManager().createImage(new DecorationOverlayIcon(categoryImage, descriptors));
} else {
// No decoration
return categoryImage;
}
}
示例11: getDecoratedImage
import org.eclipse.jface.viewers.DecorationOverlayIcon; //导入依赖的package包/类
public static Image getDecoratedImage(Image baseImage, int severity) {
initializeIfNeeded();
String baseImageId = baseImage.toString();
// Construct a new image identifier
String decoratedImageId = baseImageId.concat(String.valueOf(severity));
ImageDescriptor overlay = null;
switch (severity) {
case IStatus.ERROR:
overlay = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_DEC_FIELD_ERROR);
break;
case IStatus.WARNING:
overlay = PlatformUI.getWorkbench().getSharedImages()
.getImageDescriptor(ISharedImages.IMG_DEC_FIELD_WARNING);
break;
default:
return baseImage;
}
// Return the stored image if we have one
Image image = imageRegistry.get(decoratedImageId);
if (image != null) {
return image;
}
// Otherwise create a new image and store it
DecorationOverlayIcon decoratedImage = new DecorationOverlayIcon(baseImage,
new ImageDescriptor[] { null, null, null, overlay, null }, size) {
};
imageRegistry.put(decoratedImageId, decoratedImage);
return imageRegistry.get(decoratedImageId);
}
示例12: updateEditorImage
import org.eclipse.jface.viewers.DecorationOverlayIcon; //导入依赖的package包/类
protected void updateEditorImage(XtextEditor xtextEditor) {
Severity severity = getSeverity(xtextEditor);
if (severity != null && severity != Severity.INFO) {
ImageDescriptor descriptor = severity == Severity.ERROR ? XtextPluginImages.DESC_OVR_ERROR
: XtextPluginImages.DESC_OVR_WARNING;
DecorationOverlayIcon decorationOverlayIcon = new DecorationOverlayIcon(defaultImage, descriptor,
IDecoration.BOTTOM_LEFT);
scheduleUpdateEditor(decorationOverlayIcon);
} else {
scheduleUpdateEditor(defaultImage);
}
}
示例13: decorateImage
import org.eclipse.jface.viewers.DecorationOverlayIcon; //导入依赖的package包/类
private Image decorateImage( Image image ) {
Image result = null;
if( image != null ) {
ImageDescriptor imageDescriptor = Images.getImageDescriptor( RUNNING );
DecorationOverlayIcon overlay = new DecorationOverlayIcon( image, imageDescriptor, BOTTOM_RIGHT );
result = resourceManager.createImage( overlay );
}
return result;
}
示例14: getDebugTargetWarningImage
import org.eclipse.jface.viewers.DecorationOverlayIcon; //导入依赖的package包/类
private Image getDebugTargetWarningImage(BfDebugTarget debugTarget) {
ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
ImageDescriptor warningOverlay = sharedImages.getImageDescriptor(ISharedImages.IMG_DEC_FIELD_WARNING);
ImageDescriptor targetDescriptor = DebugUITools.getDefaultImageDescriptor(debugTarget);
if (this.overlayedImages.containsKey(targetDescriptor)) {
return this.overlayedImages.get(targetDescriptor);
}
Image targetImage = targetDescriptor.createImage();
this.disposeImages.add(targetImage);
ImageDescriptor all = new DecorationOverlayIcon(targetImage, warningOverlay, IDecoration.TOP_LEFT);
Image overlayedImage = all.createImage();
this.disposeImages.add(overlayedImage);
this.overlayedImages.put(targetDescriptor, overlayedImage);
return overlayedImage;
}
示例15: getMissingTranslationImage
import org.eclipse.jface.viewers.DecorationOverlayIcon; //导入依赖的package包/类
/**
* @return Image for the icon which indicates a key that has missing
* translations
*/
public static Image getMissingTranslationImage() {
Image image = UIUtils.getImage(UIUtils.IMAGE_KEY);
ImageDescriptor missing = ImageDescriptor.createFromImage(UIUtils
.getImage(UIUtils.IMAGE_ERROR));
image = new DecorationOverlayIcon(image, missing,
IDecoration.BOTTOM_RIGHT).createImage();
return image;
}