Skip to main content

Notice: This Wiki is now read only and edits are no longer 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 Notifier"

 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 +
[[Nebula|< Back to Nebula Main Page]]
 +
 
==Introduction==
 
==Introduction==
  
Line 15: Line 17:
 
The code is pretty simple :
 
The code is pretty simple :
  
<code>
+
  Notifier.notify("New Mail message", "Laurent CARON (lcaron@...)<br/><br/>Test message ...");
  <nowiki>
+
Notifier.notify("New Mail message",  
Notifier.notify("New Mail message", "Laurent CARON (lcaron@...)<br/><br/>Test message ...");
+
Notifier.notify("New Mail message",  
+
 
   "Laurent CARON (lcaron@...)<br/><br/>Test message with blue theme...",  
 
   "Laurent CARON (lcaron@...)<br/><br/>Test message with blue theme...",  
 
   NotifierTheme.BLUE_THEME);
 
   NotifierTheme.BLUE_THEME);
</nowiki></code>
 
  
 
4 methods are available :
 
4 methods are available :
Line 37: Line 36:
 
* <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)
Line 43: Line 42:
 
==Example==
 
==Example==
  
An example called NotifierSnippet is available in the plugin '''org.eclipse.nebula.widgets.opal.notifier.snippets'''.
+
An example called '''NotifierSnippet''' is available in the plugin '''org.eclipse.nebula.widgets.opal.notifier.snippets'''.
  
You can also have a look here : https://git.eclipse.org/c/nebula/org.eclipse.nebula.git/tree/widgets/opal/notifier/org.eclipse.nebula.widgets.opal.notifier.snippets/src/org/eclipse/nebula/widgets/opal/notifier/snippets/NotifierSnippet.java
+
You can also have a look here : [https://github.com/eclipse/nebula/blob/master/widgets/opal/notifier/org.eclipse.nebula.widgets.opal.notifier.snippets/src/org/eclipse/nebula/widgets/opal/notifier/snippets/NotifierSnippet.java NotifierSnippet.java]

Latest revision as of 07:03, 19 March 2020

< Back to Nebula Main Page

Introduction

Notifier.png

Usage

This component is dedicated to notify users. When a notification appears, a window slides in the bottom right corner on the screen.

The user can close this window by pressing the red cross. After about 5 seconds, the notification window fades out.

3 colors set (called themes) are available : YELLOW (default), BLUE or GRAY.

The code is pretty simple :

Notifier.notify("New Mail message", "Laurent CARON (lcaron@...)

Test message ..."); Notifier.notify("New Mail message", "Laurent CARON (lcaron@...)

Test message with blue theme...", NotifierTheme.BLUE_THEME);

4 methods are available :

public static void notify(final String title, final String text)
public static void notify(final Image image,final String title, final String text)
public static void notify(final String title, final String text, final NotifierTheme theme)
public static void notify(final Image image,final String title, final String text, final NotifierTheme theme)

You can change the image or the theme.

The text can contains some 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)

Example

An example called NotifierSnippet is available in the plugin org.eclipse.nebula.widgets.opal.notifier.snippets.

You can also have a look here : NotifierSnippet.java

Back to the top