本文整理匯總了Java中org.eclipse.jface.resource.ImageRegistry.get方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageRegistry.get方法的具體用法?Java ImageRegistry.get怎麽用?Java ImageRegistry.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.resource.ImageRegistry
的用法示例。
在下文中一共展示了ImageRegistry.get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getImage
import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
* Get image by path from image registry. If not already registered a new
* image will be created and registered. If not createable a fallback image
* is used instead
*
* @param path
* @param pluginId
* - plugin id to identify which plugin image should be loaded
* @return image
*/
public static Image getImage(String path, String pluginId) {
ImageRegistry imageRegistry = getImageRegistry();
if (imageRegistry == null) {
return null;
}
Image image = imageRegistry.get(path);
if (image == null) {
ImageDescriptor imageDesc = createImageDescriptor(path, pluginId);
image = imageDesc.createImage();
if (image == null) {
image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
}
imageRegistry.put(path, image);
}
return image;
}
示例2: getImage
import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
* Get image by path from image registry. If not already registered a new
* image will be created and registered. If not createable a fallback image
* is used instead
*
* @param path
* @param pluginId
* - plugin id to identify which plugin image should be loaded
* @return image
*/
public static Image getImage(String path, String pluginId) {
ImageRegistry imageRegistry = getImageRegistry();
if (imageRegistry == null) {
logWarning("No image registry found!");
return null;
}
Image image = imageRegistry.get(path);
if (image == null) {
ImageDescriptor imageDesc = createImageDescriptor(path, pluginId);
image = imageDesc.createImage();
if (image == null) {
image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
}
imageRegistry.put(path, image);
}
return image;
}
示例3: getImage
import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
* @generated
*/
private Image getImage(String key, IElementType elementType) {
ImageRegistry imageRegistry = StatemachineDiagramEditorPlugin
.getInstance().getImageRegistry();
Image image = imageRegistry.get(key);
if (image == null && elementType != null
&& StatemachineElementTypes.isKnownElementType(elementType)) {
image = StatemachineElementTypes.getImage(elementType);
imageRegistry.put(key, image);
}
if (image == null) {
image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
imageRegistry.put(key, image);
}
return image;
}
示例4: createInfoIcon
import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
private void createInfoIcon() {
if (_tourInfoImage != null) {
return;
}
final ImageRegistry imageRegistry = TourbookPlugin.getDefault().getImageRegistry();
imageRegistry.put(
Messages.Image_ToolTip_TourInfo,
TourbookPlugin.getImageDescriptor(Messages.Image_ToolTip_TourInfo));
imageRegistry.put(
Messages.Image_ToolTip_TourInfo_Hovered,
TourbookPlugin.getImageDescriptor(Messages.Image_ToolTip_TourInfo_Hovered));
_tourInfoImage = imageRegistry.get(Messages.Image_ToolTip_TourInfo);
_tourInfoImageHovered = imageRegistry.get(Messages.Image_ToolTip_TourInfo_Hovered);
_tourInfoImageSize = _tourInfoImage.getBounds();
}
示例5: getImage
import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
* getImage
*
* @param path
* @return
*/
public static Image getImage(String path)
{
ImageRegistry registry = plugin.getImageRegistry();
Image image = registry.get(path);
if (image == null)
{
ImageDescriptor id = getImageDescriptor(path);
if (id != null)
{
registry.put(path, id);
image = registry.get(path);
}
}
return image;
}
示例6: initImageRegistry
import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
private void initImageRegistry() {
final TourbookPlugin activator = TourbookPlugin.getDefault();
final ImageRegistry imageRegistry = activator.getImageRegistry();
if (imageRegistry.get(Messages.Image_POI_Anchor) == null) {
imageRegistry.put(IMG_KEY_ANCHOR, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Anchor));
imageRegistry.put(IMG_KEY_CAR, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Car));
imageRegistry.put(IMG_KEY_CART, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Cart));
imageRegistry.put(IMG_KEY_FLAG, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Flag));
imageRegistry.put(IMG_KEY_HOUSE, TourbookPlugin.getImageDescriptor(Messages.Image_POI_House));
imageRegistry.put(IMG_KEY_SOCCER, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Soccer));
imageRegistry.put(IMG_KEY_STAR, TourbookPlugin.getImageDescriptor(Messages.Image_POI_Star));
}
}
示例7: getImage
import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的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;
}
示例8: getImage
import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
* getImage
*
* @param path
* @return
*/
public static Image getImage(String path)
{
ImageRegistry registry = plugin.getImageRegistry();
Image image = registry.get(path);
if (image == null)
{
ImageDescriptor id = getImageDescriptor(path);
if (id == null)
{
return null;
}
registry.put(path, id);
image = registry.get(path);
}
return image;
}
示例9: getImage
import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
* getImage
*
* @param path
* @return
*/
public static Image getImage(String path)
{
ImageRegistry registry = PLUGIN.getImageRegistry();
Image image = registry.get(path);
if (image == null)
{
ImageDescriptor id = getImageDescriptor(path);
if (id == null)
{
return null;
}
registry.put(path, id);
image = registry.get(path);
}
return image;
}
示例10: getImage
import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
* @generated
*/
private Image getImage(String key, IElementType elementType) {
ImageRegistry imageRegistry = SimpleBPMN.diagram.part.SimpleBPMNDiagramEditorPlugin
.getInstance().getImageRegistry();
Image image = imageRegistry.get(key);
if (image == null
&& elementType != null
&& SimpleBPMN.diagram.providers.SimpleBPMNElementTypes
.isKnownElementType(elementType)) {
image = SimpleBPMN.diagram.providers.SimpleBPMNElementTypes
.getImage(elementType);
imageRegistry.put(key, image);
}
if (image == null) {
image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
imageRegistry.put(key, image);
}
return image;
}
示例11: getImage
import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
* @generated
*/
private Image getImage(String key, IElementType elementType) {
ImageRegistry imageRegistry = SmcDiagramEditorPlugin.getInstance()
.getImageRegistry();
Image image = imageRegistry.get(key);
if (image == null && elementType != null
&& SmcElementTypes.isKnownElementType(elementType)) {
image = SmcElementTypes.getImage(elementType);
imageRegistry.put(key, image);
}
if (image == null) {
image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
imageRegistry.put(key, image);
}
return image;
}
示例12: getSearchQueryIcon
import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
public Image getSearchQueryIcon()
{
final ImageRegistry registry = JiveUIPlugin.getDefault().getImageRegistry();
final String key = getPluginId() + "/" + getLocalId();
Image icon = registry.get(key);
if (icon == null)
{
try
{
final ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(
getPluginId(), getIconPath());
registry.put(key, descriptor);
icon = registry.get(key);
}
// TODO Catch the right exception and log accordingly.
// Also, handle the case when no icon is given better.
catch (final Exception e)
{
// JiveUIPlugin.log(e);
return null;
}
}
return icon;
}
示例13: getImage
import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
* This is a convenience method to get an imgIcon from a URL.
*
* @param bundle
* The target bundle
* @param sPluginRelativePath
* The URL for the imgIcon.
* @param force
* If True, still returns a dummy image if the path cannot be
* loaded.
* @return The imgIcon represented by the given URL.
*
* @see #setImageCached(boolean )
*/
public static Image getImage( Bundle bundle, String sPluginRelativePath,
boolean force )
{
ImageRegistry registry = JFaceResources.getImageRegistry( );
String imgKey = sPluginRelativePath;
if ( bundle != null )
{
imgKey = bundle.getSymbolicName( ) + ":" + sPluginRelativePath; //$NON-NLS-1$
}
Image image = registry.get( imgKey );
if ( image == null )
{
image = createImage( bundle, sPluginRelativePath, force );
if ( image != null )
{
registry.put( imgKey, image );
}
}
return image;
}
示例14: getImage
import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
* @generated
*/
private Image getImage(String key, IElementType elementType) {
ImageRegistry imageRegistry = Wc2014DiagramEditorPlugin.getInstance()
.getImageRegistry();
Image image = imageRegistry.get(key);
if (image == null && elementType != null
&& Wc2014ElementTypes.isKnownElementType(elementType)) {
image = Wc2014ElementTypes.getImage(elementType);
imageRegistry.put(key, image);
}
if (image == null) {
image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
imageRegistry.put(key, image);
}
return image;
}
示例15: getImage
import org.eclipse.jface.resource.ImageRegistry; //導入方法依賴的package包/類
/**
* @generated
*/
private Image getImage(String key, IElementType elementType) {
ImageRegistry imageRegistry = DcaseDiagramEditorPlugin.getInstance()
.getImageRegistry();
Image image = imageRegistry.get(key);
if (image == null && elementType != null
&& DcaseElementTypes.isKnownElementType(elementType)) {
image = DcaseElementTypes.getImage(elementType);
imageRegistry.put(key, image);
}
if (image == null) {
image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
imageRegistry.put(key, image);
}
return image;
}