Faceted Project Framework
Version 1.3

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

All Superinterfaces:
IFacetedProjectBase

public interface IFacetedProject
extends 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

Nested Class Summary
static class IFacetedProject.Action
          Represents a single action such as installing or uninstalling a project facet.
 
Field Summary
 
Fields inherited from interface org.eclipse.wst.common.project.facet.core.IFacetedProjectBase
PROBLEM_OTHER, PROBLEM_PROJECT_NAME
 
Method Summary
 void addListener(IFacetedProjectListener listener)
          Deprecated.  
 void addTargetedRuntime(IRuntime runtime, IProgressMonitor monitor)
          Adds a new runtime to the set of runtimes targeted by this project.
 IMarker createErrorMarker(String message)
           
 IMarker createErrorMarker(String type, String message)
           
 IMarker createWarningMarker(String message)
           
 IMarker createWarningMarker(String type, String message)
           
 IFacetedProjectWorkingCopy createWorkingCopy()
           
 IProjectFacetVersion getInstalledVersion(IProjectFacet f)
           
 IRuntime getRuntime()
          Deprecated. use getTargetRuntimes() and getPrimaryRuntime() instead
 void installProjectFacet(IProjectFacetVersion fv, Object config, IProgressMonitor monitor)
          Installs a project facet on this project.
 void modify(Set<IFacetedProject.Action> actions, IProgressMonitor monitor)
          Modifies the set of project facets installed on this project by performing a series of actions such as install and uninstall.
 void removeListener(IFacetedProjectListener listener)
          Deprecated.  
 void removeTargetedRuntime(IRuntime runtime, IProgressMonitor monitor)
          Removes a runtime from the set of runtimes targeted by this project.
 void setFixedProjectFacets(Set<IProjectFacet> facets)
          Sets the set of fixed project facets for this project.
 void setPrimaryRuntime(IRuntime runtime, IProgressMonitor monitor)
          Sets the primary target runtime for this project.
 void setRuntime(IRuntime runtime, IProgressMonitor monitor)
          Deprecated. use setTargetRuntimes() and setPrimaryRuntime() instead
 void setTargetedRuntimes(Set<IRuntime> runtimes, IProgressMonitor monitor)
          Sets the runtimes that this project will target.
 void uninstallProjectFacet(IProjectFacetVersion fv, Object config, IProgressMonitor monitor)
          Uninstalls a project facet from this project.
 
Methods inherited from interface org.eclipse.wst.common.project.facet.core.IFacetedProjectBase
addListener, getFixedProjectFacets, getPrimaryRuntime, getProject, getProjectFacets, getProjectFacetVersion, getTargetedRuntimes, hasProjectFacet, hasProjectFacet, isFixedProjectFacet, isTargetable, isTargeted, removeListener, validate, validate
 

Method Detail

getInstalledVersion

IProjectFacetVersion getInstalledVersion(IProjectFacet f)

installProjectFacet

void installProjectFacet(IProjectFacetVersion fv,
                         Object config,
                         IProgressMonitor monitor)
                         throws CoreException

Installs a project facet on this project. This method is equivalent to calling the modify(Set, IProgressMonitor) method with a single install action.

This method should not be called from the UI thread as it is long- running and may trigger resource change events. Although this framework is safe, there is no guarantee that other bundles are UI-safe and the risk of UI deadlock is high.

Parameters:
fv - the descriptor of the project facet version that should be installed
config - the associated configuration object, or null
monitor - a progress monitor, or null if progress reporting and cancellation are not desired
Throws:
CoreException - if anything goes wrong during install

uninstallProjectFacet

void uninstallProjectFacet(IProjectFacetVersion fv,
                           Object config,
                           IProgressMonitor monitor)
                           throws CoreException

Uninstalls a project facet from this project. This method is equivalent to calling the modify(Set, IProgressMonitor) method with a single uninstall action.

This method should not be called from the UI thread as it is long- running and may trigger resource change events. Although this framework is safe, there is no guarantee that other bundles are UI-safe and the risk of UI deadlock is high.

Parameters:
fv - the descriptor of the project facet version that should be uninstalled
config - the associated configuration object, or null
monitor - a progress monitor, or null if progress reporting and cancellation are not desired
Throws:
CoreException - if anything goes wrong during uninstall

modify

void modify(Set<IFacetedProject.Action> actions,
            IProgressMonitor monitor)
            throws CoreException

Modifies the set of project facets installed on this project by performing a series of actions such as install and uninstall.

This method should not be called from the UI thread as it is long- running and may trigger resource change events. Although this framework is safe, there is no guarantee that other bundles are UI-safe and the risk of UI deadlock is high.

