Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html lang="en">
<!DOCTYPE HTML><html lang="en">
<HEAD>

<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<meta charset="utf-8">
<TITLE>Advanced resource concepts</TITLE>

<link rel="stylesheet" type="text/css" HREF="../book.css">
Expand All @@ -15,7 +12,7 @@
<H1>
Advanced resource concepts</H1>
<p>In <a href="resInt.htm">Resources overview</a> we took a look at the
basic services and APIs provided by the <tt>org.eclipse.core.resources</tt>
basic services and APIs provided by the <code>org.eclipse.core.resources</code>
plug-in. This and other related plug-ins also contain many advanced features that are useful
for plug-ins that require a deeper level of integration. For details on these advanced
features, take a gander at some of these topics:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html lang="en">
<!DOCTYPE HTML><html lang="en">
<HEAD>

<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<meta charset="utf-8">
<TITLE>
Batching resource changes
</TITLE>
Expand Down Expand Up @@ -65,10 +62,10 @@ <h4>Scheduling Rules and Locking</h4>
</pre>
<p>The runnable is passed to the workspace, followed by the project that the
code is manipulating. This tells the workspace that all of the changes in the
runnable are confined to <tt>myProject</tt>. Any requests by other threads
to change <tt>myProject</tt> will be blocked until this runnable completes.
runnable are confined to <code>myProject</code>. Any requests by other threads
to change <code>myProject</code> will be blocked until this runnable completes.
Likewise, this call will block if some other thread is already modifying
<tt>myProject</tt>. By specifying which part of the resource tree will be
<code>myProject</code>. By specifying which part of the resource tree will be
modified by the runnable, you are allowing other threads to continue modifying
other portions of the workspace. It is important to be sure that your resource rule
matches the work being done inside the runnable. When a non-null scheduling
Expand All @@ -77,20 +74,20 @@ <h4>Scheduling Rules and Locking</h4>
</p>
<p>
There are two special scheduling rules that are important to consider. First,
if you use an instance of <tt>IWorkspaceRoot</tt> as the scheduling rule,
if you use an instance of <code>IWorkspaceRoot</code> as the scheduling rule,
it means your thread is blocking access to <b>all</b> resources in the tree.
While a thread holds the root rule, no other thread is allowed to modify the
workspace. Conversely, a rule of <tt>null</tt> indicates that the thread
workspace. Conversely, a rule of <code>null</code> indicates that the thread
will block access to <b>no</b> resources in the tree. While a thread with the
null rule is free to modify the workspace itself, other threads will not be prevented
from performing their own modifications. The <tt>IWorkspaceRoot</tt> and
<tt>null</tt> scheduling rules occupy opposite ends of the concurrency spectrum.
With <tt>IWorkspaceRoot</tt> there is no concurrency
and only one thread is modifying the workspace at a time. With a <tt>null</tt> rule,
from performing their own modifications. The <code>IWorkspaceRoot</code> and
<code>null</code> scheduling rules occupy opposite ends of the concurrency spectrum.
With <code>IWorkspaceRoot</code> there is no concurrency
and only one thread is modifying the workspace at a time. With a <code>null</code> rule,
there is maximum concurrency as all threads can modify the workspace concurrently.
</p>
<p>The third parameter to the <b>run</b> method specifies whether any periodic resource change events should
be broadcast during the scope of this call. Using <tt>IWorkspace.AVOID_UPDATE</tt> tells the platform to suppress any
be broadcast during the scope of this call. Using <code>IWorkspace.AVOID_UPDATE</code> tells the platform to suppress any
resource change events while the runnable is running and to broadcast one event at the end of the changes.
During this call, any other runnables created in the runnable will be considered part of the parent batch
operation. Resource changes made in those runnables will appear in the parent's resource change notification.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html lang="en">
<!DOCTYPE HTML><html lang="en">
<HEAD>

<meta name="copyright" content="Copyright (c) Broadcom Corporation and others 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<meta charset="utf-8">
<TITLE>Project Build Configurations</TITLE>

