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


Java ImageRegistry.getDescriptor方法代碼示例

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


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

示例1: registerIconForFamily

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
@Override
public void registerIconForFamily(ImageDescriptor icon, Object family) {
	String key = IMAGE_KEY + String.valueOf(imageKeyTable.size());
	imageKeyTable.put(family, key);
	ImageRegistry registry = JFaceResources.getImageRegistry();

	// Avoid registering twice
	if (registry.getDescriptor(key) == null) {
		registry.put(key, icon);
	}
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:12,代碼來源:ProgressServiceImpl.java

示例2: loadImage

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
private static ImageRegistry loadImage(String path) {
  ImageRegistry reg = getInstance().getImageRegistry();
  if (reg.getDescriptor(path) == null) {
    URL url = instance.getBundle().getEntry(path);
    reg.put(path, ImageDescriptor.createFromURL(url));
  }
  return reg;
}
 
開發者ID:eclipse,項目名稱:eclemma,代碼行數:9,代碼來源:EclEmmaUIPlugin.java

示例3: getImageDescriptor

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
public static ImageDescriptor getImageDescriptor( String name ) {
  ImageDescriptor result = null;
  ImageRegistry imageRegistry = getImageRegistry();
  if( imageRegistry != null ) {
    result = imageRegistry.getDescriptor( name );
  }
  return result;
}
 
開發者ID:rherrmann,項目名稱:eclipse-extras,代碼行數:9,代碼來源:Images.java

示例4: getImageDescriptor

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
 * Returns an image descriptor for the image file at the given plug-in
 * relative path.
 *
 * @param path
 *            the path
 * @return the image descriptor
 */
public static ImageDescriptor getImageDescriptor(String path) {
    if (path == null) {
        return null;
    }
    ImageRegistry imageRegistry = getDefault().getImageRegistry();
    ImageDescriptor imageDescriptor = imageRegistry.getDescriptor(path);
    if (imageDescriptor == null) {
        imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(
                "de.loskutov.eclipseskins.extvs", path);
        imageRegistry.put(path, imageDescriptor);
    }
    return imageDescriptor;
}
 
開發者ID:iloveeclipse,項目名稱:skin4eclipse,代碼行數:22,代碼來源:PresentationPlugin.java

示例5: ExclusionInclusionLabelProvider

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
public ExclusionInclusionLabelProvider(String key, ImageDescriptor descriptor) {
    ImageRegistry registry = FileSyncPlugin.getDefault().getImageRegistry();
    if (registry.getDescriptor(key) == null) {
        registry.put(key, descriptor);
    }
    elementImage = registry.get(key);
}
 
開發者ID:iloveeclipse,項目名稱:filesync4eclipse,代碼行數:8,代碼來源:InclusionExclusionDialog.java

示例6: getImageDescriptor

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
 * Returns an image descriptor for the image file at the given plug-in
 * relative path.
 *
 * @param path
 *            the path
 * @return the image descriptor
 */
public static ImageDescriptor getImageDescriptor(String path) {
    if (path == null) {
        return null;
    }
    ImageRegistry imageRegistry = getDefault().getImageRegistry();
    ImageDescriptor imageDescriptor = imageRegistry.getDescriptor(path);
    if (imageDescriptor == null) {
        imageDescriptor = imageDescriptorFromPlugin(PLUGIN_ID, path);
        imageRegistry.put(path, imageDescriptor);
    }
    return imageDescriptor;
}
 
開發者ID:iloveeclipse,項目名稱:filesync4eclipse,代碼行數:21,代碼來源:FileSyncPlugin.java

示例7: getImage

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
public static Image getImage(String path) {
    ImageRegistry registry = getDefault().getImageRegistry();
    ImageDescriptor descriptor = registry.getDescriptor(path);
    if(descriptor == null) {
        descriptor = getImageDescriptor(path);
        if(descriptor != null) {
            registry.put(path, descriptor);
        }
    }
    if(descriptor != null) {
        return registry.get(path);
    }
    return null;
}
 
開發者ID:iloveeclipse,項目名稱:plugindependencies,代碼行數:15,代碼來源:Activator.java

示例8: getImageDescriptor

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
 * This is a convenience method to get an imgIcon from a URL.
 * 
 * @param sPluginRelativePath
 *            The URL for the imgIcon.
 * @return The imgIcon represented by the given URL.
 * @see #setImageCached( boolean )
 */
public static ImageDescriptor getImageDescriptor( String sPluginRelativePath )
{
	ImageRegistry registry = JFaceResources.getImageRegistry( );
	ImageDescriptor image = registry.getDescriptor( sPluginRelativePath );
	if ( image == null )
	{
		registry.put( sPluginRelativePath,
				createImage( sPluginRelativePath ) );
		image = registry.getDescriptor( sPluginRelativePath );
	}
	return image;
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:21,代碼來源:UIHelper.java

示例9: getImageDescriptor

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
 * Relative to UI plugin directory, example: "icons/usertableicon.gif".
 * 
 * @param key
 * @return an Image descriptor, this is useful to preserve the original
 *         color depth for instance.
 */
public static ImageDescriptor getImageDescriptor( String key )
{
	ImageRegistry imageRegistry = ReportPlugin.getDefault( )
			.getImageRegistry( );

	ImageDescriptor imageDescriptor = imageRegistry.getDescriptor( key );

	if ( imageDescriptor == null )
	{
		URL url = ReportPlugin.getDefault( ).find( new Path( key ) );

		if ( null != url )
		{
			imageDescriptor = ImageDescriptor.createFromURL( url );
		}

		if ( imageDescriptor == null )
		{
			imageDescriptor = ImageDescriptor.getMissingImageDescriptor( );
		}

		imageRegistry.put( key, imageDescriptor );
	}

	return imageDescriptor;
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:34,代碼來源:ReportPlugin.java

示例10: decorateImage

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
public Image decorateImage( Image image, Object element )
{
	int flag =  getElementFlag( element );
	if ((flag&Normal_Element) != 0)
	{
		return image;
	}
	String key = ""; //$NON-NLS-1$
	if (element instanceof DesignElementHandle)
	{
		DesignElementHandle handle = (DesignElementHandle)element;
		key = handle.getElement( ).getDefn( ).getName( );
	}
	else if (element instanceof EmbeddedImageHandle)
	{
		EmbeddedImageHandle imageHandle = (EmbeddedImageHandle)element;
		key = imageHandle.getQualifiedName( );
	}
	
	ImageDescriptor descriptor = null;
	if ((flag&Library_Element) != 0)
	{
		key = key + Library_Key;
		descriptor = new LibraryImageDescriptor( image, ReportPlatformUIImages.getImageDescriptor( IReportGraphicConstants.ICON_REPORT_LIBRARY_OVER ) );
	}
	else if ((flag&Local_Library_Element) != 0)
	{
		key = key + Local_Library_Key;
		descriptor = new LibraryImageDescriptor( image, ReportPlatformUIImages.getImageDescriptor( IReportGraphicConstants.ICON_REPORT_LOCAL_LIBRARY_OVER ) );
	}
	ImageRegistry regiest = ReportPlugin.getDefault( ).getImageRegistry( );
	ImageDescriptor temp = regiest.getDescriptor( key );
	if (temp != null)
	{
		return temp.createImage( );
	}
	else if(descriptor != null)
	{
		regiest.put( key, descriptor );
		return descriptor.createImage( );
	}
	//ReportPlugin.getDefault( ).getImageRegistry( ).get
	return image;
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:45,代碼來源:LibraryElementImageDecorator.java

示例11: getImageDescriptor

import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
 * Returns the image descriptor from the image registry with the given key.
 * 
 * @param key
 *            of the image
 * @return the image descriptor from the image registry with the given key.
 */
public static ImageDescriptor getImageDescriptor(String key) {
	ImageRegistry imageRegistry = JFaceResources.getImageRegistry();
	return imageRegistry.getDescriptor(key);
}
 
開發者ID:angelozerr,項目名稱:typescript.java,代碼行數:12,代碼來源:TypeScriptImagesRegistry.java


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