Parameters:
actions - the set of actions to apply to the project
monitor - a progress monitor, or null if progress reporting and cancellation are not desired
Throws:
CoreException - if anything goes wrong while applying actions

setFixedProjectFacets

void setFixedProjectFacets(Set<IProjectFacet> facets)
                           throws CoreException
Sets the set of fixed project facets for this project. Fixed facets cannot be uninstalled, but the installed version can be changed.

Parameters:
facets - the set of project facets to mark as fixed
Throws:
CoreException - if failed while updating the set of fixed project facets

getRuntime

IRuntime getRuntime()
Deprecated. use getTargetRuntimes() and getPrimaryRuntime() instead


setRuntime

void setRuntime(IRuntime runtime,
                IProgressMonitor monitor)
                throws CoreException
Deprecated. use setTargetRuntimes() and setPrimaryRuntime() instead

This method should not be called from the UI thread as it is long- running and may trigger resource change events. Although this framework is safe, there is no guarantee that other bundles are UI-safe and the risk of UI deadlock is high.

Parameters:
monitor - a progress monitor, or null if progress reporting and cancellation are not desired
Throws:
CoreException

setTargetedRuntimes

void setTargetedRuntimes(Set<IRuntime> runtimes,
                         IProgressMonitor monitor)
                         throws CoreException

Sets the runtimes that this project will target. 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.

If the existing primary runtime is null or is not part of the new set of targeted runtimes, the primary runtime will be reset to one picked at random from the new set. If the new set is empty, the primary runtime will be set to null.

This method should not be called from the UI thread as it is long- running and may trigger resource change events. Although this framework is safe, there is no guarantee that other bundles are UI-safe and the risk of UI deadlock is high.

Parameters:
runtimes - the new set of runtimes to target
monitor - a progress monitor, or null if progress reporting and cancelation are not desired
Throws:
CoreException - if the project contains one or more facets that are not supported by all of the new runtimes; if failed for any other reason

addTargetedRuntime

void addTargetedRuntime(IRuntime runtime,
                        IProgressMonitor monitor)
                        throws CoreException

Adds a new runtime to the set of runtimes targeted by this project. If the set of targeted runtimes has been empty prior to this call, this runtime will become the primary runtime

This method should not be called from the UI thread as it is long- running and may trigger resource change events. Although this framework is safe, there is no guarantee that other bundles are UI-safe and the risk of UI deadlock is high.

Parameters:
runtime - the runtime
monitor - a progress monitor, or null if progress reporting and cancelation are not desired
Throws:
CoreException - if the project contains one or more facets that are not supported by this runtime; if failed for any other reason

removeTargetedRuntime

void removeTargetedRuntime(IRuntime runtime,
                           IProgressMonitor monitor)
                           throws CoreException

Removes a runtime from the set of runtimes targeted by this project. If this runtime has been the primary runtime prior to this call, a new primary will be automatically assigned (unless the list of target runtimes becomes empty, in which case the primary runtime will be set to null).

This method should not be called from the UI thread as it is long- running and may trigger resource change events. Although this framework is safe, there is no guarantee that other bundles are UI-safe and the risk of UI deadlock is high.

Parameters:
runtime - the runtime to remove
monitor - a progress monitor, or null if progress reporting and cancelation are not desired
Throws:
CoreException - if failed for any reason

setPrimaryRuntime

void setPrimaryRuntime(IRuntime runtime,
                       IProgressMonitor monitor)
                       throws CoreException

Sets the primary target runtime for this project. The new primary has to be one of the runtimes currently targeted by the project.

This method should not be called from the UI thread as it is long- running and may trigger resource change events. Although this framework is safe, there is no guarantee that other bundles are UI-safe and the risk of UI deadlock is high.

Parameters:
runtime - the new primary runtime
monitor - a progress monitor, or null if progress reporting and cancelation are not desired
Throws:
CoreException - if the primary runtime is not one of the runtimes currently targeted by the project; if failed for any other reason

createWorkingCopy

IFacetedProjectWorkingCopy createWorkingCopy()

createErrorMarker

IMarker createErrorMarker(String message)
                          throws CoreException
Throws:
CoreException

createErrorMarker

IMarker createErrorMarker(String type,
                          String message)
                          throws CoreException
Throws:
CoreException

createWarningMarker

IMarker createWarningMarker(String message)
                            throws CoreException
Throws:
CoreException

createWarningMarker

IMarker createWarningMarker(String type,
                            String message)
                            throws CoreException
Throws:
CoreException

addListener

void addListener(IFacetedProjectListener listener)
Deprecated. 


removeListener

void removeListener(IFacetedProjectListener listener)
Deprecated. 


Faceted Project Framework
Version 1.3

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