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


Java ImageDescriptor.createImage方法代码示例

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


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

示例1: getImage

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
@Override
public Image getImage(Object element) {
	ImageDescriptor descriptor = getImageDescriptor(element);

	if (descriptor == null) {
		return null;
	}

	// obtain the cached image corresponding to the descriptor
	Image image = imageCache.get(descriptor);
	if (image == null) {
		image = descriptor.createImage();
		imageCache.put(descriptor, image);
	}
	return image;

}
 
开发者ID:eclipse,项目名称:n4js,代码行数:18,代码来源:XpectLabelProvider.java

示例2: getImage

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
/**
 * Get image by path from image registry. If not already registered a new
 * image will be created and registered. If not createable a fallback image
 * is used instead
 * 
 * @param path
 * @param pluginId
 *            - plugin id to identify which plugin image should be loaded
 * @return image
 */
public static Image getImage(String path, String pluginId) {
	ImageRegistry imageRegistry = getImageRegistry();
	if (imageRegistry == null) {
		return null;
	}
	Image image = imageRegistry.get(path);
	if (image == null) {
		ImageDescriptor imageDesc = createImageDescriptor(path, pluginId);
		image = imageDesc.createImage();
		if (image == null) {
			image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
		}
		imageRegistry.put(path, image);
	}
	return image;
}
 
开发者ID:de-jcup,项目名称:eclipse-batch-editor,代码行数:27,代码来源:EclipseUtil.java

示例3: testIndirectImageCaching

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
/**
 * Checks the indirect {@link Image image} caching.
 */
@Test
public void testIndirectImageCaching() {
	final ImageDescriptor desc1 = ImageRef.LIB_PATH.asImageDescriptor().orNull();
	final ImageDescriptor desc2 = ImageRef.LIB_PATH.asImageDescriptor().orNull();
	final Image img1 = desc1.createImage();
	final Image img2 = desc2.createImage();
	assertTrue("Expected different reference of images.", img1 != img2);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:12,代码来源:GHOLD_170_ImageCaching_PluginUITest.java

示例4: getSharedImage

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
static public Image getSharedImage(ImageDescriptor descriptor){
	Image res = imageMap.get(descriptor);
	if(res == null){
		res = descriptor.createImage();
		imageMap.put(descriptor, res);
	}
	return res;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:9,代码来源:SharedIcons.java

示例5: getImage

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
private Image getImage() {
	String path = "icons/ksp.gif";
	Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID);
	URL url = FileLocator.find(bundle, new Path(path), null);
	ImageDescriptor imageDesc = ImageDescriptor.createFromURL(url);
	return imageDesc.createImage();
}
 
开发者ID:sebez,项目名称:vertigo-chroma-kspplugin,代码行数:8,代码来源:AboutDialog.java

示例6: getImage

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
/**
 * Get image contained in the 'images' folder of the plugin
 */
static Image getImage(String name) {
	Bundle bundle = Platform.getBundle(PandionJConstants.PLUGIN_ID);
	URL imagePath = FileLocator.find(bundle, new Path(PandionJConstants.IMAGE_FOLDER + "/" + name), null);
	ImageDescriptor imageDesc = ImageDescriptor.createFromURL(imagePath);
	return imageDesc.createImage();
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:10,代码来源:PandionJUI.java

示例7: OverlayImageIcon

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
public OverlayImageIcon(Image baseImage, ImageDescriptor overlay, int corner) {
	mCorner = corner;
	mBase = baseImage;
	if (overlay != null)
		mOverlay = overlay.createImage();
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:7,代码来源:ViewLabelDecorator.java

示例8: getCreateImage

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
private void getCreateImage(String path) {
	URL url = ModelActivator.getDefault().getBundle().getResource(path);
	ImageDescriptor imageDesc = ImageDescriptor.createFromURL(url);
	icon = imageDesc.createImage();
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:6,代码来源:Node.java

示例9: SimpleImageContentProposalLabelProvider

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
/**
 * Creates a new SimpleImageContentProposalLabelProvider with a given image.
 *
 *
 * @param imageDescriptor
 *            The descriptor of the image which should be used
 */
public SimpleImageContentProposalLabelProvider(ImageDescriptor imageDescriptor) {
	this.image = imageDescriptor.createImage();
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:11,代码来源:SimpleImageContentProposalLabelProvider.java


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