本文整理汇总了Java中org.eclipse.jface.resource.JFaceResources.getImageRegistry方法的典型用法代码示例。如果您正苦于以下问题:Java JFaceResources.getImageRegistry方法的具体用法?Java JFaceResources.getImageRegistry怎么用?Java JFaceResources.getImageRegistry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.resource.JFaceResources
的用法示例。
在下文中一共展示了JFaceResources.getImageRegistry方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerIconForFamily
import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的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: getImage
import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的package包/类
/**
* Returns an image stored in the classpath at the specified path
*
* @param clazz Class The class relative to which to find the image
* @param path String The path to the image file
* @return Image The image stored in the file at the specified path
*/
public static Image getImage(Class<?> clazz, String path) {
String key = clazz.getName() + '|' + path;
final ImageRegistry imageRegistry = JFaceResources.getImageRegistry();
Image image = imageRegistry.get(key);
if (image == null) {
imageRegistry.put(key, ImageDescriptor.createFromFile(clazz, path));
image = imageRegistry.get(key);
}
return image;
}
示例3: registerImageDescriptor
import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的package包/类
private static void registerImageDescriptor(String key, ImageDescriptor descriptor) {
ImageRegistry imageRegistry = JFaceResources.getImageRegistry();
imageRegistry.put(key, descriptor);
}
示例4: getImage
import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的package包/类
/**
* Returns the image from the image registry with the given key.
*
* @param key
* of the image
* @return the image from the image registry with the given key.
*/
public static Image getImage(String key) {
ImageRegistry imageRegistry = JFaceResources.getImageRegistry();
return imageRegistry.get(key);
}
示例5: getImageDescriptor
import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的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);
}