KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jac > aspects > gui > View


1 /*
2   Copyright (C) 2001-2002 Renaud Pawlak, Laurent Martelli
3   
4   This program is free software; you can redistribute it and/or modify
5   it under the terms of the GNU Lesser General Public License as
6   published by the Free Software Foundation; either version 2 of the
7   License, or (at your option) any later version.
8
9   This program is distributed in the hope that it will be useful, but
10   WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12   Lesser General Public License for more details.
13
14   You should have received a copy of the GNU Lesser General Public
15   License along with this program; if not, write to the Free Software
16   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17   USA */

18
19 package org.objectweb.jac.aspects.gui;
20
21 import org.objectweb.jac.core.rtti.FieldItem;
22 import org.objectweb.jac.core.rtti.MethodItem;
23
24 public interface View extends ViewIdentity {
25     /**
26      * Sets the label (the identifier) of the view.
27      *
28      * @param label a string that identifies the view
29      */

30     void setLabel(String JavaDoc label);
31
32     /**
33      * Gets the view's label (identifier).
34      *
35      * @return the view's label
36      */

37     String JavaDoc getLabel();
38
39     /**
40      * Sets a dynamic message to be displayed by the view when opened.
41      *
42      * @param method the method that returns a string to be dislayed
43      * @see #setDescription(String)
44      */

45     void setMessage(MethodItem method);
46    
47     /**
48      * Gets the dynamic message.
49      *
50      * @return the dynamic message
51      */

52     MethodItem getMessage();
53
54     /**
55      * Sets a static message to be display by the view when opened.
56      *
57      * @param description a string to be displayed as is
58      * @see #setMessage(MethodItem)
59      */

60     void setDescription(String JavaDoc description);
61
62     /**
63      * Gets the description of this view.
64      *
65      * @return the description
66      */

67     String JavaDoc getDescription();
68
69     /**
70      * Sets the display context for this view.
71      *
72      * <p>The display context contains the factory that is used for
73      * this view.
74      */

75     void setContext(DisplayContext context);
76
77     /**
78      * @return the DisplayContext of the view
79      */

80     DisplayContext getContext();
81
82     /**
83      * Sets the factory for this view (WEB, SWING or other supported
84      * factory).
85      */

86     void setFactory(ViewFactory factory);
87
88     /**
89      * Gets the factory.
90      */

91     ViewFactory getFactory();
92
93     /**
94      * Sets the preferred size for this view.
95      *
96      * @param width the preferred width. If null, the preferred width is not changed.
97      * @param height the preferred height. If null, the preferred height is not changed.
98      */

99     void setSize(Length width, Length height);
100
101     /**
102      * Close this view. This should be upcalled when the view is closed
103      * in order to free resources or close other dependant views.
104      *
105      * @param validate wether to validate any value contained in editors.
106      */

107     void close(boolean validate);
108
109     /**
110      * Tells if this view has been closed by the GUI or the user.
111      */

112     boolean isClosed();
113
114     /**
115      * Validate this view: its content may be saved when this method is
116      * upcalled.
117      */

118     //void validate();
119

120     /**
121      * Sets the view style. The style can be exploited in different
122      * maners depending on the GUI supports (e.g. with CSS for the
123      * WEB). Styles are user-defined.
124      */

125     void setStyle(String JavaDoc style);
126    
127     /**
128      * Gets the user-defined style for this view.
129      *
130      * @return the style, null if undefined
131      */

132     String JavaDoc getStyle();
133
134     /**
135      * Sets a border for this view.
136      */

137     void setViewBorder(Border border);
138
139     /**
140      * Gets the border for this view.
141      *
142      * @return the border, null if undefined
143      */

144     Border getViewBorder();
145    
146     /**
147      * Sets the parent view of this view (a composite view).
148      *
149      * @see CompositeView
150      */

151     void setParentView(View view);
152
153     /**
154      * Gets the parent view of this view.
155      *
156      * @see CompositeView
157      */

158     View getParentView();
159
160     /**
161      * Gets the ancestor view whose parent is null
162      */

163     View getRootView();
164
165     /**
166      * Tells wether this view has a given view in its ancestors
167      * @param ancestor the ancestor
168      */

169     boolean isDescendantOf(View ancestor);
170
171     /**
172      * Focus a field of an object's view.
173      *
174      * @param field the field to focus
175      * @param option an extra option
176      */

177     void setFocus(FieldItem field, Object JavaDoc option);
178 }
179
Popular Tags