當前位置: 首頁>>代碼示例>>Java>>正文


Java ImageRegistry.get方法代碼示例

本文整理匯總了Java中org.eclipse.jface.resource.ImageRegistry.get方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageRegistry.get方法的具體用法?Java ImageRegistry.get怎麽用?Java ImageRegistry.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.resource.ImageRegistry的用法示例。


在下文中一共展示了ImageRegistry.get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getImage

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的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

示例2: getImage

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的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) {
		logWarning("No image registry found!");
		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,項目名稱:egradle,代碼行數:28,代碼來源:EclipseUtil.java

示例3: getImage

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
 * @generated
 */
private Image getImage(String key, IElementType elementType) {
	ImageRegistry imageRegistry = StatemachineDiagramEditorPlugin
			.getInstance().getImageRegistry();
	Image image = imageRegistry.get(key);
	if (image == null && elementType != null
			&& StatemachineElementTypes.isKnownElementType(elementType)) {
		image = StatemachineElementTypes.getImage(elementType);
		imageRegistry.put(key, image);
	}

	if (image == null) {
		image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
		imageRegistry.put(key, image);
	}
	return image;
}
 
開發者ID:spoenemann,項目名稱:xtext-gef,代碼行數:20,代碼來源:StatemachineNavigatorLabelProvider.java

示例4: createInfoIcon

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
private void createInfoIcon() {

		if (_tourInfoImage != null) {
			return;
		}

		final ImageRegistry imageRegistry = TourbookPlugin.getDefault().getImageRegistry();

		imageRegistry.put(
				Messages.Image_ToolTip_TourInfo,
				TourbookPlugin.getImageDescriptor(Messages.Image_ToolTip_TourInfo));

		imageRegistry.put(
				Messages.Image_ToolTip_TourInfo_Hovered,
				TourbookPlugin.getImageDescriptor(Messages.Image_ToolTip_TourInfo_Hovered));

		_tourInfoImage = imageRegistry.get(Messages.Image_ToolTip_TourInfo);
		_tourInfoImageHovered = imageRegistry.get(Messages.Image_ToolTip_TourInfo_Hovered);

		_tourInfoImageSize = _tourInfoImage.getBounds();
	}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:22,代碼來源:TourInfoIconToolTipProvider.java

示例5: getImage

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
 * getImage
 * 
 * @param path
 * @return
 */
public static Image getImage(String path)
{
	ImageRegistry registry = plugin.getImageRegistry();
	Image image = registry.get(path);

	if (image == null)
	{
		ImageDescriptor id = getImageDescriptor(path);

		if (id != null)
		{
			registry.put(path, id);
			image = registry.get(path);
		}
	}

	return image;
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:25,代碼來源:HTMLPlugin.java

示例6: initImageRegistry

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
private void initImageRegistry() {

		final TourbookPlugin activator = TourbookPlugin.getDefault();
		final ImageRegistry imageRegistry = activator.getImageRegistry();

		if (imageRegistry.get(Messages.Image_POI_Anchor) == null) {

			imageRegistry.put(IMG_KEY_ANCHOR, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Anchor));
			imageRegistry.put(IMG_KEY_CAR, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Car));
			imageRegistry.put(IMG_KEY_CART, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Cart));
			imageRegistry.put(IMG_KEY_FLAG, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Flag));
			imageRegistry.put(IMG_KEY_HOUSE, TourbookPlugin.getImageDescriptor(Messages.Image_POI_House));
			imageRegistry.put(IMG_KEY_SOCCER, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Soccer));
			imageRegistry.put(IMG_KEY_STAR, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Star));
		}
	}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:17,代碼來源:PoiView.java

