當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。