<link rel="stylesheet" type="text/css" HREF="../book.css">
Expand Down Expand Up @@ -72,10 +69,10 @@ <h4>Creating and Setting Build Configurations </h4>

...
// Creating a build configuration
<a href="../reference/api/org/eclipse/core/resources/IWorkspace.html#newBuildConfig(java.lang.String, java.lang.String)">ResourcesPlugin().getWorkspace().newBuildConfig</a>(project.getName(), "myNewBuildConfig");
<a href="../reference/api/org/eclipse/core/resources/IWorkspace.html#newBuildConfig(java.lang.String,%20java.lang.String)">ResourcesPlugin().getWorkspace().newBuildConfig</a>(project.getName(), "myNewBuildConfig");
...
// Set new build configurations on a project
projDesc.<a href="../reference/api/org/eclipse/core/resources/IProjectDescription.html#setBuildConfigs(java.lang.String[])">setBuildConfigs</a>(buildConfigs);
projDesc.<a href="../reference/api/org/eclipse/core/resources/IProjectDescription.html#setBuildConfigs(java.lang.String%5B%5D)">setBuildConfigs</a>(buildConfigs);

// Set the description
project.setDescription(projDesc, null);
Expand All @@ -86,7 +83,7 @@ <h4>Creating and Setting Build Configurations </h4>
</p>
<h4>Active Configuration</h4>
<p>By default one configuration on the project is defined as '<b>active</b>'. The active configuration is the one that is built
when a build configurations isn't specified (e.g. when: <a href="../reference/api/org/eclipse/core/resources/IProject.html#build(int, org.eclipse.core.runtime.IProgressMonitor)">
when a build configurations isn't specified (e.g. when: <a href="../reference/api/org/eclipse/core/resources/IProject.html#build(int,%20org.eclipse.core.runtime.IProgressMonitor)">
IProject#build(kind, monitor)</a> is called on the project). To set the active build configuration:
</p>

Expand All @@ -101,7 +98,7 @@ <h4> Creating References Between Build Configurations </h4>
</p>

<pre>
projDesc.<a href="../reference/api/org/eclipse/core/resources/IProjectDescription.html#setBuildConfigReferences(java.lang.String,%20org.eclipse.core.resources.IBuildConfiguration[])">setBuildConfigReferences</a>(String configName, IBuildConfiguration[] references);
projDesc.<a href="../reference/api/org/eclipse/core/resources/IProjectDescription.html#setBuildConfigReferences(java.lang.String,%20org.eclipse.core.resources.IBuildConfiguration%5B%5D)">setBuildConfigReferences</a>(String configName, IBuildConfiguration[] references);
</pre>

<p>causes the named build configuration to reference the passed in build configurations.</p>
Expand All @@ -118,7 +115,7 @@ <h4> Building Project Build Configurations </h4>
New API exists on the workspace to allow building a build configuration and its references (if required):

<pre>
ResourcesPlugin.getWorkspace().<a href="../reference/api/org/eclipse/core/resources/IWorkspace.html#build(org.eclipse.core.resources.IBuildConfiguration[],%20int,%20boolean,%20org.eclipse.core.runtime.IProgressMonitor)">build</a>(IBuildConfiguration[] buildConfigs, int kind, boolean buildReferences, IProgressMonitor monitor);
ResourcesPlugin.getWorkspace().<a href="../reference/api/org/eclipse/core/resources/IWorkspace.html#build(org.eclipse.core.resources.IBuildConfiguration%5B%5D,%20int,%20boolean,%20org.eclipse.core.runtime.IProgressMonitor)">build</a>(IBuildConfiguration[] buildConfigs, int kind, boolean buildReferences, IProgressMonitor monitor);
</pre>

API also exists on IProject to build a specific build configuration:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html lang="en">
<!DOCTYPE HTML><html lang="en">
<HEAD>

<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<meta charset="utf-8">
<TITLE>Incremental project builders</TITLE>

