Package org.eclipse.jdt.ui.text.java
Class ClasspathFixProcessor
java.lang.Object
org.eclipse.jdt.ui.text.java.ClasspathFixProcessor
Class to be implemented by contributors to the extension point
org.eclipse.jdt.ui.classpathFixProcessors
.- Since:
- 3.4
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A proposal to fix a class path issue. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetContributedFixImportProposals
(IJavaProject project, String name, org.eclipse.core.runtime.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.
-
Constructor Details
-
ClasspathFixProcessor
public ClasspathFixProcessor()
-
-
Method Details
-
getFixImportProposals
public abstract ClasspathFixProcessor.ClasspathFixProposal[] getFixImportProposals(IJavaProject project, String name) throws org.eclipse.core.runtime.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 tojunit.framework.TestCase
is requested, it makes sense to import the full JUnit library, not just fixing the missing type.- Parameters:
project
- the current projectname
- 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. Ifnull
is returned, also the processors overridden by this processor are asked. If a non null result is returned, all overridden processors are skipped. - Throws:
org.eclipse.core.runtime.CoreException
- thrown when the creation of the proposals fails
-
getContributedFixImportProposals
public static ClasspathFixProcessor.ClasspathFixProposal[] getContributedFixImportProposals(IJavaProject project, String name, org.eclipse.core.runtime.MultiStatus status) Evaluates all contributed proposals that can fix non-resolvable imports.- Parameters:
project
- the current projectname
- 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
- aMultiStatus
to collect the resulting status ornull
to not collect status.- Returns:
- returns proposals to fix the class path so that the missing types are found.
-