Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.ui.intro')
-rw-r--r--org.eclipse.ui.intro/empty_swt.properties8
-rw-r--r--org.eclipse.ui.intro/schema/IntroContent.exsd45
-rw-r--r--org.eclipse.ui.intro/schema/introContentFileSpec.html16
-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.java12
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroContainer.java6
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroElement.java5
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroSeparator.java35
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/viewer/IntroModelLabelProvider.java4
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageWidgetFactory.java28
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/IntroModelSerializer.java10
11 files changed, 163 insertions, 7 deletions
diff --git a/org.eclipse.ui.intro/empty_swt.properties b/org.eclipse.ui.intro/empty_swt.properties
index d76cbfd18..ca26798bd 100644
--- a/org.eclipse.ui.intro/empty_swt.properties
+++ b/org.eclipse.ui.intro/empty_swt.properties
@@ -73,6 +73,11 @@
! property starts with a ".", then this property applies to this whole page,
! and to any page that inherits the properties of this page. So in effect,
! this property becomes like a shared property.
+!
+! A short form of the property that uses element id can be used:
+! <pageId.<elementId>.property = value
+! Use this for elements that do not have fixed path (when late target
+! path resolution is used).
! Flag to display link description in a given page. Default is true.
<pageId>.show-link-description = true/false
@@ -153,6 +158,9 @@
! does not have a bold property explicitly set.
bold-style-id = <style id of child subtitle Text element>
+ ! Color for separator elements:
+ <pageId>.separator.fg = #rrggbb hex
+
diff --git a/org.eclipse.ui.intro/schema/IntroContent.exsd b/org.eclipse.ui.intro/schema/IntroContent.exsd
index 86df70460..cd6719cb7 100644
--- a/org.eclipse.ui.intro/schema/IntroContent.exsd
+++ b/org.eclipse.ui.intro/schema/IntroContent.exsd
@@ -123,7 +123,6 @@ Since 3.1, if the content of the external file is XHTML 1.0, then the page is re
<annotation>
<documentation>
an optional URL of the image to use as a background for this group
-
</documentation>
</annotation>
</attribute>
@@ -420,7 +419,7 @@ If multiple paragraphs are needed, then the text can be divided into multiple se
<attribute name="style-id" type="string">
<annotation>
<documentation>
- A means to classifiy this element into a given category so that a common style may be applied
+ A means to classify this element into a given category so that a common style may be applied
</documentation>
</annotation>
</attribute>
@@ -668,8 +667,7 @@ Since 3.1, styles can also be a comma separated list of styles. These styles wil
<attribute name="id" type="string">
<annotation>
<documentation>
- (since 3.2) a unique identifier of this extension required when used in conjunction with intro configurer.
-
+ (since 3.2) a unique identifier of this extension required when used in conjunction with intro configurer.
</documentation>
</annotation>
</attribute>
@@ -719,6 +717,45 @@ Another difference between the tags is that the html tag is only supported for t
</complexType>
</element>
+ <element name="hr">
+ <annotation>
+ <documentation>
+ a horizontal rule.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+ unique identifier of this hr
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="style-id" type="string">
+ <annotation>
+ <documentation>
+ A means to classify this element into a given category so that a common style may be applied
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="filteredFrom">
+ <annotation>
+ <documentation>
+ an optional attribute that allows for filtering a given element out of a specific implementation. For example, if a group has filteredFrom = swt, it means that this group will not appear as content in the swt implementation.
+ </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="swt">
+ </enumeration>
+ <enumeration value="html">
+ </enumeration>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+
<annotation>
<appInfo>
<meta.section type="since"/>
diff --git a/org.eclipse.ui.intro/schema/introContentFileSpec.html b/org.eclipse.ui.intro/schema/introContentFileSpec.html
index 0af9bdfed..3bee8b540 100644
--- a/org.eclipse.ui.intro/schema/introContentFileSpec.html
+++ b/org.eclipse.ui.intro/schema/introContentFileSpec.html
@@ -28,7 +28,8 @@ DTD fragments.</p>
The introContent element defines the body of the intro content file. The content file is made up of pages, shared groups that can be included in multiple pages, and extensions to anchor points defined in other configurations.</p>
<br><br>
<h2><code>page</code></h2>
-<br><p class=code id=dtd>&lt;!ELEMENT <a name="e.page">page</a> (<a href="#e.group">group</a>* | <a href="#e.link">link</a>* | <a href="#e.text">text</a>* | <a href="#e.head">head</a>* | <a href="#e.img">img</a>* | <a href="#e.include">include</a>* | <a href="#e.html">html</a>* | <a href="#e.title">title</a>? | <a href="#e.anchor">anchor</a>*
+<br><p class=code id=dtd>&lt;!ELEMENT <a name="e.page">page</a> (<a href="#e.group">group</a>* | <a href="#e.link">link</a>* | <a href="#e.text">text</a>* | <a href="#e.head">head</a>* | <a href="#e.img">img</a>* | <a href="#e.include">include</a>* |
+<a href="#e.html">html</a>* | <a href="#e.hr">hr</a>* | <a href="#e.title">title</a>? | <a href="#e.anchor">anchor</a>*
| <a href="#e.contentProvider">contentProvider</a>*)&gt;</p>
<p class=code id=dtd>&lt;!ATTLIST page</p>
<p class=code id=dtdAttlist>url&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED<p class=code id=dtdAttlist>id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED<p class=code id=dtdAttlist>style&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED<p class=code id=dtdAttlist>alt-style&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED<p class=code id=dtdAttlist>filteredFrom&nbsp;(swt|html)<br>
@@ -219,6 +220,19 @@ Inclusion allows for including an html snippet directly from a file into the dyn
<li><b>filteredFrom</b> - an optional attribute that allows for filtering a given element out of a specific implementation. For example, if a group has filteredFrom = swt, it means that this group will not appear as content in the swt implementation.</li>
<li><b>encoding</b> - an optional attribute to specify the encoding of the inlined file (in the case where type=inline is specified). If not specified, the default is UTF-8. Since 3.0.1</li>
</ul>
+<h2><code>hr</code></h2>
+<br><p class=code id=dtd0>&lt;!ELEMENT <a name="e.hr">hr</a> EMPTY&gt;</p>
+<p class=code id=dtd1>&lt;!ATTLIST hr</p>
+<p class=code id=dtdAttlist0>id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED<p class=code id=dtdAttlist1>style-id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED<p class=code id=dtdAttlist2>filteredFrom&nbsp;(swt|html) &gt;</p>
+<p></p>
+<p class=ConfigMarkup id=elementDesc0>
+a horizontal rule.</p>
+<br>
+<ul class=ConfigMarkup id=attlistDesc0>
+<li><b>id</b> - unique identifier of this rule.</li>
+<li><b>style-id</b> - A means to classify this element into a given category so that a common style may be applied</li>
+<li><b>filteredFrom</b> - an optional attribute that allows for filtering a given element out of a specific implementation. For example, if a group has filteredFrom = swt, it means that this group will not appear as content in the swt implementation.</li>
+</ul>
<h2><code>title</code></h2>
<br><p class=code id=dtd>&lt;!ELEMENT <a name="e.title">title</a> EMPTY&gt;</p>
<p class=code id=dtd>&lt;!ATTLIST title</p>
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 5331479bd..5e23ad1a3 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
@@ -40,6 +40,7 @@ public interface IIntroHTMLConstants {
String ELEMENT_H2 = "H2"; //$NON-NLS-1$
String ELEMENT_H3 = "H3"; //$NON-NLS-1$
String ELEMENT_H4 = "H4"; //$NON-NLS-1$
+ String ELEMENT_HR = "HR"; //$NON-NLS-1$
String ELEMENT_PARAGRAPH = "P"; //$NON-NLS-1$
String ELEMENT_STYLE = "STYLE"; //$NON-NLS-1$
String ELEMENT_IFrame = "iFrame"; //$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 6dffc9ae2..6abc0aefb 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
@@ -30,6 +30,7 @@ import org.eclipse.ui.internal.intro.impl.model.IntroImage;
import org.eclipse.ui.internal.intro.impl.model.IntroInjectedIFrame;
import org.eclipse.ui.internal.intro.impl.model.IntroLink;
import org.eclipse.ui.internal.intro.impl.model.IntroPageTitle;
+import org.eclipse.ui.internal.intro.impl.model.IntroSeparator;
import org.eclipse.ui.internal.intro.impl.model.IntroText;
import org.eclipse.ui.internal.intro.impl.model.loader.ContentProviderManager;
import org.eclipse.ui.internal.intro.impl.model.util.BundleUtil;
@@ -257,6 +258,8 @@ public class IntroHTMLGenerator {
return generateIntroContent((IntroContentProvider) element, indentLevel);
case AbstractIntroElement.IMAGE:
return generateIntroImage((IntroImage) element, indentLevel);
+ case AbstractIntroElement.HR:
+ return generateIntroSeparator((IntroSeparator) element, indentLevel);
case AbstractIntroElement.TEXT:
return generateIntroText((IntroText) element, indentLevel);
case AbstractIntroElement.PAGE_TITLE:
@@ -459,6 +462,15 @@ public class IntroHTMLGenerator {
imageElement.addAttribute(IIntroHTMLConstants.ATTRIBUTE_ID, element.getId());
return imageElement;
}
+
+ private HTMLElement generateIntroSeparator(IntroSeparator element, int indentLevel) {
+ HTMLElement hrElement = new FormattedHTMLElement(IIntroHTMLConstants.ELEMENT_HR, indentLevel, false);
+ if (element.getId() != null)
+ hrElement.addAttribute(IIntroHTMLConstants.ATTRIBUTE_ID, element.getId());
+ if (element.getStyleId() != null)
+ hrElement.addAttribute(IIntroHTMLConstants.ATTRIBUTE_STYLE, element.getStyleId());
+ return hrElement;
+ }
/**
* Generate a paragraph (&lt;P&gt;) element from an IntroText. The paragraph element will
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroContainer.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroContainer.java
index 7f46a9b02..cc7515e9a 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroContainer.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroContainer.java
@@ -166,6 +166,9 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement {
case AbstractIntroElement.IMAGE:
src = new IntroImage[size];
break;
+ case AbstractIntroElement.HR:
+ src = new IntroSeparator[size];
+ break;
case AbstractIntroElement.HTML:
src = new IntroHTML[size];
break;
@@ -294,6 +297,9 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement {
else if (childElement.getNodeName().equalsIgnoreCase(
IntroImage.TAG_IMAGE))
child = new IntroImage(childElement, bundle, base);
+ else if (childElement.getNodeName().equalsIgnoreCase(
+ IntroSeparator.TAG_HR))
+ child = new IntroSeparator(childElement, bundle, base);
else if (childElement.getNodeName()
.equalsIgnoreCase(IntroHTML.TAG_HTML))
child = new IntroHTML(childElement, bundle, base);
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroElement.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroElement.java
index d841b225c..f8c72688f 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroElement.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroElement.java
@@ -144,6 +144,11 @@ public abstract class AbstractIntroElement extends FilterableUAElement implement
* Type constant for the theme element.
*/
public static final int THEME = 1 << 18;
+
+ /**
+ * Type constant for the hr element.
+ */
+ public static final int HR = 1 << 19;
/**
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroSeparator.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroSeparator.java
new file mode 100644
index 000000000..99554bf59
--- /dev/null
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroSeparator.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ui.internal.intro.impl.model;
+
+import org.osgi.framework.Bundle;
+import org.w3c.dom.Element;
+
+/**
+ * A horizontal ruler element.
+ */
+public class IntroSeparator extends AbstractBaseIntroElement {
+ protected static final String TAG_HR = "hr"; //$NON-NLS-1$
+
+ IntroSeparator(Element element, Bundle bundle, String base) {
+ super(element, bundle);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.internal.intro.impl.model.IntroElement#getType()
+ */
+ public int getType() {
+ return AbstractIntroElement.HR;
+ }
+}
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/viewer/IntroModelLabelProvider.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/viewer/IntroModelLabelProvider.java
index 8489ec47b..022bf6482 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/viewer/IntroModelLabelProvider.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/viewer/IntroModelLabelProvider.java
@@ -23,6 +23,7 @@ import org.eclipse.ui.internal.intro.impl.model.IntroImage;
import org.eclipse.ui.internal.intro.impl.model.IntroInclude;
import org.eclipse.ui.internal.intro.impl.model.IntroLink;
import org.eclipse.ui.internal.intro.impl.model.IntroPartPresentation;
+import org.eclipse.ui.internal.intro.impl.model.IntroSeparator;
import org.eclipse.ui.internal.intro.impl.model.IntroText;
import org.eclipse.ui.internal.intro.impl.util.ImageUtil;
@@ -87,6 +88,9 @@ public class IntroModelLabelProvider extends LabelProvider {
case AbstractIntroElement.IMAGE:
label = "IMAGE: " + ((IntroImage) introElement).getId(); //$NON-NLS-1$
break;
+ case AbstractIntroElement.HR:
+ label = "HR: " + ((IntroSeparator) introElement).getId(); //$NON-NLS-1$
+ break;
case AbstractIntroElement.HTML:
label = "HTML: " + ((IntroHTML) introElement).getId(); //$NON-NLS-1$
break;
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageWidgetFactory.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageWidgetFactory.java
index 18fc68608..5a7f4b402 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageWidgetFactory.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageWidgetFactory.java
@@ -18,6 +18,7 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.FormColors;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.FormText;
@@ -35,6 +36,7 @@ import org.eclipse.ui.internal.intro.impl.model.IntroGroup;
import org.eclipse.ui.internal.intro.impl.model.IntroHTML;
import org.eclipse.ui.internal.intro.impl.model.IntroImage;
import org.eclipse.ui.internal.intro.impl.model.IntroLink;
+import org.eclipse.ui.internal.intro.impl.model.IntroSeparator;
import org.eclipse.ui.internal.intro.impl.model.IntroText;
import org.eclipse.ui.internal.intro.impl.model.loader.ContentProviderManager;
import org.eclipse.ui.internal.intro.impl.model.url.IntroURLParser;
@@ -163,6 +165,12 @@ public class PageWidgetFactory {
c = createContentProvider(parent, provider);
updateLayoutData(c, element);
break;
+ case AbstractIntroElement.HR:
+ IntroSeparator sep = (IntroSeparator)element;
+ c = createSeparator(parent, sep);
+ updateLayoutData(c, element);
+ break;
+
default:
break;
}
@@ -348,8 +356,7 @@ public class PageWidgetFactory {
ilabel.setLayoutData(td);
return ilabel;
}
-
-
+
public Control createContentProvider(Composite parent,
IntroContentProvider provider) {
// If we've already loaded the content provider for this element,
@@ -393,6 +400,23 @@ public class PageWidgetFactory {
}
return container;
}
+
+ protected Control createSeparator(Composite parent, IntroSeparator sep) {
+ String key = sep.getParentPage().getId()+".separator.fg"; //$NON-NLS-1$
+ Color fg = styleManager.getColor(toolkit, key);
+ //Composite l = toolkit.createCompositeSeparator(parent);
+ Composite l = new Composite(parent, SWT.NULL);
+ if (fg!=null)
+ l.setBackground(fg);
+ else
+ l.setBackground(toolkit.getColors().getColor(FormColors.SEPARATOR));
+ TableWrapData td = new TableWrapData(TableWrapData.FILL,
+ TableWrapData.FILL);
+ td.grabHorizontal = true;
+ td.maxHeight = 1;
+ l.setLayoutData(td);
+ return l;
+ }
private void colorControl(Control elementControl,
AbstractBaseIntroElement element) {
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/IntroModelSerializer.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/IntroModelSerializer.java
index e3a8bd594..c71b17dfc 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/IntroModelSerializer.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/IntroModelSerializer.java
@@ -28,6 +28,7 @@ import org.eclipse.ui.internal.intro.impl.model.IntroLink;
import org.eclipse.ui.internal.intro.impl.model.IntroModelRoot;
import org.eclipse.ui.internal.intro.impl.model.IntroPage;
import org.eclipse.ui.internal.intro.impl.model.IntroPageTitle;
+import org.eclipse.ui.internal.intro.impl.model.IntroSeparator;
import org.eclipse.ui.internal.intro.impl.model.IntroText;
import org.osgi.framework.Bundle;
@@ -169,6 +170,9 @@ public class IntroModelSerializer {
case AbstractIntroElement.IMAGE:
printImage(text, (IntroImage) children[i], indent);
break;
+ case AbstractIntroElement.HR:
+ printSeparator(text, (IntroSeparator) children[i], indent);
+ break;
case AbstractIntroElement.HTML:
printHtml(text, (IntroHTML) children[i], indent);
break;
@@ -225,6 +229,12 @@ public class IntroModelSerializer {
text.append(indent + "alt = " + image.getAlt()); //$NON-NLS-1$
text.append(indent + "style-id = " + image.getStyleId()); //$NON-NLS-1$
}
+
+ private void printSeparator(StringBuffer text, IntroSeparator sep, String indent) {
+ text.append(indent + "HR: id = " + sep.getId()); //$NON-NLS-1$
+ indent = indent + "\t\t"; //$NON-NLS-1$
+ text.append(indent + "style-id = " + sep.getStyleId()); //$NON-NLS-1$
+ }
private void printHtml(StringBuffer text, IntroHTML html, String indent) {
text.append(indent + "HTML: id = " + html.getId()); //$NON-NLS-1$

Back to the top