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

Difference between revisions of "Nebula Header"

(Created page with "==Introduction== File: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....")
 
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
[[Nebula|< Back to Nebula Main Page]]
 +
 
==Introduction==
 
==Introduction==
  
Line 4: Line 6:
  
 
A widget that display a header, composed of a title, an image and a description.
 
A widget that display a header, composed of a title, an image and a description.
 +
 +
__TOC__
  
 
==Usage==
 
==Usage==
  
 
The header is composed of :
 
The header is composed of :
* A title (cf. setTitle), displayed in bold and in blue by default.
+
* A title (cf. <code>setTitle</code>), displayed in bold and in blue by default.
 
** You can change the font and the color by setting the 2 properties <code>titleFont</code> and <code>titleColor</code>
 
** You can change the font and the color by setting the 2 properties <code>titleFont</code> and <code>titleColor</code>
 
* A description (cf. <code>setDescription</code>)
 
* A description (cf. <code>setDescription</code>)
Line 20: Line 24:
 
* <code><nowiki><u>...</u></nowiki></code> to render text in underline
 
* <code><nowiki><u>...</u></nowiki></code> to render text in underline
 
* <code><nowiki><b>...</b></nowiki></code> to render text in bold
 
* <code><nowiki><b>...</b></nowiki></code> to render text in bold
* <code><nowiki><size>...</size> to increase/decrease text size. You can use the following syntaxes : <code><nowiki><size=10> (10px), <size=+4>, <size=-4></nowiki></code>
+
* <code><nowiki><size>...</size></nowiki></code> to increase/decrease text size. You can use the following syntaxes : <code><nowiki><size=10> (10px), <size=+4>, <size=-4></nowiki></code>
 
* <code><nowiki><color>...</color></nowiki></code> to change foreground color. You can use the following syntaxes : <code><nowiki><color=#FFCCAA></nowiki></code> (HTML color code),  <code><nowiki><color=9,255,10></nowiki></code> (RGB values) and  <code><nowiki><color=aliceblue</nowiki></code>> (HTML color code)
 
* <code><nowiki><color>...</color></nowiki></code> to change foreground color. You can use the following syntaxes : <code><nowiki><color=#FFCCAA></nowiki></code> (HTML color code),  <code><nowiki><color=9,255,10></nowiki></code> (RGB values) and  <code><nowiki><color=aliceblue</nowiki></code>> (HTML color code)
 
* <code><nowiki><backgroundcolor>...</backgroundcolor></nowiki></code> to change background color. You can use the following syntaxes :  <code><nowiki><backgroundcolor=#FFCCAA></nowiki></code> (HTML color code),  <code><nowiki><backgroundcolor=9,255,10></nowiki></code> (RGB values) and  <code><nowiki><backgroundcolor=aliceblue></nowiki></code> (HTML color code)
 
* <code><nowiki><backgroundcolor>...</backgroundcolor></nowiki></code> to change background color. You can use the following syntaxes :  <code><nowiki><backgroundcolor=#FFCCAA></nowiki></code> (HTML color code),  <code><nowiki><backgroundcolor=9,255,10></nowiki></code> (RGB values) and  <code><nowiki><backgroundcolor=aliceblue></nowiki></code> (HTML color code)
  
 +
 
  final Header header = new Header(shell, SWT.NONE);
 
  final Header header = new Header(shell, SWT.NONE);
 
  header.setTitle("Header title");
 
  header.setTitle("Header title");
Line 33: Line 38:
 
An example called HeaderSnippet.java is located in the plugin org.eclipse.nebula.widgets.opal.header.snippets.
 
An example called HeaderSnippet.java is located in the plugin org.eclipse.nebula.widgets.opal.header.snippets.
  
This example is also available here : https://git.eclipse.org/c/nebula/org.eclipse.nebula.git/tree/widgets/opal/header/org.eclipse.nebula.widgets.opal.header.snippets/src/org/eclipse/nebula/widgets/opal/header/snippets/HeaderSnippet.java
+
This example is also available here : [https://github.com/eclipse/nebula/blob/master/widgets/opal/header/org.eclipse.nebula.widgets.opal.header/src/org/eclipse/nebula/widgets/opal/header/Header.java HeaderSnippet.java]

Latest revision as of 06:27, 19 March 2020

< 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