Mercurial > projects > dwt-addons
comparison dwtx/jface/action/SubToolBarManager.d @ 28:50b0163e18f8
Sub...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 03 Apr 2008 05:38:04 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
27:7ec2fd279c28 | 28:50b0163e18f8 |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2000, 2006 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwtx.jface.action.SubToolBarManager; | |
14 | |
15 import dwtx.jface.action.IToolBarManager; | |
16 import dwtx.jface.action.SubContributionManager; | |
17 | |
18 import dwt.dwthelper.utils; | |
19 | |
20 /** | |
21 * A <code>SubToolBarManager</code> monitors the additional and removal of | |
22 * items from a parent manager so that visibility of the entire set can be changed as a | |
23 * unit. | |
24 */ | |
25 public class SubToolBarManager : SubContributionManager, | |
26 IToolBarManager { | |
27 | |
28 /** | |
29 * Constructs a new manager. | |
30 * | |
31 * @param mgr the parent manager. All contributions made to the | |
32 * <code>SubToolBarManager</code> are forwarded and appear in the | |
33 * parent manager. | |
34 */ | |
35 public this(IToolBarManager mgr) { | |
36 super(mgr); | |
37 } | |
38 | |
39 /** | |
40 * @return the parent toolbar manager that this sub-manager contributes to | |
41 */ | |
42 protected final IToolBarManager getParentToolBarManager() { | |
43 // Cast is ok because that's the only | |
44 // thing we accept in the construtor. | |
45 return cast(IToolBarManager) getParent(); | |
46 } | |
47 | |
48 /* (non-Javadoc) | |
49 * Method declared on IToolBarManager. | |
50 */ | |
51 public void update(bool force) { | |
52 // This method is not governed by visibility. The client may | |
53 // call <code>setVisible</code> and then force an update. At that | |
54 // point we need to update the parent. | |
55 getParentToolBarManager().update(force); | |
56 } | |
57 } |