comparison org.eclipse.jface/src/org/eclipse/jface/viewers/ICheckable.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, 2007 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.jface.viewers.ICheckable;
14
15 import java.lang.all;
16
17 import org.eclipse.jface.viewers.ICheckStateListener;
18
19 /**
20 * Interface for objects that support elements with a checked state.
21 *
22 * @see ICheckStateListener
23 * @see CheckStateChangedEvent
24 */
25 public interface ICheckable {
26 /**
27 * Adds a listener for changes to the checked state of elements
28 * in this viewer.
29 * Has no effect if an identical listener is already registered.
30 *
31 * @param listener a check state listener
32 */
33 public void addCheckStateListener(ICheckStateListener listener);
34
35 /**
36 * Returns the checked state of the given element.
37 *
38 * @param element the element
39 * @return <code>true</code> if the element is checked,
40 * and <code>false</code> if not checked
41 */
42 public bool getChecked(Object element);
43
44 /**
45 * Removes the given check state listener from this viewer.
46 * Has no effect if an identical listener is not registered.
47 *
48 * @param listener a check state listener
49 */
50 public void removeCheckStateListener(ICheckStateListener listener);
51
52 /**
53 * Sets the checked state for the given element in this viewer.
54 * Does not fire events to check state listeners.
55 *
56 * @param element the element
57 * @param state <code>true</code> if the item should be checked,
58 * and <code>false</code> if it should be unchecked
59 * @return <code>true</code> if the checked state could be set,
60 * and <code>false</code> otherwise
61 */
62 public bool setChecked(Object element, bool state);
63 }