Eclipse Spot

StatusBar Example

StatusBar Example allows you to see the StatusBar fragment plugin in action and provides sample code for usage in an E4 RCP application.

Installation and Setup

Installation requires Git and maven. Eclipse plug-ins are built with maven using Tycho.

Please note the configured Tycho version is 0.25.0. This requires Java 8 and Maven v3.3.1 or above.

The deploy steps are:

  1. Git clone https://github.com/andrew-bowley/statusbar_example
  2. Go to the status-bar directory and run command "mvn clean verify"

The build should complete successfully and the executable will be found in the releng/statusbar.example.product project location under target/products/Statusbar-example/... (filepath details are platform-specific).

Usage

When StatusBar Example is launched, small application main window appears with title "Eclipse 4 RCP Status Bar", a simple top-level menu, some controls and a status line containing 3 items tagged according to position ie. "Right", "- Middle -" and "Left".

The controls interact with the status line by sending to the items events that may occur in an Instant Messaging application, such as change in presence from "Online" to "Away".

Here is how the status line looks for everything good:

Status everything good

The status items represent status for, from left to right, "presence ", "logged in" and "online security ".

Here is how the controls are set to get the "everything good" status line:

Status line everything good

The "Menu demo" selection causes the logged in status item to be displayed. Right click on the item and a "New login" context menu pops up. When selected, a log in is simulated:

Status logging in

The top control, labelled "Message" is a text entry field which is echoed in the status line in one of two items, depending on "Menu demo" selection. When "Menu demo" is selected, the text is displayed in a 4th status item.

Status line message

This reveals how the status line layout is arranged. The items are positioned in order from left to right. The last one is aligned with the right hand side of the main window client area (except when there is only one item). The second last item is expanded to occupy all remaining available space.

So in the above case, the message item is placed on the right of the logged in item and takes over the expansion role.