01: /*
02: ItsNat Java Web Application Framework
03: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
04: Author: Jose Maria Arranz Santamaria
05:
06: This program is free software: you can redistribute it and/or modify
07: it under the terms of the GNU Affero General Public License as published by
08: the Free Software Foundation, either version 3 of the License, or
09: (at your option) any later version. See the GNU Affero General Public
10: License for more details. See the copy of the GNU Affero General Public License
11: included in this program. If not, see <http://www.gnu.org/licenses/>.
12: */
13:
14: package org.itsnat.comp.ui;
15:
16: import org.itsnat.comp.ItsNatComponent;
17:
18: /**
19: * Is the base interface of the User Interface utility object associated to
20: * the component.
21: *
22: * <p>This utility object manages only the markup layout of the component.
23: * The component calls UI methods typically as response of data model changes
24: * to synchronize the markup to match the data model.
25: * The UI object does not need the data model (if the component has one), only
26: * the tree UI implementation uses the tree data model internally.
27: * </p>
28: *
29: * <p>This architecture, inspired in Swing, separates the layout manager (the UI object) and the
30: * component object working as a coordinator of data and selection models, UI
31: * and event based actions.</p>
32: *
33: * <p>User code may use UI methods to "query" the markup of the component, but must avoid
34: * methods that modify the markup because these methods may unsynchronize the data and selection models
35: * and markup.</p>
36: *
37: * @author Jose Maria Arranz Santamaria
38: * @see ItsNatComponent#getItsNatComponentUI()
39: */
40: public interface ItsNatComponentUI {
41: /**
42: * Returns the associated component object.
43: *
44: * @return the component object.
45: */
46: public ItsNatComponent getItsNatComponent();
47:
48: /**
49: * Informs whether this component receives UI events.
50: *
51: * @return true if this component is enabled. By default is true.
52: */
53: public boolean isEnabled();
54:
55: /**
56: * Sets whether this component can receive UI events.
57: *
58: * @param b true to enable this component.
59: */
60: public void setEnabled(boolean b);
61: }
|