blob: 77f669d88e4dc7027f622886ee68e1757f1422ee [file] [log] [blame]
<html>
<head>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../../default_style.css"
type="text/css">
<link rel="stylesheet" href="../../../../wtp.css"
type="text/css">
<title>Web Content Settings</title>
<style>
<!--
p, ol, ul {
margin-top: 0em;
margin-bottom: 0em;
}
-->
</style>
</head>
<body>
<table width="100%" cellspacing="5" cellpadding="2" border="0">
<tbody>
<tr>
<td width="60%" align="left"><font class="indextop">Web
Content Settings</font> <br>
<font class="indexsub">structured source editing (sse)
component</font></td>
<td width="40%"><img width="120" hspace="50" height="86"
align="middle" src="http://eclipse.org//images/Idea.jpg"></td>
</tr>
</tbody>
</table>
<table border=1>
<tr>
<th>Date</th>
<th>Revision info</th>
</tr>
<tr>
<td>2/24/2006</td>
<td>Initial contribution</td>
</tr>
</table>
<table width="100%" cellspacing="5" cellpadding="2" border="0">
<col width="16">
<col width="*">
<tbody>
<tr>
<td valign="top" align="right">&nbsp;</td>
<td valign="top"><a name="top"></a></td>
</tr>
<tr>
<td valign="top" bgcolor="#0080c0" align="left" colspan="2"><b><font
face="Arial,Helvetica" color="#ffffff">Overview</font></b></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td>
<td valign="top">
<p>There are cases when web files cannot or do not have to
specify certain properties within the content of the file. For
example, before XHTML, it was not necessarily required to specify the
DOCTYPE within an html file. Or in JSP Fragments, page directives and
such are not in the fragments themselves. Without this information,
however, some features such as content assist and source validation
cannot work to the best of their knowledge. So there needs to be a
way to associate the invisible information. File properties can be
used to associate additional information with file. The file
properties work like per-file/per-project preferences, and they are
visible via the Properties Dialog.</p>
<p>The Structured Source Editing component currently contributes
3 property pages:</p>
<ul>
<li>jst.jsp<br />
JSP Fragment Content Settings</li>
<li>wst.html<br />
Web Content Settings</li>
<li>wst.css<br />
(CSS) Web Content Settings</li>
</ul>
<p><br />
<br />
Note: Currently changes to the file properties do not take effect
immediately in a file that is already open in an editor. Users must
close and reopen the file for the new settings to take effect.</p>
</td>
</tr>
<tr>
<td valign="top" bgcolor="#0080c0" align="left" colspan="2"><b><font
face="Arial,Helvetica" color="#ffffff">JSP Fragment</font></b></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td>
<td valign="top">
<p>Users can use the JSP Fragment property page to specify the
scripting language and content type that should be associated with
the JSP fragment. Users can also specify if they want the fragment
validated or not (the fragment will be validated like a JSP).<br />
<br />
<img src="./contentsettings/wtp15m5-jspfragment.jpg" /></p>
</td>
</tr>
<tr>
<td valign="top" bgcolor="#0080c0" align="left" colspan="2"><b><font
face="Arial,Helvetica" color="#ffffff">Web Content Settings</font></b></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td>
<td valign="top">
<p>Users can use the Web Content Settings property page to
specify the default document type to be used if none is specified in
the file. They can also specify the type of CSS they plan on using.<br />
<br />
<img src="./contentsettings/wtp15m5-webcontent.jpg" /></p>
</td>
</tr>
<tr>
<td valign="top" bgcolor="#0080c0" align="left" colspan="2"><b><font
face="Arial,Helvetica" color="#ffffff">(CSS) Web Content
Settings</font></b></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td>
<td valign="top">
<p>Users can use the (CSS) Web Content Settings property page to
specify the type of CSS they plan on using.<br />
<br />
<img src="./contentsettings/wtp15m5-csswebcontent.jpg" /></p>
</td>
</tr>
<tr>
<td valign="top" bgcolor="#0080c0" align="left" colspan="2"><b><font
face="Arial,Helvetica" color="#ffffff">Storage of Properties</font></b></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td>
<td valign="top">
<p>The properties are currently stored with the project they are
associated with. This way, the properties travel along with the
project, so when projects are shared amongst a team, so are the
properties. The properties are stored as project preferences. Project
preferences are stored in a .settings folder under the project root.</p>
</td>
</tr>
<tr>
<td valign="top" bgcolor="#0080c0" align="left" colspan="2"><b><font
face="Arial,Helvetica" color="#ffffff">Code Usage</font></b></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td>
<td valign="top">
<p>Clients should already have the properties specified and
accessible via an existing mechanism, like the PageDirectiveAdapter
or HTMLDocumentTypeAdapter. It is then up to the PageDirectiveAdapter
and HTMLDocumentTypeAdapter to call the appropriate code below to get
the information desired.<br />
For the curious, PageDirectiveAdapter ahd HTMLDocumentAdapter will
then in turn call a get or set Property method call in the desired
xxxContentProperties class to get the information they need.<code><pre>
/**
* Returns the value for the given key in the given context.
*
* @param key
* The property key
* @param resource
* The current context or <code>null</code> if no context is
* available and the workspace setting should be taken. Note
* that passing <code>null</code> should be avoided.
* @param recurse
* whether the parent should be queried till property is found
* @return Returns the current value for the key.
* @since 1.1
*/
public static String getProperty(String key, IResource resource, boolean recurse)
/**
* Sets the value for the given key in the given context.
*
* @param key
* The property key
* @param resource
* The current context. Note context cannot be
* <code>null</code>.
* @param value
* The value to set for the key. If value is <code>null</code>
* the key is removed from properties.
* @since 1.1
*/
public static void setProperty(String key, IResource resource, String value) throws CoreException
</pre></code> Current file properties:
<ul>
<li>JSP Fragment properties
(org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentProperties)<br />
JSPCONTENTTYPE - default content type for JSP Fragments<br />
JSPLANGUAGE - default language for JSP Fragments<br />
VALIDATE_FRAGMENTS - whether or not to validate JSP Fragment</li>
<li>HTML properties
(org.eclipse.wst.html.core.internal.contentproperties.HTMLContentProperties)<br />
DOCUMENT_TYPE - default content type for HTML when DOCTYPE is not
specified</li>
<li>CSS
properties(org.eclipse.wst.css.core.internal.contentproperties.CSSContentProperties)<br />
CSS_PROFILE - css profile to use</li>
</ul>
</td>
</tr>
</tbody>
</table>
<hr>
<p>Migration information from earlier revisions can be found <a
href="WebContentSettingsMigration.html">here</a>.
</body>
</html>