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