1734
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
1609
|
17 |
package com.nokia.carbide.internal.discovery.ui.editor;
|
|
18 |
|
|
19 |
import org.eclipse.swt.custom.StackLayout;
|
|
20 |
import org.eclipse.swt.widgets.Composite;
|
|
21 |
import org.eclipse.swt.widgets.Control;
|
|
22 |
|
|
23 |
public class StackComposite extends SharedBackgroundComposite {
|
|
24 |
|
|
25 |
private StackLayout stackLayout;
|
|
26 |
|
|
27 |
public StackComposite(Composite parent, Composite backgroundParent) {
|
|
28 |
super(parent, backgroundParent);
|
|
29 |
stackLayout = new StackLayout();
|
|
30 |
setLayout(stackLayout);
|
|
31 |
}
|
|
32 |
|
|
33 |
public void showControl(Control control) {
|
1705
|
34 |
if (stackLayout.topControl == control)
|
1609
|
35 |
return;
|
|
36 |
|
|
37 |
stackLayout.topControl = control;
|
|
38 |
layout();
|
|
39 |
}
|
|
40 |
}
|
|
41 |
|