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;
15:
16: /**
17: * Is the base interface of "include" components. A "include" is used to insert/remove
18: * dynamically a markup fragment below the associated DOM element of the component.
19: *
20: * <p>Only a free version is defined.</p>
21: *
22: * @author Jose Maria Arranz Santamaria
23: */
24: public interface ItsNatInclude extends ItsNatElementComponent {
25: /**
26: * Informs whether a fragment was inserted using this component.
27: *
28: * @return true if a fragment was inserted.
29: * @see #includeFragment(String,boolean)
30: */
31: public boolean isIncluded();
32:
33: /**
34: * Returns the name of the current included fragment.
35: *
36: * @return the name of the current included fragment. Null if no fragment was inserted.
37: * @see #includeFragment(String,boolean)
38: */
39: public String getIncludedFragmentName();
40:
41: /**
42: * Includes a new markup fragment. If a fragment was included before is removed first.
43: *
44: * @param name the name of the markup fragment to insert.
45: * @param buildComp if true markup defined components are build automatically.
46: * @see #removeFragment()
47: * @see ItsNatComponentManager#buildItsNatComponents(Node)
48: */
49: public void includeFragment(String name, boolean buildComp);
50:
51: /**
52: * Removes the current included markup fragment. If no fragment was included nothing is done.
53: *
54: * @see #includeFragment(String,boolean)
55: */
56: public void removeFragment();
57: }
|