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


Java JavaRuntime.resolveRuntimeClasspath方法代码示例

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


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

示例1: getRuntimeClasspaths

import org.eclipse.jdt.launching.JavaRuntime; //导入方法依赖的package包/类
protected IPath[] getRuntimeClasspaths(ILaunchConfiguration configuration)
		throws CoreException {
	IRuntimeClasspathEntry[] entries = JavaRuntime
			.computeUnresolvedRuntimeClasspath(configuration);
	entries = JavaRuntime.resolveRuntimeClasspath(entries, configuration);

	ArrayList<IPath> userEntries = new ArrayList<IPath>(entries.length);
	for (int i = 0; i < entries.length; i++) {
		if (entries[i].getClasspathProperty() == IRuntimeClasspathEntry.USER_CLASSES) {

			String location = entries[i].getLocation();
			if (location != null) {
				IPath entry = Path.fromOSString(location);
				if (!userEntries.contains(entry)) {
					userEntries.add(entry);
				}
			}
		}
	}
	return userEntries.toArray(new IPath[userEntries.size()]);
}
 
开发者ID:eclipse,项目名称:cft,代码行数:22,代码来源:JavaPackageFragmentRootHandler.java

示例2: getClasspath

import org.eclipse.jdt.launching.JavaRuntime; //导入方法依赖的package包/类
private static IPath[] getClasspath(ILaunchConfiguration configuration) throws CoreException {
	IRuntimeClasspathEntry[] entries= JavaRuntime.computeUnresolvedRuntimeClasspath(configuration);
	entries= JavaRuntime.resolveRuntimeClasspath(entries, configuration);

	ArrayList<IPath> userEntries= new ArrayList<IPath>(entries.length);
	for (int i= 0; i < entries.length; i++) {
		if (entries[i].getClasspathProperty() == IRuntimeClasspathEntry.USER_CLASSES) {

			String location= entries[i].getLocation();
			if (location != null) {
				IPath entry= Path.fromOSString(location);
				if (!userEntries.contains(entry)) {
					userEntries.add(entry);
				}
			}
		}
	}
	return userEntries.toArray(new IPath[userEntries.size()]);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:FatJarPackageWizardPage.java

示例3: getClasspath

import org.eclipse.jdt.launching.JavaRuntime; //导入方法依赖的package包/类
public String[] getClasspath( ILaunchConfiguration configuration )
		throws CoreException
{
	ScriptDebugClasspathProvider provider = new ScriptDebugClasspathProvider( );
	IRuntimeClasspathEntry[] entries = provider.computeExtraBootClasspath( configuration );
	entries = JavaRuntime.resolveRuntimeClasspath( entries, configuration );
	List userEntries = new ArrayList( entries.length );
	Set set = new HashSet( entries.length );
	for ( int i = 0; i < entries.length; i++ )
	{
		if ( entries[i].getClasspathProperty( ) == IRuntimeClasspathEntry.USER_CLASSES )
		{
			String location = entries[i].getLocation( );
			if ( location != null )
			{
				if ( !set.contains( location ) )
				{
					userEntries.add( location );
					set.add( location );
				}
			}
		}
	}

	return (String[]) userEntries.toArray( new String[userEntries.size( )] );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:27,代码来源:ReportStandardAppLaunchDelegate.java

示例4: getRawClasspathEntries

import org.eclipse.jdt.launching.JavaRuntime; //导入方法依赖的package包/类
private IClasspathEntry[] getRawClasspathEntries() {

        IClasspathEntry[] result = null;
        ILaunchConfiguration lc = getLaunchConfig();
        if (lc != null) {
            try {
                Vector cpeList = new Vector();
                // JavaRuntime.computeUnresolvedRuntimeClasspath(lc);
                IRuntimeClasspathProvider rcp = JavaRuntime
                        .getClasspathProvider(lc);
                if (rcp != null) {
                    IRuntimeClasspathEntry[] rawRcpes = rcp
                            .computeUnresolvedClasspath(lc);
                    IRuntimeClasspathEntry[] entries = JavaRuntime
                            .resolveRuntimeClasspath(rawRcpes, lc);
                    List userEntries = new ArrayList(entries.length);
                    for (int i = 0; i < entries.length; i++) {
                        if (entries[i].getClasspathProperty() == IRuntimeClasspathEntry.USER_CLASSES) {
                            String location = entries[i].getLocation();
                            if (location != null) {
                                System.out.println("cpe[" + i + "]='"
                                        + entries[i].getLocation() + "'");
                                IClasspathEntry cpe = entries[i]
                                        .getClasspathEntry();
                                if (cpe != null) {
                                    cpeList.add(cpe);
                                }
                            }
                        }
                    }
                }
                result = (IClasspathEntry[]) cpeList
                        .toArray(new IClasspathEntry[cpeList.size()]);
            } catch (CoreException e) {
                e.printStackTrace();
            }
        }
        return result;
    }
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:40,代码来源:JProjectConfiguration.java

示例5: getUserClasspath

import org.eclipse.jdt.launching.JavaRuntime; //导入方法依赖的package包/类
private static String[] getUserClasspath( ILaunchConfiguration configuration )
{
	try
	{
		ScriptDebugClasspathProvider provider = new ScriptDebugClasspathProvider( );
		IRuntimeClasspathEntry[] entries = provider.computeUserClasspath( configuration );
		entries = JavaRuntime.resolveRuntimeClasspath( entries,
				configuration );

		List userEntries = new ArrayList( );

		Set set = new HashSet( entries.length );

		for ( int i = 0; i < entries.length; i++ )
		{
			if ( entries[i].getClasspathProperty( ) == IRuntimeClasspathEntry.USER_CLASSES )
			{
				String location = entries[i].getLocation( );
				if ( location != null )
				{
					if ( !set.contains( location ) )
					{
						userEntries.add( location );
						set.add( location );
					}
				}
			}
		}

		return (String[]) userEntries.toArray( new String[userEntries.size( )] );
	}
	catch ( CoreException e )
	{
		e.printStackTrace( );
	}

	return null;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:39,代码来源:ReportLaunchHelper.java


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