| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"> |
| <!--NewPage--> |
| <HTML> |
| <HEAD> |
| <!-- Generated by javadoc on Tue Dec 04 11:51:28 EST 2001 --> |
| <TITLE> |
| : Interface IWorkspace |
| </TITLE> |
| </HEAD> |
| <BODY BGCOLOR="white"> |
| |
| <!-- ========== START OF NAVBAR ========== --> |
| <A NAME="navbar_top"><!-- --></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_top_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| PREV CLASS |
| NEXT CLASS</FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> |
| <A HREF="IWorkspace.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <!-- =========== END OF NAVBAR =========== --> |
| |
| <HR> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <H2> |
| <FONT SIZE="-1"> |
| org.eclipse.core.resources</FONT> |
| <BR> |
| Interface IWorkspace</H2> |
| <DL> |
| <DT><B>All Superinterfaces:</B> <DD>org.eclipse.core.runtime.IAdaptable</DD> |
| </DL> |
| <HR> |
| <DL> |
| <DT>public interface <B>IWorkspace</B><DT>extends org.eclipse.core.runtime.IAdaptable</DL> |
| |
| <P> |
| Workspaces are the basis for Eclipse Platform resource management. There |
| is only one workspace per running platform. All resources exist in the context |
| of this workspace. |
| <p> |
| A workspace corresponds closely to discreet areas in the local file system. |
| Each project in a workspace maps onto a specific area of the file system. |
| The folders and files within a project map directly onto the corresponding |
| directories and files in the file system. |
| One subdirectory, the workspace metadata area, contains internal |
| information about the workspace and its resources. This metadata |
| area should be accessed only by the Platform or via Platform API calls. |
| </p> |
| <p> |
| Workspaces add value over using the file system directly in that they |
| allow for comprehensive change tracking (through <code>IResourceDelta</code>s), |
| various forms of resource metadata (e.g., markers and properties) as well as support |
| for managing application/tool state (e.g., saving and restoring). |
| </p> |
| <p> |
| The workspace as a whole is thread safe and allows one |
| writer concurrent with multiple readers. It also supports mechanisms for |
| saving and snapshoting the current resource state. |
| </p> |
| <p> |
| The workspace is provided by the Resources plug-in and is automatically created |
| when that plug-in is activated. The default workspace data area (i.e., where |
| its resources are stored) overlap exactly with the platform's data area. That is, |
| by default, the workspace's projects are found directly in the platform's data area. |
| Individual project locations can be specified explicitly. |
| </p> |
| <p> |
| This interface is not intended to be implemented by clients. |
| </p> |
| <p> |
| Workspaces implement the <code>IAdaptable</code> interface; |
| extensions are managed by the platform's adapter manager. |
| </p> |
| <P> |
| <HR> |
| |
| <P> |
| <!-- ======== INNER CLASS SUMMARY ======== --> |
| |
| |
| <!-- =========== FIELD SUMMARY =========== --> |
| |
| <A NAME="field_summary"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TD COLSPAN=2><FONT SIZE="+2"> |
| <B>Field Summary</B></FONT></TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#METADATA_ALL">METADATA_ALL</A></B></CODE> |
| |
| <BR> |
| Type constant (bit mask value FFFFFFFF) which identifies all |
| the export options.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#METADATA_PROJECT_DESCRIPTION">METADATA_PROJECT_DESCRIPTION</A></B></CODE> |
| |
| <BR> |
| Type constant (bit mask value 1) which identifies |
| the project description (see <code>IProjectDescription</code>) |
| in the project export context.</TD> |
| </TR> |
| </TABLE> |
| |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| |
| |
| <!-- ========== METHOD SUMMARY =========== --> |
| |
| <A NAME="method_summary"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TD COLSPAN=2><FONT SIZE="+2"> |
| <B>Method Summary</B></FONT></TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#addResourceChangeListener(org.eclipse.core.resources.IResourceChangeListener)">addResourceChangeListener</A></B>(org.eclipse.core.resources.IResourceChangeListener listener)</CODE> |
| |
| <BR> |
| Adds the given listener for resource change events to this workspace.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#addResourceChangeListener(org.eclipse.core.resources.IResourceChangeListener, int)">addResourceChangeListener</A></B>(org.eclipse.core.resources.IResourceChangeListener listener, |
| int eventMask)</CODE> |
| |
| <BR> |
| Adds the given listener for the specified resource change events to this workspace.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> org.eclipse.core.resources.ISavedState</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#addSaveParticipant(org.eclipse.core.runtime.Plugin, org.eclipse.core.resources.ISaveParticipant)">addSaveParticipant</A></B>(org.eclipse.core.runtime.Plugin plugin, |
| org.eclipse.core.resources.ISaveParticipant participant)</CODE> |
| |
| <BR> |
| Registers the given plug-in's workspace save participant, and |
| returns an object describing the workspace state at the time |
| of the last save in which the plug-in participated.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> org.eclipse.core.resources.IProject[]</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#availableProjects(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IProgressMonitor)">availableProjects</A></B>(org.eclipse.core.runtime.IPath projectExportFile, |
| org.eclipse.core.runtime.IProgressMonitor monitor)</CODE> |
| |
| <BR> |
| Returns project handles for all projects contained in the project export |
| file at the given location.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#build(int, org.eclipse.core.runtime.IProgressMonitor)">build</A></B>(int kind, |
| org.eclipse.core.runtime.IProgressMonitor monitor)</CODE> |
| |
| <BR> |
| Builds all projects in this workspace.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#checkpoint(boolean)">checkpoint</A></B>(boolean build)</CODE> |
| |
| <BR> |
| Checkpoints the operation currently in progress.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> org.eclipse.core.resources.IProject[][]</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#computePrerequisiteOrder(org.eclipse.core.resources.IProject[])">computePrerequisiteOrder</A></B>(org.eclipse.core.resources.IProject[] projects)</CODE> |
| |
| <BR> |
| Returns the prerequisite ordering of the given projects.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> org.eclipse.core.runtime.IStatus</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#copy(org.eclipse.core.resources.IResource[], org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.runtime.IProgressMonitor)">copy</A></B>(org.eclipse.core.resources.IResource[] resources, |
| org.eclipse.core.runtime.IPath destination, |
| boolean force, |
| org.eclipse.core.runtime.IProgressMonitor monitor)</CODE> |
| |
| <BR> |
| Copies the given sibling resources so that they are located |
| as members of the resource at the given path; the names of |
| the copies are the same as the corresponding originals.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> org.eclipse.core.runtime.IStatus</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#delete(org.eclipse.core.resources.IResource[], boolean, org.eclipse.core.runtime.IProgressMonitor)">delete</A></B>(org.eclipse.core.resources.IResource[] resources, |
| boolean force, |
| org.eclipse.core.runtime.IProgressMonitor monitor)</CODE> |
| |
| <BR> |
| Deletes the given resources.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#deleteMarkers(org.eclipse.core.resources.IMarker[])">deleteMarkers</A></B>(org.eclipse.core.resources.IMarker[] markers)</CODE> |
| |
| <BR> |
| Removes the given markers from the resources with which they are associated.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#exportProjects(org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IProgressMonitor)">exportProjects</A></B>(org.eclipse.core.runtime.IPath projectExportFile, |
| boolean force, |
| org.eclipse.core.resources.IProject[] projects, |
| int options, |
| org.eclipse.core.runtime.IProgressMonitor monitor)</CODE> |
| |
| <BR> |
| Exports the specified projects to the given project export file location.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#forgetSavedTree(java.lang.String)">forgetSavedTree</A></B>(java.lang.String pluginId)</CODE> |
| |
| <BR> |
| Forgets any resource tree being saved for the plug-in |
| with the given name.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> java.util.Map</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#getDanglingReferences()">getDanglingReferences</A></B>()</CODE> |
| |
| <BR> |
| Finds all dangling project references in this workspace.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> org.eclipse.core.resources.IWorkspaceDescription</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#getDescription()">getDescription</A></B>()</CODE> |
| |
| <BR> |
| Returns the workspace description.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> org.eclipse.core.resources.IWorkspaceRoot</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#getRoot()">getRoot</A></B>()</CODE> |
| |
| <BR> |
| Returns the root resource of this workspace.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> org.eclipse.core.resources.ISynchronizer</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#getSynchronizer()">getSynchronizer</A></B>()</CODE> |
| |
| <BR> |
| Returns the synchronizer for this workspace.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> org.eclipse.core.resources.IProject[]</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#importProjects(org.eclipse.core.runtime.IPath, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.runtime.IProgressMonitor)">importProjects</A></B>(org.eclipse.core.runtime.IPath projectExportFile, |
| org.eclipse.core.resources.IProject[] projects, |
| int options, |
| org.eclipse.core.runtime.IPath baseLocation, |
| boolean force, |
| org.eclipse.core.runtime.IProgressMonitor monitor)</CODE> |
| |
| <BR> |
| Imports projects from the project export file at the given location.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#isAutoBuilding()">isAutoBuilding</A></B>()</CODE> |
| |
| <BR> |
| Returns whether this workspace performs auto-builds.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> org.eclipse.core.runtime.IStatus</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#move(org.eclipse.core.resources.IResource[], org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.runtime.IProgressMonitor)">move</A></B>(org.eclipse.core.resources.IResource[] resources, |
| org.eclipse.core.runtime.IPath destination, |
| boolean force, |
| org.eclipse.core.runtime.IProgressMonitor monitor)</CODE> |
| |
| <BR> |
| Moves the given sibling resources so that they are located |
| as members of the resource at the given path; the names of |
| the new members are the same.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> org.eclipse.core.resources.IProjectDescription</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#newProjectDescription(java.lang.String)">newProjectDescription</A></B>(java.lang.String projectName)</CODE> |
| |
| <BR> |
| Creates and returns a new project description for a project |
| with the given name.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#removeResourceChangeListener(org.eclipse.core.resources.IResourceChangeListener)">removeResourceChangeListener</A></B>(org.eclipse.core.resources.IResourceChangeListener listener)</CODE> |
| |
| <BR> |
| Removes the given resource change listener from this workspace.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#removeSaveParticipant(org.eclipse.core.runtime.Plugin)">removeSaveParticipant</A></B>(org.eclipse.core.runtime.Plugin plugin)</CODE> |
| |
| <BR> |
| Removes the workspace save participant for the given plug-in |
| from this workspace.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#run(org.eclipse.core.resources.IWorkspaceRunnable, org.eclipse.core.runtime.IProgressMonitor)">run</A></B>(org.eclipse.core.resources.IWorkspaceRunnable action, |
| org.eclipse.core.runtime.IProgressMonitor monitor)</CODE> |
| |
| <BR> |
| Runs the given action as an atomic workspace operation.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> org.eclipse.core.runtime.IStatus</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#save(boolean, org.eclipse.core.runtime.IProgressMonitor)">save</A></B>(boolean full, |
| org.eclipse.core.runtime.IProgressMonitor monitor)</CODE> |
| |
| <BR> |
| Saves this workspace's valuable state on disk.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#setDescription(org.eclipse.core.resources.IWorkspaceDescription)">setDescription</A></B>(org.eclipse.core.resources.IWorkspaceDescription description)</CODE> |
| |
| <BR> |
| Sets the workspace description.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#setWorkspaceLock(org.eclipse.core.resources.WorkspaceLock)">setWorkspaceLock</A></B>(org.eclipse.core.resources.WorkspaceLock lock)</CODE> |
| |
| <BR> |
| Sets the lock to use for controlling write access to this workspace.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> org.eclipse.core.runtime.IStatus</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#validateName(java.lang.String, int)">validateName</A></B>(java.lang.String segment, |
| int typeMask)</CODE> |
| |
| <BR> |
| Validates the given string as the name of a resource |
| valid for one of the given types.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> org.eclipse.core.runtime.IStatus</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#validatePath(java.lang.String, int)">validatePath</A></B>(java.lang.String path, |
| int typeMask)</CODE> |
| |
| <BR> |
| Validates the given string as a path for a resource of the given type(s).</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> org.eclipse.core.runtime.IStatus</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#validateProjectLocation(org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IPath)">validateProjectLocation</A></B>(org.eclipse.core.resources.IProject project, |
| org.eclipse.core.runtime.IPath location)</CODE> |
| |
| <BR> |
| Validates the given path as the location of the given project on disk.</TD> |
| </TR> |
| </TABLE> |
| <A NAME="methods_inherited_from_class_org.eclipse.core.runtime.IAdaptable"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
| <TD><B>Methods inherited from interface org.eclipse.core.runtime.IAdaptable</B></TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE>getAdapter</CODE></TD> |
| </TR> |
| </TABLE> |
| |
| <P> |
| |
| <!-- ============ FIELD DETAIL =========== --> |
| |
| <A NAME="field_detail"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TD COLSPAN=1><FONT SIZE="+2"> |
| <B>Field Detail</B></FONT></TD> |
| </TR> |
| </TABLE> |
| |
| <A NAME="METADATA_PROJECT_DESCRIPTION"><!-- --></A><H3> |
| METADATA_PROJECT_DESCRIPTION</H3> |
| <PRE> |
| public static final int <B>METADATA_PROJECT_DESCRIPTION</B></PRE> |
| <DL> |
| <DD>Type constant (bit mask value 1) which identifies |
| the project description (see <code>IProjectDescription</code>) |
| in the project export context. Note that the project's location |
| (also a property of a project description) gets ignored when a |
| project is imported.<DD><DL> |
| <DT><B>See Also: </B><DD><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#exportProjects(org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IProgressMonitor)"><CODE>exportProjects(org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IProgressMonitor)</CODE></A>, |
| <A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#importProjects(org.eclipse.core.runtime.IPath, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.runtime.IProgressMonitor)"><CODE>importProjects(org.eclipse.core.runtime.IPath, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.runtime.IProgressMonitor)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="METADATA_ALL"><!-- --></A><H3> |
| METADATA_ALL</H3> |
| <PRE> |
| public static final int <B>METADATA_ALL</B></PRE> |
| <DL> |
| <DD>Type constant (bit mask value FFFFFFFF) which identifies all |
| the export options. It indicates all possible export |
| information, including information that might be covered |
| by new options added in future releases. Use of this value |
| on export is discouraged as it could result in exporting |
| untold additional information at considerable expense |
| without any particular reason to do so.<DD><DL> |
| <DT><B>See Also: </B><DD><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#exportProjects(org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IProgressMonitor)"><CODE>exportProjects(org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IProgressMonitor)</CODE></A>, |
| <A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#importProjects(org.eclipse.core.runtime.IPath, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.runtime.IProgressMonitor)"><CODE>importProjects(org.eclipse.core.runtime.IPath, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.runtime.IProgressMonitor)</CODE></A></DL> |
| </DD> |
| </DL> |
| |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| |
| |
| <!-- ============ METHOD DETAIL ========== --> |
| |
| <A NAME="method_detail"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TD COLSPAN=1><FONT SIZE="+2"> |
| <B>Method Detail</B></FONT></TD> |
| </TR> |
| </TABLE> |
| |
| <A NAME="addResourceChangeListener(org.eclipse.core.resources.IResourceChangeListener)"><!-- --></A><H3> |
| addResourceChangeListener</H3> |
| <PRE> |
| public void <B>addResourceChangeListener</B>(org.eclipse.core.resources.IResourceChangeListener listener)</PRE> |
| <DL> |
| <DD>Adds the given listener for resource change events to this workspace. |
| Has no effect if an identical listener is already registered. |
| <p> |
| This method is equivalent to: |
| <pre> |
| addResourceChangeListener(listener, |
| IResourceChangeEvent.PRE_CLOSE | IResourceChangeEvent.PRE_DELETE | IResourceChangeEvent.POST_CHANGE); |
| </pre> |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>listener</CODE> - the listener<DT><B>See Also: </B><DD><CODE>IResourceChangeListener</CODE>, |
| <CODE>IResourceChangeEvent</CODE>, |
| <A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#addResourceChangeListener(org.eclipse.core.resources.IResourceChangeListener, int)"><CODE>addResourceChangeListener(IResourceChangeListener, int)</CODE></A>, |
| <A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#removeResourceChangeListener(org.eclipse.core.resources.IResourceChangeListener)"><CODE>removeResourceChangeListener(org.eclipse.core.resources.IResourceChangeListener)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="addResourceChangeListener(org.eclipse.core.resources.IResourceChangeListener, int)"><!-- --></A><H3> |
| addResourceChangeListener</H3> |
| <PRE> |
| public void <B>addResourceChangeListener</B>(org.eclipse.core.resources.IResourceChangeListener listener, |
| int eventMask)</PRE> |
| <DL> |
| <DD>Adds the given listener for the specified resource change events to this workspace. |
| Has no effect if an identical listener is already registered for these events. |
| After completion of this method, the given listener will be registered for exactly the |
| the specified events. If they were previously registered for other events, they |
| will be deregistered. |
| <p> |
| Once registered, a listener starts receiving notification of changes to |
| resources in the workspace. The resource deltas in the resource change |
| event are rooted at the workspace root. Most resource change notifications |
| occur well after the fact; the exception is pre-notification of impending |
| project closures and deletions. The listener continues to receive |
| notifications until it is replaced or removed. |
| </p> |
| <p> |
| Listeners can listen for several types of event as defined in <code>IResourceChangeEvent</code>. |
| Clients are free to register for any number of event types however if they register |
| for more than one, it is their responsibility to ensure they correctly handle the |
| case where the same resource change shows up in multiple notifications. |
| Clients are guaranteed to receive only the events for which they are registered. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>listener</CODE> - the listener<DD><CODE>eventMask</CODE> - the bit-wise OR of all event types of interest to the listener<DT><B>See Also: </B><DD><CODE>IResourceChangeListener</CODE>, |
| <CODE>IResourceChangeEvent</CODE>, |
| <A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#removeResourceChangeListener(org.eclipse.core.resources.IResourceChangeListener)"><CODE>removeResourceChangeListener(org.eclipse.core.resources.IResourceChangeListener)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="addSaveParticipant(org.eclipse.core.runtime.Plugin, org.eclipse.core.resources.ISaveParticipant)"><!-- --></A><H3> |
| addSaveParticipant</H3> |
| <PRE> |
| public org.eclipse.core.resources.ISavedState <B>addSaveParticipant</B>(org.eclipse.core.runtime.Plugin plugin, |
| org.eclipse.core.resources.ISaveParticipant participant) |
| throws org.eclipse.core.runtime.CoreException</PRE> |
| <DL> |
| <DD>Registers the given plug-in's workspace save participant, and |
| returns an object describing the workspace state at the time |
| of the last save in which the plug-in participated. |
| <p> |
| Once registered, the workspace save participant will actively |
| participate in the saving of this workspace. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>plugin</CODE> - the plug-in<DD><CODE>participant</CODE> - the participant<DT><B>Returns:</B><DD>the last saved state in which the plug-in participated, |
| or <code>null</code> if the plug-in has not participated before<DT><B>Throws:</B><DD><CODE>org.eclipse.core.runtime.CoreException</CODE> - if the method fails to add the participant. |
| Reasons include: |
| <ul> |
| <li> The previous state could not be recovered.</li> |
| </ul><DT><B>See Also: </B><DD><CODE>ISaveParticipant</CODE>, |
| <A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#removeSaveParticipant(org.eclipse.core.runtime.Plugin)"><CODE>removeSaveParticipant(org.eclipse.core.runtime.Plugin)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="build(int, org.eclipse.core.runtime.IProgressMonitor)"><!-- --></A><H3> |
| build</H3> |
| <PRE> |
| public void <B>build</B>(int kind, |
| org.eclipse.core.runtime.IProgressMonitor monitor) |
| throws org.eclipse.core.runtime.CoreException</PRE> |
| <DL> |
| <DD>Builds all projects in this workspace. Projects are built in the order specified |
| in this workspace's description. Projects not mentioned in the order or for which |
| the order cannot be determined are built in an undefined order after all other |
| projects have been built. If no order is specified, the workspace computes |
| an order determined by project references. |
| <p> |
| This method may change resources; these changes will be reported |
| in a subsequent resource change event. |
| </p> |
| <p> |
| This method is long-running; progress and cancellation are provided |
| by the given progress monitor. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>kind</CODE> - the kind of build being requested. Valid values are |
| <ul> |
| <li> <code>FULL_BUILD</code> - indicates a full build.</li> |
| <li> <code>INCREMENTAL_BUILD</code> - indicates a incremental build.</li> |
| </ul><DD><CODE>monitor</CODE> - a progress monitor, or <code>null</code> if progress |
| reporting and cancellation are not desired<DT><B>Throws:</B><DD><CODE>org.eclipse.core.runtime.CoreException</CODE> - if some of the builds fail. |
| The status contained in the exception is a multi-status with |
| entries for the project builds that failed.<DT><B>See Also: </B><DD><CODE>IProject.build(int, java.lang.String, java.util.Map, org.eclipse.core.runtime.IProgressMonitor)</CODE>, |
| <A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#computePrerequisiteOrder(org.eclipse.core.resources.IProject[])"><CODE>computePrerequisiteOrder(org.eclipse.core.resources.IProject[])</CODE></A>, |
| <CODE>IncrementalProjectBuilder.FULL_BUILD</CODE>, |
| <CODE>IncrementalProjectBuilder.INCREMENTAL_BUILD</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="checkpoint(boolean)"><!-- --></A><H3> |
| checkpoint</H3> |
| <PRE> |
| public void <B>checkpoint</B>(boolean build)</PRE> |
| <DL> |
| <DD>Checkpoints the operation currently in progress. |
| This method is used in the middle of a group of operations |
| to force a build (if the build argument is true) and send an |
| interim notification of resource change events. |
| <p> |
| When invoked in the dynamic scope of a |
| call to the <code>IWorkspace.run</code> method, |
| this method reports a single resource change event |
| describing the net effect of all changes done to resources |
| since the last round of notifications. |
| When the outermost <code>run</code> method eventually |
| completes, it will do another auto-build (if enabled) and report |
| the resource changes made after this call. |
| </p> |
| <p> |
| This method has no effect if invoked outside the dynamic scope |
| of a call to the <code>IWorkspace.run</code> method. |
| </p> |
| <p> |
| This method should be used under controlled circumstance |
| (e.g., to break up extremely long-running operations). |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>build</CODE> - whether or not to run a build<DT><B>See Also: </B><DD><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#run(org.eclipse.core.resources.IWorkspaceRunnable, org.eclipse.core.runtime.IProgressMonitor)"><CODE>run(org.eclipse.core.resources.IWorkspaceRunnable, org.eclipse.core.runtime.IProgressMonitor)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="computePrerequisiteOrder(org.eclipse.core.resources.IProject[])"><!-- --></A><H3> |
| computePrerequisiteOrder</H3> |
| <PRE> |
| public org.eclipse.core.resources.IProject[][] <B>computePrerequisiteOrder</B>(org.eclipse.core.resources.IProject[] projects)</PRE> |
| <DL> |
| <DD>Returns the prerequisite ordering of the given projects. The computation |
| is done by interpreting project references as dependency relationships. |
| For example if A references B and C, and C references B, this method, |
| given the list A, B, C will return the order B, C, A. That is, projects with |
| no dependencies are listed first. |
| <p> |
| The return value is a two element array of project arrays. The first project |
| array is the list of projects which could be sorted (as outlined above). The |
| second element of the return value is an array of the projects which are |
| ambiguously ordered (e.g., they are part of a cycle). |
| </p> |
| <p> |
| Cycles and ambiguities are handled by elimination. Projects involved |
| in cycles are simply cut out of the orderd list and returned in an undefined |
| order. Closed and non-existant projects are ignored and do not appear |
| in the returned value at all. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>projects</CODE> - the projects to order<DT><B>Returns:</B><DD>the projects in sorted order and a list of projects which could |
| not be ordered</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="copy(org.eclipse.core.resources.IResource[], org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.runtime.IProgressMonitor)"><!-- --></A><H3> |
| copy</H3> |
| <PRE> |
| public org.eclipse.core.runtime.IStatus <B>copy</B>(org.eclipse.core.resources.IResource[] resources, |
| org.eclipse.core.runtime.IPath destination, |
| boolean force, |
| org.eclipse.core.runtime.IProgressMonitor monitor) |
| throws org.eclipse.core.runtime.CoreException</PRE> |
| <DL> |
| <DD>Copies the given sibling resources so that they are located |
| as members of the resource at the given path; the names of |
| the copies are the same as the corresponding originals. |
| <p> |
| This method can be expressed as a series of calls to |
| <code>IResource.copy</code>, with "best effort" semantics: |
| <ul> |
| <li> Resources are copied in the order specified.</li> |
| <li> Duplicate resources are only copied once.</li> |
| <li> The <code>force</code> flag has the same meaning as it does |
| on the corresponding single-resource method.</li> |
| <li> The method fails if the resources are not all siblings.</li> |
| <li> The failure of an individual copy does not necessarily prevent |
| the method from attempting to copy other resources.</li> |
| <li> The method fails if there are projects among the resources.</li> |
| <li> The method fails if the path of the resources |
| is a prefix of the destination path.</li> |
| <li> This method also fails if one or more of the |
| individual resource copy steps fails.</li> |
| </ul> |
| </p> |
| <p> |
| After successful completion, corresponding new resources |
| will now exist as members of the resource at the given path. |
| </p> |
| <p> |
| The supplied path may be absolute or relative. Absolute paths |
| fully specify the new location for the resource, including its |
| project. Relative paths are considered to be relative to the |
| container of the resources being copied. A trailing separator is ignored. |
| </p> |
| <p> |
| This method changes resources; these changes will be reported |
| in a subsequent resource change event that will include |
| an indication that the resources have been added to the new parent. |
| </p> |
| <p> |
| This method is long-running; progress and cancellation are provided |
| by the given progress monitor. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>resources</CODE> - the resources to copy<DD><CODE>destination</CODE> - the destination container path<DD><CODE>force</CODE> - a flag controlling whether resources that are not |
| in sync with the local file system will be tolerated<DD><CODE>monitor</CODE> - a progress monitor, or <code>null</code> if progress |
| reporting and cancellation are not desired<DT><B>Returns:</B><DD>a status object with code <code>OK</code> if there were no problems; |
| otherwise a description (possibly a multi-status) consisting of |
| low-severity warnings or informational messages<DT><B>Throws:</B><DD><CODE>org.eclipse.core.runtime.CoreException</CODE> - if the method fails to copy some resources. |
| The status contained in the exception may be a multi-status indicating |
| where the individual failures occurred. Reasons include: |
| <ul> |
| <li> One of the resources does not exist.</li> |
| <li> The resources are not siblings.</li> |
| <li> One of the resources, or one of its descendents, is not local.</li> |
| <li> The resource corresponding to the destination path does not exist.</li> |
| <li> The resource corresponding to the parent destination path is a closed project.</li> |
| <li> A corresponding target resource does exist.</li> |
| <li> A resource of a different type exists at the target path.</li> |
| <li> One of the resources is a project.</li> |
| <li> The path of one of the resources is a prefix of the destination path.</li> |
| <li> One of the resources, or one of its descendents, is out of sync with the |
| local file system and <code>force</code> is <code>false</code>.</li> |
| <li> Resource changes are disallowed during resource change event notification.</li> |
| </ul><DT><B>See Also: </B><DD><CODE>IResource.copy(org.eclipse.core.resources.IProjectDescription, boolean, org.eclipse.core.runtime.IProgressMonitor)</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="delete(org.eclipse.core.resources.IResource[], boolean, org.eclipse.core.runtime.IProgressMonitor)"><!-- --></A><H3> |
| delete</H3> |
| <PRE> |
| public org.eclipse.core.runtime.IStatus <B>delete</B>(org.eclipse.core.resources.IResource[] resources, |
| boolean force, |
| org.eclipse.core.runtime.IProgressMonitor monitor) |
| throws org.eclipse.core.runtime.CoreException</PRE> |
| <DL> |
| <DD>Deletes the given resources. |
| <p> |
| This method can be expressed as a series of calls to |
| <code>IResource.delete</code>. |
| </p> |
| <p> |
| The semantics of multiple deletion are: |
| <ul> |
| <li> Resources are deleted in the order presented.</li> |
| <li> The <code>force</code> flag has the same meaning as it does |
| on the corresponding single-resource method.</li> |
| <li> Resources that do not exist are ignored.</li> |
| <li> An individual deletion fails if the resource still exists afterwards.</li> |
| <li> The failure of an individual deletion does not prevent |
| the method from attempting to delete other resources.</li> |
| <li> This method fails if one or more of the |
| individual resource deletions fails; that is, if at least one |
| of the resources in the list still exists at the end of this |
| method.</li> |
| <li> History is kept for deleted files. When projects are deleted, no history |
| is kept</li> |
| </ul> |
| </p> |
| <p> |
| This method changes resources; these changes will be reported |
| in a subsequent resource change event. |
| </p> |
| <p> |
| This method is long-running; progress and cancellation are provided |
| by the given progress monitor. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>resources</CODE> - the resources to delete<DD><CODE>force</CODE> - a flag controlling whether resources that are not |
| in sync with the local file system will be tolerated<DD><CODE>monitor</CODE> - a progress monitor, or <code>null</code> if progress |
| reporting and cancellation are not desired<DT><B>Returns:</B><DD>status with code <code>OK</code> if there were no problems; |
| otherwise a description (possibly a multi-status) consisting of |
| low-severity warnings or informational messages<DT><B>Throws:</B><DD><CODE>org.eclipse.core.runtime.CoreException</CODE> - if the method fails to delete some resource. |
| The status contained in the exception is a multi-status indicating |
| where the individual failures occurred.<DT><B>See Also: </B><DD><CODE>IResource.delete(boolean, org.eclipse.core.runtime.IProgressMonitor)</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="deleteMarkers(org.eclipse.core.resources.IMarker[])"><!-- --></A><H3> |
| deleteMarkers</H3> |
| <PRE> |
| public void <B>deleteMarkers</B>(org.eclipse.core.resources.IMarker[] markers) |
| throws org.eclipse.core.runtime.CoreException</PRE> |
| <DL> |
| <DD>Removes the given markers from the resources with which they are associated. |
| Markers that do not exist are ignored. |
| <p> |
| This method changes resources; these changes will be reported |
| in a subsequent resource change event. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>markers</CODE> - the markers to remove<DT><B>Throws:</B><DD><CODE>org.eclipse.core.runtime.CoreException</CODE> - if this method fails. Reasons include: |
| <ul> |
| <li> Resource changes are disallowed during resource change event notification.</li> |
| </ul></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="forgetSavedTree(java.lang.String)"><!-- --></A><H3> |
| forgetSavedTree</H3> |
| <PRE> |
| public void <B>forgetSavedTree</B>(java.lang.String pluginId)</PRE> |
| <DL> |
| <DD>Forgets any resource tree being saved for the plug-in |
| with the given name. If the plug-in id is <code>null</code>, |
| all trees are forgotten. |
| <p> |
| Clients should not call this method unless they have a reason |
| to do so. |
| A plug-in which uses <code>ISaveContext.needDelta</code> in the |
| process of a save indicates that it would like to be fed the |
| a resource delta the next time it is reactivated. If a plug-in |
| never gets reactivated (or if it fails to successfully register |
| to participate in workspace saves), the workspace nevertheless |
| retains the necessary information to generate the resource delta |
| if asked. This method allows such a long term leak to be plugged. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>pluginId</CODE> - the unique identifier of the plug-in<DT><B>See Also: </B><DD><CODE>ISaveContext.needDelta()</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getDanglingReferences()"><!-- --></A><H3> |
| getDanglingReferences</H3> |
| <PRE> |
| public java.util.Map <B>getDanglingReferences</B>()</PRE> |
| <DL> |
| <DD>Finds all dangling project references in this workspace. |
| Projects which are not open are ignored. |
| Returns a map with one entry for each open project in the workspace |
| that has at least one dangling project reference; the value |
| of the entry is an array of projects which are referenced by that |
| project but do not exist in the workspace. Returns an empty Map |
| if there are no projects in the workspace.<DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Returns:</B><DD>a map (key type: <code>IProject</code>, value type: <code>IProject[]</code>) |
| from project to dangling project references</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getDescription()"><!-- --></A><H3> |
| getDescription</H3> |
| <PRE> |
| public org.eclipse.core.resources.IWorkspaceDescription <B>getDescription</B>()</PRE> |
| <DL> |
| <DD>Returns the workspace description. This object is responsible for defining |
| workspace preferences. The returned value is a modifiable copy but changes |
| are not automatically applied to the workspace. In order to changes |
| take effect, <code>IWorkspace.setDescription</code> needs to be called.<DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Returns:</B><DD>the workspace description<DT><B>See Also: </B><DD><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#setDescription(org.eclipse.core.resources.IWorkspaceDescription)"><CODE>setDescription(org.eclipse.core.resources.IWorkspaceDescription)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getRoot()"><!-- --></A><H3> |
| getRoot</H3> |
| <PRE> |
| public org.eclipse.core.resources.IWorkspaceRoot <B>getRoot</B>()</PRE> |
| <DL> |
| <DD>Returns the root resource of this workspace.<DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Returns:</B><DD>the workspace root</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getSynchronizer()"><!-- --></A><H3> |
| getSynchronizer</H3> |
| <PRE> |
| public org.eclipse.core.resources.ISynchronizer <B>getSynchronizer</B>()</PRE> |
| <DL> |
| <DD>Returns the synchronizer for this workspace.<DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Returns:</B><DD>the synchronizer<DT><B>See Also: </B><DD><CODE>ISynchronizer</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="isAutoBuilding()"><!-- --></A><H3> |
| isAutoBuilding</H3> |
| <PRE> |
| public boolean <B>isAutoBuilding</B>()</PRE> |
| <DL> |
| <DD>Returns whether this workspace performs auto-builds.<DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Returns:</B><DD><code>true</code> if auto-building is on, <code>false</code> otherwise</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="move(org.eclipse.core.resources.IResource[], org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.runtime.IProgressMonitor)"><!-- --></A><H3> |
| move</H3> |
| <PRE> |
| public org.eclipse.core.runtime.IStatus <B>move</B>(org.eclipse.core.resources.IResource[] resources, |
| org.eclipse.core.runtime.IPath destination, |
| boolean force, |
| org.eclipse.core.runtime.IProgressMonitor monitor) |
| throws org.eclipse.core.runtime.CoreException</PRE> |
| <DL> |
| <DD>Moves the given sibling resources so that they are located |
| as members of the resource at the given path; the names of |
| the new members are the same. |
| <p> |
| This method can be expressed as a series of calls to |
| <code>IResource.move</code>, with "best effort" semantics: |
| <ul> |
| <li> Resources are moved in the order specified.</li> |
| <li> Duplicate resources are only moved once.</li> |
| <li> The <code>force</code> flag has the same meaning as it does |
| on the corresponding single-resource method.</li> |
| <li> The method fails if the resources are not all siblings.</li> |
| <li> The method fails the path of any of the resources |
| is a prefix of the destination path.</li> |
| <li> The failure of an individual move does not necessarily prevent |
| the method from attempting to move other resources.</li> |
| <li> This method also fails if one or more of the |
| individual resource moves fails; that is, if at least one |
| of the resources in the list still exists at the end of this |
| method.</li> |
| <li> History is kept for moved files. When projects are moved, no history |
| is kept</li> |
| </ul> |
| </p> |
| <p> |
| After successful completion, the resources and descendents |
| will no longer exist; but corresponding new resources |
| will now exist as members of the resource at the given path. |
| </p> |
| <p> |
| The supplied path may be absolute or relative. Absolute paths |
| fully specify the new location for the resource, including its |
| project. Relative paths are considered to be relative to the |
| container of the resources being moved. A trailing separator is ignored. |
| </p> |
| <p> |
| This method changes resources; these changes will be reported |
| in a subsequent resource change event that will include |
| an indication that the resources have been removed from their parent |
| and that corresponding resources have been added to the new parent. |
| Additional information provided with resource delta shows that these |
| additions and removals are pairwise related. |
| </p> |
| <p> |
| This method is long-running; progress and cancellation are provided |
| by the given progress monitor. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>resources</CODE> - the resources to move<DD><CODE>destination</CODE> - the destination container path<DD><CODE>force</CODE> - a flag controlling whether resources that are not |
| in sync with the local file system will be tolerated<DD><CODE>monitor</CODE> - a progress monitor, or <code>null</code> if progress |
| reporting and cancellation are not desired<DT><B>Returns:</B><DD>status with code <code>OK</code> if there were no problems; |
| otherwise a description (possibly a multi-status) consisting of |
| low-severity warnings or informational messages.<DT><B>Throws:</B><DD><CODE>org.eclipse.core.runtime.CoreException</CODE> - if the method fails to move some resources. |
| The status contained in the exception may be a multi-status indicating |
| where the individual failures occurred. Reasons include: |
| <ul> |
| <li> One of the resources does not exist.</li> |
| <li> The resources are not siblings.</li> |
| <li> One of the resources, or one of its descendents, is not local.</li> |
| <li> The resource corresponding to the destination path does not exist.</li> |
| <li> The resource corresponding to the parent destination path is a |
| closed project.</li> |
| <li> A corresponding target resource does exist.</li> |
| <li> A resource of a different type exists at the target path.</li> |
| <li> The path of one of the resources is a prefix of the destination path.</li> |
| <li> One of the resources, or one of its descendents, is out of sync with the |
| local file system and <code>force</code> is <code>false</code>.</li> |
| <li> Resource changes are disallowed during resource change event notification.</li> |
| </ul><DT><B>See Also: </B><DD><CODE>IResource.move(org.eclipse.core.resources.IProjectDescription, boolean, boolean, org.eclipse.core.runtime.IProgressMonitor)</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="newProjectDescription(java.lang.String)"><!-- --></A><H3> |
| newProjectDescription</H3> |
| <PRE> |
| public org.eclipse.core.resources.IProjectDescription <B>newProjectDescription</B>(java.lang.String projectName)</PRE> |
| <DL> |
| <DD>Creates and returns a new project description for a project |
| with the given name. This object is useful when creating, |
| moving or copying projects. |
| <p> |
| The project description is initialized to: |
| <ul> |
| <li> the given project name</li> |
| <li> no references to other projects</li> |
| <li> an empty build spec</li> |
| <li> an empty comment</li> |
| </ul> |
| </p> |
| <p> |
| The returned value is writeable. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>projectName</CODE> - the name of the project<DT><B>Returns:</B><DD>a new project description<DT><B>See Also: </B><DD><CODE>IProject.getDescription()</CODE>, |
| <CODE>IProject.create(org.eclipse.core.resources.IProjectDescription, org.eclipse.core.runtime.IProgressMonitor)</CODE>, |
| <CODE>IProject.copy(org.eclipse.core.resources.IProjectDescription, boolean, org.eclipse.core.runtime.IProgressMonitor)</CODE>, |
| <CODE>IProject.move(org.eclipse.core.resources.IProjectDescription, boolean, org.eclipse.core.runtime.IProgressMonitor)</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="removeResourceChangeListener(org.eclipse.core.resources.IResourceChangeListener)"><!-- --></A><H3> |
| removeResourceChangeListener</H3> |
| <PRE> |
| public void <B>removeResourceChangeListener</B>(org.eclipse.core.resources.IResourceChangeListener listener)</PRE> |
| <DL> |
| <DD>Removes the given resource change listener from this workspace. |
| Has no effect if an identical listener is not registered.<DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>listener</CODE> - the listener<DT><B>See Also: </B><DD><CODE>IResourceChangeListener</CODE>, |
| <A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#addResourceChangeListener(org.eclipse.core.resources.IResourceChangeListener)"><CODE>addResourceChangeListener(org.eclipse.core.resources.IResourceChangeListener)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="removeSaveParticipant(org.eclipse.core.runtime.Plugin)"><!-- --></A><H3> |
| removeSaveParticipant</H3> |
| <PRE> |
| public void <B>removeSaveParticipant</B>(org.eclipse.core.runtime.Plugin plugin)</PRE> |
| <DL> |
| <DD>Removes the workspace save participant for the given plug-in |
| from this workspace. If no such participant is registered, |
| no action is taken. |
| <p> |
| Once removed, the workspace save participant no longer actively |
| participates in any future saves of this workspace. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>plugin</CODE> - the plug-in<DT><B>See Also: </B><DD><CODE>ISaveParticipant</CODE>, |
| <A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#addSaveParticipant(org.eclipse.core.runtime.Plugin, org.eclipse.core.resources.ISaveParticipant)"><CODE>addSaveParticipant(org.eclipse.core.runtime.Plugin, org.eclipse.core.resources.ISaveParticipant)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="run(org.eclipse.core.resources.IWorkspaceRunnable, org.eclipse.core.runtime.IProgressMonitor)"><!-- --></A><H3> |
| run</H3> |
| <PRE> |
| public void <B>run</B>(org.eclipse.core.resources.IWorkspaceRunnable action, |
| org.eclipse.core.runtime.IProgressMonitor monitor) |
| throws org.eclipse.core.runtime.CoreException</PRE> |
| <DL> |
| <DD>Runs the given action as an atomic workspace operation. |
| <p> |
| After running a method that modifies resources in the workspace, |
| registered listeners receive after-the-fact notification of |
| what just transpired, in the form of a resource change event. |
| This method allows clients to call a number of |
| methods that modify resources and only have resource |
| change event notifications reported at the end of the entire |
| batch. |
| </p> |
| <p> |
| If this method is called outside the dynamic scope of another such |
| call, this method runs the action and then reports a single |
| resource change event describing the net effect of all changes |
| done to resources by the action. |
| </p> |
| <p> |
| If this method is called in the dynamic scope of another such |
| call, this method simply runs the action. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>action</CODE> - the action to perform<DD><CODE>monitor</CODE> - a progress monitor, or <code>null</code> if progress |
| reporting and cancellation are not desired<DT><B>Throws:</B><DD><CODE>org.eclipse.core.runtime.CoreException</CODE> - if the operation failed.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="save(boolean, org.eclipse.core.runtime.IProgressMonitor)"><!-- --></A><H3> |
| save</H3> |
| <PRE> |
| public org.eclipse.core.runtime.IStatus <B>save</B>(boolean full, |
| org.eclipse.core.runtime.IProgressMonitor monitor) |
| throws org.eclipse.core.runtime.CoreException</PRE> |
| <DL> |
| <DD>Saves this workspace's valuable state on disk. |
| Consults with all registered plug-ins so that they can |
| coordinate the saving of their persistent state as well. |
| <p> |
| The <code>full</code> parameter indicates whether a full save or a snapshot |
| is being requested. Snapshots save the workspace information that is |
| considered hard to be recomputed in the unlikely event of a crash. It includes |
| parts of the workspace tree, workspace and projects descriptions, markers and |
| sync infos. Full saves are heavy weight operations which save the complete |
| workspace state. |
| </p> |
| <p> |
| To ensure that all outstanding changes to the workspace have been |
| reported to interested parties prior to saving, a full save cannot |
| be used within the dynamic scope of an <code>IWorkspace.run</code> |
| invocation. Snapshots can be called anytime and are interpreted by the |
| workspace as a hint that a snapshot is required. The workspace will perform |
| the snapshot when possible. Even as a hint, snapshots should only be called |
| when necessary as they impact system performance. |
| Although saving does not change the workspace per se, its execution |
| is serialized like methods that write the workspace. |
| </p> |
| <p> |
| The workspace is comprised of several different kinds of data with varying |
| degrees of importance. The most important data, the resources themselves |
| and their persistent properties, |
| are written to disk immediately; other data are kept in volatile memory |
| and only written to disk periodically; and other data are maintained in memory |
| and never written out. The following table summarizes what gets saved when: |
| <ul> |
| <li>creating or deleting resource - immediately</li> |
| <li>setting contents of file - immediately</li> |
| <li>changes to project description - immediately</li> |
| <li>session properties - never</li> |
| <li>changes to persistent properties - immediately</li> |
| <li>markers - <code>save</code></li> |
| <li>synchronizer info - <code>save</code></li> |
| <li>shape of the workspace resource tree - <code>save</code></li> |
| <li>list of active plug-ins - never</li> |
| </ul> |
| Resource-based plug-in also have data with varying degrees of importance. |
| Each plug-in gets to decide the policy for protecting its data, either |
| immediately, never, or at <code>save</code> time. For the latter, |
| the plug-in coordinates its actions with the workspace |
| (see <code>ISaveParticipant</code> for details). |
| </p> |
| <p> |
| If the platform is shutdown (or crashes) after saving the workspace, |
| any information written to disk by the last successful workspace |
| <code>save</code> will be restored the next time the workspace is |
| reopened for the next session. |
| Naturally, information that is written to disk immediately |
| will be as of the last time it was changed. |
| </p> |
| <p> |
| The workspace provides a general mechanism for keeping concerned parties |
| apprised of any and all changes to resources in the workspace |
| (<code>IResourceChangeListener</code>). |
| It is even possible for a plug-in to find out about changes to resources |
| that happen between workspace sessions |
| (see <code>IWorkspace.addSaveParticipant</code>). |
| </p> |
| <p> |
| At certain points during this method, the entire workspace resource tree |
| must be locked to prevent resources from being changed (read access to |
| resources is permitted). |
| </p> |
| <p> |
| Implementation note: The execution sequence is as follows. |
| <ul> |
| <li>A long-term lock on the workspace is taken out to |
| prevent further changes to workspace until the save is done.</li> |
| <li>The list of saveable resource tree snapshots is initially empty.</li> |
| <li>A different <code>ISaveContext</code> object is created for each |
| registered workspace save participant plug-in, reflecting the |
| kind of save (<code>ISaveContext.getKind</code>), the previous save number |
| in which this plug-in actively participated, and the new save number |
| (= previous save number plus 1). |
| </li> |
| <li>Each registered workspace save participant is sent |
| <code>prepareToSave(context)</code>, passing in its own context object. |
| <ul> |
| <li>Plug-in suspends all activities until further notice. |
| </li> |
| </ul> |
| If <code>prepareToSave</code> fails (throws an exception), |
| the problem is logged and the participant is marked as unstable. |
| </li> |
| <li>In dependent-before-prerequisite order, each registered workspace |
| save participant is sent |
| <code>saving(context)</code>, passing in its own context object. |
| <ul> |
| <li>Plug-in decides whether it wants to actively participate in this |
| save. The plug-in only needs to actively participate if some of |
| its important state has changed since the last time it actively |
| participated. If it does decide to actively participate, |
| it writes its important state to a brand new file in its |
| plug-in state area under a generated file name based on |
| <code>context.getStateNumber()</code> and calls |
| <code>context.needStateNumber()</code> to indicate that |
| it has actively participated. If upon reactivation |
| the plug-in will want a resource delta covering all changes |
| between now and then, the plug-in should invoke |
| <code>context.needDelta()</code> to request this now; otherwise, |
| a resource delta for the intervening period will not be available |
| on reactivation. |
| </li> |
| </ul> |
| If <code>saving</code> fails (throws an exception), |
| the problem is logged and the participant is marked as unstable. |
| </li> |
| <li>The plug-in save table contains an entry for each plug-in that |
| has registered to participate in workspace saves at some time in |
| the past (the list of plug-ins increases monotonically). Each |
| entry records the save number of the last successful save in which |
| that plug-in actively participated, and, optionally, a saved resource tree |
| (conceptually, this is a complete tree; in practice, it is compressed into |
| a special delta tree representation). |
| A copy of the plug-in save table is made. Entries are created |
| or modified for each registered plug-in to record the appropriate |
| save number (either the previous save number, or the previous save |
| number plus 1, depending on whether the participant was active and |
| asked for a new number). |
| </li> |
| <li>The workspace tree, the modified copy of the plug-in save table, |
| all markers, etc. and all saveable resource tree |
| snapshots are written to disk as <b>one atomic operation</b>. |
| </li> |
| <li>The long-term lock on the workspace is released.</li> |
| <li>If the atomic save succeeded: |
| <ul> |
| <li>The modified copy of the plug-in save table becomes the new |
| plug-in save table. |
| </li> |
| <li>In prerequisite-before-dependent order, each registered workspace |
| save participant is sent |
| <code>doneSaving(context)</code>, passing in its own context object. |
| <ul> |
| <li>Plug-in may perform clean up by deleting obsolete state files |
| in its plug-in state area. |
| </li> |
| <li>Plug-in resumes its normal activities. |
| </li> |
| </ul> |
| If <code>doneSaving</code> fails (throws an exception), |
| the problem is logged and the participant is marked as unstable. |
| (The state number in the save table is not rolled back just because of |
| this instability.) |
| </li> |
| <li>The workspace save operation returns.</li> |
| </ul> |
| <li>If it failed: |
| <ul> |
| <li>The workspace previous state is restored. |
| </li> |
| <li>In prerequisite-before-dependent order, each registered workspace |
| save participant is sent |
| <code>rollback(context)</code>, passing in its own context object. |
| <ul> |
| <li>Plug-in may perform clean up by deleting newly-created |
| but obsolete state file in its plug-in state area. |
| </li> |
| <li>Plug-in resumes its normal activities. |
| </li> |
| </ul> |
| If <code>rollback</code> fails (throws an exception), |
| the problem is logged and the participant is marked as unstable. |
| (The state number in the save table is rolled back anyway.) |
| </li> |
| <li>The workspace save operation fails.</li> |
| </ul> |
| </li> |
| </ul> |
| </p> |
| <p> |
| After a full save, the platform can be shutdown. This will cause |
| the Resources plug-in and all the other plug-ins to shutdown, |
| without disturbing the saved workspace on disk. |
| </p> |
| <p> |
| When the platform is later restarted, activating the Resources plug-in |
| opens the saved workspace. This reads into memory the workspace's |
| resource tree, plug-in save table, and saved resource tree snapshots |
| (everything that was written to disk in the atomic operation above). |
| Later, when a plug-in gets |
| reactivated and registers to participate in workspace saves, |
| it is handed back the info from its entry in the plug-in save table, |
| if it has one. It gets back the number of the last save in which it |
| actively participated and, possibly, a resource delta. |
| </p> |
| <p> |
| The only source of long term garbage would come from a plug-in that |
| never gets reactivated, or one that gets reactivated but fails to |
| register for workspace saves. (There is no such problem with a plug-in |
| that gets uninstalled; its easy enough to scrub its state areas |
| and delete its entry in the plug-in save table.) |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>full</CODE> - <code>true</code> if this is a full save, and |
| <code>false</code> if this is only a snapshot |
| for protecting against crashes<DD><CODE>monitor</CODE> - a progress monitor, or <code>null</code> if progress |
| reporting and cancellation are not desired<DT><B>Returns:</B><DD>a status that may contain warnings, such as the failure |
| of an individual participant<DT><B>Throws:</B><DD><CODE>org.eclipse.core.runtime.CoreException</CODE> - if this method fails to save |
| the state of this workspace. Reasons include: |
| <ul> |
| <li>The operation cannot be batched with others.</li> |
| </ul><DT><B>See Also: </B><DD><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#addSaveParticipant(org.eclipse.core.runtime.Plugin, org.eclipse.core.resources.ISaveParticipant)"><CODE>addSaveParticipant(org.eclipse.core.runtime.Plugin, org.eclipse.core.resources.ISaveParticipant)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="setDescription(org.eclipse.core.resources.IWorkspaceDescription)"><!-- --></A><H3> |
| setDescription</H3> |
| <PRE> |
| public void <B>setDescription</B>(org.eclipse.core.resources.IWorkspaceDescription description) |
| throws org.eclipse.core.runtime.CoreException</PRE> |
| <DL> |
| <DD>Sets the workspace description.<DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>description</CODE> - the new workspace description.<DT><B>Throws:</B><DD><CODE>org.eclipse.core.runtime.CoreException</CODE> - if the method fails. |
| Reasons include: |
| <ul> |
| <li> There was a problem writing the description to disk.</li> |
| </ul><DT><B>See Also: </B><DD><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#getDescription()"><CODE>getDescription()</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="setWorkspaceLock(org.eclipse.core.resources.WorkspaceLock)"><!-- --></A><H3> |
| setWorkspaceLock</H3> |
| <PRE> |
| public void <B>setWorkspaceLock</B>(org.eclipse.core.resources.WorkspaceLock lock)</PRE> |
| <DL> |
| <DD>Sets the lock to use for controlling write access to this workspace. |
| The lock must only be set once. |
| <p> |
| This method is for internal use by the platform-related plug-ins. |
| Clients should not call this method. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>lock</CODE> - the lock to install on this workspace.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="validateName(java.lang.String, int)"><!-- --></A><H3> |
| validateName</H3> |
| <PRE> |
| public org.eclipse.core.runtime.IStatus <B>validateName</B>(java.lang.String segment, |
| int typeMask)</PRE> |
| <DL> |
| <DD>Validates the given string as the name of a resource |
| valid for one of the given types. |
| <p> |
| In addition to the basic restrictions on paths in general |
| (see <code>IPath.isValidSegment</code>), |
| a resource name must also obey the following rules: |
| <ul> |
| <li> it must not be empty |
| <li> it must not be a single period character (".") |
| <li> it must not contain two or more consecutive period characters |
| <li> it must not end in a period character |
| <li> it must not contain any of the characters </code>"*?:;'<>|"</code> |
| </ul> |
| </p> |
| <p> |
| This validation check is done automatically as a |
| resource is created (but not when the resource handle is constructed); |
| this means that any resource that exists can be safely assumed to have |
| a valid name and path. Note that the name of the workspace root resource |
| is inherently invalid. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>segment</CODE> - the name segment to be checked<DD><CODE>typeMask</CODE> - bitwise-or of the resource type constants ( |
| <code>FILE</code>, <code>FOLDER</code>, |
| <code>PROJECT</code> or <code>ROOT</code>) indicating |
| expected resource type(s)<DT><B>Returns:</B><DD>a status object with code <code>IStatus.OK</code> if |
| the given string is valid as a resource name, otherwise a status |
| object indicating what is wrong with the string<DT><B>See Also: </B><DD><CODE>IResource.PROJECT</CODE>, |
| <CODE>IResource.FOLDER</CODE>, |
| <CODE>IResource.FILE</CODE>, |
| <CODE>IStatus.OK</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="validatePath(java.lang.String, int)"><!-- --></A><H3> |
| validatePath</H3> |
| <PRE> |
| public org.eclipse.core.runtime.IStatus <B>validatePath</B>(java.lang.String path, |
| int typeMask)</PRE> |
| <DL> |
| <DD>Validates the given string as a path for a resource of the given type(s). |
| <p> |
| In addition to the restrictions for |
| paths in general (see <code>IPath.isValidPath</code>), |
| a resource path should also obey the following rules: |
| <ul> |
| <li> a resource path should be an absolute path with no device id |
| <li> its segments should be valid names according to <code>validateName</code> |
| <li> a path for the workspace root must be the canonical root path |
| <li> a path for a project should have exactly 1 segment |
| <li> a path for a file or folder should have more than 1 segment |
| <li> the first segment should be a valid project name |
| <li> the second through penultimate segments should be valid folder names |
| <li> the last segment should be a valid name of the given type |
| </ul> |
| </p> |
| <p> |
| Note: this method does not consider whether a resource at the |
| specified path exists. |
| </p> |
| <p> |
| This validation check is done automatically as a |
| resource is created (but not when the resource handle is constructed); |
| this means that any resource that exists can be safely assumed to have |
| a valid name and path. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>path</CODE> - the path string to be checked<DD><CODE>typeMask</CODE> - bitwise-or of the resource type constants ( |
| <code>FILE</code>, <code>FOLDER</code>, <code>PROJECT</code>, |
| or <code>ROOT</code>) indicating expected resource type(s)<DT><B>Returns:</B><DD>a status object with code <code>IStatus.OK</code> if |
| the given path is valid as a resource path, otherwise a status |
| object indicating what is wrong with the string<DT><B>See Also: </B><DD><CODE>IResource.PROJECT</CODE>, |
| <CODE>IResource.FOLDER</CODE>, |
| <CODE>IResource.FILE</CODE>, |
| <CODE>IStatus.OK</CODE>, |
| <CODE>IResourceStatus.getPath()</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="validateProjectLocation(org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IPath)"><!-- --></A><H3> |
| validateProjectLocation</H3> |
| <PRE> |
| public org.eclipse.core.runtime.IStatus <B>validateProjectLocation</B>(org.eclipse.core.resources.IProject project, |
| org.eclipse.core.runtime.IPath location)</PRE> |
| <DL> |
| <DD>Validates the given path as the location of the given project on disk. |
| In addition to the restrictions for |
| paths in general (see <code>IPath.isValidPath</code>), |
| a location path should also obey the following rules: |
| <ul> |
| <li> must not overlap with another open or closed project |
| <li> must not overlap with the platform's working directory |
| </ul> |
| </p> |
| <p> |
| Note: this method does not consider whether files or directories exist in |
| the filesystem at the specified path.<DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>project</CODE> - the project to validate the location for<DD><CODE>location</CODE> - the location of the project contents on disk<DT><B>Returns:</B><DD>a status object with code <code>IStatus.OK</code> if |
| the given location is valid as the project content location, otherwise a status |
| object indicating what is wrong with the string<DT><B>See Also: </B><DD><CODE>IProjectDescription.getLocation()</CODE>, |
| <CODE>IProjectDescription.setLocation(org.eclipse.core.runtime.IPath)</CODE>, |
| <CODE>IStatus.OK</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="availableProjects(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IProgressMonitor)"><!-- --></A><H3> |
| availableProjects</H3> |
| <PRE> |
| public org.eclipse.core.resources.IProject[] <B>availableProjects</B>(org.eclipse.core.runtime.IPath projectExportFile, |
| org.eclipse.core.runtime.IProgressMonitor monitor) |
| throws org.eclipse.core.runtime.CoreException</PRE> |
| <DL> |
| <DD>Returns project handles for all projects contained in the project export |
| file at the given location. |
| </p><p> |
| This method is long-running; progress and cancellation are provided |
| by the given progress monitor. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>projectExportFile</CODE> - the absolute file system location of the |
| project export file<DD><CODE>monitor</CODE> - a progress monitor, or <code>null</code> if progress |
| reporting and cancellation are not desired<DT><B>Returns:</B><DD>an array of project handles representing projects contained |
| in the project export file<DT><B>Throws:</B><DD><CODE>org.eclipse.core.runtime.CoreException</CODE> - if this operation did not succeed. Reasons include: |
| <ul> |
| <li>The given project export file does not exist.</li> |
| <li>The given project export file does not have the correct format.</li> |
| </ul><DT><B>See Also: </B><DD><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#exportProjects(org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IProgressMonitor)"><CODE>exportProjects(org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IProgressMonitor)</CODE></A>, |
| <A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#importProjects(org.eclipse.core.runtime.IPath, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.runtime.IProgressMonitor)"><CODE>importProjects(org.eclipse.core.runtime.IPath, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.runtime.IProgressMonitor)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="exportProjects(org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IProgressMonitor)"><!-- --></A><H3> |
| exportProjects</H3> |
| <PRE> |
| public void <B>exportProjects</B>(org.eclipse.core.runtime.IPath projectExportFile, |
| boolean force, |
| org.eclipse.core.resources.IProject[] projects, |
| int options, |
| org.eclipse.core.runtime.IProgressMonitor monitor) |
| throws org.eclipse.core.runtime.CoreException</PRE> |
| <DL> |
| <DD>Exports the specified projects to the given project export file location. |
| The projects must exist and be open. Resources that are not local are |
| ignored. The operation fails if any of the projects could not be |
| exported. The <code>force</code> parameter indicates whether an existing |
| file at the specified project export file location should be overwritten. |
| </p><p> |
| The <code>options</code> parameter is a mask that indicates what information |
| should be exported besides project's resources. The following options are |
| available (note that more may be added in the future): |
| <ul> |
| <li> <code>IWorkspace.METADATA_PROJECT_DESCRIPTION</code></li> |
| </ul> |
| Note that persistent properties, markers, synchronization information and |
| other metadata are currently not exported. |
| </p><p> |
| Files under the project content location that exist in the local file |
| system but do not exist in the workspace are not exported. |
| The operation fails if any of the files being exported is not local or |
| is out of sync with the workspace. |
| </p><p> |
| This method is long-running; progress and cancellation are provided |
| by the given progress monitor. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>projectExportFile</CODE> - the absolute file system location of the |
| project export file<DD><CODE>force</CODE> - indicates whether an existing file at the specified |
| location should be overwritten<DD><CODE>projects</CODE> - the projects to be exported<DD><CODE>options</CODE> - bitwise-or of the project export constants ( |
| <code>IWorkspace.METADATA_PROJECT_DESCRIPTION</code> ) indicating |
| the extra information that should be exported or |
| <code>IWorkspace.METADATA_ALL</code> for all the options<DD><CODE>monitor</CODE> - a progress monitor, or <code>null</code> if progress |
| reporting and cancellation are not desired<DT><B>Throws:</B><DD><CODE>org.eclipse.core.runtime.CoreException</CODE> - if this export did not succeed. Reasons include: |
| <ul> |
| <li>One or more projects are not accessible.</li> |
| <li>One or more resources are not local.</li> |
| <li>A file exists at the project export file location and <code>force</code> |
| is <code>false</code>.</li> |
| <li>The project export file could not be written.</li> |
| </ul><DT><B>See Also: </B><DD><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#availableProjects(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IProgressMonitor)"><CODE>availableProjects(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IProgressMonitor)</CODE></A>, |
| <A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#importProjects(org.eclipse.core.runtime.IPath, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.runtime.IProgressMonitor)"><CODE>importProjects(org.eclipse.core.runtime.IPath, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.runtime.IProgressMonitor)</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="importProjects(org.eclipse.core.runtime.IPath, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.runtime.IProgressMonitor)"><!-- --></A><H3> |
| importProjects</H3> |
| <PRE> |
| public org.eclipse.core.resources.IProject[] <B>importProjects</B>(org.eclipse.core.runtime.IPath projectExportFile, |
| org.eclipse.core.resources.IProject[] projects, |
| int options, |
| org.eclipse.core.runtime.IPath baseLocation, |
| boolean force, |
| org.eclipse.core.runtime.IProgressMonitor monitor) |
| throws org.eclipse.core.runtime.CoreException</PRE> |
| <DL> |
| <DD>Imports projects from the project export file at the given location. |
| The projects must not exist in the workspace. The operation fails if any of |
| the projects could not be imported. |
| The <code>force</code> parameter indicates whether existing files in the local |
| file system should be overwritten. If <code>false</code> is specified, this method |
| will not overwrite existing files in the local file system and the operation fails if |
| such files exist. This option ensures there is no unintended data loss; it is the |
| recommended setting. However, if <code>true</code> is specified, |
| existing files in the local file system will be overwritten as needed. At the end |
| of the operation, the imported projects are left open. |
| </p><p> |
| The <code>options</code> parameter is a mask that indicates what information, if |
| available, should be imported besides project's resources. The following options are |
| available (note that more may be added in the future): |
| <ul> |
| <li> <code>IWorkspace.METADATA_PROJECT_DESCRIPTION</code></li> |
| </ul> |
| If a specific information is not provided by the project export file or is not |
| required by the client, the project is imported using a best effort approach (e.g. if |
| the project description is not available, a simple project will be created to hold |
| the imported resources). For convenience, the constant <code>IWorkspace.METADATA_ALL</code> |
| is provided. It indicates all information in the project export file is to be imported. |
| </p><p> |
| If the <code>baseLocation</code> parameter is provided, it is used as the root |
| location for all projects. The project location will consist |
| of the given <code>baseLocation</code> plus the project name (e.g. if providing |
| a base location c:\MyProjects and the projects P1 and P2, the content location |
| for the projects will respectively be c:\MyProjects\P1 and c:\MyProjects\P2). |
| If it is not provided, the default content location is used instead. |
| Note that a project's location is never obtained from the project export file itself. |
| </p><p> |
| If the operation fails, projects might end up in a half-imported |
| state and none of the projects can be guaranteed to have been imported correctly. |
| </p><p> |
| This method changes resources; these changes will be reported |
| in a subsequent resource change event. |
| </p><p> |
| This method is long-running; progress and cancellation are provided |
| by the given progress monitor. |
| </p><DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>projectExportFile</CODE> - the absolute file system location of the |
| project export file<DD><CODE>projects</CODE> - the projects to be imported or <code>null</code> for importing all |
| the projects in the file<DD><CODE>options</CODE> - bitwise-or of the project export constants ( |
| <code>IWorkspace.METADATA_PROJECT_DESCRIPTION</code> ) indicating |
| the extra information that should be imported or |
| <code>IWorkspace.METADATA_ALL</code> for all the options<DD><CODE>baseLocation</CODE> - the content location for the projects or <code>null</code> |
| to use the default<DD><CODE>force</CODE> - a flag controlling whether existing files should be overwritten<DD><CODE>monitor</CODE> - a progress monitor, or <code>null</code> if progress |
| reporting and cancellation are not desired<DT><B>Returns:</B><DD>an array of project handles representing the imported projects<DT><B>Throws:</B><DD><CODE>org.eclipse.core.runtime.CoreException</CODE> - if this import did not succeed. Reasons include: |
| <ul> |
| <li>The given project export file does not exist.</li> |
| <li>The given project export file does not have the correct format.</li> |
| <li>One or more projects already exist.</li> |
| <li>Files at the project location exist and <code>force</code> is <code>false</code>.</li> |
| <li>Resource changes are disallowed during resource change event notification.</li> |
| </ul><DT><B>See Also: </B><DD><A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#availableProjects(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IProgressMonitor)"><CODE>availableProjects(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IProgressMonitor)</CODE></A>, |
| <A HREF="../../../../org/eclipse/core/resources/IWorkspace.html#exportProjects(org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IProgressMonitor)"><CODE>exportProjects(org.eclipse.core.runtime.IPath, boolean, org.eclipse.core.resources.IProject[], int, org.eclipse.core.runtime.IProgressMonitor)</CODE></A></DL> |
| </DD> |
| </DL> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <HR> |
| |
| <!-- ========== START OF NAVBAR ========== --> |
| <A NAME="navbar_bottom"><!-- --></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_bottom_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| PREV CLASS |
| NEXT CLASS</FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> |
| <A HREF="IWorkspace.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <!-- =========== END OF NAVBAR =========== --> |
| |
| <HR> |
| |
| </BODY> |
| </HTML> |