Sometimes more than one view is placed on the same perspective. In this condition it is not possible to see the whole view without maximizing it.

But in some situations you may need to see all the views completely at the same time without maximizing them.

This can be possible by making the view scrollable. View can be made scrollable by using Scrollable Composite.

Following is the snapshot of the Scrollable View:

Implementation Code:

 1. public class scrollbarcomposite extends ViewPart {
2.  Composite composite=null;
3.   public void createPartControl(Composite parent) {
4.  ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL |   
  SWT.V_SCROLL | SWT.BORDER);
5.    composite = new Composite(sc, SWT.NONE);
6.         composite.setLayout(new FillLayout());
7.         composite.setSize(400,400);
8.         sc.setContent(composite);
9.         sc.setExpandHorizontal(true);
10        sc.setExpandVertical(true);
11.       sc.setMinSize(composite.computeSize(1000, 1000));
12. } 
13.}

In the above code first ScrollableComposite is created (In step 4) and set the minimum size of the Scrollable Composite (In step 11). Now Composite having the Controls is added to the Scrollable composite (In step 5).

When the size of the view reduced to the minimum size of the ScrollableComposite then scrollbar will automatically appears.