Eclipse JDT
Release 3.8

org.eclipse.jdt.ui.text.java
Class ClasspathFixProcessor

java.lang.Object
  extended by org.eclipse.jdt.ui.text.java.ClasspathFixProcessor

public abstract class ClasspathFixProcessor
extends Object

Class to be implemented by contributors to the extension point org.eclipse.jdt.ui.classpathFixProcessors.

Since:
3.4

Nested Class Summary
static class ClasspathFixProcessor.ClasspathFixProposal
          A proposal to fix a class path issue.
 
Constructor Summary
ClasspathFixProcessor()
           
 
Method Summary
static ClasspathFixProcessor.ClasspathFixProposal[] getContributedFixImportProposals(IJavaProject project, String name, MultiStatus status)
          Evaluates all contributed proposals that can fix non-resolvable imports.
abstract  ClasspathFixProcessor.ClasspathFixProposal[] getFixImportProposals(IJavaProject project, String name)
          Returns proposal that can fix non-resolvable imports.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClasspathFixProcessor

public ClasspathFixProcessor()
Method Detail

getFixImportProposals

public abstract ClasspathFixProcessor.ClasspathFixProposal[] getFixImportProposals(IJavaProject project,
                                                                                   String name)
                                                                            throws CoreException
Returns proposal that can fix non-resolvable imports. The proposal is expected to change the class path or a classpath container so that the missing type can be resolved. A proposal should also consider to fix related types. For example, when a reference to junit.framework.TestCase is requested, it makes sense to import the full JUnit library, not just fixing the missing type.

Parameters:
project - the current project
name - the missing type to be added to the class path. The entries can be either a
  • qualified type name, like 'junit.framework.Test'
  • simple type name, like 'TestCase'
  • on demand import name, like 'org.junit.*'
Returns:
returns proposals to fix the class path so that the missing types are found. If no proposals can be offered, either null or the empty array can be returned. If null is returned, also the processors overridden by this processor are asked. If a non null result is returned, all overridden processors are skipped.
Throws:
CoreException - thrown when the creation of the proposals fails

getContributedFixImportProposals

public static ClasspathFixProcessor.ClasspathFixProposal[] getContributedFixImportProposals(IJavaProject project,
                                                                                            String name,
                                                                                            MultiStatus status)
Evaluates all contributed proposals that can fix non-resolvable imports.

Parameters:
project - the current project
name - the missing type to be added to the class path. The entries can be either a
  • qualified type name, like 'junit.framework.Test'
  • simple type name, like 'TestCase'
  • on demand import name, like 'org.junit.*'
status - a MultiStatus to collect the resulting status or null to not collect status.
Returns:
returns proposals to fix the class path so that the missing types are found.

Eclipse JDT
Release 3.8

Guidelines for using Eclipse APIs.

Copyright (c) 2000, 2013 IBM Corporation and others. All rights reserved.