Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDejan Gloszic2004-06-11 00:22:25 +0000
committerDejan Gloszic2004-06-11 00:22:25 +0000
commit8373d02dc4767f65ee89eeb94a378e391cedd73e (patch)
treee23b7d1d58be9fb001f6bf6137ee1834fa6f6b49 /org.eclipse.ui.intro
parent785cd3d16cd8427922d736c69ea7537f517e959a (diff)
downloadeclipse.platform.ua-8373d02dc4767f65ee89eeb94a378e391cedd73e.tar.gz
eclipse.platform.ua-8373d02dc4767f65ee89eeb94a378e391cedd73e.tar.xz
eclipse.platform.ua-8373d02dc4767f65ee89eeb94a378e391cedd73e.zip
*** empty log message ***v20040610MFv20040610_withLinkImage
Diffstat (limited to 'org.eclipse.ui.intro')
-rw-r--r--org.eclipse.ui.intro/schema/IntroContent.exsd21
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/IIntroHTMLConstants.java1
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/IntroHTMLGenerator.java18
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroLink.java17
4 files changed, 40 insertions, 17 deletions
diff --git a/org.eclipse.ui.intro/schema/IntroContent.exsd b/org.eclipse.ui.intro/schema/IntroContent.exsd
index d9b583b76..9df9c3614 100644
--- a/org.eclipse.ui.intro/schema/IntroContent.exsd
+++ b/org.eclipse.ui.intro/schema/IntroContent.exsd
@@ -23,12 +23,12 @@
<element name="page">
<annotation>
<documentation>
- This element is used to describe a page to be displayed. A page can be either either dynamic or static.&lt;br/&gt;
-&lt;br/&gt;
-Static pages allow for reuse of existing HTML documents within ones introduction. When a static page is used, none of the subelements are utilized. Also note when the SWT presentation is used and a static page is to be displayed an external brower is launched and the current page remains visible.&lt;br/&gt;
-&lt;br/&gt;
-Dynamic pages do not have a url defined and their contents are generated from the subelements of the page. The style or alt-style will be applied depending on the presentation. The styles can be further enhanced by referencing the id or class-id.&lt;br/&gt;
-
+ This element is used to describe a page to be displayed. A page can be either either dynamic or static.&lt;br/&gt;
+&lt;br/&gt;
+Static pages allow for reuse of existing HTML documents within ones introduction. When a static page is used, none of the subelements are utilized. Also note when the SWT presentation is used and a static page is to be displayed an external brower is launched and the current page remains visible.&lt;br/&gt;
+&lt;br/&gt;
+Dynamic pages do not have a url defined and their contents are generated from the subelements of the page. The style or alt-style will be applied depending on the presentation. The styles can be further enhanced by referencing the id or class-id.&lt;br/&gt;
+
A &lt;b&gt;group&lt;/b&gt; subelement is used to group of content and apply style across the grouped content. A &lt;b&gt;link&lt;/b&gt; subelement defines a link which can be used to link to a page and run an intro action/command. A link is normally defined at the page level to navigate between main pages verses links within a page. A &lt;b&gt;text&lt;/b&gt; subelement defines textual content for the page level. A &lt;b&gt;head&lt;/b&gt; subelement is only applicable for the Web based presentation and allows for additional html to be added to the HTML &lt;b&gt;head&lt;/b&gt; section. This is useful for adding java srcipts or extra styles sheets. An &lt;b&gt;img&lt;/b&gt; subelement defines image content for the page level. An &lt;b&gt;include&lt;/b&gt; subelement allows for reuse any element other than a page. An &lt;b&gt;html&lt;/b&gt; subelement is only applicable for the Web based presentation and allows for the embedding or inclusion of html into the page&apos;s content. Embedding allows for a fully defined html file to be embeded within an HTML &lt;b&gt;object&lt;/b&gt; by referencing the html file. Inclusion allows for embedding an html snippets directly from html file. A &lt;b&gt;title&lt;/b&gt; subelement defines the title of the page.
</documentation>
</annotation>
@@ -90,7 +90,7 @@ A &lt;b&gt;group&lt;/b&gt; subelement is used to group of content and apply styl
<attribute name="content" type="string">
<annotation>
<documentation>
- an optional attribute which can define the location of an introContent.xml file that represents the content of this page. When defined all attributes in this page element, except id, are ignored. This is because the content of this page is now assumed to reside in the xml files pointed to by the content file. It is also assumed that this new file has only one page deifned. When resolving to the content of this file, the page with a matching is to the id defined in this page is chosen.
+ an optional attribute which can define the location of an introContent.xml file that represents the content of this page. When defined all attributes in this page element, except id, are ignored. This is because the content of this page is now assumed to reside in the xml files pointed to by the content file. It is also assumed that this new file has only one page deifned. When resolving to the content of this file, the page with a matching is to the id defined in this page is chosen.
This seperation out of pages can be used when performance is an issue, as the content of a page is now loaded more lazily.
</documentation>
</annotation>
@@ -159,6 +159,7 @@ This seperation out of pages can be used when performance is an issue, as the co
<complexType>
<sequence>
<element ref="text" minOccurs="0" maxOccurs="1"/>
+ <element ref="img" minOccurs="0" maxOccurs="1"/>
</sequence>
<attribute name="id" type="string">
<annotation>
@@ -209,7 +210,7 @@ This seperation out of pages can be used when performance is an issue, as the co
<element name="html">
<annotation>
<documentation>
- direct HTML to include in the page either by embedding the entire document, or inlining a snippet of HTML in-place. A fallback image or text must be defined for alternative swt presentation rendering.
+ direct HTML to include in the page either by embedding the entire document, or inlining a snippet of HTML in-place. A fallback image or text must be defined for alternative swt presentation rendering.
Embedding allows for a fully defined html file to be embeded within an HTML object by referencing the html file. Inclusion allows for embedding an html snippets directly from html file.
</documentation>
</annotation>
@@ -314,7 +315,7 @@ Embedding allows for a fully defined html file to be embeded within an HTML obje
<element name="text">
<annotation>
<documentation>
- a snippet of text that can optionally contain escaped HTML tags. It can include b and li tags. It can also contain anchors for urls.
+ a snippet of text that can optionally contain escaped HTML tags. It can include b and li tags. It can also contain anchors for urls.
If multiple paragraphs are needed, then the text can be divided into multiple sections each begining and ending with the p tag.
</documentation>
</annotation>
@@ -385,7 +386,7 @@ If multiple paragraphs are needed, then the text can be divided into multiple se
<element name="head">
<annotation>
<documentation>
- Direct HTML to include in a page&apos;s HEAD content area. It allows for additional html to be added to the HTML HEAD section. This is useful for adding java srcipts or extra styles sheets.
+ Direct HTML to include in a page&apos;s HEAD content area. It allows for additional html to be added to the HTML HEAD section. This is useful for adding java srcipts or extra styles sheets.
This markup is only to be used with an SWT Based intro part implementation. It is simply ignored in the case of a UI Forms implementation. A page can have more than one head element. An implementation can have one and only one head element (since it is a shared head content, it makes sense to just define it in one file).
</documentation>
</annotation>
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/IIntroHTMLConstants.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/IIntroHTMLConstants.java
index 95ab0f24d..0639c4749 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/IIntroHTMLConstants.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/IIntroHTMLConstants.java
@@ -65,6 +65,7 @@ public interface IIntroHTMLConstants {
String ANCHOR_CLASS_LINK = "link"; //$NON-NLS-1$
String IMAGE_SRC_BLANK = "icons/blank.gif"; //$NON-NLS-1$
+ String IMAGE_CLASS_BG = "background-image"; //$NON-NLS-1$
String SPAN_ID_PRESENTATION_TITLE = "presentation-title"; //$NON-NLS-1$
String SPAN_ID_PAGE_TITLE = "page-title"; //$NON-NLS-1$
String SPAN_CLASS_DIV_LABEL = "div-label"; //$NON-NLS-1$
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/IntroHTMLGenerator.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/IntroHTMLGenerator.java
index beb1d89b6..a50195ce9 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/IntroHTMLGenerator.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/IntroHTMLGenerator.java
@@ -299,8 +299,13 @@ public class IntroHTMLGenerator {
String blankImageURL = IntroModelRoot.getPluginLocation(
IIntroHTMLConstants.IMAGE_SRC_BLANK, IIntroConstants.PLUGIN_ID);
if (blankImageURL != null) {
- anchor.addContent(generateImageElement(blankImageURL, null,
- indentLevel + 1));
+ anchor.addContent(generateImageElement(blankImageURL, null,
+ IIntroHTMLConstants.IMAGE_CLASS_BG, indentLevel + 1));
+ }
+ // add link image, if one is specified
+ if(element.getImg() != null) {
+ HTMLElement img = generateIntroImage(element.getImg(), indentLevel + 1);
+ anchor.addContent(img);
}
// add <SPAN class="link-label">linkLabel</SPAN>
if (element.getLabel() != null) {
@@ -358,13 +363,10 @@ public class IntroHTMLGenerator {
*/
private HTMLElement generateIntroImage(IntroImage element, int indentLevel) {
HTMLElement imageElement = generateImageElement(element.getSrc(),
- element.getAlt(), indentLevel);
+ element.getAlt(), element.getStyleId(), indentLevel);
if (element.getId() != null)
imageElement.addAttribute(IIntroHTMLConstants.ATTRIBUTE_ID, element
.getId());
- if (element.getStyleId() != null)
- imageElement.addAttribute(IIntroHTMLConstants.ATTRIBUTE_CLASS,
- element.getStyleId());
return imageElement;
}
/**
@@ -746,13 +748,15 @@ public class IntroHTMLGenerator {
* @return an img HTMLElement
*/
private HTMLElement generateImageElement(String imageSrc, String altText,
- int indentLevel) {
+ String imageClass, int indentLevel) {
HTMLElement image = new FormattedHTMLElement(
IIntroHTMLConstants.ELEMENT_IMG, indentLevel, true, false);
image.addAttribute(IIntroHTMLConstants.ATTRIBUTE_SRC, imageSrc);
if (altText == null)
altText = ""; //$NON-NLS-1$
image.addAttribute(IIntroHTMLConstants.ATTRIBUTE_ALT, altText);
+ if(imageClass != null)
+ image.addAttribute(IIntroHTMLConstants.ATTRIBUTE_CLASS, imageClass);
return image;
}
/**
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroLink.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroLink.java
index 6d6053da2..a543b66c6 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroLink.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroLink.java
@@ -24,9 +24,11 @@ public class IntroLink extends AbstractTextElement {
private static final String ATT_LABEL = "label"; //$NON-NLS-1$
private static final String ATT_URL = "url"; //$NON-NLS-1$
+ private static final String TAG_IMG = "img"; //$NON-NLS-1$
private String label;
private String url;
+ private IntroImage img;
private IntroURL introURL;
/**
@@ -44,6 +46,15 @@ public class IntroLink extends AbstractTextElement {
if (parser.hasIntroUrl())
introURL = parser.getIntroURL();
}
+
+ // There should be at most one img element.
+ NodeList imgElements = element
+ .getElementsByTagName(TAG_IMG);
+ if (imgElements.getLength() > 0) {
+ img = new IntroImage((Element) imgElements.item(0),
+ getBundle());
+ img.setParent(this);
+ }
}
/**
@@ -79,4 +90,10 @@ public class IntroLink extends AbstractTextElement {
return AbstractIntroElement.LINK;
}
+ /**
+ * @return Returns the img.
+ */
+ public IntroImage getImg() {
+ return img;
+ }
} \ No newline at end of file

Back to the top