1 /*
2 * Created on Jan 19, 2004
3 *
4 * Copyright (C) 2004 Sean Ruff
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20 package org.un4gvn.editorviewer.internal.element;
21
22 import org.eclipse.swt.graphics.Image;
23
24 /***
25 * This interface represnts a Model Object element
26 * <p>
27 * @author Sean Ruff
28 */
29
30 public interface IViewerElement {
31
32 /***
33 * Retreive the name of this AbstractViewerElement
34 * @return Object
35 */
36 public Object getId();
37
38 /***
39 * Retreive the Label to display for this element
40 * @return String
41 */
42 public String getLabel();
43
44 /***
45 * Retreive the image to display for this AbstractViewerElement
46 * @return
47 */
48 public Image getImage();
49
50 /***
51 * Retreive all IViewerElement objects which
52 * have this IViewerElement as an Ancestor
53 * @return IViewerElement[]
54 */
55 public IViewerElement[] getAllChildren();
56
57 /***
58 * Retreive all IViewerElement objects which
59 * have this IViewerElement as a Parent
60 * @return IViewerElement[]
61 */
62 public IViewerElement[] getChildren();
63
64 /***
65 * Retreive the Child IViewerElement by name
66 * @param name Name of the child ELement to
67 * retreive
68 * @return IViewerElement or null if no IViewerElement is found
69 * with specified name
70 */
71 public IViewerElement getChild(Object id);
72
73 /***
74 * Determine whether this IViewerElement has any direct
75 * children
76 * @return boolean
77 */
78 public boolean hasChildren();
79
80 /***
81 * Should return true only if no children elements
82 * can be added to the IViewerElement, not simply
83 * when no chilren are present b/c a non-leaf can
84 * still add children even if non are currently present.
85 * @return boolean
86 */
87 public boolean isLeaf();
88
89 /***
90 * Retreive the Parent of this element or null
91 * if one does not exist
92 * @return
93 */
94 public IViewerElement getParent();
95
96 /***
97 * Set the Parent IViewerElement
98 * @param parent
99 */
100 public void setParent(IViewerElement parent);
101
102 /***
103 * Determine whether this IViewerElement has a parent
104 * IViewerElement
105 * @return
106 */
107 public boolean hasParent();
108
109 /***
110 * Add a IViewerElement as a child, all listeners registered
111 * should/will be notified of this action
112 * @param child IViewerElement to add
113 */
114 public void addChild(IViewerElement child);
115
116 /***
117 * Remove an child IViewerElement if found or null, all listeners
118 * registered should/will be notified of this action
119 * if not found
120 * @param child
121 */
122 public void removeChild(IViewerElement child);
123
124 /***
125 * Remove all the Children from this Element
126 */
127 public void removeChildren();
128
129 }
This page was automatically generated by Maven