當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。