Defining Intro Content
Now we can look at the content itself. Content is described in terms of pages. All pages have an id attribute.
This is the id that is used when defining the home and standby pages, and other places where there is a reference
to a page. Otherwise, the relevant attributes depend on the kind of page that is defined.
There are two basic types of pages:
- Static pages are plain HTML files. These pages use the normal HTML mechanisms to link to other
pages. Static pages need not be defined in the config content file, except for the home page. Since the home
page is specified by id (home-page-id) in the presentation element, there must be a page definition
using that id in the content file. This page need only define a url. All other subelements will be ignored
since the HTML page itself will describe the page content. All other HTML intro pages contributed by the plug-in
must be included with the plug-in, but do not need to be specified in the content file. HTML files located in other
plug-ins or on the web may be referenced also.
- Dynamic pages are described in the XML content file using subelements that describe the content of the
page. The subelements are UI items often found in HTML-like pages. Depending on the implementation, these pages
will either be dynamically translated to HTML (when the implementation kind is html) or else dynamically
created as SWT-based UI forms (when the implementation kind is swt). The following subelements
can be defined in a page:
- A group is used to group other subelements and define a consistent style across the group.
- A link defines a link that can be displayed using an image and text. The link can navigate to another
page and optionally run an intro action. Actions are specified as commands in the URL.
- The text and img elements show text and image content.
- The include element includes a previously defined subelement. The element is referred to by its id.
- The head element defines additional HTML to be included in the head section of the page
when the html implementation is used.
- The html element defines additional HTML to be included in the body of the page
when the html implementation is used.
A title for a page may also be defined. A page may also specify that
its content is defined in a separate content file. Breaking up pages into separate
files may be useful when performance is a concern, since an intro page's contents won't be initialized until needed.
The best way to get a feel for the content definition format is to browse the
implementations in the Eclipse SDK. The snippet below shows an example of this:
<introContent>
<page alt-style="css/root_swt.properties" style="css/root.css" id="root" style-id="page">
<title style-id="intro-header">Welcome to Eclipse Platform</title>
<group id="links-background">
<group id="page-links">
<link label="Overview" url="http://org.eclipse.ui.intro/showPage?id=overview" id="overview" style-id="left">
<text>Find out what Eclipse is all about</text>
</link>
<link label="Tutorials" url="http://org.eclipse.ui.intro/showPage?id=tutorials" id="tutorials" style-id="left">
<text>Let us guide you through Eclipse end-to-end tutorials</text>
</link>
<link label="Samples" url="http://org.eclipse.ui.intro/showPage?id=samples" id="samples" style-id="right">
<text>Explore Eclipse development through code samples</text>
</link>
<link label="Whats New" url="http://org.eclipse.ui.intro/showPage?id=news" id="news" style-id="right">
<text>Find out what is new in this release</text>
</link>
</group>
</group>
...
Elements on a page can also be filteredFrom a particular implementation. This allows page designers
to design with particular platforms in mind. There are many more powerful attributes that
can be used when describing a page and its contents. See the extension point documentation for
org.eclipse.ui.intro.config
and its associated intro content file format specification for a complete reference of
valid elements, subelements, and their attributes.