001: /*
002: ItsNat Java Web Application Framework
003: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
004: Author: Jose Maria Arranz Santamaria
005:
006: This program is free software: you can redistribute it and/or modify
007: it under the terms of the GNU Affero General Public License as published by
008: the Free Software Foundation, either version 3 of the License, or
009: (at your option) any later version. See the GNU Affero General Public
010: License for more details. See the copy of the GNU Affero General Public License
011: included in this program. If not, see <http://www.gnu.org/licenses/>.
012: */
013:
014: package org.itsnat.comp.html;
015:
016: import org.itsnat.comp.ItsNatComponentManager;
017: import org.itsnat.comp.ItsNatTableStructure;
018: import org.itsnat.core.html.ItsNatHTMLDocument;
019: import org.itsnat.core.NameValue;
020: import org.w3c.dom.html.HTMLAnchorElement;
021: import org.w3c.dom.html.HTMLButtonElement;
022: import org.w3c.dom.html.HTMLFormElement;
023: import org.w3c.dom.html.HTMLInputElement;
024: import org.w3c.dom.html.HTMLLabelElement;
025: import org.w3c.dom.html.HTMLSelectElement;
026: import org.w3c.dom.html.HTMLTableElement;
027: import org.w3c.dom.html.HTMLTextAreaElement;
028:
029: /**
030: * Utility interface to manage (create, register etc) ItsNat HTML based components of
031: * the associated {@link ItsNatHTMLDocument}.
032: *
033: * @author Jose Maria Arranz Santamaria
034: * @see ItsNatHTMLDocument#getItsNatHTMLComponentManager()
035: */
036: public interface ItsNatHTMLComponentManager extends
037: ItsNatComponentManager {
038: /**
039: * Returns the associated ItsNat HTML document (parent of this object).
040: *
041: * @return the associated ItsNat HTML document.
042: */
043: public ItsNatHTMLDocument getItsNatHTMLDocument();
044:
045: /**
046: * Creates a new HTML label component.
047: *
048: * @param element the DOM element associated. If null a new label is created.
049: * @param artifacts artifacts used to construct the component. May be null.
050: * @return a new HTML label component.
051: */
052: public ItsNatHTMLLabel createItsNatHTMLLabel(
053: HTMLLabelElement element, NameValue[] artifacts);
054:
055: /**
056: * Creates a new HTML anchor component.
057: *
058: * @param element the DOM element associated. If null a new anchor is created.
059: * @param artifacts artifacts used to construct the component. May be null.
060: * @return a new HTML anchor component.
061: */
062: public ItsNatHTMLAnchor createItsNatHTMLAnchor(
063: HTMLAnchorElement element, NameValue[] artifacts);
064:
065: /**
066: * Creates a new HTML anchor component with label.
067: *
068: * @param element the DOM element associated. If null a new anchor is created.
069: * @param artifacts artifacts used to construct the component. May be null.
070: * @return a new HTML anchor component.
071: */
072: public ItsNatHTMLAnchorLabel createItsNatHTMLAnchorLabel(
073: HTMLAnchorElement element, NameValue[] artifacts);
074:
075: /**
076: * Creates a new HTML form component.
077: *
078: * @param element the DOM element associated. If null a new form is created.
079: * @param artifacts artifacts used to construct the component. May be null.
080: * @return a new HTML form component.
081: */
082: public ItsNatHTMLForm createItsNatHTMLForm(HTMLFormElement element,
083: NameValue[] artifacts);
084:
085: /**
086: * Creates a new HTML input text component. Text is not formatted.
087: *
088: * @param element the DOM element associated. If null a new input text is created.
089: * @param artifacts artifacts used to construct the component. May be null.
090: * @return a new HTML input text (not formatter) component.
091: */
092: public ItsNatHTMLInputText createItsNatHTMLInputText(
093: HTMLInputElement element, NameValue[] artifacts);
094:
095: /**
096: * Creates a new HTML input text component. Text is formatted using user defined formatters
097: *
098: * @param element the DOM element associated. If null a new input text is created.
099: * @param artifacts artifacts used to construct the component. May be null.
100: * @return a new HTML input text (formatter) component.
101: */
102: public ItsNatHTMLInputTextFormatted createItsNatHTMLInputTextFormatted(
103: HTMLInputElement element, NameValue[] artifacts);
104:
105: /**
106: * Creates a new HTML input password component.
107: *
108: * @param element the DOM element associated. If null a new input password is created.
109: * @param artifacts artifacts used to construct the component. May be null.
110: * @return a new HTML input password component.
111: */
112: public ItsNatHTMLInputPassword createItsNatHTMLInputPassword(
113: HTMLInputElement element, NameValue[] artifacts);
114:
115: /**
116: * Creates a new HTML input check box component.
117: *
118: * @param element the DOM element associated. If null a new input check box is created.
119: * @param artifacts artifacts used to construct the component. May be null.
120: * @return a new HTML input check box component.
121: */
122: public ItsNatHTMLInputCheckBox createItsNatHTMLInputCheckBox(
123: HTMLInputElement element, NameValue[] artifacts);
124:
125: /**
126: * Creates a new HTML input radio button component.
127: *
128: * @param element the DOM element associated. If null a new input radio is created.
129: * @param artifacts artifacts used to construct the component. May be null.
130: * @return a new HTML input radio button component.
131: */
132: public ItsNatHTMLInputRadio createItsNatHTMLInputRadio(
133: HTMLInputElement element, NameValue[] artifacts);
134:
135: /**
136: * Creates a new HTML input submit component.
137: *
138: * @param element the DOM element associated. If null a new input submit is created.
139: * @param artifacts artifacts used to construct the component. May be null.
140: * @return a new HTML input submit component.
141: */
142: public ItsNatHTMLInputSubmit createItsNatHTMLInputSubmit(
143: HTMLInputElement element, NameValue[] artifacts);
144:
145: /**
146: * Creates a new HTML input reset component.
147: *
148: * @param element the DOM element associated. If null a new input reset is created.
149: * @param artifacts artifacts used to construct the component. May be null.
150: * @return a new HTML input reset component.
151: */
152: public ItsNatHTMLInputReset createItsNatHTMLInputReset(
153: HTMLInputElement element, NameValue[] artifacts);
154:
155: /**
156: * Creates a new HTML input button component.
157: *
158: * @param element the DOM element associated. If null a new input button is created.
159: * @param artifacts artifacts used to construct the component. May be null.
160: * @return a new HTML input button component.
161: */
162: public ItsNatHTMLInputButton createItsNatHTMLInputButton(
163: HTMLInputElement element, NameValue[] artifacts);
164:
165: /**
166: * Creates a new HTML input image component.
167: *
168: * @param element the DOM element associated. If null a new input image is created.
169: * @param artifacts artifacts used to construct the component. May be null.
170: * @return a new HTML input image component.
171: */
172: public ItsNatHTMLInputImage createItsNatHTMLInputImage(
173: HTMLInputElement element, NameValue[] artifacts);
174:
175: /**
176: * Creates a new HTML input hidden component.
177: *
178: * @param element the DOM element associated. If null a new input hidden is created.
179: * @param artifacts artifacts used to construct the component. May be null.
180: * @return a new HTML input hidden component.
181: */
182: public ItsNatHTMLInputHidden createItsNatHTMLInputHidden(
183: HTMLInputElement element, NameValue[] artifacts);
184:
185: /**
186: * Creates a new HTML input file component.
187: *
188: * @param element the DOM element associated. If null a new input file is created.
189: * @param artifacts artifacts used to construct the component. May be null.
190: * @return a new HTML input file component.
191: */
192: public ItsNatHTMLInputFile createItsNatHTMLInputFile(
193: HTMLInputElement element, NameValue[] artifacts);
194:
195: /**
196: * Creates a new HTML select component as a list.
197: *
198: * @param element the DOM element associated. If null a new (empty) select is created.
199: * @param artifacts artifacts used to construct the component. May be null.
200: * @return a new HTML select component as a list.
201: */
202: public ItsNatHTMLSelectMult createItsNatHTMLSelectMult(
203: HTMLSelectElement element, NameValue[] artifacts);
204:
205: /**
206: * Creates a new HTML select component as a combo box.
207: *
208: * @param element the DOM element associated. If null a new (empty) select is created.
209: * @param artifacts artifacts used to construct the component. May be null.
210: * @return a new HTML select component as a combo box.
211: */
212: public ItsNatHTMLSelectComboBox createItsNatHTMLSelectComboBox(
213: HTMLSelectElement element, NameValue[] artifacts);
214:
215: /**
216: * Creates a new HTML text area component.
217: *
218: * @param element the DOM element associated. If null a new textarea is created.
219: * @param artifacts artifacts used to construct the component. May be null.
220: * @return a new HTML text area component.
221: */
222: public ItsNatHTMLTextArea createItsNatHTMLTextArea(
223: HTMLTextAreaElement element, NameValue[] artifacts);
224:
225: /**
226: * Creates a new HTML button component.
227: *
228: * @param element the DOM element associated. If null a new button is created.
229: * @param artifacts artifacts used to construct the component. May be null.
230: * @return a new HTML button component.
231: */
232: public ItsNatHTMLButton createItsNatHTMLButton(
233: HTMLButtonElement element, NameValue[] artifacts);
234:
235: /**
236: * Creates a new HTML button component with a label.
237: *
238: * @param element the DOM element associated. If null a new button is created.
239: * @param artifacts artifacts used to construct the component. May be null.
240: * @return a new HTML button component.
241: */
242: public ItsNatHTMLButtonLabel createItsNatHTMLButtonLabel(
243: HTMLButtonElement element, NameValue[] artifacts);
244:
245: /**
246: * Creates a new HTML table component.
247: *
248: * @param element the DOM element associated. If null a new (empty) table is created.
249: * @param structure the specified structure, if null then is obtained from artifacts ("useStructure"), if not defined then from markup ("useStructure" attribute), if not defined the default structure is used.
250: * @param artifacts artifacts used to construct the component. May be null.
251: * @return a new HTML table component.
252: */
253: public ItsNatHTMLTable createItsNatHTMLTable(
254: HTMLTableElement element, ItsNatTableStructure structure,
255: NameValue[] artifacts);
256: }
|