comparison org.eclipse.jface/src/org/eclipse/jface/preference/IPreferenceNode.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, 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 org.eclipse.jface.preference.IPreferenceNode;
14
15 import org.eclipse.jface.preference.IPreferencePage;
16
17 import org.eclipse.swt.graphics.Image;
18 import java.lang.all;
19
20 /**
21 * Interface to a node in a preference dialog.
22 * A preference node maintains a label and image used to display the
23 * node in a preference dialog (usually in the form of a tree),
24 * as well as the preference page this node stands for.
25 *
26 * The node may use lazy creation for its page
27 *
28 * Note that all preference nodes must be dispose their resources.
29 * The node must dispose the page managed by this node, and any SWT resources
30 * allocated by this node (Images, Fonts, etc).
31 * However the node itself may be reused.
32 */
33 public interface IPreferenceNode {
34 /**
35 * Adds the given preference node as a subnode of this
36 * preference node.
37 *
38 * @param node the node to add
39 */
40 public void add(IPreferenceNode node);
41
42 /**
43 * Creates the preference page for this node.
44 */
45 public void createPage();
46
47 /**
48 * Release the page managed by this node, and any SWT resources
49 * held onto by this node (Images, Fonts, etc).
50 *
51 * Note that nodes are reused so this is not a call to dispose the
52 * node itself.
53 */
54 public void disposeResources();
55
56 /**
57 * Returns the subnode of this contribution node with the given node id.
58 *
59 * @param id the preference node id
60 * @return the subnode, or <code>null</code> if none
61 */
62 public IPreferenceNode findSubNode(String id);
63
64 /**
65 * Returns the id of this contribution node.
66 * This id identifies a contribution node relative to its parent.
67 *
68 * @return the node id
69 */
70 public String getId();
71
72 /**
73 * Returns the image used to present this node in a preference dialog.
74 *
75 * @return the image for this node, or <code>null</code>
76 * if there is no image for this node
77 */
78 public Image getLabelImage();
79
80 /**
81 * Returns the text label used to present this node in a preference dialog.
82 *
83 * @return the text label for this node, or <code>null</code>
84 * if there is no label for this node
85 */
86 public String getLabelText();
87
88 /**
89 * Returns the preference page for this node.
90 *
91 * @return the preference page
92 */
93 public IPreferencePage getPage();
94
95 /**
96 * Returns an iterator over the subnodes (immediate children)
97 * of this contribution node.
98 *
99 * @return an IPreferenceNode array containing the child nodes
100 */
101 public IPreferenceNode[] getSubNodes();
102
103 /**
104 * Removes the subnode of this preference node with the given node id.
105 *
106 * @param id the subnode id
107 * @return the removed subnode, or <code>null</code> if none
108 */
109 public IPreferenceNode remove(String id);
110
111 /**
112 * Removes the given preference node from the list of subnodes
113 * (immediate children) of this node.
114 *
115 * @param node the node to remove
116 * @return <code>true</code> if the node was removed,
117 * and <code>false</code> otherwise
118 */
119 public bool remove(IPreferenceNode node);
120 }