TransitionComposite - lcaron/opal GitHub Wiki

Introduction

https://raw.githubusercontent.com/lcaron/opal/wiki/images/transitionComposite.png

This is a composite that hold multiple controls, like CTabFolder. You can programmaticaly switch from Control to Control with a little animation.

Usage

Once the widget is initialised :

TransitionComposite transitionComposite = new TransitionComposite(shell, SWT.NONE);

You can add control by calling the method addControl.

Then, you choose your transition effect (by calling setTransition) which is one of the component of the Transition enumeration : LEFT_TO_RIGHT, LEFT_TO_RIGHT_AND_APPEAR, RIGHT_TO_LEFT, RIGHT_TO_LEFT_AND_APPEAR, UP_TO_DOWN, UP_TO_DOWN_AND_APPEAR, DOWN_TO_UP, DOWN_TO_UP_AND_APPEAR, NONE.

Then, you can navigate through the controls with the methods moveToFirst,moveToLast,moveToPrevious,moveToNext or setSelection.

Animation

An animation is available at https://github.com/lcaron/opal/blob/wiki/wink/transitionComposite.swf?raw=true

Example

An example called TransitionCompositeSnippet is available in the directory src/test/java/org/mihalis/opal/transitionComposite.

This example is also available here : https://github.com/lcaron/opal/blob/master/src/test/java/org/mihalis/opal/transitionComposite/TransitionCompositeSnippet.java