comparison org.eclipse.draw2d/src/org/eclipse/draw2d/Toggle.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) 2000, 2005 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 org.eclipse.draw2d.Toggle;
14
15 import java.lang.all;
16
17 import org.eclipse.swt.graphics.Image;
18 import org.eclipse.draw2d.Clickable;
19 import org.eclipse.draw2d.IFigure;
20 import org.eclipse.draw2d.Label;
21
22 /**
23 * Basic Rule for Toggle: Whoever creates the toggle is reponsible for response changes
24 * for it (selection, rollover, etc). Only {@link org.eclipse.draw2d.CheckBox} does its
25 * own listening.
26 */
27 public class Toggle
28 : Clickable
29 {
30
31 /**
32 * Constructs a Toggle with no text or icon.
33 *
34 * @since 2.0
35 */
36 public this() {
37 super();
38 setStyle(STYLE_TOGGLE);
39 }
40
41 /**
42 * Constructs a Toggle with passed text and icon
43 *
44 * @param text the text
45 * @param icon the icon
46 * @since 2.0
47 */
48 public this(String text, Image icon) {
49 super(new Label(text, icon), STYLE_TOGGLE);
50 }
51
52 /**
53 * Constructs a Toggle with passed IFigure as its contents.
54 *
55 * @param contents the contents
56 * @since 2.0
57 */
58 public this(IFigure contents) {
59 super(contents, STYLE_TOGGLE);
60 }
61
62 /**
63 * Constructs a Toggle with the passed figure as its contents and the given style.
64 * @param contents the contents
65 * @param style the style
66 */
67 public this(IFigure contents, int style) {
68 super(contents, style);
69 }
70
71 }