本文整理匯總了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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}