本文整理汇总了Java中org.eclipse.jdt.launching.IRuntimeClasspathEntry.USER_CLASSES属性的典型用法代码示例。如果您正苦于以下问题:Java IRuntimeClasspathEntry.USER_CLASSES属性的具体用法?Java IRuntimeClasspathEntry.USER_CLASSES怎么用?Java IRuntimeClasspathEntry.USER_CLASSES使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.launching.IRuntimeClasspathEntry
的用法示例。
在下文中一共展示了IRuntimeClasspathEntry.USER_CLASSES属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRuntimeClasspaths
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()]);
}
示例2: getClasspath
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()]);
}
示例3: getClasspath
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( )] );
}
示例4: getRawClasspathEntries
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;
}
示例5: findIndexOfFirstUserEntry
/**
* Given a list of classpath entries, with all bootstrap entries before any user entries, returns
* the index of the first user classpath entry.
*/
private static int findIndexOfFirstUserEntry(List<IRuntimeClasspathEntry> entries) {
for (int i = 0, size = entries.size(); i < size; i++) {
if (entries.get(i).getClasspathProperty() == IRuntimeClasspathEntry.USER_CLASSES) {
return i;
}
}
return entries.size();
}
示例6: getUserClasspath
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;
}