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


Java FileLocator.find方法代码示例

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


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

示例1: createImageDescriptor

import org.eclipse.core.runtime.FileLocator; //导入方法依赖的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: init

import org.eclipse.core.runtime.FileLocator; //导入方法依赖的package包/类
/**
 * <p>
 * Creates the sole wizard page contributed by this base implementation; the
 * standard Eclipse WizardNewProjectCreationPage.
 * </p>
 * 
 * @see WizardNewProjectCreationPage#WizardNewProjectCreationPage(String)
 */
public void init(IWorkbench workbench, IStructuredSelection selection) {
	// Set default image for all wizard pages
	IPath path = new Path(eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingUIResourceBundle.NEW_PROJECT_WIZARD_PAGE_ICON);
	Bundle bundle = eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingUIPlugin.getDefault().getBundle();
	URL url = FileLocator.find(bundle, path, null);
	ImageDescriptor descriptor = ImageDescriptor.createFromURL(url);
	setDefaultPageImageDescriptor(descriptor);
	
	wizardNewProjectCreationPage = new WizardNewProjectCreationPage(pageName);
	wizardNewProjectCreationPage.setTitle(pageTitle);
	wizardNewProjectCreationPage.setDescription(pageDescription);
	wizardNewProjectCreationPage.setInitialProjectName(pageProjectName);
	
	this.addPage(wizardNewProjectCreationPage);
	setWindowTitle(eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingUIResourceBundle.NEW_PROJECT_WIZARD_WINDOW_TITLE);
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:25,代码来源:HymappingNewProjectWizard.java

示例3: init

import org.eclipse.core.runtime.FileLocator; //导入方法依赖的package包/类
/**
 * <p>
 * Creates the sole wizard page contributed by this base implementation; the
 * standard Eclipse WizardNewProjectCreationPage.
 * </p>
 * 
 * @see WizardNewProjectCreationPage#WizardNewProjectCreationPage(String)
 */
public void init(IWorkbench workbench, IStructuredSelection selection) {
	// Set default image for all wizard pages
	IPath path = new Path(eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestUIResourceBundle.NEW_PROJECT_WIZARD_PAGE_ICON);
	Bundle bundle = eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestUIPlugin.getDefault().getBundle();
	URL url = FileLocator.find(bundle, path, null);
	ImageDescriptor descriptor = ImageDescriptor.createFromURL(url);
	setDefaultPageImageDescriptor(descriptor);
	
	wizardNewProjectCreationPage = new WizardNewProjectCreationPage(pageName);
	wizardNewProjectCreationPage.setTitle(pageTitle);
	wizardNewProjectCreationPage.setDescription(pageDescription);
	wizardNewProjectCreationPage.setInitialProjectName(pageProjectName);
	
	this.addPage(wizardNewProjectCreationPage);
	setWindowTitle(eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestUIResourceBundle.NEW_PROJECT_WIZARD_WINDOW_TITLE);
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:25,代码来源:HymanifestNewProjectWizard.java

示例4: getOpenPerspectiveImage

import org.eclipse.core.runtime.FileLocator; //导入方法依赖的package包/类
/**
 * Returns the open perspective image TODO: Evaluate whether this needs to
 * ported into an Eclipse4 friendly version.
 * 
 * @return the image
 */
Image getOpenPerspectiveImage() {
	if (openPerspectiveImage == null || openPerspectiveImage.isDisposed()) {
		Bundle bundle = FrameworkUtil.getBundle(this.getClass());
		URL url = FileLocator.find(bundle, new Path(
				"icons/full/eview16/new_persp.gif"), null);
		ImageDescriptor imageDescr = ImageDescriptor.createFromURL(url);
		return imageDescr.createImage();
		// ImageDescriptor desc =
		// WorkbenchImages.getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_NEW_PAGE);
		// openPerspectiveImage = desc.createImage();
	}
	// return openPerspectiveImage;
	// TODO fill image
	return null;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:22,代码来源:PerspectiveSwitcherSwtTrim.java

示例5: getJSLintScript

import org.eclipse.core.runtime.FileLocator; //导入方法依赖的package包/类
/**
 * Lazily grab the JSLint script.
 * 
 * @return
 */
private synchronized JSLint getJSLintScript()
{
	if (JS_LINT_SCRIPT == null)
	{
		URL url = FileLocator.find(JSCorePlugin.getDefault().getBundle(), Path.fromPortableString(JSLINT_FILENAME),
				null);
		if (url != null)
		{
			try
			{
				String source = StreamUtil.readContent(url.openStream());
				if (source != null)
				{
					JS_LINT_SCRIPT = getJSLintScript(source);
				}
			}
			catch (IOException e)
			{
				IdeLog.logError(JSCorePlugin.getDefault(), Messages.JSLintValidator_ERR_FailToGetJSLint, e);
			}
		}
	}
	return JS_LINT_SCRIPT;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:30,代码来源:JSLintValidator.java

示例6: getImage

import org.eclipse.core.runtime.FileLocator; //导入方法依赖的package包/类
@Override
public Image getImage(Object element) {
   if (element instanceof IProject) {
      return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_PROJECT);
   }
   if (element instanceof IResource) {
      return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE);
   }
   if (element instanceof Route) {
      Bundle bundle = FrameworkUtil.getBundle(RouteTreeLabelProvider.class);
      URL url = FileLocator.find(bundle, new Path("icons/obj16/Route.gif"), null);
      ImageDescriptor imageDcr = ImageDescriptor.createFromURL(url);
      return imageDcr.createImage();
   }
   return null;
}
 
开发者ID:lbroudoux,项目名称:eip-designer,代码行数:17,代码来源:RouteTreeLabelProvider.java

示例7: configureLogbackInBundle

import org.eclipse.core.runtime.FileLocator; //导入方法依赖的package包/类
private void configureLogbackInBundle(Bundle bundle) throws JoranException, IOException {
	LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
	JoranConfigurator jc = new JoranConfigurator();
	jc.setContext(context);
	context.reset();
	URL logbackConfigFileUrl = FileLocator.find(bundle, new Path("logback.xml"), null);
	jc.doConfigure(logbackConfigFileUrl.openStream());
 
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:10,代码来源:Activator.java

示例8: getImage

import org.eclipse.core.runtime.FileLocator; //导入方法依赖的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

示例9: declareRegistryImage

import org.eclipse.core.runtime.FileLocator; //导入方法依赖的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

示例10: getFallbackCompilerPath

import org.eclipse.core.runtime.FileLocator; //导入方法依赖的package包/类
protected String getFallbackCompilerPath() {
	Bundle bundle = Platform.getBundle(SolidityCompilerActivator.PLUGIN_ID);
	URL url = FileLocator.find(bundle, getPath(), null);
	try {
		URL fileURL = FileLocator.toFileURL(url);
		return fileURL.getFile();
	} catch (IOException e) {
		throw new IllegalStateException(e);
	}
}
 
开发者ID:Yakindu,项目名称:solidity-ide,代码行数:11,代码来源:SolidityCompilerBase.java

示例11: registerImage

import org.eclipse.core.runtime.FileLocator; //导入方法依赖的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

示例12: launch

import org.eclipse.core.runtime.FileLocator; //导入方法依赖的package包/类
private void launch(IResource file, int line, IType type, String agentArgs, IMethod mainMethod)
		throws CoreException {
	ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
	ILaunchConfigurationType confType = manager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
	ILaunchConfigurationWorkingCopy wc = confType.newInstance(null, file.getName() + " (PandionJ)");
	wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, file.getProject().getName());
	wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, type.getFullyQualifiedName());
	wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_STOP_IN_MAIN, false);

	//		if(breakPoint != null)
	//			breakPoint.delete();
	//		if(line != -1)
	//			breakPoint = JDIDebugModel.createLineBreakpoint(file, firstType.getFullyQualifiedName(), line, -1, -1, 0, true, null);

	try {	
		Bundle bundle = Platform.getBundle(LaunchCommand.class.getPackage().getName());
		URL find = FileLocator.find(bundle, new Path("lib/agent.jar"), null);
		URL resolve = FileLocator.resolve(find);
		if(!mainMethod.exists()) {
			String path = resolve.getPath();
			if(Platform.getOS().compareTo(Platform.OS_WIN32) == 0)
				path = path.substring(1);

			String args =  "-javaagent:\"" + path + "=" + agentArgs + "\" -Djava.awt.headless=true";
			wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, args);
		}
	} catch (IOException e1) {
		e1.printStackTrace();
	}
	ILaunchConfiguration config = wc.doSave();
	Activator.launch(config);
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:33,代码来源:LaunchCommand.java

