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