Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.ui.intro')
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/IIntroHTMLConstants.java3
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/IntroHTMLGenerator.java9
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroImage.java12
3 files changed, 18 insertions, 6 deletions
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 23c343352..e65a32abc 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -58,6 +58,7 @@ public interface IIntroHTMLConstants {
String ATTRIBUTE_TYPE = "type"; //$NON-NLS-1$
String ATTRIBUTE_DATA = "data"; //$NON-NLS-1$
String ATTRIBUTE_ALT = "alt"; //$NON-NLS-1$
+ String ATTRIBUTE_TITLE = "title"; //$NON-NLS-1$
String ATTRIBUTE_FRAMEBORDER = "frameborder"; //$NON-NLS-1$
String ATTRIBUTE_SCROLLING = "scrolling"; //$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 d9a1e6cff..600353852 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
@@ -437,7 +437,7 @@ public class IntroHTMLGenerator {
String blankImageURL = BundleUtil.getResolvedResourceLocation(IIntroHTMLConstants.IMAGE_SRC_BLANK,
IIntroConstants.PLUGIN_ID);
if (blankImageURL != null) {
- anchor1.addContent(generateImageElement(blankImageURL, null, IIntroHTMLConstants.IMAGE_CLASS_BG,
+ anchor1.addContent(generateImageElement(blankImageURL, null, null, IIntroHTMLConstants.IMAGE_CLASS_BG,
indentBase + 1));
}
// add link image, if one is specified
@@ -515,7 +515,7 @@ public class IntroHTMLGenerator {
* @return an img HTMLElement
*/
private HTMLElement generateIntroImage(IntroImage element, int indentLevel) {
- HTMLElement imageElement = generateImageElement(element.getSrc(), element.getAlt(), element
+ HTMLElement imageElement = generateImageElement(element.getSrc(), element.getAlt(),element.getTitle(), element
.getStyleId(), indentLevel);
if (element.getId() != null)
imageElement.addAttribute(IIntroHTMLConstants.ATTRIBUTE_ID, element.getId());
@@ -956,7 +956,7 @@ public class IntroHTMLGenerator {
* the number of indents to insert before the element when it is printed
* @return an img HTMLElement
*/
- private HTMLElement generateImageElement(String imageSrc, String altText, String imageClass,
+ private HTMLElement generateImageElement(String imageSrc, String altText, String title, String imageClass,
int indentLevel) {
HTMLElement image = new FormattedHTMLElement(IIntroHTMLConstants.ELEMENT_IMG, indentLevel, true,
false);
@@ -981,6 +981,9 @@ public class IntroHTMLGenerator {
if (altText == null)
altText = ""; //$NON-NLS-1$
image.addAttribute(IIntroHTMLConstants.ATTRIBUTE_ALT, altText);
+ if (title != null) {
+ image.addAttribute(IIntroHTMLConstants.ATTRIBUTE_TITLE, title);
+ }
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/IntroImage.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroImage.java
index a630004c6..78f177435 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroImage.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroImage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,6 +24,7 @@ public class IntroImage extends AbstractBaseIntroElement {
private static final String ATT_SRC = "src"; //$NON-NLS-1$
private static final String ATT_ALT = "alt"; //$NON-NLS-1$
+ private static final String ATT_TITLE = "title"; //$NON-NLS-1$
private Element element;
private String src;
@@ -34,13 +35,20 @@ public class IntroImage extends AbstractBaseIntroElement {
this.element = element;
this.base = base;
}
-
+
/**
* @return Returns the alt.
*/
public String getAlt() {
return getAttribute(element, ATT_ALT);
}
+
+ /**
+ * @return Returns the title.
+ */
+ public String getTitle() {
+ return getAttribute(element, ATT_TITLE);
+ }
/*

Back to the top