示例13: getImage

import org.eclipse.core.runtime.FileLocator; //导入方法依赖的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

示例14: getImageDescriptor

import org.eclipse.core.runtime.FileLocator; //导入方法依赖的package包/类
public ImageDescriptor getImageDescriptor(
        String relativePath) {
	//TODO E4 - the only place that requires org.eclipse.core.runtime
	URL url = FileLocator.find(Platform
	        .getBundle(IProgressConstants.PLUGIN_ID), new Path(
	        ICONS_LOCATION + relativePath), null);
	return ImageDescriptor.createFromURL(url);
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:9,代码来源:ImageTools.java

示例15: ShowFilterConfigurationDialog

import org.eclipse.core.runtime.FileLocator; //导入方法依赖的package包/类
public ShowFilterConfigurationDialog(ReportListView listView) {
    super(listView, "Show Filter Configurators", IAction.AS_PUSH_BUTTON);
    setToolTipText("Show Filter Configurators");
    Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID);
    final URL fullPathString = FileLocator.find(bundle, new Path("icons/filter.png"), null);
    setImageDescriptor(ImageDescriptor.createFromURL(fullPathString));
}
 
开发者ID:Ericsson,项目名称:CodeCheckerEclipsePlugin,代码行数:8,代码来源:ShowFilterConfigurationDialog.java


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