示例7: getImage

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
public static Image getImage(AbstractUIPlugin plugin, String path)
{
	ImageRegistry registry = plugin.getImageRegistry();
	Image image = registry.get(path);
	if (image == null)
	{
		ImageDescriptor id = getImageDescriptor(plugin.getBundle().getSymbolicName(), path);
		if (id == null)
		{
			return null;
		}
		registry.put(path, id);
		image = registry.get(path);
	}
	return image;
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:17,代碼來源:UIUtils.java

示例8: getImage

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
 * getImage
 * 
 * @param path
 * @return
 */
public static Image getImage(String path)
{
	ImageRegistry registry = plugin.getImageRegistry();
	Image image = registry.get(path);

	if (image == null)
	{
		ImageDescriptor id = getImageDescriptor(path);

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

		registry.put(path, id);
		image = registry.get(path);
	}

	return image;
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:27,代碼來源:CSSPlugin.java

示例9: getImage

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
 * getImage
 * 
 * @param path
 * @return
 */
public static Image getImage(String path)
{
	ImageRegistry registry = PLUGIN.getImageRegistry();
	Image image = registry.get(path);
	if (image == null)
	{
		ImageDescriptor id = getImageDescriptor(path);
		if (id == null)
		{
			return null;
		}
		registry.put(path, id);
		image = registry.get(path);
	}
	return image;
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:23,代碼來源:JSPlugin.java

示例10: getImage

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
 * @generated
 */
private Image getImage(String key, IElementType elementType) {
	ImageRegistry imageRegistry = SimpleBPMN.diagram.part.SimpleBPMNDiagramEditorPlugin
			.getInstance().getImageRegistry();
	Image image = imageRegistry.get(key);
	if (image == null
			&& elementType != null
			&& SimpleBPMN.diagram.providers.SimpleBPMNElementTypes
					.isKnownElementType(elementType)) {
		image = SimpleBPMN.diagram.providers.SimpleBPMNElementTypes
				.getImage(elementType);
		imageRegistry.put(key, image);
	}

	if (image == null) {
		image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
		imageRegistry.put(key, image);
	}
	return image;
}
 
開發者ID:bluezio,項目名稱:simplified-bpmn-example,代碼行數:23,代碼來源:SimpleBPMNNavigatorLabelProvider.java

示例11: getImage

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
 * @generated
 */
private Image getImage(String key, IElementType elementType) {
	ImageRegistry imageRegistry = SmcDiagramEditorPlugin.getInstance()
			.getImageRegistry();
	Image image = imageRegistry.get(key);
	if (image == null && elementType != null
			&& SmcElementTypes.isKnownElementType(elementType)) {
		image = SmcElementTypes.getImage(elementType);
		imageRegistry.put(key, image);
	}

	if (image == null) {
		image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
		imageRegistry.put(key, image);
	}
	return image;
}
 
開發者ID:road-framework,項目名稱:ROADDesigner,代碼行數:20,代碼來源:SmcNavigatorLabelProvider.java

示例12: getSearchQueryIcon

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
public Image getSearchQueryIcon()
{
  final ImageRegistry registry = JiveUIPlugin.getDefault().getImageRegistry();
  final String key = getPluginId() + "/" + getLocalId();
  Image icon = registry.get(key);
  if (icon == null)
  {
    try
    {
      final ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(
          getPluginId(), getIconPath());
      registry.put(key, descriptor);
      icon = registry.get(key);
    }
    // TODO Catch the right exception and log accordingly.
    // Also, handle the case when no icon is given better.
    catch (final Exception e)
    {
      // JiveUIPlugin.log(e);
      return null;
    }
  }
  return icon;
}
 
開發者ID:UBPL,項目名稱:jive,代碼行數:25,代碼來源:JiveSearchPageDescriptor.java

示例13: getImage

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
 * This is a convenience method to get an imgIcon from a URL.
 * 
 * @param bundle
 *            The target bundle
 * @param sPluginRelativePath
 *            The URL for the imgIcon.
 * @param force
 *            If True, still returns a dummy image if the path cannot be
 *            loaded.
 * @return The imgIcon represented by the given URL.
 * 
 * @see #setImageCached(boolean )
 */
public static Image getImage( Bundle bundle, String sPluginRelativePath,
		boolean force )
{
	ImageRegistry registry = JFaceResources.getImageRegistry( );

	String imgKey = sPluginRelativePath;
	if ( bundle != null )
	{
		imgKey = bundle.getSymbolicName( ) + ":" + sPluginRelativePath; //$NON-NLS-1$
	}

	Image image = registry.get( imgKey );
	if ( image == null )
	{
		image = createImage( bundle, sPluginRelativePath, force );
		if ( image != null )
		{
			registry.put( imgKey, image );
		}
	}
	return image;
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:37,代碼來源:UIHelper.java

示例14: getImage

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
 * @generated
 */
private Image getImage(String key, IElementType elementType) {
	ImageRegistry imageRegistry = Wc2014DiagramEditorPlugin.getInstance()
			.getImageRegistry();
	Image image = imageRegistry.get(key);
	if (image == null && elementType != null
			&& Wc2014ElementTypes.isKnownElementType(elementType)) {
		image = Wc2014ElementTypes.getImage(elementType);
		imageRegistry.put(key, image);
	}

	if (image == null) {
		image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
		imageRegistry.put(key, image);
	}
	return image;
}
 
開發者ID:ggxx,項目名稱:HelloBrazil,代碼行數:20,代碼來源:Wc2014NavigatorLabelProvider.java

示例15: getImage

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
 * @generated
 */
private Image getImage(String key, IElementType elementType) {
    ImageRegistry imageRegistry = DcaseDiagramEditorPlugin.getInstance()
            .getImageRegistry();
    Image image = imageRegistry.get(key);
    if (image == null && elementType != null
            && DcaseElementTypes.isKnownElementType(elementType)) {
        image = DcaseElementTypes.getImage(elementType);
        imageRegistry.put(key, image);
    }

    if (image == null) {
        image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
        imageRegistry.put(key, image);
    }
    return image;
}
 
開發者ID:d-case,項目名稱:d-case_editor,代碼行數:20,代碼來源:DcaseNavigatorLabelProvider.java


注:本文中的org.eclipse.jface.resource.ImageRegistry.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。