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


Java ImageDescriptor.createFromURL方法代码示例

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


在下文中一共展示了ImageDescriptor.createFromURL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
 
开发者ID:de-jcup,项目名称:eclipse-batch-editor,代码行数:23,代码来源:EclipseUtil.java

示例2: createIcons

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
private void createIcons() {
	icons   = new HashMap<String, Image>(7);

	final IConfigurationElement[] eles = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.scanning.api.generator");
	for (IConfigurationElement e : eles) {
		final String     identity = e.getAttribute("id");

		final String icon = e.getAttribute("icon");
		if (icon !=null) {
			final String   cont  = e.getContributor().getName();
			final Bundle   bundle= Platform.getBundle(cont);
			final URL      entry = bundle.getEntry(icon);
			final ImageDescriptor des = ImageDescriptor.createFromURL(entry);
			icons.put(identity, des.createImage());
		}

	}
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:19,代码来源:GeneratorDescriptor.java

示例3: fillContextMenu

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
@SuppressWarnings("restriction")
@Override
public void fillContextMenu(IMenuManager menu) {
	super.fillContextMenu(menu);

	ActionContributionItem pasteContribution = getPasteContribution(menu.getItems());
	menu.remove(pasteContribution);
	IAction pasteAction = new Action(PASTE_ACTION_TEXT) {
		@Override
		public void run() {
			IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench()
					.getService(IHandlerService.class);
			try {
				JobCopyParticipant.setCopiedFileList(new ArrayList<>());
				handlerService.executeCommand(PASTE_COMMAND_ID, null);
			} catch (Exception exception) {
				logger.warn("Error while pasting job files :: {}",exception.getMessage());
			}
		}
	};
	pasteAction.setAccelerator(SWT.MOD1 | 'v');
	Bundle bundle = Platform.getBundle(MENU_PLUGIN_NAME);
	URL imagePath = BundleUtility.find(bundle,ImagePathConstant.PASTE_IMAGE_PATH.getValue());
	ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(imagePath);
	pasteAction.setImageDescriptor(imageDescriptor);
	menu.insertAfter(COPY_ACTION_ID, pasteAction);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:28,代码来源:CustomEditActionProvider.java

示例4: getComponentToAddInContainer

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
private CombinedTemplateCreationEntry getComponentToAddInContainer(ELTGraphicalEditor eLEtlGraphicalEditor,
		Component componentConfig) {
	Class<?> clazz = DynamicClassProcessor.INSTANCE.createClass(componentConfig);

	CombinedTemplateCreationEntry component = new CombinedTemplateCreationEntry(componentConfig.getNameInPalette(),
			null, clazz, new SimpleFactory(clazz),
			ImageDescriptor.createFromURL(eLEtlGraphicalEditor.prepareIconPathURL(componentConfig
					.getPaletteIconPath())), ImageDescriptor.createFromURL(eLEtlGraphicalEditor
					.prepareIconPathURL(componentConfig.getPaletteIconPath())));
	return component;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:12,代码来源:CustomPaletteViewer.java

示例5: createPaletteContainer

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
/**
 * Creates the palette container.
 * 
 * @param CategoryName
 *            the category name
 * @return the palette drawer
 */
public PaletteDrawer createPaletteContainer(String CategoryName) {
	String name = CategoryName.substring(0, 1).toUpperCase()
			+ CategoryName.substring(1).toLowerCase();
	PaletteDrawer p = new PaletteDrawer(name, ImageDescriptor.createFromURL(prepareIconPathURL("/icons/"+ name + "_categoryIcon.png")));
	p.setInitialState(PaletteDrawer.INITIAL_STATE_CLOSED);
	return p;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:15,代码来源:ELTGraphicalEditor.java

示例6: createShapesDrawer

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
private void createShapesDrawer(PaletteRoot palette) throws RuntimeException, SAXException, IOException {
	Map<String, PaletteDrawer> categoryPaletteConatiner = new HashMap<>();
	for (CategoryType category : CategoryType.values()) {
		if(category.name().equalsIgnoreCase(Constants.UNKNOWN_COMPONENT_CATEGORY)){
			continue;
		}				
		PaletteDrawer p = createPaletteContainer(category.name());
		addContainerToPalette(palette, p);
		categoryPaletteConatiner.put(category.name(), p);
	}
	List<Component> componentsConfig = XMLConfigUtil.INSTANCE.getComponentConfig();
	
	//To show the components in sorted order in palette
	Collections.sort(componentsConfig, new Comparator<Component>() {
		public int compare(Component component1, Component component2) {
			return 	component1.getNameInPalette().compareToIgnoreCase(component2.getNameInPalette());			
		};
	});
			
	for (Component componentConfig : componentsConfig) {
		Class<?> clazz = DynamicClassProcessor.INSTANCE.createClass(componentConfig);

		if(componentConfig.getName().equalsIgnoreCase(Constants.UNKNOWN_COMPONENT)){
			continue;
		}

		CombinedTemplateCreationEntry component = new CombinedTemplateCreationEntry(
				componentConfig.getNameInPalette(), null, clazz,
				new SimpleFactory(clazz),
				ImageDescriptor.createFromURL(
						prepareIconPathURL(componentConfig.getPaletteIconPath())),
						ImageDescriptor.createFromURL(
								prepareIconPathURL(componentConfig.getPaletteIconPath())));
		categoryPaletteConatiner.get(componentConfig.getCategory().name()).add(component);
	}

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:38,代码来源:ELTGraphicalEditor.java

示例7: getImage

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
private Image getImage() {
	String path = "icons/ksp.gif";
	Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID);
	URL url = FileLocator.find(bundle, new Path(path), null);
	ImageDescriptor imageDesc = ImageDescriptor.createFromURL(url);
	return imageDesc.createImage();
}
 
开发者ID:sebez,项目名称:vertigo-chroma-kspplugin,代码行数:8,代码来源:AboutDialog.java

示例8: 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);
}
 
开发者ID:angelozerr,项目名称:ec4e,代码行数:13,代码来源:EditorConfigImages.java

示例9: registerImage

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
private Image registerImage(String key) {
	try {
		IPath path = new Path("images/" + key); //$NON-NLS-1$
		URL url = FileLocator.find(this.getBundle(), path, null);
		if (url != null) {
			ImageDescriptor desc = ImageDescriptor.createFromURL(url);
			getImageRegistry().put(key, desc);
			return getImageRegistry().get(key);
		}
	} catch (Exception e) {
		// ignored
	}
	return null;
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:15,代码来源:Activator.java

示例10: getImage

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
/**
 * Get image contained in the 'images' folder of the plugin
 */
static Image getImage(String name) {
	Bundle bundle = Platform.getBundle(PandionJConstants.PLUGIN_ID);
	URL imagePath = FileLocator.find(bundle, new Path(PandionJConstants.IMAGE_FOLDER + "/" + name), null);
	ImageDescriptor imageDesc = ImageDescriptor.createFromURL(imagePath);
	return imageDesc.createImage();
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:10,代码来源:PandionJUI.java

示例11: getImageDescriptor

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
@Override
public ImageDescriptor getImageDescriptor ()
{
    return ImageDescriptor.createFromURL ( Activator.getDefault ().getBundle ().getEntry ( "/icons/delete.gif" ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:6,代码来源:ConfigurationFormToolkit.java

示例12: createConnectionActions

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
private void createConnectionActions() {

		connectors.clear();

		String lastId = Activator.getDefault().getPreferenceStore().getString(DevicePreferenceConstants.STREAM_ID);


		final IConfigurationElement[] eles = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.scanning.api.stream");
		for (IConfigurationElement e : eles) {

			CheckableActionGroup group = new CheckableActionGroup();
			try {
				final IStreamConnection<ILazyDataset> connection = (IStreamConnection<ILazyDataset>)e.createExecutableExtension("stream");
				connectors.add(connection);
				connection.setId(e.getAttribute("id"));
				connection.setLabel(e.getAttribute("label"));

				final String iconPath = e.getAttribute("icon");
				ImageDescriptor icon=null;
			if (iconPath!=null) {
				final String   id    = e.getContributor().getName();
				final Bundle   bundle= Platform.getBundle(id);
				final URL      entry = bundle.getEntry(iconPath);
				icon = ImageDescriptor.createFromURL(entry);
			}

			final MenuAction menu = new MenuAction(connection.getLabel());
			final IAction connect = new Action(connection.getLabel(), IAction.AS_CHECK_BOX) {
				@Override
					public void run() {
					connect(connection);
				}
			};
			connect.setImageDescriptor(icon);
			connect.setChecked(lastId!=null && lastId.equals(connection.getId()));
			group.add(connect);
			menu.add(connect);
			menu.setSelectedAction(connect);

			final IAction configure = new Action("Configure...") {
				@Override
					public void run() {
					configure(connection);
				}
			};
			menu.add(configure);

			getViewSite().getActionBars().getToolBarManager().add(menu);

			} catch (Exception ne) {
				logger.error("Problem creating stream connection for "+e, ne);
			}

			getViewSite().getActionBars().getToolBarManager().add(new Separator());
		}

	}
 
开发者ID:eclipse,项目名称:scanning,代码行数:58,代码来源:StreamView.java

示例13: createImageDescriptor

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
private ImageDescriptor createImageDescriptor() {
	Bundle bundle = FrameworkUtil.getBundle(ViewLabelProvider.class);
	URL url = FileLocator.find(bundle, new Path("icons/folder.png"), null);
	return ImageDescriptor.createFromURL(url);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:6,代码来源:ModelSearchResultPage.java

示例14: DepcyGraphView

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
public DepcyGraphView() {
    projectAction = new ProjectAction(Messages.DepcyGraphView_project, ImageDescriptor.createFromURL(
            Activator.getContext().getBundle().getResource(FILE.ICONBALLBLUE)));
    remoteAction = new ToggleAction(Messages.DepcyGraphView_remote, ImageDescriptor.createFromURL(
            Activator.getContext().getBundle().getResource(FILE.ICONBALLGREEN)));
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:7,代码来源:DepcyGraphView.java

示例15: getCreateImage

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
private void getCreateImage(String path) {
	URL url = ModelActivator.getDefault().getBundle().getResource(path);
	ImageDescriptor imageDesc = ImageDescriptor.createFromURL(url);
	icon = imageDesc.createImage();
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:6,代码来源:Node.java


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