本文整理匯總了Java中org.eclipse.ui.plugin.AbstractUIPlugin.getImageRegistry方法的典型用法代碼示例。如果您正苦於以下問題:Java AbstractUIPlugin.getImageRegistry方法的具體用法?Java AbstractUIPlugin.getImageRegistry怎麽用?Java AbstractUIPlugin.getImageRegistry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.ui.plugin.AbstractUIPlugin
的用法示例。
在下文中一共展示了AbstractUIPlugin.getImageRegistry方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getImage
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入方法依賴的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;
}
示例2: registImageFile
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入方法依賴的package包/類
public static ImageDescriptor registImageFile(AbstractUIPlugin plugin, File file) throws IOException{
ImageRegistry registry = plugin.getImageRegistry();
String rootpath = LocationUtil.getAbsoluteFile(plugin, "").getAbsolutePath();
if (!file.getAbsolutePath().startsWith(rootpath)) return null;
String rpath = file.getAbsolutePath().substring(rootpath.length() + 1).replaceAll("\\\\", "/");
ImageDescriptor descriptor = ImageDescriptor.createFromURL(LocationUtil.getURL(plugin, rpath));
registry.put(rpath, descriptor);
return descriptor;
}
示例3: getImage
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入方法依賴的package包/類
public static Image getImage(AbstractUIPlugin plugin, String id){
ImageRegistry imageRegistry = plugin.getImageRegistry();
Image image = imageRegistry.get(id);
if (image == null) {
try {
registImage(plugin, id);
image = imageRegistry.get(id);
} catch (FileNotFoundException e) {
image = ImageUtil.UNKNOWN;
}
}
return image;
}
示例4: registImage
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入方法依賴的package包/類
public static ImageDescriptor registImage(AbstractUIPlugin plugin, String path) throws FileNotFoundException{
ImageRegistry registry = plugin.getImageRegistry();
ImageDescriptor descriptor = ImageDescriptor.createFromURL(LocationUtil.getURL(plugin, path));
registry.put(path, descriptor);
return descriptor;
}
示例5: registImageDescriptor
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入方法依賴的package包/類
public static ImageDescriptor registImageDescriptor(AbstractUIPlugin plugin, String id, ImageDescriptor descriptor){
ImageRegistry registry = plugin.getImageRegistry();
registry.put(id, descriptor);
return descriptor;
}