本文整理汇总了Java中org.eclipse.jface.resource.ImageDescriptor.getMissingImageDescriptor方法的典型用法代码示例。如果您正苦于以下问题:Java ImageDescriptor.getMissingImageDescriptor方法的具体用法?Java ImageDescriptor.getMissingImageDescriptor怎么用?Java ImageDescriptor.getMissingImageDescriptor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.resource.ImageDescriptor
的用法示例。
在下文中一共展示了ImageDescriptor.getMissingImageDescriptor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createImageDescriptor
import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
public static ImageDescriptor createImageDescriptor(String path, String pluginId) {
if (path == null) {
/* fall back if path null , so avoid NPE in eclipse framework */
return ImageDescriptor.getMissingImageDescriptor();
}
if (pluginId == null) {
/* fall back if pluginId null , so avoid NPE in eclipse framework */
return ImageDescriptor.getMissingImageDescriptor();
}
Bundle bundle = Platform.getBundle(pluginId);
if (bundle == null) {
/*
* fall back if bundle not available, so avoid NPE in eclipse
* framework
*/
return ImageDescriptor.getMissingImageDescriptor();
}
URL url = FileLocator.find(bundle, new Path(path), null);
ImageDescriptor imageDesc = ImageDescriptor.createFromURL(url);
return imageDesc;
}
示例2: makeDescriptor
import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
private ImageDescriptor makeDescriptor ( final String icon )
{
if ( "info".equalsIgnoreCase ( icon ) )
{
return ImageDescriptor.createFromFile ( SystemMessageExtension.class, "icons/information.png" );
}
else if ( "warning".equalsIgnoreCase ( icon ) )
{
return ImageDescriptor.createFromFile ( SystemMessageExtension.class, "icons/exclamation.png" );
}
return ImageDescriptor.getMissingImageDescriptor ();
}
示例3: declareRegistryImage
import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
private final static void declareRegistryImage(String key, String path) {
ImageDescriptor desc = ImageDescriptor.getMissingImageDescriptor();
Bundle bundle = Platform.getBundle(EditorConfigPlugin.PLUGIN_ID);
URL url = null;
if (bundle != null) {
url = FileLocator.find(bundle, new Path(path), null);
if (url != null) {
desc = ImageDescriptor.createFromURL(url);
}
}
imageRegistry.put(key, desc);
}
示例4: getImageDescriptor
import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
@Override
public ImageDescriptor getImageDescriptor() {
return ImageDescriptor.getMissingImageDescriptor();
}