当前位置: 首页>>代码示例>>Java>>正文


Java AbstractUIPlugin.imageDescriptorFromPlugin方法代码示例

本文整理汇总了Java中org.eclipse.ui.plugin.AbstractUIPlugin.imageDescriptorFromPlugin方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractUIPlugin.imageDescriptorFromPlugin方法的具体用法?Java AbstractUIPlugin.imageDescriptorFromPlugin怎么用?Java AbstractUIPlugin.imageDescriptorFromPlugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ui.plugin.AbstractUIPlugin的用法示例。


在下文中一共展示了AbstractUIPlugin.imageDescriptorFromPlugin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SVNPluginAction

import org.eclipse.ui.plugin.AbstractUIPlugin; //导入方法依赖的package包/类
public SVNPluginAction(IConfigurationElement element) {
	super(element.getAttribute(ATT_LABEL), getStyleFromElement(element));
	this.element = element;
	pluginId = element.getContributor().getName();
	
	createDelegate();
	
	setId(element.getAttribute(ATT_ID));
	setToolTipText(element.getAttribute(ATT_TOOLTIP));
	
	if ((getStyle() == AS_RADIO_BUTTON) || (getStyle() == AS_CHECK_BOX)) {
		String bool = element.getAttribute(ATT_STATE);
		setChecked("true".equals(bool));	//$NON-NLS-1$
	}
	
	String iconPath = element.getAttribute(ATT_ICON);
	if ((iconPath != null) && (iconPath.length() > 0)) {
		ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, iconPath);
		if (desc != null) {
			setImageDescriptor(desc);
		}
	}
	
	 // Give delegate a chance to adjust enable state
       selectionChanged(StructuredSelection.EMPTY);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:27,代码来源:SVNPluginAction.java

示例2: descriptor

