comparison org.eclipse.jface/src/org/eclipse/jface/menus/IWidget.d @ 12:bc29606a740c

Added dwt-addons in original directory structure of eclipse.org
author Frank Benoit <benoit@tionex.de>
date Sat, 14 Mar 2009 18:23:29 +0100
parents
children
comparison
equal deleted inserted replaced
11:43904fec5dca 12:bc29606a740c
1 /*******************************************************************************
2 * Copyright (c) 2005, 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
14 module org.eclipse.jface.menus.IWidget;
15
16 import org.eclipse.swt.widgets.Composite;
17 import org.eclipse.swt.widgets.CoolBar;
18 import org.eclipse.swt.widgets.Menu;
19 import org.eclipse.swt.widgets.ToolBar;
20
21 import java.lang.all;
22
23 /**
24 * <p>
25 * Provides a hook by which third-party code can contribute SWT widgets to a
26 * menu, tool bar or status line. This can be used, for example, to add a combo
27 * box to the status line, or a "Location" bar to the tool bar.
28 * </p>
29 * <p>
30 * It is possible for fill and dispose to be called multiple times for a single
31 * instance of <code>IWidget</code>.
32 * </p>
33 * <p>
34 * Clients may implement, but must not extend.
35 * </p>
36 *
37 * @since 3.2
38 */
39 public interface IWidget {
40
41 /**
42 * Disposes of the underlying widgets. This can be called when the widget is
43 * becoming hidden.
44 */
45 public void dispose();
46
47 /**
48 * Fills the given composite control with controls representing this widget.
49 *
50 * @param parent
51 * the parent control
52 */
53 public void fill(Composite parent);
54
55 /**
56 * Fills the given menu with controls representing this widget.
57 *
58 * @param parent
59 * the parent menu
60 * @param index
61 * the index where the controls are inserted, or <code>-1</code>
62 * to insert at the end
63 */
64 public void fill(Menu parent, int index);
65
66 /**
67 * Fills the given tool bar with controls representing this contribution
68 * item.
69 *
70 * @param parent
71 * the parent tool bar
72 * @param index
73 * the index where the controls are inserted, or <code>-1</code>
74 * to insert at the end
75 */
76 public void fill(ToolBar parent, int index);
77
78 /**
79 * Fills the given cool bar with controls representing this contribution
80 * item.
81 *
82 * @param parent
83 * the parent cool bar
84 * @param index
85 * the index where the controls are inserted, or <code>-1</code>
86 * to insert at the end
87 */
88 public void fill(CoolBar parent, int index);
89 }