Faceted Project Framework
Version 1.3

org.eclipse.wst.common.project.facet.core
Interface IFacetedProjectBase

All Known Subinterfaces:
IFacetedProject, IFacetedProjectWorkingCopy

public interface IFacetedProjectBase

This interface is used for manipulating the set of facets installed on a project. Use ProjectFacetsManager.create(IProject) to get an instance of this interface.

Author:
Konstantin Komissarchik

Field Summary
static int PROBLEM_OTHER
           
static int PROBLEM_PROJECT_NAME
           
 
Method Summary
 void addListener(IFacetedProjectListener listener, IFacetedProjectEvent.Type... types)
          Adds a faceted project listener that will be notified when the selected events in the faceted project life cycle occur.
 Set<IProjectFacet> getFixedProjectFacets()
          Returns the set of fixed project facets for this project.
 IRuntime getPrimaryRuntime()
          Returns the primary target runtime for this project.
 IProject getProject()
           
 Set<IProjectFacetVersion> getProjectFacets()
          Returns the set of project facets currently installed on this project.
 IProjectFacetVersion getProjectFacetVersion(IProjectFacet f)
           
 Set<IRuntime> getTargetedRuntimes()
          Returns the set of all runtimes that this project is targeting.
 boolean hasProjectFacet(IProjectFacet f)
          Determines whether any version of the specified project facet is installed on this project.
 boolean hasProjectFacet(IProjectFacetVersion fv)
          Determines whether the specfied project facet version is installed on this project.
 boolean isFixedProjectFacet(IProjectFacet facet)
           
 boolean isTargetable(IRuntime runtime)
          Determines whether this project (in it's current state) can be targeted to the provided runtime.
 boolean isTargeted(IRuntime runtime)
          Checks whether this project currently targets the specified runtime.
 void removeListener(IFacetedProjectListener listener)
          Removes the faceted project listener that was previously registered using the addListener(IFacetedProjectListener,IFacetedProjectEvent.Type[]) method.
 IStatus validate()
          Performs a variety of consistency checks over the faceted project.
 IStatus validate(IProgressMonitor monitor)
          Performs a variety of consistency checks over the faceted project.
 

Field Detail

PROBLEM_PROJECT_NAME

static final int PROBLEM_PROJECT_NAME
See Also:
Constant Field Values

PROBLEM_OTHER

static final int PROBLEM_OTHER
See Also:
Constant Field Values
Method Detail

getProject

IProject getProject()

getFixedProjectFacets

Set<IProjectFacet> getFixedProjectFacets()
Returns the set of fixed project facets for this project. Fixed facets cannot be uninstalled, but the installed version can be changed.

Returns:
the set of fixed project facets for this project

isFixedProjectFacet

boolean isFixedProjectFacet(IProjectFacet facet)

getProjectFacets

Set<IProjectFacetVersion> getProjectFacets()
Returns the set of project facets currently installed on this project.

Returns:
the set of project facets currently installed on this project

getProjectFacetVersion

IProjectFacetVersion getProjectFacetVersion(IProjectFacet f)

hasProjectFacet

boolean hasProjectFacet(IProjectFacet f)
Determines whether any version of the specified project facet is installed on this project.

Parameters:
f - the project facet descriptor
Returns:
true if any version of the specified project facet is installed on this project, false otherwise

hasProjectFacet

boolean hasProjectFacet(IProjectFacetVersion fv)
Determines whether the specfied project facet version is installed on this project.

Parameters:
fv - the project facet version descriptor
Returns:
true if the specified project facet version is installed on this project, false otherwise

isTargetable

boolean isTargetable(IRuntime runtime)
Determines whether this project (in it's current state) can be targeted to the provided runtime. This determination is made by looking at the facets that are currently installed and checking them against the set of facets known to be supported by the provided runtime.

Parameters:
runtime - the runtime to check
Returns:
true if this project can target the provided runtime and false otherwise
Since:
WTP 2.0

isTargeted

boolean isTargeted(IRuntime runtime)
Checks whether this project currently targets the specified runtime.

Parameters:
runtime - the runtime to check
Returns:
true if this project currently targets the specified runtime and false otherwise
Since:
WTP 2.0

getTargetedRuntimes

Set<IRuntime> getTargetedRuntimes()

Returns the set of all runtimes that this project is targeting. When a project targets a runtime, the set of facets that can be installed is limited to those supported by that runtime. When a project targets multiple runtimes, the set of applicable facets is limited to those supported by all targeted runtimes.

Returns:
the set of targeted runtimes

getPrimaryRuntime

IRuntime getPrimaryRuntime()

Returns the primary target runtime for this project. There is always a primary runtime unless the list of target runtimes is empty.

Returns:
the primary runtime, or null

validate

IStatus validate(IProgressMonitor monitor)
Performs a variety of consistency checks over the faceted project. The result of the validation is returned as a status object.

Parameters:
monitor - a progress monitor, or null if progress reporting and cancellation are not desired
Returns:
a status object with code IStatus.OK if this faceted project is valid, otherwise a status object indicating what is wrong with it

validate

IStatus validate()
Performs a variety of consistency checks over the faceted project. The result of the validation is returned as a status object. This method is equivalent to calling validate with a null progress monitor.

Returns:
a status object with code IStatus.OK if this faceted project is valid, otherwise a status object indicating what is wrong with it

addListener

void addListener(IFacetedProjectListener listener,
                 IFacetedProjectEvent.Type... types)
Adds a faceted project listener that will be notified when the selected events in the faceted project life cycle occur. The listener will apply only to this project.

Parameters:
listener - the faceted project listener
types - the types of the events to listen for
Throws:
IllegalArgumentException - if listener parameter is null or the types parameter is null or empty.
See Also:
removeListener(IFacetedProjectListener), FacetedProjectFramework.addListener(IFacetedProjectListener,IFacetedProjectEvent.Type[]), FacetedProjectFramework.removeListener(IFacetedProjectListener)

removeListener

void removeListener(IFacetedProjectListener listener)
Removes the faceted project listener that was previously registered using the addListener(IFacetedProjectListener,IFacetedProjectEvent.Type[]) method. If the specified listener is not present in the listener registry, this call will be ignored.

Parameters:
listener - the faceted project listener
Throws:
IllegalArgumentException - if listener parameter is null
See Also:
addListener(IFacetedProjectListener,IFacetedProjectEvent.Type[]), FacetedProjectFramework.addListener(IFacetedProjectListener,IFacetedProjectEvent.Type[]), FacetedProjectFramework.removeListener(IFacetedProjectListener)

Faceted Project Framework
Version 1.3

Copyright (c) 2008 BEA Systems, Inc. and others. All rights reserved.