|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.modisco.infra.discovery.core.AbstractDiscoverer<T>
T
- the type of source of the discoverypublic abstract class AbstractDiscoverer<T>
A base implementation of Discoverer, which proposes to centralize some parameters properties and behaviors :
Constructor Summary | |
---|---|
AbstractDiscoverer()
|
Method Summary | |
---|---|
void |
discoverElement(T source,
IProgressMonitor monitor)
Generic method to launch a discovery from a source element. |
static boolean |
isAFolder(java.lang.Object source)
Utility service for usual isApplicableTo test. |
static boolean |
isAJavaProject(java.lang.Object source)
Utility service for usual isApplicableTo test. |
static boolean |
isAnIFileWithExtension(java.lang.Object source,
java.lang.String fileExtension)
Utility service for usual isApplicableTo test. |
static boolean |
isAProject(java.lang.Object source)
Utility service for usual isApplicableTo test. |
void |
setRefreshSourceBeforeDiscovery(boolean value)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.modisco.infra.discovery.core.IDiscoverer |
---|
isApplicableTo |
Constructor Detail |
---|
public AbstractDiscoverer()
Method Detail |
---|
@Parameter(name="REFRESH_SOURCE_BEFORE", description="Whether to refresh the source at the beginning of the discovery. Refresh behavior depends on the Discoverer implementation. The standard refresh behavior is to test if the source is an org.eclipse.core.resources.IResource and call its refreshLocal() method.") public void setRefreshSourceBeforeDiscovery(boolean value)
public void discoverElement(T source, IProgressMonitor monitor) throws DiscoveryException
IDiscoverer
Additional discovery parameters values (input or output) should be
managed using fields and methods annotated with a Parameter
annotation. See the class AbstractDiscoverer
as an example.
discoverElement
in interface IDiscoverer<T>
source
- the selected object.monitor
- a progress monitor used to report progress and respond to
cancellation. May be a NullProgressMonitor
if no
monitor is to be used.
DiscoveryException
- abnormal discovery process terminationpublic static boolean isAJavaProject(java.lang.Object source)
IJavaProject
or IProject
with java nature.public static boolean isAFolder(java.lang.Object source)
IFolder
public static boolean isAProject(java.lang.Object source)
IProject
.public static boolean isAnIFileWithExtension(java.lang.Object source, java.lang.String fileExtension)
source
- fileExtension
- the file extension to test. May be null
to test
if there is no extension. May be empty to test if a file name
ends with a dot character.
true
if the source is an instance of IFile
with the given extension.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |