Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Nebula Header

< Back to Nebula Main Page

Introduction

Header.png

A widget that display a header, composed of a title, an image and a description.

Usage

The header is composed of :

  • A title (cf. setTitle), displayed in bold and in blue by default.
    • You can change the font and the color by setting the 2 properties titleFont and titleColor
  • A description (cf. setDescription)
  • An image (optional, cf. setImage)
  • A gradient background
    • You can change the color by setting the properties gradientStart and gradientEnd

The description can contains some pseudo-HTML tags for formatting :

  • <br/> for adding a line break
  • <i>...</i> to render text in italic
  • <u>...</u> to render text in underline
  • <b>...</b> to render text in bold
  • <size>...</size> to increase/decrease text size. You can use the following syntaxes : <size=10> (10px), <size=+4>, <size=-4>
  • <color>...</color> to change foreground color. You can use the following syntaxes : <color=#FFCCAA> (HTML color code), <color=9,255,10> (RGB values) and <color=aliceblue> (HTML color code)
  • <backgroundcolor>...</backgroundcolor> to change background color. You can use the following syntaxes : <backgroundcolor=#FFCCAA> (HTML color code), <backgroundcolor=9,255,10> (RGB values) and <backgroundcolor=aliceblue> (HTML color code)


final Header header = new Header(shell, SWT.NONE);
header.setTitle("Header title");
header.setImage(icon);
header.setDescription("Description area for the header. You can put all additional, relevant information to the description panel (or jokes, citations, ... what you want !)");

Example

An example called HeaderSnippet.java is located in the plugin org.eclipse.nebula.widgets.opal.header.snippets.

This example is also available here : HeaderSnippet.java

Back to the top