import org.eclipse.ui.plugin.AbstractUIPlugin; //导入方法依赖的package包/类
public ImageDescriptor descriptor() {
	if (descriptor == null) {
		final Image image = GamaIcons.getInstance().getImageInCache(code);
		if (image != null) {
			descriptor = ImageDescriptor.createFromImage(image);
		} else {
			descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(plugin, GamaIcons.DEFAULT_PATH + path + ".png");
		}

		if (descriptor == null) {
			System.out.println(
					"ERROR: Cannot find icon " + GamaIcons.DEFAULT_PATH + path + ".png in plugin: " + plugin);
			descriptor = ImageDescriptor.getMissingImageDescriptor();
		}
	}
	return descriptor;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:18,代码来源:GamaIcon.java

示例3: getImageDescriptor

import org.eclipse.ui.plugin.AbstractUIPlugin; //导入方法依赖的package包/类
/**
 * Returns an ImageDescriptor for a given icon name.
 * <p/>
 * Callers should not dispose it.
 *
 * @param osName The leaf name, without the extension, of an existing icon in the
 *        editor's "icons" directory. If it doesn't exists, a default icon will be
 *        generated automatically based on the name.
 * @param color The color of the text in the automatically generated icons.
 *        one of COLOR_DEFAULT, COLOR_RED, COLOR_BLUE or COLOR_RED.
 * @param shape The shape of the icon in the automatically generated icons,
 *        one of SHAPE_DEFAULT, SHAPE_CIRCLE or SHAPE_RECT.
 */
public ImageDescriptor getImageDescriptor(String osName, int color, int shape) {
    String key = Character.toString((char) shape) + Integer.toString(color) + osName;
    ImageDescriptor id = mImageDescMap.get(key);
    if (id == null && !mImageDescMap.containsKey(key)) {
        id = AbstractUIPlugin.imageDescriptorFromPlugin(
        		AguiPlugin.PLUGIN_ID,
                String.format("/icons/%1$s.png", osName)); //$NON-NLS-1$

        if (id == null) {
            id = new LetterImageDescriptor(osName.charAt(0), color, shape);
        }

        // Note that we store null references in the icon map, to avoid looking them
        // up every time. If it didn't exist once, it will not exist later.
        mImageDescMap.put(key, id);
    }
    return id;
}
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:32,代码来源:IconFactory.java

示例4: getImage

import org.eclipse.ui.plugin.AbstractUIPlugin; //导入方法依赖的package包/类
private static Image getImage(String bundleSymbolicName, String path, ImageDescriptor id)
{
	String computedName = bundleSymbolicName + path;
	Image image = JFaceResources.getImage(computedName);
	if (image != null)
	{
		return image;
	}

	if (id == null)
	{
		id = AbstractUIPlugin.imageDescriptorFromPlugin(bundleSymbolicName, path);
	}

	if (id != null)
	{
		JFaceResources.getImageRegistry().put(computedName, id);
		return JFaceResources.getImage(computedName);
	}
	return null;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:22,代码来源:SWTUtils.java

示例5: loadImage

import org.eclipse.ui.plugin.AbstractUIPlugin; //导入方法依赖的package包/类
/**
 * Loads image in Image Registry is not available in it
 *
 * @param pluginId
 *            : Id of the plugin containing thie image
 * @param imageFilePath
 *            : image File Path in plugin
 * @return Image if loaded
 */
private synchronized Image loadImage(String pluginId, String imageFilePath) {
	String id = pluginId + ":" + imageFilePath;
	Image image = Activator.getDefault().getImageRegistry().get(id);
	if (image != null)
		return image;
	ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, imageFilePath);
	if (imageDescriptor != null) {
		image = imageDescriptor.createImage();
		Activator.getDefault().getImageRegistry().put(pluginId + ":" + imageFilePath, image);
	}
	return image;
}
 
开发者ID:awltech,项目名称:eclipse-asciidoctools,代码行数:22,代码来源:Activator.java

示例6: getImageDescriptor

import org.eclipse.ui.plugin.AbstractUIPlugin; //导入方法依赖的package包/类
public static ImageDescriptor getImageDescriptor(
    final IConfigurationElement configElement,
    final String attributeName,
    final String extensionPointName) {
    final String s = configElement.getAttribute(attributeName);
    if (s == null) {
        return null;
    }

    final String contributor = getContributorFor(configElement);

    return AbstractUIPlugin.imageDescriptorFromPlugin(contributor, s);
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:14,代码来源:Utils.java

示例7: getIcon

import org.eclipse.ui.plugin.AbstractUIPlugin; //导入方法依赖的package包/类
public ImageDescriptor getIcon() {
    if (icon != null) {
        return icon;
    }

    final String iconPath = configElement.getAttribute(ATT_ICON);
    if (iconPath == null) {
        return null;
    }

    icon = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, iconPath);
    return icon;
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:14,代码来源:CreateBuildConfigurationWizardNode.java

示例8: getImage

import org.eclipse.ui.plugin.AbstractUIPlugin; //导入方法依赖的package包/类
@Override
protected Image getImage(Template template) {
	ImageRegistry registry = FtcPlugin.getDefault().getImageRegistry();
	Image image = registry.get(TEMPLATE_IMAGE);
	if (image == null) {
		ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(PluginConst.PLUGIN_NAME, TEMPLATE_IMAGE);
		registry.put(TEMPLATE_IMAGE, desc);
		image = registry.get(TEMPLATE_IMAGE);

	}
	return image;
}
 
开发者ID:curiosag,项目名称:ftc,代码行数:13,代码来源:FtcCompletionProcessor.java

示例9: setInitializationData

import org.eclipse.ui.plugin.AbstractUIPlugin; //导入方法依赖的package包/类
@Override
public void setInitializationData(IConfigurationElement config,
		String propertyName, Object data) throws CoreException {
	String iconResource = config.getAttribute("icon");
	this.imageDescriptor = iconResource == null ? null : AbstractUIPlugin
			.imageDescriptorFromPlugin(config.getDeclaringExtension().getContributor().getName(), iconResource);
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:8,代码来源:AbstractImportTeamProject.java

示例10: RemoteBookmarkStoreDescriptor

import org.eclipse.ui.plugin.AbstractUIPlugin; //导入方法依赖的package包/类
public RemoteBookmarkStoreDescriptor(String id,
		String label, String iconResource, String iconOverlayResource, String bundleSymbolicName) {
	this.id = id;
	this.label = label;
	this.imageDescriptor = iconResource == null ? null : AbstractUIPlugin
			.imageDescriptorFromPlugin(bundleSymbolicName, iconResource);
	this.imageOverlayDescriptor = iconOverlayResource == null ? null : AbstractUIPlugin
			.imageDescriptorFromPlugin(bundleSymbolicName, iconOverlayResource);
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:10,代码来源:RemoteBookmarkStoreDescriptor.java

示例11: getWizardBanner

import org.eclipse.ui.plugin.AbstractUIPlugin; //导入方法依赖的package包/类
public static ImageDescriptor getWizardBanner(String serverTypeId) {
	IConfigurationElement config = CloudFoundryBrandingExtensionPoint.getConfigurationElement(serverTypeId);
	String wizBanner = CloudFoundryBrandingUIExtensionPoint.getWizardBannerPath(serverTypeId);
	if (config != null && wizBanner != null && wizBanner.trim().length() > 0) {
		String bundle = config.getContributor().getName();
		return AbstractUIPlugin.imageDescriptorFromPlugin(bundle, wizBanner);
	}
	return null;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:10,代码来源:CloudFoundryImages.java

示例12: createImageDescriptor

import org.eclipse.ui.plugin.AbstractUIPlugin; //导入方法依赖的package包/类
/**
 * Creates an image descriptor from the given imageFilePath and adds the
 * image descriptor to the image descriptor registry. If an image descriptor
 * could not be created, the default "missing" image descriptor is returned
 * but not added to the image descriptor registry.
 * 
 * @param imageFilePath
 * @return ImageDescriptor image descriptor for imageFilePath or default
 *         "missing" image descriptor if resource could not be found
 */
private ImageDescriptor createImageDescriptor(String imageFilePath) {
	ImageDescriptor imageDescriptor = AbstractUIPlugin
			.imageDescriptorFromPlugin(PLUGINID, imageFilePath);
	if (imageDescriptor != null) {
		getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
	} else {
		imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
	}

	return imageDescriptor;
}
 
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:22,代码来源:NPMEditorPluginImageHelper.java

示例13: findImageDescriptor

import org.eclipse.ui.plugin.AbstractUIPlugin; //导入方法依赖的package包/类
/**
 * Respects images residing in any plug-in. If path is relative,
 * then this bundle is looked up for the image, otherwise, for absolute 
 * path, first segment is taken as id of plug-in with image
 *
 * @generated
 * @param path the path to image, either absolute (with plug-in id as first segment), or relative for bundled images
 * @return the image descriptor
 */
public static ImageDescriptor findImageDescriptor(String path) {
	final IPath p = new Path(path);
	if (p.isAbsolute() && p.segmentCount() > 1) {
		return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p
				.removeFirstSegments(1).makeAbsolute().toString());
	} else {
		return getBundledImageDescriptor(p.makeAbsolute().toString());
	}
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:19,代码来源:StatemachineDiagramEditorPlugin.java

示例14: loadIcon

import org.eclipse.ui.plugin.AbstractUIPlugin; //导入方法依赖的package包/类
private static ImageDescriptor loadIcon(String name)
{
  try
  {
    if (!PlatformUI.isWorkbenchRunning())
    {
      return NO_IMAGE;
    }
  } catch (Throwable ex)
  {
    return NO_IMAGE;
  }
  return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, "icons/"+name);
}
 
开发者ID:ivy-supplements,项目名称:bpm-beans,代码行数:15,代码来源:RuleBeansIcons.java

示例15: RemoveGroupAction

import org.eclipse.ui.plugin.AbstractUIPlugin; //导入方法依赖的package包/类
public RemoveGroupAction(final DisplayEditor editor, final GroupWidget group)
{
    super(Messages.RemoveGroup,
          AbstractUIPlugin.imageDescriptorFromPlugin(ModelPlugin.ID, "icons/group.png"));
    this.editor = editor;
    this.group = group;
}
 
开发者ID:kasemir,项目名称:org.csstudio.display.builder,代码行数:8,代码来源:RemoveGroupAction.java


注:本文中的org.eclipse.ui.plugin.AbstractUIPlugin.imageDescriptorFromPlugin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。