public interface ProjectConfigurator
It is typically used as:
ProjectConfigurator
can
apply
Project configurators can be contributed via the
org.eclipse.ui.ide.projectConfigurators
extension point. The
lifecycle of project configurators is not specified, so implementing classes
must be stateless (i.e. their methods cannot keep any state inside or outside
this class). The framework may create multiple instances of those classes for
a single import session, or it may reuse the same instances for multiple
sessions.
Modifier and Type | Method and Description |
---|---|
boolean |
canConfigure(IProject project,
Set<IPath> ignoredPaths,
IProgressMonitor monitor)
Checks whether this configurator can contribute to the configuration of
the given project.
|
void |
configure(IProject project,
Set<IPath> ignoredPaths,
IProgressMonitor monitor)
Configures a project.
|
Set<File> |
findConfigurableLocations(File root,
IProgressMonitor monitor)
From a given
File , detects which directories can/should be
imported as projects into the workspace and configured by this
configurator. |
Set<IFolder> |
getFoldersToIgnore(IProject project,
IProgressMonitor monitor)
Returns the folders to exclude from the analysis that happens on an
IProject . |
default void |
removeDirtyDirectories(Map<File,List<ProjectConfigurator>> proposals)
Removes from the set of directories those that should not be proposed to
the user for import.
|
boolean |
shouldBeAnEclipseProject(IContainer container,
IProgressMonitor monitor)
Tells whether this configurator thinks that a given
IContainer
should be also imported as a project into the workspace. |
Set<File> findConfigurableLocations(File root, IProgressMonitor monitor)
File
, detects which directories can/should be
imported as projects into the workspace and configured by this
configurator. This first set of directories is then presented to the user
as import proposals.
This method must be stateless.
root
- the root directory on which to start the discoverymonitor
- the progress monitordefault void removeDirtyDirectories(Map<File,List<ProjectConfigurator>> proposals)
This method must be stateless.
proposals
- the existing import proposals (key is file and value is the
list of configurators that have identified the key as a
location they can configure for import). Those can be modified
and current method is expected to remove some entries from
this map.boolean shouldBeAnEclipseProject(IContainer container, IProgressMonitor monitor)
IContainer
should be also imported as a project into the workspace.
This method must be stateless (ideally static) and cannot rely on any class state.
container
- the container to analyzemonitor
- the progress monitorSet<IFolder> getFoldersToIgnore(IProject project, IProgressMonitor monitor)
IProject
.
This method must be stateless.
project
- the project to check for content to ignoremonitor
- the progress monitorboolean canConfigure(IProject project, Set<IPath> ignoredPaths, IProgressMonitor monitor)
This method must be stateless.
project
- the project to check for potential configurationignoredPaths
- paths that have to be ignored when checking whether this
configurator applies. Those will typically be nested projects
(handled separately), or output directories (bin/, target/,
...).monitor
- the progress monitortrue
iff this configurator can configure the given
projectvoid configure(IProject project, Set<IPath> ignoredPaths, IProgressMonitor monitor)
canConfigure(IProject, Set, IProgressMonitor)
returned
true
for the given project.
This method must be stateless.
project
- the project to configureignoredPaths
- paths that have to be ignored when configuring the project.
Those will typically be nested projects, output directories
(bin/, target/, ...)monitor
- the progress monitor
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.