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