<link rel="stylesheet" type="text/css" HREF="../book.css">
<style>
table, td, th {
border: 1px solid;
border-collapse: collapse;
}
</style>
</HEAD>
<BODY>
<H2>
Expand Down Expand Up @@ -222,7 +225,7 @@ <h4>Build Locking</h4>
</p>

<pre>
public ISchedulingRule <a href="../reference/api/org/eclipse/core/resources/IncrementalProjectBuilder.html#getRule(int, java.util.Map)">getRule</a>(int kind, Map&lt;String,String&gt; args) {
public ISchedulingRule <a href="../reference/api/org/eclipse/core/resources/IncrementalProjectBuilder.html#getRule(int,%20java.util.Map)">getRule</a>(int kind, Map&lt;String,String&gt; args) {
// Allow any resource to be modified concurrently with this buidler's invocation.
return null;
}
Expand Down Expand Up @@ -284,7 +287,7 @@ <H3>
Configuring a project's builder is done just once, usually as the project is being created.
A common way to associate a builder with a project is by configuring a <a href="resAdv_natures.htm">project nature</a>.
</P>
<H3><a name="advanced_build_kinds">Advanced Build Kinds</a></H3>
<H3><a id="advanced_build_kinds">Advanced Build Kinds</a></H3>

<h4>Triggers vs. Kinds</h4>
<p>When a build is invoked on an IProject or IWorkspace, we call the passed in build kind the build <i>trigger</i>.
Expand All @@ -293,7 +296,7 @@ <h4>Triggers vs. Kinds</h4>
<p>The major exception to this is where no delta exists. In this case the build <i>trigger</i> is always promoted to <b>FULL_BUILD</b>.</p>

The mapping between triggers and kinds looks like:
<table border="1">
<table>
<tr>
<th>Trigger</th>
<th>Kind</th>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html lang="en">
<!DOCTYPE HTML><html lang="en">
<HEAD>

<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<meta charset="utf-8">
<TITLE>
Concurrency and the workspace
</TITLE>
Expand Down Expand Up @@ -67,7 +64,7 @@ <h4>Workspace Jobs</h4>
</pre>
<p>Our job is scheduled like any other job. The platform job manager will run it according to its
priority, other jobs in the queue, and the scheduling rules. Note that we must attach the
scheduling rule to the job in order to prevent simultaneous modification of <tt>myProject</tt>.
scheduling rule to the job in order to prevent simultaneous modification of <code>myProject</code>.
</p>
<pre>MyWorkspaceJob job = new MyWorkspaceJob();
<b>job.setRule(myProject);</b>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html lang="en">
<!DOCTYPE HTML><html lang="en">
<HEAD>

<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<meta charset="utf-8">
<TITLE>
Derived resources
</TITLE>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html lang="en">
<!DOCTYPE HTML><html lang="en">
<HEAD>

<meta name="copyright" content="Copyright (c) IBM Corporation and others 2006. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<meta charset="utf-8">
<TITLE>
Using the file system API
</TITLE>
Expand All @@ -16,21 +13,21 @@
<BODY>
<h3>Using the File System API</h3>
<p>
The <tt>org.eclipse.core.filesystem</tt> plug-in provides a generic API for
interacting with an arbitrary file system. This API is similar to <tt>java.io.File</tt>,
The <code>org.eclipse.core.filesystem</code> plug-in provides a generic API for
interacting with an arbitrary file system. This API is similar to <code>java.io.File</code>,
with a few key differences:
</p>
<ul>
<li>Plug-ins can install providers for different types of file systems.</li>
<li>All methods integrate support for reporting progress and responding to cancelation,
making it easier to integrate into a graphical user interface.</li>
<li>There is support for some additional functionality not available in <tt>java.io.File</tt>,
<li>There is support for some additional functionality not available in <code>java.io.File</code>,
such as getting and setting file permissions.</li>
<li>There are more convenience methods, such as copy, move, and recursive deletion.</li>
</ul>
<p>
In the file system API, the path for any given file is represented as a hierarchical
<tt>java.net.URI</tt>. The URI scheme represents the kind of file system,
<code>java.net.URI</code>. The URI scheme represents the kind of file system,
and the URI path component represents the location of the file within the file
system tree. Thus any given hierarchical URI represents a potential file or
directory in some arbitrary file system.
Expand All @@ -40,23 +37,23 @@ <h3>Using the File System API</h3>
<b><a href="../reference/api/org/eclipse/core/filesystem/package-summary.html">org.eclipse.core.filesystem</a></b>)
package. The central API type is
<b><a href="../reference/api/org/eclipse/core/filesystem/IFileStore.html">IFileStore</a></b>
Each instance of <tt>IFileStore</tt> represents
a single file in the file system. As with <tt>IResource</tt>, the existence of
an <tt>IFileStore</tt> instance does not mean that such a file exists on disk. You
can use an <tt>IFileStore</tt> instance to create, delete, copy, move, or open
streams on files. For a given <tt>URI</tt>, you can get your hands on an <tt>IFileStore</tt>
instance using the static method <tt>EFS.getStore(URI)</tt>
Each instance of <code>IFileStore</code> represents
a single file in the file system. As with <code>IResource</code>, the existence of
an <code>IFileStore</code> instance does not mean that such a file exists on disk. You
can use an <code>IFileStore</code> instance to create, delete, copy, move, or open
streams on files. For a given <code>URI</code>, you can get your hands on an <code>IFileStore</code>
instance using the static method <code>EFS.getStore(URI)</code>
</p>
<p>
The <b><a href="../reference/api/org/eclipse/core/filesystem/IFileSystem.html">IFileSystem</a></b>
interface can be used to find out things about the file system as a whole. Each
<tt>IFileSystem</tt> instance represents a single URI scheme, such as "file:",
<code>IFileSystem</code> instance represents a single URI scheme, such as "file:",
"ftp:", etc. You can use this type to ask questions such as what file attributes
are supported, or whether the file system is case-sensitive. You can also use
this type to obtain an <tt>IFileStore</tt> for a given <tt>URI</tt>.
this type to obtain an <code>IFileStore</code> for a given <code>URI</code>.
</p>
<p>
Most methods on <tt>IFileStore</tt> have a flag parameter that allows
Most methods on <code>IFileStore</code> have a flag parameter that allows
extra options to be supplied. The flag values can be found
in the <b><a href="../reference/api/org/eclipse/core/filesystem/EFS.html">EFS</a></b>
class. For example, to open an output stream for appending to a file, use:
Expand Down Expand Up @@ -87,12 +84,12 @@ <h3>Using the File System API</h3>
This style of API allows you to obtain and change file information with
a single call to the file system. In the above example, there is only
one file system call to fetch the info, and then you can perform as many
operations as you want on the <tt>IFileInfo</tt> object without hitting
operations as you want on the <code>IFileInfo</code> object without hitting
the disk again.
</p>
<p>
The <b><a href="../reference/api/org/eclipse/core/filesystem/EFS.html">EFS</a></b>
class has static factory methods for obtaining <tt>IFileStore</tt> and <tt>IFileSystem</tt>
class has static factory methods for obtaining <code>IFileStore</code> and <code>IFileSystem</code>
instances, as well as various option constants and error codes.
</p>
</BODY>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html lang="en">
<!DOCTYPE HTML><html lang="en">
<HEAD>

<meta name="copyright" content="Copyright (c) IBM Corporation and others 2006. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<meta charset="utf-8">
<TITLE>
Alternate file systems
</TITLE>
Expand All @@ -18,7 +15,7 @@ <h3>Alternate File Systems</h3>

<p>
Most of the time, resources in the workspace are stored in a local file system
that is accessible via <tt>java.io.File</tt>. However, it is also possible
that is accessible via <code>java.io.File</code>. However, it is also possible
to create resources that are stored in other kinds of file systems, such
as network file systems or a database.
</p>
Expand Down
Loading
Loading