GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Log in
  • Manage Cookies
  • Download
  • Projects
  • Working Groups
  • Members
  • Marketplace
  • Events
  • Planet Eclipse
  • Newsletter
  • Videos
  • Blogs
  • Report a Bug
  • Forums

This view

  • Original page
  • New address

GeezerVison is showing wiki.eclipse.org — Nebula LED - Eclipsepedia

Jump to: navigation, search

Nebula LED

< Back to Nebula Main Page

Introduction

Ledwidget.png

This widget displays characters as if they were displayed on a LED.

Contents

  • 1 Introduction
  • 2 Usage
    • 2.1 LED
    • 2.2 DotsLed
    • 2.3 LEDSeparator
    • 2.4 Customization
  • 3 Example

Usage

3 components are available.

LED

This component displays a single character, and possibly a dot in the left bottom corner of the widget. To set the character to display you have to pick a value in the enumeration LEDCharacter : all letters and digits are available, plus 2 special values : CLEAR to display a blank widget (no element is lit) and MINUS to display a dash character.

Character no dot.png

LED led = new LED(top, SWT.NONE);
led.setCharacter(LEDCharacter.THREE);

If you want to display the dot in the left bottom corner, you have to set the flag SWT.ICON. To switch on/off the light, you can use the method setShowDot(boolean value)

Character dot.png

LED led = new LED(composite, SWT.ICON);
led.setCharacter(LEDCharacter.THREE);
led.setShowDot(true);

DotsLed

This component display a colon :

Ledcolon.png

To switch on/off the colon, you have to use the methods switchOn() and switchOff()

DotsLed dots = new DotsLed(composite, SWT.NONE);
dots.switchOn();

LEDSeparator

This components displays a separator (thin line, white by default)

Ledseparator.png

LEDSeparator sep = new LEDSeparator(composite, SWT.NONE);

Customization

Because the widget is a canvas, you can change the background color with the method setBackground(...).

For the LEDS, you can change the color of the line with the method setForeground(...)

For both LED and DotsLed components, you can change the idle and selected color with the suitable method :

LED led = new LED(top, SWT.NONE);
led.setCharacter(LEDCharacter.A);

Color idleColor = new Color(shell.getDisplay(), 60, 60, 60);
led.setIdleColor(idleColor);

Color selectedColor = new Color(shell.getDisplay(), 255, 0, 0);
led.setSelectedColor(selectedColor);

Example

An example called LEDSnippet.java is located in the plugin org.eclipse.nebula.widgets.led.snippets.

This example is also available here : LEDSnippet.java

Retrieved from "https://wiki.eclipse.org/index.php?title=Nebula_LED&oldid=438764"

This page was last modified 06:34, 19 March 2020 by Eclipsepedia anonymous user Unnamed Poltroon.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.