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


Java DecorationOverlayIcon类代码示例

本文整理汇总了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;
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:22,代码来源:SQLEditor.java

示例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;
}
 
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:19,代码来源:OutlineDecorator.java

示例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;
	}
}
 
开发者ID:RichardBirenheide,项目名称:brainfuck,代码行数:21,代码来源:BfDebugModelPresentation.java

示例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);

}
 
开发者ID:gama-platform,项目名称:gama,代码行数:27,代码来源:GamlEditorTickUpdater.java

示例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;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:20,代码来源:JSIndexViewLabelProvider.java

示例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;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:26,代码来源:ActivityAdvisorLabelDecorator.java

示例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;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:16,代码来源:ProjectLabelDecorator.java

示例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;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:16,代码来源:XtextSpyLabelProvider.java

示例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));
  }
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:14,代码来源:PreferenceRule.java

示例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;
  }
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:15,代码来源:PreferenceCategory.java

示例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);
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:30,代码来源:TypeScriptUIImageResource.java

示例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);
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:13,代码来源:XtextEditorErrorTickUpdater.java

示例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;
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:10,代码来源:LaunchConfigLabelProvider.java

示例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;
}
 
开发者ID:RichardBirenheide,项目名称:brainfuck,代码行数:16,代码来源:BfDebugModelPresentation.java

示例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;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:13,代码来源:UIUtils.java


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