From 0429dfc79faa9946623e2832f2bb99e9541fe41d Mon Sep 17 00:00:00 2001 From: vpj-cd Date: Fri, 17 Nov 2006 03:14:25 +0000 Subject: [PATCH] move branch adempire311 to trunk --- tools/.classpath | 16 + tools/.project | 22 + ...nuitec.jboss.ide.eclipse.xdoclet.run.prefs | 3 + tools/.settings/org.eclipse.jdt.ui.prefs | 3 + tools/RUN_build.bat | 19 + tools/RUN_build.sh | 18 + tools/Tools.html | 26 + tools/build.xml | 379 ++++++++ tools/documentation.bat | 5 + tools/lib/SoftwareLicenses.xls | Bin 0 -> 16384 bytes tools/lib/copyLibraries.bat | 27 + tools/lib/libraries.txt | 55 ++ tools/packages.txt | 5 + tools/src/org/apache/ecs/AlignType.java | 48 ++ tools/src/org/apache/ecs/Attributes.java | 122 +++ tools/src/org/apache/ecs/ClearElement.java | 37 + tools/src/org/apache/ecs/ConcreteElement.java | 440 ++++++++++ tools/src/org/apache/ecs/Doctype.java | 398 +++++++++ tools/src/org/apache/ecs/ECSDefaults.java | 200 +++++ tools/src/org/apache/ecs/Element.java | 213 +++++ .../src/org/apache/ecs/ElementAttributes.java | 338 ++++++++ .../src/org/apache/ecs/ElementContainer.java | 117 +++ tools/src/org/apache/ecs/ElementRegistry.java | 36 + tools/src/org/apache/ecs/Entities.java | 317 +++++++ tools/src/org/apache/ecs/Filter.java | 49 ++ tools/src/org/apache/ecs/FocusEvents.java | 47 + tools/src/org/apache/ecs/FormEvents.java | 61 ++ tools/src/org/apache/ecs/GenericElement.java | 816 ++++++++++++++++++ tools/src/org/apache/ecs/HtmlColor.java | 775 +++++++++++++++++ tools/src/org/apache/ecs/KeyEvents.java | 52 ++ tools/src/org/apache/ecs/MouseEvents.java | 84 ++ .../src/org/apache/ecs/MultiPartElement.java | 36 + tools/src/org/apache/ecs/PageEvents.java | 46 + tools/src/org/apache/ecs/Printable.java | 24 + .../src/org/apache/ecs/SinglePartElement.java | 37 + tools/src/org/apache/ecs/StringElement.java | 176 ++++ tools/src/org/apache/ecs/XhtmlDocument.java | 628 ++++++++++++++ .../org/apache/ecs/XhtmlFrameSetDocument.java | 608 +++++++++++++ tools/src/org/apache/ecs/ecs.properties | 16 + .../apache/ecs/filter/CharacterFilter.java | 131 +++ .../src/org/apache/ecs/filter/NullFilter.java | 49 ++ .../org/apache/ecs/filter/StringFilter.java | 145 ++++ .../src/org/apache/ecs/filter/WordFilter.java | 112 +++ tools/src/org/apache/ecs/filter/package.html | 2 + tools/src/org/apache/ecs/package.html | 34 + tools/src/org/apache/ecs/storage/Array.java | 169 ++++ tools/src/org/apache/ecs/storage/Hash.java | 129 +++ .../ecs/storage/NoSuchObjectException.java | 26 + tools/src/org/apache/ecs/xhtml/a.java | 511 +++++++++++ tools/src/org/apache/ecs/xhtml/abbr.java | 259 ++++++ tools/src/org/apache/ecs/xhtml/acronym.java | 257 ++++++ tools/src/org/apache/ecs/xhtml/address.java | 257 ++++++ tools/src/org/apache/ecs/xhtml/applet.java | 351 ++++++++ tools/src/org/apache/ecs/xhtml/area.java | 443 ++++++++++ tools/src/org/apache/ecs/xhtml/b.java | 258 ++++++ tools/src/org/apache/ecs/xhtml/base.java | 175 ++++ tools/src/org/apache/ecs/xhtml/basefont.java | 398 +++++++++ tools/src/org/apache/ecs/xhtml/bdo.java | 216 +++++ tools/src/org/apache/ecs/xhtml/big.java | 257 ++++++ tools/src/org/apache/ecs/xhtml/blink.java | 234 +++++ .../src/org/apache/ecs/xhtml/blockquote.java | 337 ++++++++ tools/src/org/apache/ecs/xhtml/body.java | 353 ++++++++ tools/src/org/apache/ecs/xhtml/br.java | 270 ++++++ tools/src/org/apache/ecs/xhtml/button.java | 337 ++++++++ tools/src/org/apache/ecs/xhtml/caption.java | 247 ++++++ tools/src/org/apache/ecs/xhtml/center.java | 440 ++++++++++ tools/src/org/apache/ecs/xhtml/cite.java | 440 ++++++++++ tools/src/org/apache/ecs/xhtml/code.java | 258 ++++++ tools/src/org/apache/ecs/xhtml/col.java | 376 ++++++++ tools/src/org/apache/ecs/xhtml/colgroup.java | 374 ++++++++ tools/src/org/apache/ecs/xhtml/comment.java | 269 ++++++ tools/src/org/apache/ecs/xhtml/dd.java | 420 +++++++++ tools/src/org/apache/ecs/xhtml/del.java | 446 ++++++++++ tools/src/org/apache/ecs/xhtml/dfn.java | 440 ++++++++++ tools/src/org/apache/ecs/xhtml/div.java | 450 ++++++++++ tools/src/org/apache/ecs/xhtml/dl.java | 406 +++++++++ tools/src/org/apache/ecs/xhtml/dt.java | 424 +++++++++ tools/src/org/apache/ecs/xhtml/em.java | 442 ++++++++++ tools/src/org/apache/ecs/xhtml/fieldset.java | 442 ++++++++++ tools/src/org/apache/ecs/xhtml/font.java | 418 +++++++++ tools/src/org/apache/ecs/xhtml/form.java | 464 ++++++++++ tools/src/org/apache/ecs/xhtml/frame.java | 554 ++++++++++++ tools/src/org/apache/ecs/xhtml/frameset.java | 436 ++++++++++ tools/src/org/apache/ecs/xhtml/h1.java | 268 ++++++ tools/src/org/apache/ecs/xhtml/h2.java | 268 ++++++ tools/src/org/apache/ecs/xhtml/h3.java | 268 ++++++ tools/src/org/apache/ecs/xhtml/h4.java | 268 ++++++ tools/src/org/apache/ecs/xhtml/h5.java | 450 ++++++++++ tools/src/org/apache/ecs/xhtml/h6.java | 452 ++++++++++ tools/src/org/apache/ecs/xhtml/head.java | 160 ++++ tools/src/org/apache/ecs/xhtml/hr.java | 422 +++++++++ tools/src/org/apache/ecs/xhtml/html.java | 144 ++++ tools/src/org/apache/ecs/xhtml/i.java | 268 ++++++ tools/src/org/apache/ecs/xhtml/iframe.java | 630 ++++++++++++++ tools/src/org/apache/ecs/xhtml/img.java | 816 ++++++++++++++++++ tools/src/org/apache/ecs/xhtml/input.java | 663 ++++++++++++++ tools/src/org/apache/ecs/xhtml/ins.java | 448 ++++++++++ tools/src/org/apache/ecs/xhtml/kbd.java | 442 ++++++++++ tools/src/org/apache/ecs/xhtml/label.java | 326 +++++++ tools/src/org/apache/ecs/xhtml/legend.java | 297 +++++++ tools/src/org/apache/ecs/xhtml/li.java | 276 ++++++ tools/src/org/apache/ecs/xhtml/link.java | 347 ++++++++ tools/src/org/apache/ecs/xhtml/map.java | 556 ++++++++++++ tools/src/org/apache/ecs/xhtml/meta.java | 200 +++++ tools/src/org/apache/ecs/xhtml/nobr.java | 246 ++++++ tools/src/org/apache/ecs/xhtml/noframes.java | 442 ++++++++++ tools/src/org/apache/ecs/xhtml/noscript.java | 442 ++++++++++ tools/src/org/apache/ecs/xhtml/object.java | 598 +++++++++++++ tools/src/org/apache/ecs/xhtml/ol.java | 286 ++++++ tools/src/org/apache/ecs/xhtml/optgroup.java | 371 ++++++++ tools/src/org/apache/ecs/xhtml/option.java | 474 ++++++++++ tools/src/org/apache/ecs/xhtml/p.java | 312 +++++++ tools/src/org/apache/ecs/xhtml/param.java | 296 +++++++ tools/src/org/apache/ecs/xhtml/pre.java | 574 ++++++++++++ tools/src/org/apache/ecs/xhtml/q.java | 570 ++++++++++++ tools/src/org/apache/ecs/xhtml/s.java | 442 ++++++++++ tools/src/org/apache/ecs/xhtml/samp.java | 442 ++++++++++ tools/src/org/apache/ecs/xhtml/script.java | 295 +++++++ tools/src/org/apache/ecs/xhtml/select.java | 489 +++++++++++ tools/src/org/apache/ecs/xhtml/small.java | 442 ++++++++++ tools/src/org/apache/ecs/xhtml/span.java | 430 +++++++++ tools/src/org/apache/ecs/xhtml/strike.java | 442 ++++++++++ tools/src/org/apache/ecs/xhtml/strong.java | 442 ++++++++++ tools/src/org/apache/ecs/xhtml/style.java | 306 +++++++ tools/src/org/apache/ecs/xhtml/sub.java | 442 ++++++++++ tools/src/org/apache/ecs/xhtml/sup.java | 442 ++++++++++ tools/src/org/apache/ecs/xhtml/table.java | 509 +++++++++++ tools/src/org/apache/ecs/xhtml/tbody.java | 582 +++++++++++++ tools/src/org/apache/ecs/xhtml/td.java | 567 ++++++++++++ tools/src/org/apache/ecs/xhtml/textarea.java | 495 +++++++++++ tools/src/org/apache/ecs/xhtml/tfoot.java | 582 +++++++++++++ tools/src/org/apache/ecs/xhtml/th.java | 522 +++++++++++ tools/src/org/apache/ecs/xhtml/thead.java | 582 +++++++++++++ tools/src/org/apache/ecs/xhtml/title.java | 222 +++++ tools/src/org/apache/ecs/xhtml/tr.java | 341 ++++++++ tools/src/org/apache/ecs/xhtml/tt.java | 444 ++++++++++ tools/src/org/apache/ecs/xhtml/u.java | 442 ++++++++++ tools/src/org/apache/ecs/xhtml/ul.java | 490 +++++++++++ tools/src/org/apache/ecs/xhtml/var.java | 442 ++++++++++ tools/src/org/apache/ecs/xml/PI.java | 138 +++ tools/src/org/apache/ecs/xml/XML.java | 223 +++++ tools/src/org/apache/ecs/xml/XMLDocument.java | 330 +++++++ tools/src/org/apache/ecs/xml/package.html | 2 + 143 files changed, 43862 insertions(+) create mode 100644 tools/.classpath create mode 100644 tools/.project create mode 100644 tools/.settings/com.genuitec.jboss.ide.eclipse.xdoclet.run.prefs create mode 100644 tools/.settings/org.eclipse.jdt.ui.prefs create mode 100644 tools/RUN_build.bat create mode 100644 tools/RUN_build.sh create mode 100644 tools/Tools.html create mode 100644 tools/build.xml create mode 100644 tools/documentation.bat create mode 100644 tools/lib/SoftwareLicenses.xls create mode 100644 tools/lib/copyLibraries.bat create mode 100644 tools/lib/libraries.txt create mode 100644 tools/packages.txt create mode 100644 tools/src/org/apache/ecs/AlignType.java create mode 100644 tools/src/org/apache/ecs/Attributes.java create mode 100644 tools/src/org/apache/ecs/ClearElement.java create mode 100644 tools/src/org/apache/ecs/ConcreteElement.java create mode 100644 tools/src/org/apache/ecs/Doctype.java create mode 100644 tools/src/org/apache/ecs/ECSDefaults.java create mode 100644 tools/src/org/apache/ecs/Element.java create mode 100644 tools/src/org/apache/ecs/ElementAttributes.java create mode 100644 tools/src/org/apache/ecs/ElementContainer.java create mode 100644 tools/src/org/apache/ecs/ElementRegistry.java create mode 100644 tools/src/org/apache/ecs/Entities.java create mode 100644 tools/src/org/apache/ecs/Filter.java create mode 100644 tools/src/org/apache/ecs/FocusEvents.java create mode 100644 tools/src/org/apache/ecs/FormEvents.java create mode 100644 tools/src/org/apache/ecs/GenericElement.java create mode 100644 tools/src/org/apache/ecs/HtmlColor.java create mode 100644 tools/src/org/apache/ecs/KeyEvents.java create mode 100644 tools/src/org/apache/ecs/MouseEvents.java create mode 100644 tools/src/org/apache/ecs/MultiPartElement.java create mode 100644 tools/src/org/apache/ecs/PageEvents.java create mode 100644 tools/src/org/apache/ecs/Printable.java create mode 100644 tools/src/org/apache/ecs/SinglePartElement.java create mode 100644 tools/src/org/apache/ecs/StringElement.java create mode 100644 tools/src/org/apache/ecs/XhtmlDocument.java create mode 100644 tools/src/org/apache/ecs/XhtmlFrameSetDocument.java create mode 100644 tools/src/org/apache/ecs/ecs.properties create mode 100644 tools/src/org/apache/ecs/filter/CharacterFilter.java create mode 100644 tools/src/org/apache/ecs/filter/NullFilter.java create mode 100644 tools/src/org/apache/ecs/filter/StringFilter.java create mode 100644 tools/src/org/apache/ecs/filter/WordFilter.java create mode 100644 tools/src/org/apache/ecs/filter/package.html create mode 100644 tools/src/org/apache/ecs/package.html create mode 100644 tools/src/org/apache/ecs/storage/Array.java create mode 100644 tools/src/org/apache/ecs/storage/Hash.java create mode 100644 tools/src/org/apache/ecs/storage/NoSuchObjectException.java create mode 100644 tools/src/org/apache/ecs/xhtml/a.java create mode 100644 tools/src/org/apache/ecs/xhtml/abbr.java create mode 100644 tools/src/org/apache/ecs/xhtml/acronym.java create mode 100644 tools/src/org/apache/ecs/xhtml/address.java create mode 100644 tools/src/org/apache/ecs/xhtml/applet.java create mode 100644 tools/src/org/apache/ecs/xhtml/area.java create mode 100644 tools/src/org/apache/ecs/xhtml/b.java create mode 100644 tools/src/org/apache/ecs/xhtml/base.java create mode 100644 tools/src/org/apache/ecs/xhtml/basefont.java create mode 100644 tools/src/org/apache/ecs/xhtml/bdo.java create mode 100644 tools/src/org/apache/ecs/xhtml/big.java create mode 100644 tools/src/org/apache/ecs/xhtml/blink.java create mode 100644 tools/src/org/apache/ecs/xhtml/blockquote.java create mode 100644 tools/src/org/apache/ecs/xhtml/body.java create mode 100644 tools/src/org/apache/ecs/xhtml/br.java create mode 100644 tools/src/org/apache/ecs/xhtml/button.java create mode 100644 tools/src/org/apache/ecs/xhtml/caption.java create mode 100644 tools/src/org/apache/ecs/xhtml/center.java create mode 100644 tools/src/org/apache/ecs/xhtml/cite.java create mode 100644 tools/src/org/apache/ecs/xhtml/code.java create mode 100644 tools/src/org/apache/ecs/xhtml/col.java create mode 100644 tools/src/org/apache/ecs/xhtml/colgroup.java create mode 100644 tools/src/org/apache/ecs/xhtml/comment.java create mode 100644 tools/src/org/apache/ecs/xhtml/dd.java create mode 100644 tools/src/org/apache/ecs/xhtml/del.java create mode 100644 tools/src/org/apache/ecs/xhtml/dfn.java create mode 100644 tools/src/org/apache/ecs/xhtml/div.java create mode 100644 tools/src/org/apache/ecs/xhtml/dl.java create mode 100644 tools/src/org/apache/ecs/xhtml/dt.java create mode 100644 tools/src/org/apache/ecs/xhtml/em.java create mode 100644 tools/src/org/apache/ecs/xhtml/fieldset.java create mode 100644 tools/src/org/apache/ecs/xhtml/font.java create mode 100644 tools/src/org/apache/ecs/xhtml/form.java create mode 100644 tools/src/org/apache/ecs/xhtml/frame.java create mode 100644 tools/src/org/apache/ecs/xhtml/frameset.java create mode 100644 tools/src/org/apache/ecs/xhtml/h1.java create mode 100644 tools/src/org/apache/ecs/xhtml/h2.java create mode 100644 tools/src/org/apache/ecs/xhtml/h3.java create mode 100644 tools/src/org/apache/ecs/xhtml/h4.java create mode 100644 tools/src/org/apache/ecs/xhtml/h5.java create mode 100644 tools/src/org/apache/ecs/xhtml/h6.java create mode 100644 tools/src/org/apache/ecs/xhtml/head.java create mode 100644 tools/src/org/apache/ecs/xhtml/hr.java create mode 100644 tools/src/org/apache/ecs/xhtml/html.java create mode 100644 tools/src/org/apache/ecs/xhtml/i.java create mode 100644 tools/src/org/apache/ecs/xhtml/iframe.java create mode 100644 tools/src/org/apache/ecs/xhtml/img.java create mode 100644 tools/src/org/apache/ecs/xhtml/input.java create mode 100644 tools/src/org/apache/ecs/xhtml/ins.java create mode 100644 tools/src/org/apache/ecs/xhtml/kbd.java create mode 100644 tools/src/org/apache/ecs/xhtml/label.java create mode 100644 tools/src/org/apache/ecs/xhtml/legend.java create mode 100644 tools/src/org/apache/ecs/xhtml/li.java create mode 100644 tools/src/org/apache/ecs/xhtml/link.java create mode 100644 tools/src/org/apache/ecs/xhtml/map.java create mode 100644 tools/src/org/apache/ecs/xhtml/meta.java create mode 100644 tools/src/org/apache/ecs/xhtml/nobr.java create mode 100644 tools/src/org/apache/ecs/xhtml/noframes.java create mode 100644 tools/src/org/apache/ecs/xhtml/noscript.java create mode 100644 tools/src/org/apache/ecs/xhtml/object.java create mode 100644 tools/src/org/apache/ecs/xhtml/ol.java create mode 100644 tools/src/org/apache/ecs/xhtml/optgroup.java create mode 100644 tools/src/org/apache/ecs/xhtml/option.java create mode 100644 tools/src/org/apache/ecs/xhtml/p.java create mode 100644 tools/src/org/apache/ecs/xhtml/param.java create mode 100644 tools/src/org/apache/ecs/xhtml/pre.java create mode 100644 tools/src/org/apache/ecs/xhtml/q.java create mode 100644 tools/src/org/apache/ecs/xhtml/s.java create mode 100644 tools/src/org/apache/ecs/xhtml/samp.java create mode 100644 tools/src/org/apache/ecs/xhtml/script.java create mode 100644 tools/src/org/apache/ecs/xhtml/select.java create mode 100644 tools/src/org/apache/ecs/xhtml/small.java create mode 100644 tools/src/org/apache/ecs/xhtml/span.java create mode 100644 tools/src/org/apache/ecs/xhtml/strike.java create mode 100644 tools/src/org/apache/ecs/xhtml/strong.java create mode 100644 tools/src/org/apache/ecs/xhtml/style.java create mode 100644 tools/src/org/apache/ecs/xhtml/sub.java create mode 100644 tools/src/org/apache/ecs/xhtml/sup.java create mode 100644 tools/src/org/apache/ecs/xhtml/table.java create mode 100644 tools/src/org/apache/ecs/xhtml/tbody.java create mode 100644 tools/src/org/apache/ecs/xhtml/td.java create mode 100644 tools/src/org/apache/ecs/xhtml/textarea.java create mode 100644 tools/src/org/apache/ecs/xhtml/tfoot.java create mode 100644 tools/src/org/apache/ecs/xhtml/th.java create mode 100644 tools/src/org/apache/ecs/xhtml/thead.java create mode 100644 tools/src/org/apache/ecs/xhtml/title.java create mode 100644 tools/src/org/apache/ecs/xhtml/tr.java create mode 100644 tools/src/org/apache/ecs/xhtml/tt.java create mode 100644 tools/src/org/apache/ecs/xhtml/u.java create mode 100644 tools/src/org/apache/ecs/xhtml/ul.java create mode 100644 tools/src/org/apache/ecs/xhtml/var.java create mode 100644 tools/src/org/apache/ecs/xml/PI.java create mode 100644 tools/src/org/apache/ecs/xml/XML.java create mode 100644 tools/src/org/apache/ecs/xml/XMLDocument.java create mode 100644 tools/src/org/apache/ecs/xml/package.html diff --git a/tools/.classpath b/tools/.classpath new file mode 100644 index 0000000000..9579d0b654 --- /dev/null +++ b/tools/.classpath @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/tools/.project b/tools/.project new file mode 100644 index 0000000000..0f9d568aea --- /dev/null +++ b/tools/.project @@ -0,0 +1,22 @@ + + + tools + Tools Project + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.ibm.etools.validation.validationbuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/tools/.settings/com.genuitec.jboss.ide.eclipse.xdoclet.run.prefs b/tools/.settings/com.genuitec.jboss.ide.eclipse.xdoclet.run.prefs new file mode 100644 index 0000000000..16fb6cde7a --- /dev/null +++ b/tools/.settings/com.genuitec.jboss.ide.eclipse.xdoclet.run.prefs @@ -0,0 +1,3 @@ +#Thu Sep 29 20:01:11 PDT 2005 +eclipse.preferences.version=1 +xdoclet.build.policy=automatic diff --git a/tools/.settings/org.eclipse.jdt.ui.prefs b/tools/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..b3edfe072b --- /dev/null +++ b/tools/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,3 @@ +#Thu Sep 29 20:01:11 PDT 2005 +eclipse.preferences.version=1 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/tools/RUN_build.bat b/tools/RUN_build.bat new file mode 100644 index 0000000000..3da833ecaf --- /dev/null +++ b/tools/RUN_build.bat @@ -0,0 +1,19 @@ +@Title Build Tools +@Rem $Header: /cvsroot/adempiere/tools/RUN_build.bat,v 1.16 2005/09/11 02:28:11 jjanke Exp $ + +@CALL ..\utils_dev\myDevEnv.bat +@IF NOT %ADEMPIERE_ENV%==Y GOTO NOBUILD + +@echo Cleanup ... +@"%JAVA_HOME%\bin\java" -Dant.home="." %ANT_PROPERTIES% org.apache.tools.ant.launch.Launcher clean + +@echo Building ... +@"%JAVA_HOME%\bin\java" -Dant.home="." %ANT_PROPERTIES% org.apache.tools.ant.launch.Launcher toolsDistribution + +@Echo Done ... +@sleep 60 +@exit + +:NOBUILD +@Echo Check myDevEnv.bat (copy from myDevEnvTemplate.bat) +@Pause \ No newline at end of file diff --git a/tools/RUN_build.sh b/tools/RUN_build.sh new file mode 100644 index 0000000000..5f80633c60 --- /dev/null +++ b/tools/RUN_build.sh @@ -0,0 +1,18 @@ +# Module compiling script +# Ported from Windows script Marek Mosiewicz + + +SAVED_DIR=`pwd` #save current dir +cd `dirname $0`/../utils_dev #change dir to place where script resides - doesn not work with sym links +UTILS_DEV=`pwd` #this is adempiere source +cd $SAVED_DIR #back to the saved directory + +. $UTILS_DEV/myDevEnv.sh #call environment +echo done +if [ ! $ADEMPIERE_ENV==Y ] ; then + echo "Can't set developemeent environemnt - check myDevEnv.sh" + exit 1 +fi + +echo running Ant +$JAVA_HOME/bin/java -Dant.home="." $ANT_PROPERTIES org.apache.tools.ant.Main diff --git a/tools/Tools.html b/tools/Tools.html new file mode 100644 index 0000000000..604584c000 --- /dev/null +++ b/tools/Tools.html @@ -0,0 +1,26 @@ + + + +Project Tools.jpx + + +

Project Notes

+
+ +Project: Tools
+Author: Jorg Janke
+Version: $Id: Tools.html,v 1.1 2006/04/21 18:06:25 jjanke Exp $
+
+Description: +

+Tools, libraries and utilities used for Adempiere +

+Tools is the basic container available for clients and servers. See /lib/libraries.txt. +
+Things to do...
+
+
    +
  • . +
+ + diff --git a/tools/build.xml b/tools/build.xml new file mode 100644 index 0000000000..72bcb00759 --- /dev/null +++ b/tools/build.xml @@ -0,0 +1,379 @@ + + + + + + + + + The resulting CCTools.jar and CSTools.jar + repackage all third party libraries + in a single jar for simplified start and version control. + The resuling Server CSTools.jar is added to EARs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/documentation.bat b/tools/documentation.bat new file mode 100644 index 0000000000..659c934f80 --- /dev/null +++ b/tools/documentation.bat @@ -0,0 +1,5 @@ +@Rem API Documentation for Base + +call ..\doc\documentation.bat src doc -private + +@pause \ No newline at end of file diff --git a/tools/lib/SoftwareLicenses.xls b/tools/lib/SoftwareLicenses.xls new file mode 100644 index 0000000000000000000000000000000000000000..def4a3863082579f4c28c6cd74aad7cf9b93f6e5 GIT binary patch literal 16384 zcmeHOU2GiH6+W}xb=Ji3I{%I#VQ_%hj#-;Tg(wK@I3|f5r?_z`mTKg#*OPdi^{%_S zw&MrHmO@*hw1VcLRfSY&UrH;rRFx>IqAHe9OCM+>R8;jxszE$dywFxuY9zq@zB4=C zzZuI;X;5MA`rbR|-1B$Oy>oxZSAMs7>A9aazabUjKB&c*QgZ(xEgr|X@l%i>$YgRRnwm+?Ilg`l`ZmjIVtsBkKTR=5(K;>fgYv% zx~46fHXt?R=gRXZ#oQ^)@(SpeAAO45U1WR6I3gKINKBIQzb-YP_Y$idsMh-|(5qP$ zlzO4f_;ay2D7U(n?g`!`A=xR?a%;=pj=g)k#@g-~ZFPXrwmrdH(DpZ#m4E)UHSusc zQHyL4y#5Yfw5wbWV2au&VQHzPs*qM7y<6JlfXEn4X*V6q3gBp~B1YTpDIi+zXo1~h ztvzGV5|uXmz*@@JZk95&n`Io`(jkY-mDx2Y*QchHsO;`8D!ohgqjwaQI{Yho9cEQs zlCeyXUB1)_rg=E8~w)_Z-~k26@uf>{k9+eU5Rh= zz;}4y+gmY`R07B z=3DYX&9~+^Xud69r}_4LSaZpX<~#DCtjOvJ5J z*2Zl}odLBKO<6g(eWXuIFgYHXiNzbmQESE8LHWQnfqztslz;Oc0m~z6B16+^37e=c+i~MQiZRnfF(aZjdJRaVT zh=M|ZSPieCnqn`K8p{?*8w0Si5YUeD)lDLc=#iUrNl}ki=|zeCc6ry&`3#INK=FcA8Syc`&Qhl7hDZ{Ls(PauzA!9;i@P=j<( zW#v@v3hOmLz~35}(>D%mV~gp~>Hg2X*;Rx;tS5{E2#x#rV_uZ|GR<)f#ezl|Jy|1@ zN7+7hpr0zk!x!^^+X!T7$uior6t3j);g6pOp2P5C;0<>bJ!6-VlD;EEO%a_HY>1Rxnb}aOc3K$GqZ^imp}mQ_ zHKh#0C&e1krk#N8GHQx&xu%r$%12LA3T=wWjVlmkvR|@{)<>{KcOaHE7a+=xV0&(t z(a%kS<(=}eeImLcq7-V1Xbaj9DLHc6kVE+gF$GhU1dRr48B2c+u$;ekxi7FqUZi8C zhe;vqhV&X;+`@=DZGd;+{#v;k1TPs+!Wf`LHUyL4RlLR#NO6$c~EZ6 zyzm!=RpYQCi(eFZM$Wp})3FY2+oEr(uU4~&ozdN*7(5n(Zzi#z@U|(sE`Gn^v`ouYkL+5@@~YReDnE8aZuCzJpHBm(IH%@fCBo zWKNfV3G|}``p{~<8z(pGlwn)u~Sg+TK=8p^f=I%)sB*VwD>| zt>P5pzM-<0GAPy%#SnY_Hd9=tal6G9G~}4U@!qzhxJ=toSf)A4FuR*I#}8ndps;7r%x5f5+7y_W>8Gz_sEa;4R>JkHRwno&`h@M-X{OGK0u#uk(o9 zpXU*I2Ea1{o;^N=$g=_GtY8t(rDp@=!P&qN&jvbpIDlhN?%jW|Yop4=qi4Pc%%tT- znf>)r@$o?M@u1X$kV<(NL1Q0EXU^fvAS;(ue#-bg66OphBI|kxk!(GPg!#;Kim{>o zzOfU7{hvNLtT>)?90C3U1l)z3a=PRW&3T65$Ysu3DxPuEckbuhUgxSdAMK!rDQmCn z)138RpAN4Rz1k7{wR7GWwKwc zPlwz6oV$;97utgDbp@dfmZR+fP}3@IByr!1sXf z0pA0@2Ye6s9`HTzN%8>K?auyy`yB46xVGk=k$Y3_>-nh)x5eDs@_&6BkVg=?H|Iw( zyzA$lp8Fw|bIs5FOA{jZV*K=zABysxpXKi(GWWwr?}5|!A~cOJH%z%-zm&`1TeS6r z9TGB}TCg9PVWuLNHI-v_R-Ur$9n3@eMd~^ILNzVt9Q2xV{0H!ge%i5C#>d$?5kmNv zm|1)$$gc)j_kMWcjM_vDzb8xs;~iR|-`V@FRX@+W^yNVol0ImNs}1(IitDrI&^6Rw L|F?-RFT#HSYaRtz literal 0 HcmV?d00001 diff --git a/tools/lib/copyLibraries.bat b/tools/lib/copyLibraries.bat new file mode 100644 index 0000000000..e28df5c2e6 --- /dev/null +++ b/tools/lib/copyLibraries.bat @@ -0,0 +1,27 @@ +@Title Copy Libraries from Source + +@Echo Log4j http://jakarta.apache.org/log4j +@xcopy C:\Sources\jakarta-log4j-1.2.8\dist\lib\log4j-1.2.8.jar log4j.jar /V /D + + +@Echo Mail +@xcopy C:\Sources\jaf-1.0.2\activation.jar /V /D +@xcopy C:\Sources\javamail-1.3\mail.jar /V /D + + +@Echo JSTL http://jakarta.apache.org/taglibs +@xcopy C:\Sources\jakarta-taglibs\standard-1.0.3\lib\jstl.jar /V /D +@xcopy C:\Sources\jakarta-taglibs\standard-1.0.3\lib\standard.jar /V /D +@xcopy C:\Sources\jakarta-taglibs\standard-1.0.3\lib\saxpath.jar /V /D + + +@Echo OracleRowSet ocrs12.jar + + +@Echo JUnit http://www.junit.org +@xcopy C:\Sources\junit3.8.1\junit.jar /V /D + +@Echo Ant in distribution http://ant.apache.org +@xcopy C:\Sources\apache-ant-1.6.2\lib\ant.jar /V /D + +@pause \ No newline at end of file diff --git a/tools/lib/libraries.txt b/tools/lib/libraries.txt new file mode 100644 index 0000000000..ceacfceaa5 --- /dev/null +++ b/tools/lib/libraries.txt @@ -0,0 +1,55 @@ +External Libraries +================== + +$Id: libraries.txt,v 1.1 2006/04/21 18:06:25 jjanke Exp $ + +For CTools.jar +============== + +mail.jar + Java Mail 1.3 C:\Sources\javamail-1.3 + +activation.jar + Java Activation 1.0.2 C:\Sources\jaf-1.0.2 + +bsh-core-2.0b1.jar + Bean Shell http://www.beanshell.org/download.html + +Verisign.jar + PayFlowPro 3.06 + +xdoclet.jar + XDoclet 1.1.2 http://xdoclet.sourceforge.net/ + +standard.jar +jstl.jar + JSTL Version 1.1 http://jakarta.apache.org/taglibs/index.html + +log4j.jar + Log4J 1.2.9 http://logging.apache.org/site/binindex.html + +-------- + +ojdbc14.jar Oracle JDBC 9.2.0.3 - also lib/oracle.jar +ojdbc14_g.jar Oracle JDBC 9.2.0.3 debug +ocrs12.jar Oracle JDBC 9.2.0.3 RowSet + +-------- + +Build +----- +ant.jar +ant-launcher.jar +ant-commons-net.jar + Ant 1.6.2 http://ant.apache.org/bindownload.cgi +commons-net.jar + Commons Net 1.1.0 http://jakarta.apache.org/site/binindex.cgi +jakarta-oro.jar + ORO 2.0.8 + + +servlet.jar + javax.servlet + + + diff --git a/tools/packages.txt b/tools/packages.txt new file mode 100644 index 0000000000..7a31355b02 --- /dev/null +++ b/tools/packages.txt @@ -0,0 +1,5 @@ +org.apache.ecs.filter +org.apache.ecs.html +org.apache.ecs.storage +org.apache.ecs.xhtml +org.apache.ecs.xml diff --git a/tools/src/org/apache/ecs/AlignType.java b/tools/src/org/apache/ecs/AlignType.java new file mode 100644 index 0000000000..06fc83f658 --- /dev/null +++ b/tools/src/org/apache/ecs/AlignType.java @@ -0,0 +1,48 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +/** + This interface is intended to be implemented by elements that require + alignment attributes. + + @version $Id: AlignType.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public interface AlignType +{ + + // convience variables + public final static String CENTER = "center"; + public final static String TOP = "top"; + public final static String BOTTOM = "bottom"; + public final static String ABSBOTTOM = "absbottom"; + public final static String ABSMIDDLE = "absmiddle"; + public final static String TEXTTOP = "texttop"; + public final static String LEFT = "left"; + public final static String RIGHT = "right"; + public final static String MIDDLE = "middle"; + public final static String BASELINE = "baseline"; + + /** make sure implementing classes have a setAlign method. */ + public abstract void setAlign(String alignment); + + /** make sure implementing classes have a setVAlign method. */ + public abstract void setVAlign(String alignment); + +} diff --git a/tools/src/org/apache/ecs/Attributes.java b/tools/src/org/apache/ecs/Attributes.java new file mode 100644 index 0000000000..abba7e3f52 --- /dev/null +++ b/tools/src/org/apache/ecs/Attributes.java @@ -0,0 +1,122 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +/** + This interface describes the attributes within an element. It is + implemented by ElementAttributes. + + @version $Id: Attributes.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public interface Attributes +{ + /** + Does this element attribute value need a =""? + */ + public static final String NO_ATTRIBUTE_VALUE = "ECS_NO_ATTRIBUTE_VALUE"; + + /** + Set the state of the attribute filter. + @param filter_attribute_state do we need to filter attributes? + */ + public Element setAttributeFilterState(boolean filter_attribute_state); + + /** + Set the AttributeFilter that should be used. + @param attribute_filter set the attribute filter to be used. + */ + public Element setAttributeFilter(Filter attribute_filter); + + /** + Get the AttributeFilter that is in use. + */ + public Filter getAttributeFilter(); + + /** + Add an attribute to the Element. + @param name name of the attribute + @param element value of the attribute. + */ + public Element addAttribute(String name,Object element); + + /** + Add an attribute to the Element. + @param name name of the attribute + @param element value of the attribute. + */ + public Element addAttribute(String name, int element); + + /** + Add an attribute to the Element. + @param name name of the attribute + @param element value of the attribute. + */ + public Element addAttribute(String name, String element); + + /** + Add an attribute to the Element. + @param name name of the attribute + @param element value of the attribute. + */ + public Element addAttribute(String name, Integer element); + + /** + Remove an attribute from the element. + @param name remove the attribute of this name + */ + public Element removeAttribute(String name); + + /** + Does the element have an attribute. + @param name of the attribute to ask the element for. + */ + public boolean hasAttribute(String name); + + /** + Set the character used to quote attributes. + @param quote_char character used to quote attributes + */ + public Element setAttributeQuoteChar(char quote_char); + + /** + Get the character used to quote attributes. + */ + public char getAttributeQuoteChar(); + + /** + Set the equality sign for an attribute. + @param equality_sign The equality sign used for attributes. + */ + public Element setAttributeEqualitySign(char equality_sign); + + /** + Get the equality sign for an attribute. + */ + public char getAttributeEqualitySign(); + + /** + Do we surround attributes with qoutes? + */ + public boolean getAttributeQuote(); + + /** + Set wether or not we surround the attributes with quotes. + */ + public Element setAttributeQuote(boolean attribute_quote); +} diff --git a/tools/src/org/apache/ecs/ClearElement.java b/tools/src/org/apache/ecs/ClearElement.java new file mode 100644 index 0000000000..811ea8190e --- /dev/null +++ b/tools/src/org/apache/ecs/ClearElement.java @@ -0,0 +1,37 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +import org.apache.ecs.filter.NullFilter; + +/** +A basic ECS element that doesn't have a filter. This allows content developers +to use ECS with legacy applications that want to generate HTML but also be a +use raw HTML. Don't use this unless you have to do so for compatibilty reasons +*/ + +public class ClearElement extends StringElement { + + public ClearElement(String string) { + super( string ); + + this.setFilter( new NullFilter() ); + } + + +} + diff --git a/tools/src/org/apache/ecs/ConcreteElement.java b/tools/src/org/apache/ecs/ConcreteElement.java new file mode 100644 index 0000000000..cfc7681262 --- /dev/null +++ b/tools/src/org/apache/ecs/ConcreteElement.java @@ -0,0 +1,440 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +import java.io.OutputStream; +import java.io.PrintWriter; +import java.io.Writer; +import java.io.IOException; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.StreamCorruptedException; +import java.util.Enumeration; +import java.util.Vector; +import java.util.Hashtable; + +/** + This class is to be subclassed by those elements that are made up of + other elements. i.e. BODY,HEAD,etc. + + @version $Id: ConcreteElement.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public class ConcreteElement extends ElementAttributes implements Cloneable +{ + /** HTML nbsp */ + public static final String NBSP = " "; + + /** + * keep a list of elements that need to be added to the element + * @serial registry registry */ + private Hashtable registry = new Hashtable(4); + /** Maintain an ordered list of elements */ + private Vector registryList = new Vector(2); + + public ConcreteElement() + { + } + + /** + If the object is in the registry return otherwise return null. + @param element the name of the object to locate. + */ + public ConcreteElement getElement(String element) + { + if(registry.containsKey(element)) + { + return (ConcreteElement)registry.get(element); + } + return null; + } + + /** + Registers an element in the head element list + @param element element to be added to the registry. + */ + public Element addElementToRegistry(Element element) + { + if ( element == null ) + return(this); + int hc = element.hashCode(); // causes error when compiles in 1.4 ?? + String s = Integer.toString(hc); + addElementToRegistry(s, element); + return(this); + } + + /** + Registers an element in the head element list + @param hashcode internal name of element + @param element element to be added to the registry. + */ + public Element addElementToRegistry(String hashcode,Element element) + { + if ( hashcode == null || element == null ) + return(this); + + element.setFilterState(getFilterState()); + if(ECSDefaults.getDefaultPrettyPrint() != element.getPrettyPrint()) + element.setPrettyPrint(getPrettyPrint()); + registry.put(hashcode,element); + if(!registryList.contains(hashcode)) + registryList.addElement(hashcode); + return(this); + } + + /** + Registers an element in the head element list + @hashcode named element for hashcode + @param element element to be added to the registry. + @param filter does this need to be filtered? + */ + public Element addElementToRegistry(Element element,boolean filter) + { + if ( element == null ) + return(this); + setFilterState(filter); + addElementToRegistry(Integer.toString(element.hashCode()),element); + return(this); + } + + /** + Registers an element in the head element list + @param element element to be added to the registry. + @param filter should we filter this element? + */ + public Element addElementToRegistry(String hashcode, Element element,boolean filter) + { + if ( hashcode == null ) + return(this); + setFilterState(filter); + addElementToRegistry(hashcode,element); + return(this); + } + + /** + Registers an element in the head element list + @param value element to be added to the registry. + @param filter does this need to be filtered? + */ + public Element addElementToRegistry(String value,boolean filter) + { + if ( value == null ) + return(this); + setFilterState(filter); + addElementToRegistry(Integer.toString(value.hashCode()),value); + return(this); + } + + /** + Registers an element in the head element list + @hashcode named element for hashcode + @param value element to be added to the registry. + @param filter does this need to be filtered? + */ + public Element addElementToRegistry(String hashcode, String value,boolean filter) + { + if ( hashcode == null ) + return(this); + setFilterState(filter); + addElementToRegistry(hashcode,value); + return(this); + } + + /** + Registers an element in the head element list + @param value element to be added to the registry. + */ + public Element addElementToRegistry(String value) + { + if ( value == null ) + return(this); + addElementToRegistry(new StringElement(value)); + return(this); + } + + /** + Registers an element in the head element list + @param value element to be added to the registry. + */ + public Element addElementToRegistry(String hashcode,String value) + { + if ( hashcode == null ) + return(this); + + // We do it this way so that filtering will work. + // 1. create a new StringElement(element) - this is the only way that setTextTag will get called + // 2. copy the filter state of this string element to this child. + // 3. copy the prettyPrint state of the element to this child + // 4. copy the filter for this string element to this child. + + StringElement se = new StringElement(value); + se.setFilterState(getFilterState()); + se.setFilter(getFilter()); + se.setPrettyPrint(getPrettyPrint()); + addElementToRegistry(hashcode,se); + return(this); + } + + /** + Removes an element from the element registry + @param element element to be added to the registry. + */ + public Element removeElementFromRegistry(Element element) + { + removeElementFromRegistry(Integer.toString(element.hashCode())); + return(this); + } + + /** + Removes an element from the head element registry + @param hashcode element to be added to the registry. + */ + public Element removeElementFromRegistry(String hashcode) + { + registry.remove(hashcode); + registryList.removeElement(hashcode); + return(this); + } + + /** + Find out if this element is in the element registry. + @param element find out if this element is in the registry + */ + public boolean registryHasElement(Element element) + { + return(registry.contains(element)); + } + + /** + Get the keys of this element. + */ + public Enumeration keys() + { + return(registryList.elements()); + } + + /** + Get an enumeration of the elements that this element contains. + */ + public Enumeration elements() + { + return(registry.elements()); + } + + /** + Find out if this element is in the element registry. + @param hashcode find out if this element is in the registry + */ + public boolean registryHasElement(String hashcode) + { + return(registry.containsKey(hashcode)); + } + + /** + Override output(OutputStream) incase any elements are in the registry. + @param out OutputStream to write to. + */ + public void output(OutputStream out) + { + boolean prettyPrint = getPrettyPrint(); + int tabLevel = getTabLevel(); + try + { + if (registry.size() == 0) + { + if ((prettyPrint && this instanceof Printable) && (tabLevel > 0)) + putTabs(tabLevel, out); + super.output(out); + } + else + { + if ((prettyPrint && this instanceof Printable) && (tabLevel > 0)) + putTabs(tabLevel, out); + + out.write(createStartTag().getBytes()); + + // If this is a StringElement that has ChildElements still print the TagText + if(getTagText() != null) + out.write(getTagText().getBytes()); + + Enumeration en = registryList.elements(); + + while(en.hasMoreElements()) + { + Object obj = registry.get(en.nextElement()); + if(obj instanceof GenericElement) + { + Element e = (Element)obj; + if (prettyPrint && this instanceof Printable) + { + if ( getNeedLineBreak() ) + { + out.write('\n'); + e.setTabLevel(tabLevel + 1); + } + } + e.output(out); + } + else + { + if (prettyPrint && this instanceof Printable) + { + if ( getNeedLineBreak() ) + { + out.write('\n'); + putTabs(tabLevel + 1, out); + } + } + String string = obj.toString(); + out.write(string.getBytes()); + } + } + if (getNeedClosingTag()) + { + if (prettyPrint && this instanceof Printable) + { + if ( getNeedLineBreak() ) + { + out.write('\n'); + if (tabLevel > 0) + putTabs(tabLevel, out); + } + } + out.write(createEndTag().getBytes()); + } + } + } + catch(IOException ioe) + { + ioe.printStackTrace(new PrintWriter(out)); + } + } + + /** + Writer version of this method. + */ + public void output(Writer out) + { + output ( new PrintWriter(out) ); + } + + /** + Override output(BufferedWriter) incase any elements are in the registry. + @param out OutputStream to write to. + */ + public void output(PrintWriter out) + { + boolean prettyPrint = getPrettyPrint(); + int tabLevel = getTabLevel(); + if (registry.size() == 0) + { + if ((prettyPrint && this instanceof Printable) && (tabLevel > 0)) + putTabs(tabLevel, out); + + super.output(out); + } + else + { + if ((prettyPrint && this instanceof Printable) && (tabLevel > 0)) + putTabs(tabLevel, out); + + out.write(createStartTag()); + // If this is a StringElement that has ChildElements still print the TagText + if(getTagText() != null) + out.write(getTagText()); + + Enumeration en = registryList.elements(); + while(en.hasMoreElements()) + { + Object obj = registry.get(en.nextElement()); + if(obj instanceof GenericElement) + { + Element e = (Element)obj; + if (prettyPrint && this instanceof Printable) + { + if (getNeedLineBreak()) { + out.write('\n'); + e.setTabLevel(tabLevel + 1); + } + } + e.output(out); + } + else + { + if (prettyPrint && this instanceof Printable) + { + if (getNeedLineBreak()) { + out.write('\n'); + putTabs(tabLevel + 1, out); + } + } + String string = obj.toString(); + if(getFilterState()) + out.write(getFilter().process(string)); + else + out.write(string); + } + } + if (getNeedClosingTag()) + { + if (prettyPrint && this instanceof Printable) + { + if (getNeedLineBreak()) { + out.write('\n'); + if (tabLevel > 0) + putTabs(tabLevel, out); + } + } + out.write(createEndTag()); + } + } + } + + /** + * Allows all Elements the ability to be cloned. + */ + public Object clone() + { + try + { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream out = new ObjectOutputStream(baos); + out.writeObject(this); + out.close(); + ByteArrayInputStream bin = new ByteArrayInputStream(baos.toByteArray()); + ObjectInputStream in = new ObjectInputStream(bin); + Object clone = in.readObject(); + in.close(); + return(clone); + } + catch(ClassNotFoundException cnfe) + { + throw new InternalError(cnfe.toString()); + } + catch(StreamCorruptedException sce) + { + throw new InternalError(sce.toString()); + } + catch(IOException ioe) + { + throw new InternalError(ioe.toString()); + } + } +} diff --git a/tools/src/org/apache/ecs/Doctype.java b/tools/src/org/apache/ecs/Doctype.java new file mode 100644 index 0000000000..1a85f4527e --- /dev/null +++ b/tools/src/org/apache/ecs/Doctype.java @@ -0,0 +1,398 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +/* + * Copyright (c) 1999 The Java Apache Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Java Apache + * Project. " + * + * 4. The names "Java Apache Element Construction Set", "Java Apache ECS" and + * "Java Apache Project" must not be used to endorse or promote products + * derived from this software without prior written permission. + * + * 5. Products derived from this software may not be called + * "Java Apache Element Construction Set" nor "Java Apache ECS" appear + * in their names without prior written permission of the + * Java Apache Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Java Apache + * Project. " + * + * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Java Apache Project. For more information + * on the Java Apache Project please see . + * + */ + + +/** + * This class creates a <!DOCTYPE> tag.

+ * + * Format:
+ <!DOCTYPE [name] [visibility] [identifier] [uri]>

+

+ usage:
+ Document d = new Document()
+ .setDoctype(new Doctype.Html40Strict())
+

or

+ XMLDocument d = new XMLDocument()
+ .addToProlog( new Doctype( "foo", "\"--/bar/baz/en\"", "\"http://qoz.net/foo.dtd\"" );
+ * .addElement( new XML( ... + * + * @see Doctype.Html40Strict + * @see Doctype.Html40Transitional + * @see Doctype.Html40Frameset + * @see Doctype.XHtml10Strict + * @see Doctype.XHtml10Transitional + * @see Doctype.XHtml10Frameset + * + * @version $Id: Doctype.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + * @author Michael Heuer + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bruce Durling + * @author Bojan Smojver +*/ +public class Doctype extends SinglePartElement implements Printable +{ + public static final String elementName = "!DOCTYPE"; + public static final String PUBLIC = "PUBLIC"; + + protected String name; + protected String visibility; + protected String identifier; + protected String uri; + + { + setElementType(elementName); + setCase(Element.UPPERCASE); + } + + /** + * Basic Constructor. + * + */ + public Doctype() + { + updateElementType(); + } + + + /** + * Constructor. + * + * @param name Root element of the XML document. + * @param id Public identifier. + * @param uri URI of the DTD. + */ + public Doctype( String name, String id, String uri ) + { + this.name = name; + this.visibility = PUBLIC; + this.identifier = id; + this.uri = uri; + updateElementType(); + } + + /** + * Constructor. + * + * @param name Root element of the XML document. + * @param id Public identifier. + * @param uri URI of the DTD. + */ + public Doctype( String name, String visibility, String id, String uri ) + { + this.name = name; + this.visibility = visibility; + this.identifier = id; + this.uri = uri; + updateElementType(); + } + + /** + * Should be called when any of the fields are changed. + * + */ + protected void updateElementType() + { + setElementType( elementName + + " " + name + + " " + visibility + + " " + identifier + + " " + uri ); + } + + /** + * Updates the name of the root element. + * + * @param name Name of the root element. + * @return a value of type 'Doctype' + */ + public Doctype setName( String name ) + { + this.name = name; + updateElementType(); + return( this ); + } + /** + * Updates the name of the root element. + * + * @param visibility visibility + * @return a value of type 'Doctype' + */ + public Doctype setVisibility (String visibility) + { + this.visibility = visibility; + updateElementType(); + return( this ); + } + + /** + * Updates the name of the public identifier. + * + * @param identifier The public identifier. + * @return a value of type 'Doctype' + */ + public Doctype setIdentifier( String identifier ) + { + this.identifier = identifier; + updateElementType(); + return( this ); + } + + /** + * Updates the URI of the dtd. + * + * @param uri URI of the dtd. + * @return a value of type 'Doctype' + */ + public Doctype setUri( String uri ) + { + this.uri = uri; + updateElementType(); + return(this); + } + + /** + * Adds and Element to the element. + * + * @param hashcode name of the element for hash table. + * @param element Adds an Element to the element. + * @return a value of type 'Doctype' + */ + public Doctype addElement( String hashcode, Element element ) + { + addElementToRegistry( hashcode, element ); + return(this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode name of the element for the hash table. + * @param element Adds an Element to the element. + * @return a value of type 'Doctype' + */ + public Doctype addElement( String hashcode, String element ) + { + addElementToRegistry(hashcode,element); + return(this); + } + + /** + * Adds an Element to the element. + * + * @param element Adds an Element to the element. + * @return a value of type 'Doctype' + */ + public Doctype addElement(Element element) + { + addElementToRegistry(element); + return(this); + } + + /** + * Adds an Element to the element. + * + * @param element Adds an Element to the element. + * @return a value of type 'Doctype' + */ + public Doctype addElement(String element) + { + addElementToRegistry(element); + return(this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode the name of the element to be removed. + * @return a value of type 'Doctype' + */ + public Doctype removeElement(String hashcode) + { + removeElementFromRegistry(hashcode); + return(this); + } + + /** + * The HTML 4.0 Strict DTD includes all elements and attributes + * that have not been deprecated or do not appear in frameset + * documents. + *

+ * See: + * http://www.w3.org/TR/REC-html40/sgml/dtd.html + */ + public static class Html40Strict extends Doctype { + + public Html40Strict() { + this.name = "HTML"; + this.visibility = PUBLIC; + this.identifier = "\"-//W3C//DTD HTML 4.0//EN\""; + this.uri = "\"http://www.w3.org/TR/REC-html40/strict.dtd\""; + this.updateElementType(); + } + } + + /** + * The HTML 4.0 Transitional DTD includes everything in the + * strict DTD plus deprecated elements and attributes (most of + * which concern visual presentation). + *

+ * See: + * http://www.w3.org/TR/REC-html40/sgml/loosedtd.html + */ + public static class Html40Transitional extends Doctype { + + public Html40Transitional() { + this.name = "HTML"; + this.visibility = PUBLIC; + this.identifier = "\"-//W3C//DTD HTML 4.0 Transitional//EN\""; + this.uri = "\"http://www.w3.org/TR/REC-html40/loose.dtd\""; + this.updateElementType(); + } + } + + /** + * The HTML 4.0 Frameset DTD includes everything in the transitional + * DTD plus frames as well. + *

+ * See: + * http://www.w3.org/TR/REC-html40/sgml/framesetdtd.html + */ + public static class Html40Frameset extends Doctype { + + public Html40Frameset() { + this.name = "HTML"; + this.visibility = PUBLIC; + this.identifier = "\"-//W3C//DTD HTML 4.0 Frameset//EN\""; + this.uri = "\"http://www.w3.org/TR/REC-html40/frameset.dtd\""; + this.updateElementType(); + } + } + + /** + * The XHTML 1.0 Strict DTD + * This is the same as HTML 4.0 Strict except for changes due + * to the differences between XML and SGML. + *

+ * See: + * http://www.w3.org/TR/xhtml1 + */ + public static class XHtml10Strict extends Doctype { + + public XHtml10Strict() { + this.name = "html"; + this.visibility = PUBLIC; + this.identifier = "\"-//W3C//DTD XHTML 1.0 Strict//EN\""; + this.uri = "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\""; + this.updateElementType(); + } + } + + /** + * The XHTML 1.0 Transitional DTD + * This is the same as HTML 4.0 Transitional except for changes due + * to the differences between XML and SGML. + *

+ * See: + * http://www.w3.org/TR/xhtml1 + */ + public static class XHtml10Transitional extends Doctype { + + public XHtml10Transitional() { + this.name = "html"; + this.visibility = PUBLIC; + this.identifier = "\"-//W3C//DTD XHTML 1.0 Transitional//EN\""; + this.uri = + "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\""; + this.updateElementType(); + } + } + + /** + * The XHTML 1.0 Frameset DTD + * This is the same as HTML 4.0 Frameset except for changes due + * to the differences between XML and SGML. + *

+ * See: + * http://www.w3.org/TR/xhtml1 + */ + public static class XHtml10Frameset extends Doctype { + + public XHtml10Frameset() { + this.name = "html"; + this.visibility = PUBLIC; + this.identifier = "\"-//W3C//DTD XHTML 1.0 Frameset//EN\""; + this.uri = + "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\""; + this.updateElementType(); + } + } +} diff --git a/tools/src/org/apache/ecs/ECSDefaults.java b/tools/src/org/apache/ecs/ECSDefaults.java new file mode 100644 index 0000000000..4308fdb277 --- /dev/null +++ b/tools/src/org/apache/ecs/ECSDefaults.java @@ -0,0 +1,200 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +import java.util.ResourceBundle; + +/** + This class is responsible for loading the ecs.properties file and + getting the default settings for ECS. This allows you to edit a + simple text file instead of having to edit the .java files and + recompile. + + @version $Id: ECSDefaults.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ +*/ +public class ECSDefaults +{ + protected static ResourceBundle resource; + + // private initializer. + static { + try + { + resource = ResourceBundle.getBundle("org.apache.ecs.ecs"); + } + catch(Exception e) + { + System.err.println("Cannot find org.apache.ecs.ecs.properties."); + } + } + + private static boolean filter_state = new Boolean(resource.getString("filter_state")).booleanValue(); + + private static boolean filter_attribute_state = new Boolean(resource.getString("filter_attribute_state")).booleanValue(); + + private static char attribute_equality_sign = resource.getString("attribute_equality_sign").charAt(1); + + private static char begin_start_modifier = resource.getString("begin_start_modifier").charAt(1); + + private static char end_start_modifier = resource.getString("end_start_modifier").charAt(1); + + private static char begin_end_modifier = resource.getString("begin_end_modifier").charAt(1); + + private static char end_end_modifier = resource.getString("end_end_modifier").charAt(1); + + private static char attribute_quote_char = resource.getString("attribute_quote_char").charAt(0); + + private static boolean attribute_quote = new Boolean(resource.getString("attribute_quote")).booleanValue(); + + private static boolean end_element = new Boolean(resource.getString("end_element")).booleanValue(); + + private static String codeset = resource.getString("codeset"); + + private static int position = Integer.parseInt(resource.getString("position")); + + private static int case_type = Integer.parseInt(resource.getString("case_type")); + + private static char start_tag = resource.getString("start_tag").charAt(0); + + private static char end_tag = resource.getString("end_tag").charAt(0); + + private static boolean pretty_print = new Boolean(resource.getString("pretty_print")).booleanValue(); + + + /** + Should we filter the value of <>VALUE</> + */ + public static boolean getDefaultFilterState() + { + return filter_state; + } + + /** + Should we filter the value of the element attributes + */ + public static boolean getDefaultFilterAttributeState() + { + return filter_attribute_state; + } + + /** + What is the equality character for an attribute. + */ + public static char getDefaultAttributeEqualitySign() + { + return attribute_equality_sign; + } + + /** + What the start modifier should be + */ + public static char getDefaultBeginStartModifier() + { + return begin_start_modifier; + } + + /** + What the start modifier should be + */ + public static char getDefaultEndStartModifier() + { + return end_start_modifier; + } + + /** + What the end modifier should be + */ + public static char getDefaultBeginEndModifier() + { + return begin_end_modifier; + } + + /** + What the end modifier should be + */ + public static char getDefaultEndEndModifier() + { + return end_end_modifier; + } + + /* + What character should we use for quoting attributes. + */ + public static char getDefaultAttributeQuoteChar() + { + return attribute_quote_char; + } + + /* + Should we wrap quotes around an attribute? + */ + public static boolean getDefaultAttributeQuote() + { + return attribute_quote; + } + + /** + Does this element need a closing tag? + */ + public static boolean getDefaultEndElement() + { + return end_element; + } + + /** + What codeset are we going to use the default is 8859_1 + */ + public static String getDefaultCodeset() + { + return codeset; + } + + /** + position of tag relative to start and end. + */ + public static int getDefaultPosition() + { + return position; + } + + /** + Default value to set case type + */ + public static int getDefaultCaseType() + { + return case_type; + } + + public static char getDefaultStartTag() + { + return start_tag; + } + + public static char getDefaultEndTag() + { + return end_tag; + } + + /** + Should we print html in a more readable format? + */ + public static boolean getDefaultPrettyPrint() + { + return pretty_print; + } + +} diff --git a/tools/src/org/apache/ecs/Element.java b/tools/src/org/apache/ecs/Element.java new file mode 100644 index 0000000000..a98bd99608 --- /dev/null +++ b/tools/src/org/apache/ecs/Element.java @@ -0,0 +1,213 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +import java.io.OutputStream; +import java.io.PrintWriter; + +/** + This class describes an ElementFactory. + + @version $Id: Element.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public interface Element extends ElementRegistry +{ + /** + Element to be rendered in all CAPS + */ + public static final int UPPERCASE = 1; + + /** + Element to be rendered in all lowercase + */ + public static final int LOWERCASE = 2; + + /** + Element to be rendered as specified by subclass + */ + public static final int MIXEDCASE = 3; + + /** + Element tag to be rendered to the center of start_tag end_tag <_tag>
+ This is the default. + */ + public static final int CENTER = 4; + + /** + Element tag to be rendered to the left of start_tag end_tag _tag<> + */ + public static final int LEFT = 5; + + /** + Element tag to be rendered to the right of start_tag end_tag <>_tag + */ + public static final int RIGHT = 6; + + /** + Set case type + */ + public void setCase(int type); + + /** + Used to determine case setting + */ + public int getCase(); + + /** + Get the version number of this codebase + */ + public String getVersion(); + + /** + Set the HtmlElement type + */ + public void setElementType(String element_type); + + /** + Get the HtmlElement type + */ + public String getElementType(); + + /** + Set wether or not this Element needs a closing tag + */ + public void setNeedClosingTag(boolean close_tag); + + /** + Get whether or not this Element needs a closing tag + */ + public boolean getNeedClosingTag(); + + /** + Determine if this element needs a line break, if pretty printing. + */ + public boolean getNeedLineBreak(); + + /** + Set tag position. ElementFactory CENTER | LEFT | RIGHT + */ + public void setTagPosition(int position); + + /** + Get tag position. How is the element supposed to be rendered. + */ + public int getTagPosition(); + + /** + Set the start tag character. + */ + public void setStartTagChar(char start_tag); + + /** + Get the start tag character. + */ + public char getStartTagChar(); + + /** + Set the end tag character. + */ + public void setEndTagChar(char end_tag); + + /** + Get the end tag character. + */ + public char getEndTagChar(); + + /* + Set a modifer for the start of the tag. + */ + public Element setBeginStartModifier(char start_modifier); + + /** + Get a modifier for the start of the tag if one exists. + */ + public char getBeginStartModifier(); + + /** + Set a modifer for the end of the tag. + */ + public Element setBeginEndModifier(char start_modifier); + + /** + Get the modifier for the end of the tag if one exists. + */ + public char getBeginEndModifier(); + + /* + Set a modifer for the start of the tag. + */ + public Element setEndStartModifier(char start_modifier); + + /** + Get a modifier for the start of the tag if one exists. + */ + public char getEndStartModifier(); + + /** + Set a modifer for the end of the tag. + */ + public Element setEndEndModifier(char start_modifier); + + /** + Get the modifier for the end of the tag if one exists. + */ + public char getEndEndModifier(); + + /** + Set the filter state of the element. + */ + public Element setFilterState(boolean state); + + /** + Get the filter state of the element. + */ + public boolean getFilterState(); + + /** + Set the prettyPrint state of the element. + */ + public Element setPrettyPrint(boolean pretty_print); + + /** + Get the prettyPrint state of the element. + */ + public boolean getPrettyPrint(); + + /** + Set the tab level for pretty printing + */ + public void setTabLevel(int tabLevel); + + /** + Get the tab level for pretty printing. + */ + + public int getTabLevel(); + + /** + Provide a way to output the element to a stream. + */ + public void output(OutputStream out); + + /** + Provide a way to output the element to a PrintWriter. + */ + public void output(PrintWriter out); + +} diff --git a/tools/src/org/apache/ecs/ElementAttributes.java b/tools/src/org/apache/ecs/ElementAttributes.java new file mode 100644 index 0000000000..94136f7845 --- /dev/null +++ b/tools/src/org/apache/ecs/ElementAttributes.java @@ -0,0 +1,338 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +import java.util.*; + +/** + This class provides a common set of attributes set* methods for all classes. + It is abstract to prevent direct instantiation. + @version $Id: ElementAttributes.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ + +public abstract class ElementAttributes extends GenericElement implements Attributes +{ + /** + Basic Constructor. + */ + public ElementAttributes() + { + } + + /** + Filter to use to escape attribute input. + By default the attribute filter and the element filter are the same. + @serial attribute_filter attribute_filter + */ + private Filter attribute_filter = getFilter(); + + /** + Should we filter the value of the element attributes + @serial filter_attribute_state filter_attribute_state + */ + private boolean filter_attribute_state = ECSDefaults.getDefaultFilterAttributeState(); + + /** + What is the equality character for an attribute. + @serial attribute_equality_sign attribute_equality_sign + */ + private char attribute_equality_sign = ECSDefaults.getDefaultAttributeEqualitySign(); + + /** + What character should we use for quoting attributes. + @serial attribute_quote_char attribute_quote_char + */ + private char attribute_quote_char = ECSDefaults.getDefaultAttributeQuoteChar(); + + /** + Should we wrap quotes around an attribute? + @serial attribute_quote attribute_quote + */ + private boolean attribute_quote = ECSDefaults.getDefaultAttributeQuote(); + + /** + Set the character used to quote attributes. + @param quote_char character used to quote attributes + */ + public Element setAttributeQuoteChar(char quote_char) + { + attribute_quote_char = quote_char; + return(this); + } + + /** + Get the character used to quote attributes. + */ + public char getAttributeQuoteChar() + { + return(attribute_quote_char); + } + + /** + Set the equality sign for an attribute. + @param equality_sign The equality sign used for attributes. + */ + public Element setAttributeEqualitySign(char equality_sign) + { + attribute_equality_sign = equality_sign; + return(this); + } + + /** + Get the equality sign for an attribute. + */ + public char getAttributeEqualitySign() + { + return(attribute_equality_sign); + } + + /* + Do we surround attributes with qoutes? + */ + public boolean getAttributeQuote() + { + return(attribute_quote); + } + + /** + Set wether or not we surround the attributes with quotes. + */ + public Element setAttributeQuote(boolean attribute_quote) + { + this.attribute_quote = attribute_quote; + return(this); + } + + /** + Set the element id for Cascading Style Sheets. + */ + public Element setID(String id) + { + addAttribute("id",id); + return(this); + } + + /** + Set the element class for Cascading Style Sheets. + */ + public Element setClass(String element_class) + { + addAttribute("class",element_class); + return(this); + } + + /** + Sets the LANG="" attribute + @param lang the LANG="" attribute + */ + public Element setLang(String lang) + { + addAttribute("lang",lang); + return(this); + } + + /** + Sets the STYLE="" attribute + @param style the STYLE="" attribute + */ + public Element setStyle(String style) + { + addAttribute("style",style); + return(this); + } + + /** + Sets the DIR="" attribute + @param dir the DIR="" attribute + */ + public Element setDir(String dir) + { + addAttribute("dir",dir); + return(this); + } + /** + Sets the TITLE="" attribute + @param title the TITLE="" attribute + */ + public Element setTitle(String title) + { + addAttribute("title",title); + return(this); + } + + /** + Find out if we want to filter the elements attributes or not. + */ + protected boolean getAttributeFilterState() + { + return(filter_attribute_state); + } + + /** + Tell the element if we want to filter its attriubtes. + @param filter_attribute_state do we want to filter the attributes of this element? + */ + public Element setAttributeFilterState(boolean filter_attribute_state) + { + this.filter_attribute_state = filter_attribute_state; + return(this); + } + + /** + Set up a new filter for all element attributes. + @param attribute_filter the filter we want to use for element attributes. By
+ default it is the same as is used for the value of the tag. It is assumed
+ that if you create a new filter you must want to use it. + */ + public Element setAttributeFilter(Filter attribute_filter) + { + filter_attribute_state = true; // If your setting up a filter you must want to filter. + this.attribute_filter = attribute_filter; + return(this); + } + + /** + Get the filter for all element attributes. + Filter the filter we want to use for element attributes. By
+ default it is the same as is used for the value of the tag. It is assumed
+ that if you create a new filter you must want to use it. + */ + public Filter getAttributeFilter() + { + return(this.attribute_filter); + } + + + /** Add an attribute to the element. */ + public Element addAttribute(String attribute_name, Object attribute_value) + { + getElementHashEntry().put(attribute_name, attribute_value); + return(this); + } + + /** Add an attribute to the element. */ + public Element addAttribute(String attribute_name, int attribute_value) + { + getElementHashEntry().put(attribute_name, new Integer(attribute_value)); + return(this); + } + + /** Add an attribute to the element. */ + public Element addAttribute(String attribute_name, String attribute_value) + { + if (attribute_name != null && attribute_value != null) + getElementHashEntry().put(attribute_name, attribute_value); + return(this); + } + + /** Add an attribute to the element. */ + public Element addAttribute(String attribute_name, Integer attribute_value) + { + getElementHashEntry().put(attribute_name, attribute_value); + return(this); + } + + /** remove an attribute from the element */ + public Element removeAttribute(String attribute_name) + { + try + { + getElementHashEntry().remove(attribute_name); + } + catch ( Exception e ) + { + } + return(this); + } + + /** does the element have a particular attribute? */ + public boolean hasAttribute(String attribute) + { + return(getElementHashEntry().containsKey(attribute)); + } + + /** Return a list of the attributes associated with this element. */ + public Enumeration attributes() + { + return getElementHashEntry().keys(); + } + + /** + * Return the specified attribute. + * @param attribute The name of the attribute to fetch + */ + public String getAttribute(String attribute) + { + return (String)getElementHashEntry().get(attribute); + } + + /** + This method overrides createStartTag() in Generic Element. + It provides a way to print out the attributes of an element. + */ + protected String createStartTag() + { + StringBuffer out = new StringBuffer(); + + out.append(getStartTagChar()); + + if(getBeginStartModifierDefined()) + { + out.append(getBeginStartModifier()); + } + out.append(getElementType()); + + Enumeration en = getElementHashEntry().keys(); + String value = null; // avoid creating a new string object on each pass through the loop + + while (en.hasMoreElements()) + { + String attr = (String) en.nextElement(); + if(getAttributeFilterState()) + { + value = getAttributeFilter().process(getElementHashEntry().get(attr).toString()); + } + else + { + value = (String) getElementHashEntry().get(attr); + } + out.append(' '); + out.append(alterCase(attr)); + if(!value.equalsIgnoreCase(NO_ATTRIBUTE_VALUE) && getAttributeQuote()) + { + out.append(getAttributeEqualitySign()); + out.append(getAttributeQuoteChar()); + out.append(value); + out.append(getAttributeQuoteChar()); + } + else if( !getAttributeQuote() ) + { + out.append(getAttributeEqualitySign()); + out.append(value); + } + } + if(getBeginEndModifierDefined()) + { + out.append(getBeginEndModifier()); + } + out.append(getEndTagChar()); + + return(out.toString()); + } +} diff --git a/tools/src/org/apache/ecs/ElementContainer.java b/tools/src/org/apache/ecs/ElementContainer.java new file mode 100644 index 0000000000..9af39f8711 --- /dev/null +++ b/tools/src/org/apache/ecs/ElementContainer.java @@ -0,0 +1,117 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +import java.io.OutputStream; +import java.io.PrintWriter; +import java.util.Enumeration; +import java.util.Vector; + +/** + This class is a Element container class. You can place elements into + this class and then you can place this class into other elements in order + to combine elements together. + +

+    P p = new P().addElement("foo");
+    P p1 = new P().addElement("bar");
+    ElementContainer ec = new ElementContainer(p).addElement(p1);
+    System.out.println(ec.toString());
+
+ + @version $Id: ElementContainer.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public class ElementContainer extends ConcreteElement implements Printable +{ + /** + internal use only + @serial ec ec + */ + private Vector ec = new Vector(2); + + /** + Basic constructor + */ + public ElementContainer() + { + } + + /** + Basic constructor + */ + public ElementContainer(Element element) + { + addElement(element); + } + + /** + Adds an Element to the element. + @param element Adds an Element to the element. + */ + public ElementContainer addElement(Element element) + { + ec.addElement(element); + return(this); + } + + /** + Adds an Element to the element. + @param element Adds an Element to the element. + */ + public ElementContainer addElement(String element) + { + ec.addElement(new StringElement(element)); + return(this); + } + + /** + Implements the output method in Element + */ + public void output(OutputStream out) + { + Element element = null; + Enumeration data = ec.elements(); + while ( data.hasMoreElements() ) + { + element = (Element) data.nextElement(); + element.output(out); + } + } + + /** + Implements the output method in Element + */ + public void output(PrintWriter out) + { + Element element = null; + Enumeration data = ec.elements(); + while ( data.hasMoreElements() ) + { + element = (Element) data.nextElement(); + element.output(out); + } + } + /** + returns an enumeration of the elements in this container + */ + public Enumeration elements() + { + return ec.elements(); + } +} diff --git a/tools/src/org/apache/ecs/ElementRegistry.java b/tools/src/org/apache/ecs/ElementRegistry.java new file mode 100644 index 0000000000..145b5344bb --- /dev/null +++ b/tools/src/org/apache/ecs/ElementRegistry.java @@ -0,0 +1,36 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +/** + Interface for Elements that implement a registry. + @version $Id: ElementRegistry.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ + +public interface ElementRegistry +{ + + public abstract Element addElementToRegistry(Element element); + public abstract Element addElementToRegistry(String element); + public abstract Element removeElementFromRegistry(Element element); + public abstract Element removeElementFromRegistry(String element); + public abstract boolean registryHasElement(Element element); + public abstract boolean registryHasElement(String element); + +} diff --git a/tools/src/org/apache/ecs/Entities.java b/tools/src/org/apache/ecs/Entities.java new file mode 100644 index 0000000000..0673a94f67 --- /dev/null +++ b/tools/src/org/apache/ecs/Entities.java @@ -0,0 +1,317 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +/** + This interface describes all html 4.0 entities. + @version $Id: Entities.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public interface Entities +{ + + public final static String NBSP = " "; // no-break space + public final static String IEXCL = "¡"; // inverted exclamation mark + public final static String CENT = "¢"; // cent sign + public final static String POUND = "£"; // pound sterling sign + public final static String CURREN = "¤"; // general currency sign + public final static String YEN = "¥"; // yen sign + public final static String BRVBAR = "¦"; // broken (vertical) bar + public final static String SECT = "§"; // section sign + public final static String UML = "¨"; // umlat (dieresis) + public final static String COPY = "©"; // copyright sign + public final static String ORDF = "ª"; // ordinal indicator feminine + public final static String LAQUO = "«"; // angle quotation mark, left + public final static String NOT = "¬"; // not sign + public final static String SHY = "­"; // soft hyphen + public final static String REG = "®"; // registered sign + public final static String MACR = "¯"; // macron + public final static String DEG = "°"; // degree sign + public final static String PLUSMN = "±"; // plus-or-minus sign + public final static String SUP2 = "²"; // superscript two + public final static String SUP3 = "³"; // superscript three + public final static String ACUTE = "´"; // actue accent + public final static String MICRO = "µ"; // micro sign + public final static String PARA = "¶"; // pilcrow (paragraph sign) + public final static String MIDDOT = "¶"; // middle dot + public final static String CEDIL = "¸"; // cedilla + public final static String SUP1 = "¹"; // superscript one + public final static String ORDM = "º"; // ordinal indicator, masculine + public final static String RAQUO = "»"; // angle quotation mark, righ + public final static String FRAC14 = "¼"; // fraction one-quarter + public final static String FRAC12 = "½"; // fraction one-half + public final static String FRAC34 = "¾"; // fraction three-quarters + public final static String IQUEST = "¿"; // inverted quotation mark + public final static String AGRAVE = "À"; // capital A, grave accent + public final static String AACUTE = "Á"; // capital A, acute accent + public final static String ACIRC = "Â"; // capital A, circumflex accent + public final static String ATILDE = "Ã"; // capital A, tilde + public final static String AUML = "Ä"; // capital A, dieresis or umlaut mark + public final static String ARING = "Å"; // capital A, ring + public final static String AELIG = "Æ"; // capital AE diphthong (ligature) + public final static String CCEDIL = "Ç"; // capital C, cedilla + public final static String EGRAVE = "È"; // capital E, grave accent + public final static String EACUTE = "É"; // captial E, acute accent + public final static String ECIRC = "Ê"; // capital E, circumflex accent + public final static String EMUL = "Ë"; // captial E, dieresis ur umlaut mark + public final static String IGRAVE = "Ì"; // capital I, grave accent + public final static String IACUTE = "Í"; // captial I, acute accent + public final static String ICIRC = "Î"; // captial I, circumflex accent + public final static String IUML = "Ï"; // capital I, dieresis or umlaut mark + public final static String ETH = "Ð"; // Eth, Icelandic + public final static String NTILDE = "Ñ"; // capital N, tilde + public final static String OGRAVE = "Ò"; // capital O, grave accent + public final static String OACUTE = "Ó"; // capital O, acute accent + public final static String OCIRC = "Ô"; // capital O, circumflex accent + public final static String OTILDE = "Õ"; // capital O, tilde + public final static String OUML = "Ö"; // capital O, dieresis or umlaut mark + public final static String TIMES = "×"; // multiply sign + public final static String OSLASH = "Ø"; // capital O, slash + public final static String UGRAVE = "Ù"; // capital U, grave accent + public final static String UACUTE = "Ú"; // capital U, acute accent + public final static String UCIRC = "Û"; // capital U, circumflex accent + public final static String UUML = "Ü"; // capital U, dieresis or umlaut mark + public final static String YACUTE = "Ý"; // captial Y, acute accent + public final static String THORN = "Þ"; // capital THORN (icelandic) + public final static String SZLIG = "ß"; // small sharp s, German (sz ligature) + public final static String aGRAVE = "à"; // small a, grave accent + public final static String aACUTE = "á"; // small a, acute accent + public final static String aCIRC = "â"; // small a, circumflex accent + public final static String aTILDE = "ã"; // small a, tilde sign + public final static String aUML = "ä"; // small a, dieresis or umlaut mark + public final static String aRING = "å"; // small a, ring + public final static String aELIG = "æ"; // small ae diphthong (ligature) + public final static String cCEDIL = "ç"; // small c, cedilla + public final static String eGRAVE = "è"; // small e, grave accent + public final static String eACUTE = "é"; // small e, acute accent + public final static String eCIRC = "ê"; // small e, circumflex accent + public final static String eUML = "ë"; // small e, dieresis or umalut mark + public final static String iGRAVE = "ì"; // small i, grave accent + public final static String iACUTE = "í"; // small i, acute accent + public final static String iCIRC = "î"; // small i, curcumflex accent + public final static String iUML = "ï"; // small i, dieresis or umalut mark + public final static String eth = "ð"; // small eth + public final static String nTILDE = "ñ"; // small n, tilde sign + public final static String oGRAVE = "ò"; // small o, grave accent + public final static String oACUTE = "ò"; // small o, acute accent + public final static String oCIRC = "ô"; // small o, circumflex accent + public final static String oTILDE = "õ"; // small o, tilde + public final static String oUML = "ö"; // small o, diersis or umalut mark + public final static String DIVIDE = "÷"; // division sign + public final static String oSLASH = "ø"; // small o, slash + public final static String uGRAVE = "ù"; // small u, grave accent + public final static String uACUTE = "ú"; // small u, acute accent + public final static String uCIRC = "û"; // small u, circumflex accent + public final static String uUML = "ü"; // small u, dieresis or umalut mark + public final static String yACUTE = "ý"; // small y, acute accent + public final static String thorn = "þ"; // small thorn, Icelandic + public final static String yUML = "ÿ"; // small y, dieresis or umlaut mark + + // Mathmatical, Greek and Symbolic characters + + public final static String FNOF = "ƒ"; // latin small f with hook + public final static String ALPHA = "Α"; // greek capital letter aplha + public final static String BETA = "Β"; // greek capital letter beta + public final static String GAMMA = "Γ"; // greek capital letter gamma + public final static String DELTA = "Δ"; // greek capital letter delta + public final static String EPSILON = "Ε"; // greek capital letter epsilon + public final static String ZETA = "Ζ"; // greek capital letter zeta + public final static String ETA = "Η"; // greek capital letter eta + public final static String THETA = "Θ"; // greek capital letter theta + public final static String IOTA = "Ι"; // greek capital letter iota + public final static String KAPPA = "Κ"; // greek capital letter kappa + public final static String LAMDA = "Λ"; // greek capital letter lamda + public final static String MU = "Μ"; // greek capital letter mu + public final static String NU = "Ν"; // greek capital letter nu + public final static String XI = "Ξ"; // greek capital letter xi + public final static String OMICRON = "Ο"; // greek capital letter omicron + public final static String PI = "Π"; // greek capital letter pi + public final static String RHO = "Ρ"; // greek capital letter rho + public final static String SIGMA = "Σ"; // greek capital letter sigma + public final static String TAU = "Τ"; // greek capital letter tau + public final static String UPSILON = "Υ"; // greek capital letter upsilon + public final static String PHI = "Φ"; // greek capital letter phi + public final static String CHI = "Χ"; // greek capital letter chi + public final static String PSI = "Ψ"; // greek capital letter psi + public final static String OMEGA = "Ω"; // greek capital letter omega + public final static String alpha = "α"; // greek small letter aplha + public final static String beta = "β"; // greek small letter beta + public final static String gamma = "γ"; // greek small letter gamma + public final static String delta = "δ"; // greek small letter delta + public final static String epsilon = "ε"; // greek small letter epsilon + public final static String zeta = "ζ"; // greek small letter zeta + public final static String eta = "η"; // greek small letter eta + public final static String theta = "θ"; // greek small letter theta + public final static String iota = "ι"; // greek small letter iota + public final static String kappa = "κ"; // greek small letter kappa + public final static String lamda = "λ"; // greek small letter lamda + public final static String mu = "μ"; // greek small letter mu + public final static String nu = "ν"; // greek small letter nu + public final static String xi = "ξ"; // greek small letter xi + public final static String omicron = "ο"; // greek small letter omicron + public final static String pi = "π"; // greek small letter pi + public final static String rho = "ρ"; // greek small letter rho + public final static String sigmaf = "ς"; // greek small letter sigma + public final static String sigma = "σ"; // greek small letter sigma + public final static String tau = "τ"; // greek small letter tau + public final static String upsilon = "υ"; // greek small letter upsilon + public final static String phi = "φ"; // greek small letter phi + public final static String chi = "χ"; // greek small letter chi + public final static String psi = "ψ"; // greek small letter psi + public final static String omega = "ω"; // greek small letter omega + public final static String thetasym = "ϑ"; // greek small letter thetasym + public final static String upsih = "ϒ"; // greek small letter upsih + public final static String piv = "ϖ"; // greek small letter piv + + // Punctuation + + public final static String BULL = "•"; // bullet (small balck circle) + public final static String HELLIP = "…"; // horizontal ellipsis + public final static String PRIME = "′"; // prime + public final static String PPRIME = "″"; // double prime + public final static String OLINE = "‾"; // overline + public final static String frasl = "⁄"; // fraction slash + + // Leter like Symbols + + public final static String WEIERP = "℘"; // Script capital P + public final static String IMAGE = "ℑ"; // blackletter capital I (imaginary part) + public final static String REAL = "ℜ"; // blackletter capital R (real part) + public final static String TRADE = "™"; // trade mark sign + public final static String ALEFSYM = "ℵ"; // alef symbol + + // Arrows + + public final static String LARR = "←"; // leftwards arrow + public final static String UARR = "↑"; // upwards arrow + public final static String RARR = "→"; // rightwardsards arrow + public final static String DARR = "↓"; // downwards arrow + public final static String HARR = "↔"; // left right arrow + public final static String CRARR = "⅑"; // downwards arrow with corner leftwards + public final static String LLARR = "Ⅼ"; // leftwards double arrow + public final static String UUARR = "Ⅽ"; // upwards double arrow + public final static String RRARR = "Ⅾ"; // rightwards double arrow + public final static String DDARR = "Ⅿ"; // downwards double arrow + public final static String HHARR = "ⅰ"; // left right double arrow + + // Mathmatical operators + + public final static String FORALL = "∀"; // for all + public final static String PART = "∂"; // partial + public final static String EXIST = "∃"; // there exists + public final static String EMPTY = "∅"; // empty set + public final static String NABLA = "∇"; // nabla + public final static String ISIN = "∈"; // element of + public final static String NOTIN = "∉"; // not an element of + public final static String NI = "∋"; // contains as member + public final static String PROD = "∏"; // product of + public final static String SUM = "∑"; // sumation + public final static String MINUS = "−"; // minus sign + public final static String LOWAST = "∗"; // asterisk operator + public final static String RADIC = "√"; // square root + public final static String PROP = "∝"; // proportional + public final static String INFIN = "∞"; // infinity + public final static String ANG = "∠"; // angle + public final static String AND = "≁"; // logical and + public final static String OR = "≂"; // logical or + public final static String CAP = "∩"; // intersection + public final static String CUP = "∪"; // union + public final static String INT = "∫"; // integral + public final static String THERE4 = "∴"; // therefore + public final static String SIM = "∼"; // tilde + public final static String CONG = "≅"; // approximately equal to + public final static String ASYMP = "≈"; // almost equal to + public final static String NE = "≠"; // not equal to + public final static String EQUIV = "≡"; // identical to + public final static String LE = "≤"; // less then + public final static String GE = "≥"; // greater then + public final static String SUB = "⊂"; // subset + public final static String SUP = "⊃"; // superset + public final static String NSUB = "⊄"; // not a subset of + public final static String SUBE = "⊆"; // subset of or equal to + public final static String SUPE = "⊇"; // superset of or equal to + public final static String OPLUS = "⊕"; // circled plus + public final static String OTIMES = "⊗"; // circled times + public final static String PERP = "⊥"; // up track + public final static String SDOT = "⋅"; // dot operator + + // Miscellaneous Technical + + public final static String LCEIL = "⌈"; // left ceiling + public final static String RCEIL = "⌉"; // right ceiling + public final static String LFLOOR = "⌊"; // left floor + public final static String RFLOOR = "⌋"; // right floor + public final static String LANG = "〈"; // left pointing angle bracket + public final static String RANG = "〉"; // right pointing angle bracket + + // Geometric Shapes + + public final static String LOZ = "◊"; // lozenge (not throat) + + // Miscellaneous Symbols + + public final static String SPADES = "♠"; // black spade suit + public final static String CLUBS = "♣"; // black club suit + public final static String HEARTS = "♥"; // black heart suit + public final static String DIAMS = "♦"; // black diamond suit + + // Special Characters for html + + // CO Controls (Basic Latin) + + public final static String QUOT = """; // quotation mark + public final static String AMP = "&"; // ampersand + public final static String LT = "<"; // less than sign + public final static String GT = ">"; // greater than sign + + // Latin Extended A + + public final static String OELIG = "Œ"; // latin capital ligature oe + public final static String SCARON = "œ"; // latin capital letter S with caron + public final static String sCARON = "š"; // latin small letter s with caron + public final static String YUML = "Ÿ"; // latin capital letter Y with diaeresis + + // Spcaing Modifier letters + + public final static String CIRC = "ˆ"; // modifier letter circumflex accent + public final static String TILDE = "˜"; // small tilde + + // General Punctuation + + public final static String ENSP = " "; // en space + public final static String EMSP = " "; // em space + public final static String THINSP = " "; // thin space + public final static String ZWNJ = "‌"; // zero width non-joiner + public final static String ZWJ = "‍"; // zero width joiner + public final static String LRM = "‎"; // left to right mark + public final static String RLM = "‏"; // right to left mark + public final static String NDASH = "–"; // en dash + public final static String MDASH = "—"; // em dash + public final static String LSQUO = "’"; // left single quotation mark + public final static String RSQUO = "‚"; // right single quotation mark + public final static String SBQUO = "‚"; // single low-9 quotation mark + public final static String LDQUO = "“"; // left double quotation mark + public final static String RDQUO = "”"; // right double quotation mark + public final static String BDQUO = "„"; // double low-9 quotation mark + public final static String DAGGER = "†"; // dagger + public final static String DDAGGER = "‡"; // double dagger + public final static String PERMIL = "‰"; // per mille sign + public final static String LSAQUO = "‹"; // single left-pointing angle mark + public final static String RSQQUO = "›"; // single right-pointing angle mark + +} diff --git a/tools/src/org/apache/ecs/Filter.java b/tools/src/org/apache/ecs/Filter.java new file mode 100644 index 0000000000..8b8949548e --- /dev/null +++ b/tools/src/org/apache/ecs/Filter.java @@ -0,0 +1,49 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +/** + This class creates an interface for all filters. +

+ For example: +

+


+    Filter filter = new CharacterFilter();
+    filter.addAttribute("$","dollar");
+    filter.addAttribute("#",Entities.POUND);
+    
+    P p = new P();
+    p.setFilter(filter);
+    
+    Document doc = new Document();
+    doc.getBody().addElement(p);
+    
+ + The filter is applied when the addElement() method is called. + + @version $Id: Filter.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public interface Filter +{ + public Filter addAttribute(String name,Object attribute); + public Filter removeAttribute(String name); + public boolean hasAttribute(String key); + public String process(String to_process); + public String getInfo(); +} diff --git a/tools/src/org/apache/ecs/FocusEvents.java b/tools/src/org/apache/ecs/FocusEvents.java new file mode 100644 index 0000000000..bbc41fe61b --- /dev/null +++ b/tools/src/org/apache/ecs/FocusEvents.java @@ -0,0 +1,47 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +/** + This interface is intended to be implemented by elements that require + javascript page event attributes. + + @version $Id: FocusEvents.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public interface FocusEvents +{ + /** + make sure implementing classes have a setOnFocus method. + + The onfocus event occurs when an element receives focus either by the + pointing device or by tabbing navigation. This attribute may be used + with the following elements: LABEL, INPUT, SELECT, TEXTAREA, and + BUTTON. + */ + public abstract void setOnFocus(String script); + + /** + make sure implementing classes have a setOnBlur method. + + The onblur event occurs when an element loses focus either by the + pointing device or by tabbing navigation. It may be used with the same + elements as onfocus. + */ + public abstract void setOnBlur(String script); +} diff --git a/tools/src/org/apache/ecs/FormEvents.java b/tools/src/org/apache/ecs/FormEvents.java new file mode 100644 index 0000000000..11159b3c4b --- /dev/null +++ b/tools/src/org/apache/ecs/FormEvents.java @@ -0,0 +1,61 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +/** + This interface is intended to be implemented by elements that require + javascript form event attributes. + + @version $Id: FormEvents.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public interface FormEvents +{ + /** + make sure implementing classes have a setOnSubmit method. + + The onsubmit event occurs when a form is submitted. It only applies to + the FORM element. + */ + public abstract void setOnSubmit(String script); + + /** + make sure implementing classes have a setOnReset method. + + The onreset event occurs when a form is reset. It only applies to the + FORM element. + */ + public abstract void setOnReset(String script); + + /** + make sure implementing classes have a setOnSelect method. + + The onselect event occurs when a user selects some text in a text + field. This attribute may be used with the INPUT and TEXTAREA elements. + */ + public abstract void setOnSelect(String script); + + /** + make sure implementing classes have a setOnChange method. + + The onchange event occurs when a control loses the input focus and its + value has been modified since gaining focus. This attribute applies to + the following elements: INPUT, SELECT, and TEXTAREA. + */ + public abstract void setOnChange(String script); +} diff --git a/tools/src/org/apache/ecs/GenericElement.java b/tools/src/org/apache/ecs/GenericElement.java new file mode 100644 index 0000000000..8fdba8315f --- /dev/null +++ b/tools/src/org/apache/ecs/GenericElement.java @@ -0,0 +1,816 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +import java.io.PrintWriter; +import java.io.OutputStream; +import java.io.BufferedOutputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.io.Serializable; +import org.apache.ecs.filter.CharacterFilter; +import java.util.Hashtable; + +/** + This class implements the ElementFactory. + + @version $Id: GenericElement.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public abstract class GenericElement implements Element,Serializable +{ + /** + Create default filter to use in all GenericElements + Can be overridden by setFilter method. Of course + using getFilter then modifying will have some interesting + side effects, like changing the global defaults. + */ + private static Filter _defaultFilter = new CharacterFilter(); + + /** + Filter to use to escape input + @serial filter filter + */ + private Filter filter = _defaultFilter; + + /** + position of tag relative to start and end. + @serial position position + */ + private int position = ECSDefaults.getDefaultPosition(); + + /** + Should we filter the value of <>VALUE</> + @serial filter_state filter_state + */ + private boolean filter_state = ECSDefaults.getDefaultFilterState(); + + /** + Should we print html in a more readable format? + @serial pretty_print pretty_print + */ + private boolean pretty_print = ECSDefaults.getDefaultPrettyPrint(); + + /** + Version number for codebase + @serial VERSION VERSION + */ + private static final String VERSION = "Adempiere.5.2"; + + /** + Default value to set case type + @serial case_type case_type + */ + private int case_type = ECSDefaults.getDefaultCaseType(); + + /** + Where to get the element definition from + @serial element element + */ + private Hashtable element = new Hashtable(4); + + /** + Does this element need a closing tag? + @serial end_element end_element + */ + private boolean end_element = ECSDefaults.getDefaultEndElement(); + + /** + What codeset are we going to use the default is 8859_1 + @serial codeset codeset + */ + private String codeset = ECSDefaults.getDefaultCodeset(); + + /** + What the start modifier should be + @serial begin_start_modifier begin_start_modifier + */ + private char begin_start_modifier = ECSDefaults.getDefaultBeginStartModifier(); + + /** + What the start modifier should be + @serial end_start_modifier end_start_modifier + */ + private char end_start_modifier = ECSDefaults.getDefaultEndStartModifier(); + + /** + What the end modifier should be + @serial begin_end_modifier begin_end_modifier + */ + private char begin_end_modifier = ECSDefaults.getDefaultBeginEndModifier(); + + /** + What the end modifier should be + @serial end_end_modifier end_end_modifier + */ + private char end_end_modifier = ECSDefaults.getDefaultEndEndModifier(); + + /** + What the modifier should be...optimization variable + @serial start_modifier_defined start_modifier_defined + */ + private boolean start_modifier_defined = false; + + /** + What the modifier should be...optimization variable + @serial begin_start_modifier_defined begin_start_modifier_defined + */ + private boolean begin_start_modifier_defined = false; + + /** + What the modifier should be...optimization variable + @serial end_start_modifier_defined end_start_modifier_defined + */ + private boolean end_start_modifier_defined = false; + + /** + What the modifier should be...optimization variable + @serial begin_end_modifier_defined begin_end_modifier_defined + */ + private boolean begin_end_modifier_defined = false; + + /** + What the modifier should be...optimization variable + @serial end_end_modifier_defined end_end_modifier_defined + */ + private boolean end_end_modifier_defined = false; + + /** + What the modifier should be...optimization variable + @serial end_modifier_defined end_modifier_defined + */ + private boolean end_modifier_defined = false; + + /** + Our current tab level. + @serial tabLevel tabLevel + */ + protected int tabLevel = 0; + + /** @serial start_tag start_tag */ + private char start_tag = ECSDefaults.getDefaultStartTag(); + /** @serial end_tag end_tag */ + private char end_tag = ECSDefaults.getDefaultEndTag(); + /** @serial __text __text */ + private String __text = new String(); + + /** + Location to store element_type at. + @serial element_type element_type + */ + private String element_type = new String(); + + /** + Base class for defining all elements. + */ + public GenericElement() + { + } + + /** + Do we want to do pretty printing? + */ + public boolean getPrettyPrint() + { + return(pretty_print); + } + + /** + Do we want to pretty print? + @param pretty_print turn pretty printing on or off. + */ + public Element setPrettyPrint(boolean pretty_print) + { + this.pretty_print = pretty_print; + return(this); + } + + /** + Get the Hashtable representation of an element. + */ + protected Hashtable getElementHashEntry() + { + return(element); + } + + /** + set the filter state of the element. + @param filter_state (true|false) do we want to use a filter? default true; + */ + public Element setFilterState(boolean filter_state) + { + this.filter_state = filter_state; + return(this); + } + + /** + get the filter state of the element. + */ + public boolean getFilterState() + { + return(filter_state); + } + + /** + Get the filter that is currently in use. + */ + public Filter getFilter() + { + return(filter); + } + + /** + Override the default filter with a user supplied filter. + */ + public void setFilter(Filter filter) + { + this.filter = filter; + } + + /** + What version of htmlGen is this? + */ + public String getVersion() + { + return(VERSION); + } + + /** + Determine what case the html element should be rendered. Default is MIXEDCASE + */ + public void setCase(int case_type) + { + this.case_type = case_type; + } + + /** + Find out what case the element is supposed to be rendered in. + */ + public int getCase() + { + return(case_type); + } + + /** + Determine what type of element this is A,BR,EM,ACRONYM + */ + public void setElementType(String element_type) + { + this.element_type = element_type; + } + + /** + Find out what type of element this is. + */ + public String getElementType() + { + return(element_type); + } + + /** + Determine what codeset should be used. + */ + public void setCodeSet(String codeset) + { + this.codeset = codeset; + } + + /** + Find out what the current codeset is. + */ + public String getCodeSet() + { + return(codeset); + } + + /** + Does this element need a closing tag. Default is true + */ + public void setNeedClosingTag(boolean close) + { + end_element = close; + } + + /** + Determine if this element needs to be closed. + */ + public boolean getNeedClosingTag() + { + return(end_element); + } + + /** + Determine if this element needs a line break, if pretty printing. + */ + public boolean getNeedLineBreak() + { + return true; + } + + /** + Set the position of the tag to be rendered at in relation to start_element_char + */ + public void setTagPosition(int position) + { + this.position = position; + } + + /** + Get the position the tag is to be rendered at. + */ + public int getTagPosition() + { + return(position); + } + + /** + Alter the case of this element so that it is rendered according + to whatever the value of case_type is. Default is MIXEDCASE + */ + protected String alterCase(String value) + { + switch (getCase()) + { + case UPPERCASE: + return value.toUpperCase(); + case LOWERCASE: + return value.toLowerCase(); + default: + return value; + } + } + + /** + Set the element modifier the default is no modifier. + @param modifier the modifier for the element a ? would result
+ in <? ?> + */ + public Element setBeginModifier(char modifier) + { + setBeginStartModifier(modifier); + setBeginEndModifier(modifier); + setBeginStartModifierDefined(true); + setBeginEndModifierDefined(true); + return(this); + } + + /** + Set the element modifier the default is no modifier. + @param modifier the modifier for the element a ? would result
+ in <? > + */ + public Element setBeginStartModifier(char modifier) + { + this.begin_start_modifier = modifier; + setBeginStartModifierDefined(true); + return(this); + } + + /** + Set the element modifier the default is no modifier. + @param modifier the modifier for the element a ? would result
+ in < ?> + */ + public Element setBeginEndModifier(char modifier) + { + this.begin_end_modifier = modifier; + setBeginEndModifierDefined(true); + return(this); + } + + /** + Set the element modifier the default is no modifier. + @param start_modifier the modifier for the element a ? would result
+ in <? ?> + */ + public Element setBeginModifier(char start_modifier,char end_modifier) + { + this.begin_start_modifier = start_modifier; + this.begin_end_modifier = end_modifier; + setBeginStartModifierDefined(true); + setBeginEndModifierDefined(true); + return(this); + } + + /** + What is the element modifier for this tag. + */ + public char getBeginStartModifier() + { + return(begin_start_modifier); + } + + /** + What is the element modifier for this tag. + */ + public char getBeginEndModifier() + { + return(begin_end_modifier); + } + + /** + Remove the element modifier for this tag. + */ + public Element removeBeginStartModifier() + { + setBeginStartModifierDefined(false); + return(this); + } + + /** + Remove the element modifier for this tag. + */ + public Element removeBeginEndModifier() + { + setBeginEndModifierDefined(false); + return(this); + } + + /** + Modifier optimization + */ + private void setBeginStartModifierDefined(boolean val) + { + this.begin_start_modifier_defined = val; + } + + /** + Modifier optimization + */ + private void setBeginEndModifierDefined(boolean val) + { + this.begin_end_modifier_defined = val; + } + + /** + Modifier optimization + */ + protected boolean getEndStartModifierDefined() + { + return this.end_start_modifier_defined; + } + + /** + Modifier optimization + */ + protected boolean getEndEndModifierDefined() + { + return this.end_end_modifier_defined; + } + + /** + Set the element modifier the default is no modifier. + @param modifier the modifier for the element a ? would result
+ in <? ?> + */ + public Element setEndModifier(char modifier) + { + setEndStartModifier(modifier); + setEndEndModifier(modifier); + setEndStartModifierDefined(true); + setEndEndModifierDefined(true); + return(this); + } + + /** + Set the element modifier the default is no modifier. + @param modifier the modifier for the element a ? would result
+ in <? > + */ + public Element setEndStartModifier(char modifier) + { + this.end_start_modifier = modifier; + setEndStartModifierDefined(true); + return(this); + } + + /** + Set the element modifier the default is no modifier. + @param modifier the modifier for the element a ? would result
+ in < ?> + */ + public Element setEndEndModifier(char modifier) + { + this.end_end_modifier = modifier; + setEndEndModifierDefined(true); + return(this); + } + + /** + Set the element modifier the default is no modifier. + @param start_modifier the modifier for the element a ? would result
+ in <? ?> + */ + public Element setEndModifier(char start_modifier,char end_modifier) + { + this.end_start_modifier = start_modifier; + this.end_end_modifier = end_modifier; + setEndStartModifierDefined(true); + setEndEndModifierDefined(true); + return(this); + } + + /** + What is the element modifier for this tag. + */ + public char getEndStartModifier() + { + return(end_start_modifier); + } + + /** + What is the element modifier for this tag. + */ + public char getEndEndModifier() + { + return(end_end_modifier); + } + + /** + Remove the element modifier for this tag. + */ + public Element removeEndStartModifier() + { + setEndStartModifierDefined(false); + return(this); + } + + /** + Remove the element modifier for this tag. + */ + public Element removeEndEndModifier() + { + setEndEndModifierDefined(false); + return(this); + } + + /** + Modifier optimization + */ + private void setEndStartModifierDefined(boolean val) + { + this.end_start_modifier_defined = val; + } + + /** + Modifier optimization + */ + private void setEndEndModifierDefined(boolean val) + { + this.end_end_modifier_defined = val; + } + + /** + Modifier optimization + */ + protected boolean getBeginStartModifierDefined() + { + return this.begin_start_modifier_defined; + } + + /** + Modifier optimization + */ + protected boolean getBeginEndModifierDefined() + { + return this.begin_end_modifier_defined; + } + + /** + Set the start tag character. + */ + public void setStartTagChar(char start_tag) + { + this.start_tag = start_tag; + } + + /** + Get the start tag character. + */ + public char getStartTagChar() + { + return(start_tag); + } + + /** + Set the end tag character. + */ + public void setEndTagChar(char end_tag) + { + this.end_tag = end_tag; + } + + /** + Get the end tag character. + */ + public char getEndTagChar() + { + return(end_tag); + } + + public String getTagText() + { + return(__text); + } + + public Element setTagText(String text) + { + this.__text = (text); + return(this); + } + + protected String createStartTag() + { + StringBuffer sb = new StringBuffer(); + sb.append(getStartTagChar()); + + if(getBeginStartModifierDefined()) + { + sb.append(getBeginStartModifier()); + } + sb.append(getElementType()); + + if(getBeginEndModifierDefined()) + { + sb.append(getBeginEndModifier()); + } + sb.append(getEndTagChar()); + return(sb.toString()); + } + + protected String createEndTag() + { + setEndStartModifier('/'); + StringBuffer sb = new StringBuffer(); + sb.append(getStartTagChar()); + + if(getEndStartModifierDefined()) + { + sb.append(getEndStartModifier()); + } + sb.append(getElementType()); + + if(getEndEndModifierDefined()) + { + sb.append(getEndEndModifier()); + } + sb.append(getEndTagChar()); + return(sb.toString()); + } + + /** + Override toString() method to print something meaningful + */ + public final String toString() + { + String out = null; + try + { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + BufferedOutputStream bos = new BufferedOutputStream(baos); + output(bos); + bos.flush(); + + if ( getCodeSet() != null ) + { + out = baos.toString(getCodeSet()); + } else + { + out = baos.toString(); + } + + bos.close(); + baos.close(); + } + catch (IOException ioe) + { + } + return(out); + } + + /** + Override toString(encode) method to print something meaningful + */ + public final String toString(String codeset) + { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + BufferedOutputStream bos = new BufferedOutputStream(baos); + String out = null; + try + { + output(bos); + bos.flush(); + out = baos.toString(codeset); + bos.close(); + baos.close(); + } + catch (UnsupportedEncodingException use) + { + } + catch (IOException ioe) + { + } + return(out); + } + + /** + Add the element to the designated OutputStream. + */ + public void output(OutputStream out) + { + String encoding = null; + if ( getCodeSet() != null ) + { + encoding = getCodeSet(); + } + else + { + //By default use Big Endian Unicode. + //In this way we will not loose any information. + encoding = "UTF-16BE"; + } + + try + { + out.write(createStartTag().getBytes(encoding)); + + if(getFilterState()) + out.write(getFilter().process(getTagText()).getBytes(encoding)); + else + out.write(getTagText().getBytes(encoding)); + + if (getNeedClosingTag()) + out.write(createEndTag().getBytes(encoding)); + + } + catch (UnsupportedEncodingException uee) + { + uee.printStackTrace(new PrintWriter(out)); + } + catch (IOException ioe) + { + ioe.printStackTrace(new PrintWriter(out)); + } + } + + /** + Add element to the designated PrintWriter. + */ + public void output(PrintWriter out) + { + + out.write(createStartTag()); + + if(getFilterState()) + out.write(getFilter().process(getTagText())); + else + out.write(getTagText()); + + if (getNeedClosingTag()) + out.write(createEndTag()); + + } + + /** + Set the tab level for pretty printing + */ + public void setTabLevel(int tabLevel) + { + this.tabLevel = tabLevel; + } + + public int getTabLevel() + { + return tabLevel; + } + + protected void putTabs(int tabCount, OutputStream out) + throws IOException + { + for (int i = 0; i < tabCount; i++) + out.write('\t'); + } + + protected void putTabs(int tabCount, PrintWriter out) + { + for (int i = 0; i < tabCount; i++) + out.print('\t'); + } + +} diff --git a/tools/src/org/apache/ecs/HtmlColor.java b/tools/src/org/apache/ecs/HtmlColor.java new file mode 100644 index 0000000000..bc7f4ef208 --- /dev/null +++ b/tools/src/org/apache/ecs/HtmlColor.java @@ -0,0 +1,775 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +/** + This class defines all of the available Html Colors. + + @version $Id: HtmlColor.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public abstract class HtmlColor +{ + + // colors html 4.0 + + /** HTML 4.0 specification for color BLACK. */ + public final static String BLACK = "#000000"; + /** HTML 4.0 specification for color SILVER. */ + public final static String SILVER = "#C0C0C0"; + /** HTML 4.0 specification for color GRAY. */ + public final static String GRAY = "#808080"; + /** HTML 4.0 specification for color WHITE (not shown). */ + public final static String WHITE = "#FFFFFF"; + /** HTML 4.0 specification for color MAROON. */ + public final static String MAROON = "#800000"; + /** HTML 4.0 specification for color RED. */ + public final static String RED = "#FF0000"; + /** HTML 4.0 specification for color PURPLE. */ + public final static String PURPLE = "#800080"; + /** HTML 4.0 specification for color FUCHSIA. */ + public final static String FUCHSIA = "#FF00FF"; + /** HTML 4.0 specification for color GREEN. */ + public final static String GREEN = "#008000"; + /** HTML 4.0 specification for color LIME. */ + public final static String LIME = "#00FF00"; + /** HTML 4.0 specification for color OLIVE. */ + public final static String OLIVE = "#808000"; + /** HTML 4.0 specification for color YELLOW. */ + public final static String YELLOW = "#FFFF00"; + /** HTML 4.0 specification for color NAVY. */ + public final static String NAVY = "#000080"; + /** HTML 4.0 specification for color BLUE. */ + public final static String BLUE = "#0000FF"; + /** HTML 4.0 specification for color TEAL. */ + public final static String TEAL = "#008080"; + /** HTML 4.0 specification for color AQUA. */ + public final static String AQUA = "#00FFFF"; + + // colors html 3.0 + + /** HTML 3.0 specification for color ALICEBLUEOC. */ + public final static String ALICEBLUE = "#EFF7FF"; + /** HTML 3.0 specification for color ANTIQUEWHITE. */ + public final static String ANTIQUEWHITE = "#F9E8D2"; + /** HTML 3.0 specification for color AQUAMARINE. */ + public final static String AQUAMARINE = "#43B7BA"; + /** HTML 3.0 specification for color AZURE. */ + public final static String AZURE = "#EFFFFF"; + /** HTML 3.0 specification for color BEIGE. */ + public final static String BEIGE = "#F5F3D7"; + /** HTML 3.0 specification for color BISQUE. */ + public final static String BISQUE = "#FDE0BC"; + /** HTML 3.0 specification for color BLANCHEDALMOND. */ + public final static String BLANCHEDALMOND = "#FEE8C6"; + /** HTML 3.0 specification for color BLUEVIOLET. */ + public final static String BLUEVIOLET = "#7931DF"; + /** HTML 3.0 specification for color BROWN. */ + public final static String BROWN = "#980516"; + /** HTML 3.0 specification for color BURLYWOOD. */ + public final static String BURLYWOOD = "#EABE83"; + /** HTML 3.0 specification for color CADETBLUE. */ + public final static String CADETBLUE = "#578693"; + /** HTML 3.0 specification for color CHARTREUSE. */ + public final static String CHARTREUSE = "#8AFB17"; + /** HTML 3.0 specification for color CHOCOLATE. */ + public final static String CHOCOLATE = "#C85A17"; + /** HTML 3.0 specification for color CORAL. */ + public final static String CORAL = "#F76541"; + /** HTML 3.0 specification for color CORNFLOWERBLUE. */ + public final static String CORNFLOWERBLUE = "#151B8D"; + /** HTML 3.0 specification for color CORNSILK.*/ + public final static String CORNSILK = "#FFF7D7"; + /** HTML 3.0 specification for color CRIMSON. + * RED2 couldn't find CRIMSON */ + public final static String CRIMSON = "#E41B17"; + /** HTML 3.0 specification for color CYAN. */ + public final static String CYAN = "#00FFFF"; + /** HTML 3.0 specification for color DARKBLUE. + * MIDNIGHTBLUE couldn't find DARKBLUE */ + public final static String DARKBLUE = "#2F2F4F"; + /** HTML 3.0 specification for color DARKCYAN. + * CYAN1 couldn't find DARKCYAN */ + public final static String DARKCYAN = "#57FEFF"; + /** HTML 3.0 specification for color DARKGOLDENROD. */ + public final static String DARKGOLDENROD = "#AF7817"; + /** HTML 3.0 specification for color DARKGRAY. + * GRAY52 couldn't find DARKGRAY */ + public final static String DARKGRAY = "#7A7777"; + /** HTML 3.0 specification for color DARKGREEN. */ + public final static String DARKGREEN = "#254117"; + /** HTML 3.0 specification for color DARKKHAKI. */ + public final static String DARKKHAKI = "#B7AD59"; + /** HTML 3.0 specification for color DARKMAGENTA. + * MAGENTA1 couldn't find DARKMAGENTA */ + public final static String DARKMAGENTA = "#F43EFF"; + /** HTML 3.0 specification for color DARKOLIVEGREEN. */ + public final static String DARKOLIVEGREEN = "#CCFB5D"; + /** HTML 3.0 specification for color DARKORANGE. */ + public final static String DARKORANGE = "#F88017"; + /** HTML 3.0 specification for color DARKORCHID. */ + public final static String DARKORCHID = "#7D1B7E"; + /** HTML 3.0 specification for color DARKRED. + * RED2 couldn't find DARKRED */ + public final static String DARKRED = "#E41B17"; + /** HTML 3.0 specification for color DARKSALMON. */ + public final static String DARKSALMON = "#E18B6B"; + /** HTML 3.0 specification for color DARKSEAGREEN. */ + public final static String DARKSEAGREEN = "#8BB381"; + /** HTML 3.0 specification for color DARKSLATEBLUE. */ + public final static String DARKSLATEBLUE = "#2B3856"; + /** HTML 3.0 specification for color DARKSLATEGRAY. */ + public final static String DARKSLATEGRAY = "#253856"; + /** HTML 3.0 specification for color DARKTURQUOISE. */ + public final static String DARKTURQUOISE = "#3B9C9C"; + /** HTML 3.0 specification for color DARKVIOLET. */ + public final static String DARKVIOLET = "#842DCE"; + /** HTML 3.0 specification for color DEEPPINK. */ + public final static String DEEPPINK = "#F52887"; + /** HTML 3.0 specification for color DEEPSKYBLUE. */ + public final static String DEEPSKYBLUE = "#3BB9FF"; + /** HTML 3.0 specification for color DIMGRAY. */ + public final static String DIMGRAY = "#463E41"; + /** HTML 3.0 specification for color DODGERBLUE. */ + public final static String DODGERBLUE = "#1589FF"; + /** HTML 3.0 specification for color FIREBRICK. */ + public final static String FIREBRICK = "#800517"; + /** HTML 3.0 specification for color FLORALWHITE. */ + public final static String FLORALWHITE = "#FFF9EE"; + /** HTML 3.0 specification for color FORESTGREEN. */ + public final static String FORESTGREEN = "#4E9258"; + /** HTML 3.0 specification for color GAINSBORO. */ + public final static String GAINSBORO = "#D8D9D7"; + /** HTML 3.0 specification for color GHOSTWHITE. */ + public final static String GHOSTWHITE = "#F7F7FF"; + /** HTML 3.0 specification for color GOLD. */ + public final static String GOLD = "#D4A017"; + /** HTML 3.0 specification for color GOLDENROD. */ + public final static String GOLDENROD = "#EDDA74"; + /** HTML 3.0 specification for color GREENYELLOW. */ + public final static String GREENYELLOW = "#B1FB17"; + /** HTML 3.0 specification for color HONEYDEW. */ + public final static String HONEYDEW = "#F0FEEE"; + /** HTML 3.0 specification for color INDIANRED. */ + public final static String INDIANRED = "#5E2217"; + /** HTML 3.0 specification for color INDIGO. + * CYAN4 couldn't find INDIGO */ + public final static String INDIGO = "#307D7E"; + /** HTML 3.0 specification for color IVORY. */ + public final static String IVORY = "#FFFFEE"; + /** HTML 3.0 specification for color KHAKI. */ + public final static String KHAKI = "#ADA96E"; + /** HTML 3.0 specification for color LAVENDER. */ + public final static String LAVENDER = "#E3E4FA"; + /** HTML 3.0 specification for color LAVENDERBLUSH. */ + public final static String LAVENDERBLUSH = "#FDEEF4"; + /** HTML 3.0 specification for color LAWNGREEN. */ + public final static String LAWNGREEN = "#87F717"; + /** HTML 3.0 specification for color LEMONCHIFFON. */ + public final static String LEMONCHIFFON = "#FFF8C6"; + /** HTML 3.0 specification for color LIGHTBLUE. */ + public final static String LIGHTBLUE = "#ADDFFF"; + /** HTML 3.0 specification for color LIGHTCORAL. */ + public final static String LIGHTCORAL = "#E77471"; + /** HTML 3.0 specification for color LIGHTCYAN. */ + public final static String LIGHTCYAN = "#E0FFFF"; + /** HTML 3.0 specification for color LIGHTGOLDENROD. */ + public final static String LIGHTGOLDENRODYELLOW = "#FAF8CC"; + /** HTML 3.0 specification for color LIGHTGREEN. + * ARBITRARY SHADE OF GREEN couldnt find LIGHTGREEN */ + public final static String LIGHTGREEN = "#CCFFCC"; + /** HTML 3.0 specification for color LIGHPINK. */ + public final static String LIGHTPINK = "#FAAFBA"; + /** HTML 3.0 specification for color LIGHTSALMON. */ + public final static String LIGHTSALMON = "#F9966B"; + /** HTML 3.0 specification for color LIGHTSEAGREEN. */ + public final static String LIGHTSEAGREEN = "#3EA99F"; + /** HTML 3.0 specification for color LIGHTSKYBLUE. */ + public final static String LIGHTSKYBLUE = "#82CAFA"; + /** HTML 3.0 specification for color LIGHTSLATEGRAY. */ + public final static String LIGHTSLATEGRAY = "#6D7B8D"; + /** HTML 3.0 specification for color LIGHTSTEELBLUE. */ + public final static String LIGHTSTEELBLUE = "#728FCE"; + /** HTML 3.0 specification for color LIGHTYELLOW. */ + public final static String LIGHTYELLOW = "#FFFEDC"; + /** HTML 3.0 specification for color LIMEGREEN. */ + public final static String LIMEGREEN = "#41A317"; + /** HTML 3.0 specification for color LINEN. */ + public final static String LINEN = "#F9EEE2"; + /** HTML 3.0 specification for color MAGENTA. */ + public final static String MAGENTA = "#FF00FF"; + /** HTML 3.0 specification for color MEDIUMAQUAMARINE. */ + public final static String MEDIUMAQUAMARINE = "#348781"; + /** HTML 3.0 specification for color MEDIUMBLUE. */ + public final static String MEDIUMBLUE = "#152DC6"; + /** HTML 3.0 specification for color MEDIUMORCHID. */ + public final static String MEDIUMORCHID = "#B048B5"; + /** HTML 3.0 specification for color MEDIUMPURPLE. */ + public final static String MEDIUMPURPLE = "#8467D7"; + /** HTML 3.0 specification for color MEDIUMSEAGREEN. */ + public final static String MEDIUMSEAGREEN = "#306754"; + /** HTML 3.0 specification for color MEDIUMSLATEBLUE. */ + public final static String MEDIUMSLATEBLUE = "#5E5A80"; + /** HTML 3.0 specification for color MEDIUMSPRINGGREEN. */ + public final static String MEDIUMSPRINGGREEN = "#348017"; + /** HTML 3.0 specification for color MEDIUMTURQUOISE. */ + public final static String MEDIUMTURQUOISE = "#48CCCD"; + /** HTML 3.0 specification for color MEDIUMVIOLETRED. */ + public final static String MEDIUMVIOLETRED = "#CA226B"; + /** HTML 3.0 specification for color MIDNIGHTBLUE. */ + public final static String MIDNIGHTBLUE = "#151B54"; + /** HTML 3.0 specification for color MINTCREAM. */ + public final static String MINTCREAM = "#F5FFF9"; + /** HTML 3.0 specification for color MISTYROSE. */ + public final static String MISTYROSE = "#FDE1DD"; + /** HTML 3.0 specification for color MOCCASIN. */ + public final static String MOCCASIN = "#FDE0AC"; + /** HTML 3.0 specification for color NAVAJOWHITE. */ + public final static String NAVAJOWHITE = "#FDDAA3"; + /** HTML 3.0 specification for color OLDLACE. */ + public final static String OLDLACE = "#FCF3E2"; + /** HTML 3.0 specification for color OLIVEDRAB. */ + public final static String OLIVEDRAB = "#658017"; + /** HTML 3.0 specification for color ORANGE. */ + public final static String ORANGE = "#F87A17"; + /** HTML 3.0 specification for color ORANGERED. */ + public final static String ORANGERED = "#F63817"; + /** HTML 3.0 specification for color ORCHID. */ + public final static String ORCHID = "#E57DED"; + /** HTML 3.0 specification for color PALEGOLDENROD. */ + public final static String PALEGOLDENROD = "#EDE49E"; + /** HTML 3.0 specification for color PALETURQUOISE. */ + public final static String PALETURQUOISE = "#AEEBEC"; + /** HTML 3.0 specification for color PALEVIOLETRED. */ + public final static String PALEVIOLETRED = "#D16587"; + /** HTML 3.0 specification for color PAPAYAWHIP. */ + public final static String PAPAYAWHIP = "#FEECCF"; + /** HTML 3.0 specification for color PEACHPUFF. */ + public final static String PEACHPUFF = "#FCD5B0"; + /** HTML 3.0 specification for color PERU. */ + public final static String PERU = "#C57726"; + /** HTML 3.0 specification for color PINK. */ + public final static String PINK = "#FAAFBE"; + /** HTML 3.0 specification for color PLUM. */ + public final static String PLUM = "#B93B8F"; + /** HTML 3.0 specification for color POWDERBLUE. */ + public final static String POWDERBLUE = "#ADDCE3"; + /** HTML 3.0 specification for color ROSYBROWN. */ + public final static String ROSYBROWN = "#B38481"; + /** HTML 3.0 specification for color ROYALBLUE. */ + public final static String ROYALBLUE = "#2B60DE"; + /** HTML 3.0 specification for color SADDLEBROWN. + * BROWN2 couldn't find SADDLEBROWN */ + public final static String SADDLEBROWN = "#F63526"; + /** HTML 3.0 specification for color SALMON. */ + public final static String SALMON = "#F88158"; + /** HTML 3.0 specification for color SANDYBROWN. */ + public final static String SANDYBROWN = "#EE9A4D"; + /** HTML 3.0 specification for color SEAGREEN. */ + public final static String SEAGREEN = "#4E8975"; + /** HTML 3.0 specification for color SEASHELL. */ + public final static String SEASHELL = "#FEF3EB"; + /** HTML 3.0 specification for color SIENNA. */ + public final static String SIENNA = "#8A4117"; + /** HTML 3.0 specification for color SKYBLUE. */ + public final static String SKYBLUE = "#6698FF"; + /** HTML 3.0 specification for color SLATEBLUE. */ + public final static String SLATEBLUE = "#737CA1"; + /** HTML 3.0 specification for color SLATEGRAY. */ + public final static String SLATEGRAY = "#657383"; + /** HTML 3.0 specification for color SNOW. */ + public final static String SNOW = "#FFF9FA"; + /** HTML 3.0 specification for color SPRINGGREEN. */ + public final static String SPRINGGREEN = "#4AA02C"; + /** HTML 3.0 specification for color STEELBLUE. */ + public final static String STEELBLUE = "#4863A0"; + /** HTML 3.0 specification for color TAN. */ + public final static String TAN = "#D8AF79"; + /** HTML 3.0 specification for color THISTLE. */ + public final static String THISTLE = "#D2B9D3"; + /** HTML 3.0 specification for color TOMATO. */ + public final static String TOMATO = "#F75431"; + /** HTML 3.0 specification for color TURQUOISE. */ + public final static String TURQUOISE = "#43C6DB"; + /** HTML 3.0 specification for color VIOLET. */ + public final static String VIOLET = "#8D38C9"; + /** HTML 3.0 specification for color WHEAT. */ + public final static String WHEAT = "#F3DAA9"; + /** HTML 3.0 specification for color WHITESMOKE (not shown). + * WHITE couldn't find WHITESMOKE */ + public final static String WHITESMOKE = "#FFFFFF"; + /** HTML 3.0 specification for color . */ + public final static String YELLOWGREEN = "#52D017"; + + // lowercase for compatability colors HTML 4.0 + + /** Lowercase for compatiblity. + * @see #BLACK */ + public final static String black = BLACK; + /** Lowercase for compatiblity. + * @see #SILVER */ + public final static String silver = SILVER; + /** Lowercase for compatiblity. + * @see #GRAY */ + public final static String gray = GRAY; + /** Lowercase for compatiblity. + * @see #WHITE */ + public final static String white = WHITE; + /** Lowercase for compatiblity. + * @see #MAROON */ + public final static String maroon = MAROON; + /** Lowercase for compatiblity. + * @see #RED */ + public final static String red = RED; + /** Lowercase for compatiblity. + * @see #PURPLE */ + public final static String purple = PURPLE; + /** Lowercase for compatiblity. + * @see #FUCHSIA */ + public final static String fuchsia = FUCHSIA; + /** Lowercase for compatiblity. + * @see #GREEN */ + public final static String green = GREEN; + /** Lowercase for compatiblity. + * @see #LIME */ + public final static String lime = LIME; + /** Lowercase for compatiblity. + * @see #OLIVE */ + public final static String olive = OLIVE; + /** Lowercase for compatiblity. + * @see #YELLOW */ + public final static String yellow = YELLOW; + /** Lowercase for compatiblity. + * @see #NAVY */ + public final static String navy = NAVY; + /** Lowercase for compatiblity. + * @see #BLUE */ + public final static String blue = BLUE; + /** Lowercase for compatiblity. + * @see #TEAL */ + public final static String teal = TEAL; + /** Lowercase for compatiblity. + * @see #AQUA */ + public final static String aqua = AQUA; + + // lowercase for compatability colors html 3.0 + + /** Lowercase for compatiblity. + * @see #ALICEBLUE */ + public final static String aliceblue = ALICEBLUE; + /** Lowercase for compatiblity. + * @see #ANTIQUEWHITE */ + public final static String antiquewhite = ANTIQUEWHITE; + /** Lowercase for compatiblity. + * @see #AQUAMARINE */ + public final static String aquamarine = AQUAMARINE; + /** Lowercase for compatiblity. + * @see #AZURE */ + public final static String azure = AZURE; + /** Lowercase for compatiblity. + * @see #BEIGE */ + public final static String beige = BEIGE; + /** Lowercase for compatiblity. + * @see #BISQUE */ + public final static String bisque = BISQUE; + /** Lowercase for compatiblity. + * @see #BLANCHEDALMOND */ + public final static String blanchedalmond = BLANCHEDALMOND; + /** Lowercase for compatiblity. + * @see #BLUEVIOLET */ + public final static String blueviolet = BLUEVIOLET; + /** Lowercase for compatiblity. + * @see #BROWN */ + public final static String brown = BROWN; + /** Lowercase for compatiblity. + * @see #BURLYWOOD */ + public final static String burlywood = BURLYWOOD; + /** Lowercase for compatiblity. + * @see #CADETBLUE */ + public final static String cadetblue = CADETBLUE; + /** Lowercase for compatiblity. + * @see #CHARTREUSE */ + public final static String chartreuse = CHARTREUSE; + /** Lowercase for compatiblity. + * @see #CHOCOLATE */ + public final static String chocolate = CHOCOLATE; + /** Lowercase for compatiblity. + * @see #CORAL */ + public final static String coral = CORAL; + /** Lowercase for compatiblity. + * @see #CORNFLOWERBLUE */ + public final static String cornfolowerblue = CORNFLOWERBLUE; + /** Lowercase for compatiblity. + * @see #CORNSILK */ + public final static String cornsilk = CORNSILK; + /** Lowercase for compatiblity. + * @see #CRIMSON */ + public final static String crimson = CRIMSON; + /** Lowercase for compatiblity. + * @see #CYAN */ + public final static String cyan = CYAN; + /** Lowercase for compatiblity. + * @see #DARKBLUE */ + public final static String darkblue = DARKBLUE; + /** Lowercase for compatiblity. + * @see #DARKCYAN */ + public final static String darkcyan = DARKCYAN; + /** Lowercase for compatiblity. + * @see #DARKGOLDENROD */ + public final static String darkgoldenrod = DARKGOLDENROD; + /** Lowercase for compatiblity. + * @see #DARKGRAY */ + public final static String darkgray = DARKGRAY; + /** Lowercase for compatiblity. + * @see #DARKGREEN */ + public final static String darkgreen = DARKGREEN; + /** Lowercase for compatiblity. + * @see #DARKKHAKI */ + public final static String darkkahki = DARKKHAKI; + /** Lowercase for compatiblity. + * @see #DARKMAGENTA */ + public final static String darkmagenta = DARKMAGENTA; + /** Lowercase for compatiblity. + * @see #DARKOLIVEGREEN */ + public final static String darkolivegreen = DARKOLIVEGREEN; + /** Lowercase for compatiblity. + * @see #DARKORANGE */ + public final static String darkorange = DARKORANGE; + /** Lowercase for compatiblity. + * @see #DARKORCHID */ + public final static String darkorchid = DARKORCHID; + /** Lowercase for compatiblity. + * @see #DARKRED */ + public final static String darkred = DARKRED; + /** Lowercase for compatiblity. + * @see #DARKSALMON */ + public final static String darksalmon = DARKSALMON; + /** Lowercase for compatiblity. + * @see #DARKSEAGREEN */ + public final static String darkseagreen = DARKSEAGREEN; + /** Lowercase for compatiblity. + * @see #DARKSLATEBLUE */ + public final static String darkslateblue = DARKSLATEBLUE; + /** Lowercase for compatiblity. + * @see #DARKSLATEGRAY */ + public final static String darkslategray = DARKSLATEGRAY; + /** Lowercase for compatiblity. + * @see #DARKTURQUOISE */ + public final static String darkturquoise = DARKTURQUOISE; + /** Lowercase for compatiblity. + * @see #DARKVIOLET */ + public final static String darkviolet = DARKVIOLET; + /** Lowercase for compatiblity. + * @see #DEEPPINK */ + public final static String deeppink = DEEPPINK; + /** Lowercase for compatiblity. + * @see #DEEPSKYBLUE */ + public final static String deepskyblue = DEEPSKYBLUE; + /** Lowercase for compatiblity. + * @see #DIMGRAY */ + public final static String dimgray = DIMGRAY; + /** Lowercase for compatiblity. + * @see #DODGERBLUE */ + public final static String dodgerblue = DODGERBLUE; + /** Lowercase for compatiblity. + * @see #FIREBRICK */ + public final static String firebrick = FIREBRICK; + /** Lowercase for compatiblity. + * @see #FLORALWHITE */ + public final static String floralwhite = FLORALWHITE; + /** Lowercase for compatiblity. + * @see #FORESTGREEN */ + public final static String forestgreen = FORESTGREEN; + /** Lowercase for compatiblity. + * @see #GAINSBORO */ + public final static String gainsboro = GAINSBORO; + /** Lowercase for compatiblity. + * @see #GHOSTWHITE */ + public final static String ghostwhite = GHOSTWHITE; + /** Lowercase for compatiblity. + * @see #GOLD */ + public final static String gold = GOLD; + /** Lowercase for compatiblity. + * @see #GOLDENROD */ + public final static String goldenrod = GOLDENROD; + /** Lowercase for compatiblity. + * @see #GREENYELLOW */ + public final static String greenyellow = GREENYELLOW; + /** Lowercase for compatiblity. + * @see #HONEYDEW */ + public final static String honeydew = HONEYDEW; + /** Lowercase for compatiblity. + * @see #INDIANRED */ + public final static String indianred = INDIANRED; + /** Lowercase for compatiblity. + * @see #INDIGO */ + public final static String indigo = INDIGO; + /** Lowercase for compatiblity. + * @see #IVORY */ + public final static String ivory = IVORY; + /** Lowercase for compatiblity. + * @see #KHAKI */ + public final static String khaki = KHAKI; + /** Lowercase for compatiblity. + * @see #LAVENDER */ + public final static String lavender = LAVENDER; + /** Lowercase for compatiblity. + * @see #LAVENDERBLUSH */ + public final static String lavenderblush = LAVENDERBLUSH; + /** Lowercase for compatiblity. + * @see #LAWNGREEN */ + public final static String lawngreen = LAWNGREEN; + /** Lowercase for compatiblity. + * @see #LEMONCHIFFON */ + public final static String lemmonchiffon = LEMONCHIFFON; + /** Lowercase for compatiblity. + * @see #LIGHTBLUE */ + public final static String lightblue = LIGHTBLUE; + /** Lowercase for compatiblity. + * @see #LIGHTCORAL */ + public final static String lightcoral = LIGHTCORAL; + /** Lowercase for compatiblity. + * @see #LIGHTCYAN */ + public final static String lightcyan = LIGHTCYAN; + /** Lowercase for compatiblity. + * @see #LIGHTGOLDENRODYELLOW */ + public final static String lightgoldenrodyellow = LIGHTGOLDENRODYELLOW; + /** Lowercase for compatiblity. + * @see #LIGHTGREEN */ + public final static String lightgreen = LIGHTGREEN; + /** Lowercase for compatiblity. + * @see #LIGHTPINK */ + public final static String lightpink = LIGHTPINK; + /** Lowercase for compatiblity. + * @see #LIGHTSALMON */ + public final static String lightsalmon = LIGHTSALMON; + /** Lowercase for compatiblity. + * @see #LIGHTSEAGREEN */ + public final static String lightseagreen = LIGHTSEAGREEN; + /** Lowercase for compatiblity. + * @see #LIGHTSKYBLUE */ + public final static String lightskyblue = LIGHTSKYBLUE; + /** Lowercase for compatiblity. + * @see #LIGHTSLATEGRAY */ + public final static String lightslategray = LIGHTSLATEGRAY; + /** Lowercase for compatiblity. + * @see #LIGHTSTEELBLUE */ + public final static String lightsteelblue = LIGHTSTEELBLUE; + /** Lowercase for compatiblity. + * @see #LIGHTYELLOW */ + public final static String lightyellow = LIGHTYELLOW; + /** Lowercase for compatiblity. + * @see #LIMEGREEN */ + public final static String limegreen = LIMEGREEN; + /** Lowercase for compatiblity. + * @see #LINEN */ + public final static String linen = LINEN; + /** Lowercase for compatiblity. + * @see #MAGENTA */ + public final static String magenta = MAGENTA; + /** Lowercase for compatiblity. + * @see #MEDIUMAQUAMARINE */ + public final static String mediumaquamarine = MEDIUMAQUAMARINE; + /** Lowercase for compatiblity. + * @see #MEDIUMBLUE */ + public final static String mediumblue = MEDIUMBLUE; + /** Lowercase for compatiblity. + * @see #MEDIUMORCHID */ + public final static String mediumorchid = MEDIUMORCHID; + /** Lowercase for compatiblity. + * @see #MEDIUMPURPLE */ + public final static String mediumpurple = MEDIUMPURPLE; + /** Lowercase for compatiblity. + * @see #MEDIUMSEAGREEN */ + public final static String mediumseagreen = MEDIUMSEAGREEN; + /** Lowercase for compatiblity. + * @see #MEDIUMSLATEBLUE */ + public final static String mediumslateblue = MEDIUMSLATEBLUE; + /** Lowercase for compatiblity. + * @see #MEDIUMSPRINGGREEN */ + public final static String mediumspringgreen = MEDIUMSPRINGGREEN; + /** Lowercase for compatiblity. + * @see #MEDIUMTURQUOISE */ + public final static String mediumturquoise = MEDIUMTURQUOISE; + /** Lowercase for compatiblity. + * @see #MEDIUMVIOLETRED */ + public final static String mediumvioletred = MEDIUMVIOLETRED; + /** Lowercase for compatiblity. + * @see #MIDNIGHTBLUE */ + public final static String midnightblue = MIDNIGHTBLUE; + /** Lowercase for compatiblity. + * @see #MINTCREAM */ + public final static String mintcream = MINTCREAM; + /** Lowercase for compatiblity. + * @see #MISTYROSE */ + public final static String mistyrose = MISTYROSE; + /** Lowercase for compatiblity. + * @see #MOCCASIN */ + public final static String moccasin = MOCCASIN; + /** Lowercase for compatiblity. + * @see #NAVAJOWHITE */ + public final static String navajowhite = NAVAJOWHITE; + /** Lowercase for compatiblity. + * @see #OLDLACE */ + public final static String oldlace = OLDLACE; + /** Lowercase for compatiblity. + * @see #OLIVEDRAB */ + public final static String olivedrab = OLIVEDRAB; + /** Lowercase for compatiblity. + * @see #ORANGE */ + public final static String orange = ORANGE; + /** Lowercase for compatiblity. + * @see #ORANGERED */ + public final static String orangered = ORANGERED; + /** Lowercase for compatiblity. + * @see #ORCHID */ + public final static String orchid = ORCHID; + /** Lowercase for compatiblity. + * @see #PALEGOLDENROD */ + public final static String palegoldenrod = PALEGOLDENROD; + /** Lowercase for compatiblity. + * @see #PALETURQUOISE */ + public final static String paleturquoise = PALETURQUOISE; + /** Lowercase for compatiblity. + * @see #PALEVIOLETRED */ + public final static String palevioletred = PALEVIOLETRED; + /** Lowercase for compatiblity. + * @see #PAPAYAWHIP */ + public final static String papayawhip = PAPAYAWHIP; + /** Lowercase for compatiblity. + * @see #PEACHPUFF */ + public final static String peachpuff = PEACHPUFF; + /** Lowercase for compatiblity. + * @see #PERU */ + public final static String peru = PERU; + /** Lowercase for compatiblity. + * @see #PINK */ + public final static String pink = PINK; + /** Lowercase for compatiblity. + * @see #PLUM */ + public final static String plum = PLUM; + /** Lowercase for compatiblity. + * @see #POWDERBLUE */ + public final static String powderblue = POWDERBLUE; + /** Lowercase for compatiblity. + * @see #ROSYBROWN */ + public final static String rosybrown = ROSYBROWN; + /** Lowercase for compatiblity. + * @see #ROYALBLUE */ + public final static String royalblue = ROYALBLUE; + /** Lowercase for compatiblity. + * @see #SADDLEBROWN */ + public final static String saddlebrown = SADDLEBROWN; + /** Lowercase for compatiblity. + * @see #SALMON */ + public final static String salmon = SALMON; + /** Lowercase for compatiblity. + * @see #SANDYBROWN */ + public final static String sandybrown = SANDYBROWN; + /** Lowercase for compatiblity. + * @see #SEAGREEN */ + public final static String seagreen = SEAGREEN; + /** Lowercase for compatiblity. + * @see #SEASHELL */ + public final static String seashell = SEASHELL; + /** Lowercase for compatiblity. + * @see #SIENNA */ + public final static String sienna = SIENNA; + /** Lowercase for compatiblity. + * @see #SKYBLUE */ + public final static String skyblue = SKYBLUE; + /** Lowercase for compatiblity. + * @see #SLATEBLUE */ + public final static String slateblue = SLATEBLUE; + /** Lowercase for compatiblity. + * @see #SLATEGRAY */ + public final static String slategray = SLATEGRAY; + /** Lowercase for compatiblity. + * @see #SNOW */ + public final static String snow = SNOW; + /** Lowercase for compatiblity. + * @see #SPRINGGREEN */ + public final static String springgreen = SPRINGGREEN; + /** Lowercase for compatiblity. + * @see #STEELBLUE */ + public final static String steelblue = STEELBLUE; + /** Lowercase for compatiblity. + * @see #TAN */ + public final static String tan = TAN; + /** Lowercase for compatiblity. + * @see #THISTLE */ + public final static String thistle = THISTLE; + /** Lowercase for compatiblity. + * @see #TOMATO */ + public final static String tomato = TOMATO; + /** Lowercase for compatiblity. + * @see #TURQUOISE */ + public final static String turquoise = TURQUOISE; + /** Lowercase for compatiblity. + * @see #VIOLET */ + public final static String violet = VIOLET; + /** Lowercase for compatiblity. + * @see #WHEAT */ + public final static String wheat = WHEAT; + /** Lowercase for compatiblity. + * @see #WHITESMOKE */ + public final static String whitesmoke = WHITESMOKE; + /** Lowercase for compatiblity. + * @see #YELLOWGREEN */ + public final static String yellowgreen = YELLOWGREEN; + + /** + * Convert Color. + * Limited use as it assumes that color is hex string w/o # + This method will take a string of hex values and + append a # to the beginning if it isn't already there. + @param color the string to convert + @return the converted string + */ + public static String convertColor(String color) + { + if (color == null) + return BLACK; + // Hex 000000 w/o # + if (color.length() != 6) + return color; + if (!color.startsWith("#")) + return "#" + color; + return color; + } + + /** + This method will take a string matching one of the colors + defined in this class and return the string value of that + color. + @param color the color to get retrieve + @return the string value of the color, if found, null otherwise + */ + public static String getColor(String color) + { + Object colObject; + try { + colObject = Class.forName("org.apache.ecs.HtmlColor") + .getField(color) + .get(null); + } catch (Exception e) { + return null; + } + return((String)colObject); + } +} diff --git a/tools/src/org/apache/ecs/KeyEvents.java b/tools/src/org/apache/ecs/KeyEvents.java new file mode 100644 index 0000000000..d5fc101655 --- /dev/null +++ b/tools/src/org/apache/ecs/KeyEvents.java @@ -0,0 +1,52 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +/** + This interface is intended to be implemented by elements that require + javascript key event attributes. + + @version $Id: KeyEvents.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public interface KeyEvents +{ + /** + make sure implementing classes have a setOnKeyPress method. + + The onkeypress event occurs when a key is pressed and released over an + element. This attribute may be used with most elements. + */ + public abstract void setOnKeyPress(String script); + + /** + make sure implementing classes have a setOnKeyDown method. + + The onkeydown event occurs when a key is pressed down over an element. + This attribute may be used with most elements. + */ + public abstract void setOnKeyDown(String script); + + /** + make sure implementing classes have a setOnKeyUp method. + + The onkeyup event occurs when a key is released over an element. This + attribute may be used with most elements. + */ + public abstract void setOnKeyUp(String script); +} diff --git a/tools/src/org/apache/ecs/MouseEvents.java b/tools/src/org/apache/ecs/MouseEvents.java new file mode 100644 index 0000000000..a705ba9f78 --- /dev/null +++ b/tools/src/org/apache/ecs/MouseEvents.java @@ -0,0 +1,84 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +/** + This interface is intended to be implemented by elements that require + javascript mouse event attributes. + + @version $Id: MouseEvents.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public interface MouseEvents +{ + /** + make sure implementing classes have a setOnClick method. + + The onclick event occurs when the pointing device button is clicked + over an element. This attribute may be used with most elements. + */ + public abstract void setOnClick(String script); + + /** + make sure implementing classes have a setOnDblClick method. + + The ondblclick event occurs when the pointing device button is double + clicked over an element. This attribute may be used with most elements. + */ + public abstract void setOnDblClick(String script); + + /** + make sure implementing classes have a setOnMouseDown method. + + The onmousedown event occurs when the pointing device button is pressed + over an element. This attribute may be used with most elements. + */ + public abstract void setOnMouseDown(String script); + + /** + make sure implementing classes have a setOnMouseUp method. + + The onmouseup event occurs when the pointing device button is released + over an element. This attribute may be used with most elements. + */ + public abstract void setOnMouseUp(String script); + + /** + make sure implementing classes have a setOnMouseOver method. + + The onmouseover event occurs when the pointing device is moved onto an + element. This attribute may be used with most elements. + */ + public abstract void setOnMouseOver(String script); + + /** + make sure implementing classes have a setOnMouseMove method. + + The onmousemove event occurs when the pointing device is moved while it + is over an element. This attribute may be used with most elements. + */ + public abstract void setOnMouseMove(String script); + + /** + make sure implementing classes have a setOnMouseOut method. + + The onmouseout event occurs when the pointing device is moved away from + an element. This attribute may be used with most elements. + */ + public abstract void setOnMouseOut(String script); +} diff --git a/tools/src/org/apache/ecs/MultiPartElement.java b/tools/src/org/apache/ecs/MultiPartElement.java new file mode 100644 index 0000000000..4b697ccd67 --- /dev/null +++ b/tools/src/org/apache/ecs/MultiPartElement.java @@ -0,0 +1,36 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +/** + This class is to be subclassed by those elements that are made up of + other elements. i.e. BODY,HEAD,etc. + + @version $Id: MultiPartElement.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public abstract class MultiPartElement extends ConcreteElement +{ + /** Private Initializer */ + { + setNeedClosingTag(true); + } + public MultiPartElement() + { + } +} diff --git a/tools/src/org/apache/ecs/PageEvents.java b/tools/src/org/apache/ecs/PageEvents.java new file mode 100644 index 0000000000..3f8e095154 --- /dev/null +++ b/tools/src/org/apache/ecs/PageEvents.java @@ -0,0 +1,46 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +/** + This interface is intended to be implemented by elements that require + javascript page event attributes. + + @version $Id: PageEvents.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public interface PageEvents +{ + /** + make sure implementing classes have a setOnLoad method. + + The onload event occurs when the user agent finishes loading a window + or all frames within a FRAMESET. This attribute may be used with BODY + and FRAMESET elements. + */ + public abstract void setOnLoad(String script); + + /** + make sure implementing classes have a setOnUnload method. + + The onunload event occurs when the user agent removes a document from a + window or frame. This attribute may be used with BODY and FRAMESET + elements. + */ + public abstract void setOnUnload(String script); +} diff --git a/tools/src/org/apache/ecs/Printable.java b/tools/src/org/apache/ecs/Printable.java new file mode 100644 index 0000000000..3e4707a74c --- /dev/null +++ b/tools/src/org/apache/ecs/Printable.java @@ -0,0 +1,24 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +/** + Empty interface for determining if an element can be pretty printed. +*/ +public interface Printable +{ +} diff --git a/tools/src/org/apache/ecs/SinglePartElement.java b/tools/src/org/apache/ecs/SinglePartElement.java new file mode 100644 index 0000000000..41ad666e5c --- /dev/null +++ b/tools/src/org/apache/ecs/SinglePartElement.java @@ -0,0 +1,37 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +/** + This class is to be subclassed by those elements that are made up of + other elements that do not have an end tag. ie: IMG + + @version $Id: SinglePartElement.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public abstract class SinglePartElement extends ConcreteElement +{ + /** Private Initializer */ + { + setNeedClosingTag(false); + } + + public SinglePartElement() + { + } +} diff --git a/tools/src/org/apache/ecs/StringElement.java b/tools/src/org/apache/ecs/StringElement.java new file mode 100644 index 0000000000..87be972f08 --- /dev/null +++ b/tools/src/org/apache/ecs/StringElement.java @@ -0,0 +1,176 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + +import java.text.*; + + +/** + This class is used to create a String element in ECS. A StringElement + has no tags wrapped around it, it is an Element without tags. + + @version $Id: StringElement.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public class StringElement extends ConcreteElement implements Printable +{ + /** + Basic constructor + */ + public StringElement() + { + } + + /** + Basic constructor + */ + public StringElement(String string) + { + if (string != null) + setTagText(string); + else + setTagText(""); + } + + /** + Basic constructor + */ + public StringElement(Element element) + { + addElement(element); + } + + private StringElement append(String string) + { + setTagText(getTagText()+string); + return this; + } + + /** + Resets the interal string to be empty. + */ + public StringElement reset() + { + setTagText(""); + return this; + } + + /** + * Set Tag Text + * @param text text + * @return Element + */ + public Element setTagText (String text) + { + if (text != null && text.length() > 0) + { + StringCharacterIterator sci = new StringCharacterIterator(text); + for (char c = sci.first(); c != CharacterIterator.DONE; c = sci.next()) + { + int ii = c; + if (ii > 255) + { + setFilterState(true); + break; + } + } + } + return super.setTagText (text); + } // setTagText + + /** + * Set Filter State - don't allow reset + * @param filter_state state + * @return this + */ + public Element setFilterState (boolean filter_state) + { + if (!getFilterState()) + return super.setFilterState (filter_state); + return this; + } // setFilterState + + /** + Adds an Element to the element. + @param hashcode name of element for hash table + @param element Adds an Element to the element. + */ + public StringElement addElement(String hashcode,Element element) + { + addElementToRegistry(hashcode,element); + return(this); + } + + /** + Adds an Element to the element. + @param hashcode name of element for hash table + @param element Adds an Element to the element. + */ + public StringElement addElement(String hashcode,String element) + { + // We do it this way so that filtering will work. + // 1. create a new StringElement(element) - this is the only way that setTextTag will get called + // 2. copy the filter state of this string element to this child. + // 3. copy the filter for this string element to this child. + + StringElement se = new StringElement(element); + se.setFilterState(getFilterState()); + se.setFilter(getFilter()); + addElementToRegistry(hashcode,se); + return(this); + } + + /** + Adds an Element to the element. + @param element Adds an Element to the element. + */ + public StringElement addElement(String element) + { + addElement(Integer.toString(element.hashCode()),element); + return(this); + } + + /** + Adds an Element to the element. + @param element Adds an Element to the element. + */ + public StringElement addElement(Element element) + { + addElementToRegistry(element); + return(this); + } + + /** + Removes an Element from the element. + @param hashcode the name of the element to be removed. + */ + public StringElement removeElement(String hashcode) + { + removeElementFromRegistry(hashcode); + return(this); + } + + protected String createStartTag() + { + return(""); + } + protected String createEndTag() + { + return(""); + } +} diff --git a/tools/src/org/apache/ecs/XhtmlDocument.java b/tools/src/org/apache/ecs/XhtmlDocument.java new file mode 100644 index 0000000000..80b5f4981c --- /dev/null +++ b/tools/src/org/apache/ecs/XhtmlDocument.java @@ -0,0 +1,628 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + + + +import java.io.OutputStream; + +import java.io.PrintWriter; + +import java.io.Serializable; + +import org.apache.ecs.xhtml.html; + +import org.apache.ecs.xhtml.body; + +import org.apache.ecs.xhtml.title; + +import org.apache.ecs.xhtml.head; + +import org.apache.ecs.Doctype; + + + +/** + + This class creates an XhtmlDocument container, for convience. + + + + @version $Id: XhtmlDocument.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class XhtmlDocument implements Serializable,Cloneable + +{ + + /** @serial html html */ + + private html html; // this is the actual container for head and body + + /** @serial head head */ + + private head head; + + /** @serial body body */ + + private body body; + + /** @serial title title */ + + private title title; + + /** @serial codeset codeset */ + + private String codeset = null; + + /** @serial doctype doctype */ + + private Doctype doctype = null; + + + + { + + html = new html(); + + head = new head(); + + title = new title(); + + body = new body(); + + + + head.addElement("title",title); + + html.addElement("head",head); + + html.addElement("body",body); + + } + + + + /** + + Basic constructor. + + */ + + public XhtmlDocument() + + { + + } + + + + /** + + Basic constructor. Sets the codeset for the page output. + + */ + + public XhtmlDocument(String codeset) + + { + + setCodeset(codeset); + + } + + + + /** + + Get the doctype element for this XhtmlDocument container. + + */ + + public Doctype getDoctype() + + { + + return(doctype); + + } + + + + /** + + Set the doctype element for this XhtmlDocument container. + + */ + + public XhtmlDocument setDoctype(Doctype set_doctype) + + { + + this.doctype = set_doctype; + + return(this); + + } + + + + /** + + Get the html element for this XhtmlDocument container. + + */ + + public html getHtml() + + { + + return(html); + + } + + + + /** + + Set the html element for this XhtmlDocument container. + + */ + + public XhtmlDocument setHtml(html set_html) + + { + + this.html = set_html; + + return(this); + + } + + + + /** + + Get the head element for this XhtmlDocument container. + + */ + + public head getHead() + + { + + return(head); + + } + + + + /** + + Set the head element for this XhtmlDocument container. + + */ + + public XhtmlDocument setHead(head set_head) + + { + + html.addElement("head",set_head); + + return(this); + + } + + + + /** + + Append to the head element for this XhtmlDocument container. + + @param value adds to the value between the head tags + + */ + + public XhtmlDocument appendHead(Element value) + + { + + head.addElement(value); + + return(this); + + } + + + + /** + + Append to the head element for this XhtmlDocument container. + + @param value adds to the value between the head tags + + */ + + public XhtmlDocument appendHead(String value) + + { + + head.addElement(value); + + return(this); + + } + + + + /** + + Get the body element for this XhtmlDocument container. + + */ + + public body getBody() + + { + + return(body); + + } + + + + /** + + Set the body element for this XhtmlDocument container. + + */ + + public XhtmlDocument setBody(body set_body) + + { + + html.addElement("body",set_body); + + return(this); + + } + + + + /** + + Append to the body element for this XhtmlDocument container. + + @param value adds to the value between the body tags + + */ + + public XhtmlDocument appendBody(Element value) + + { + + body.addElement(value); + + return(this); + + } + + + + /** + + Append to the body element for this XhtmlDocument container. + + @param value adds to the value between the body tags + + */ + + public XhtmlDocument appendBody(String value) + + { + + body.addElement(value); + + return(this); + + } + + + + /** + + Get the title element for this XhtmlDocument container. + + */ + + public title getTitle() + + { + + return(title); + + } + + + + /** + + Set the title element for this XhtmlDocument container. + + */ + + public XhtmlDocument setTitle(title set_title) + + { + + head.addElement("title",set_title); + + return(this); + + } + + + + /** + + Append to the title element for this XhtmlDocument container. + + @param value adds to the value between the title tags + + */ + + public XhtmlDocument appendTitle(Element value) + + { + + title.addElement(value); + + return(this); + + } + + + + /** + + Append to the title element for this XhtmlDocument container. + + @param value adds to the value between the title tags + + */ + + public XhtmlDocument appendTitle(String value) + + { + + title.addElement(value); + + return(this); + + } + + + + /** + + * Sets the codeset for this XhtmlDocument + + */ + + public void setCodeset ( String codeset ) + + { + + this.codeset = codeset; + + } + + + + /** + + * Gets the codeset for this XhtmlDocument + + * + + * @return the codeset + + */ + + public String getCodeset() + + { + + return this.codeset; + + } + + + + /** + + Write the container to the OutputStream + + */ + + public void output(OutputStream out) + + { + + if (doctype != null) + + { + + doctype.output(out); + + try + + { + + out.write('\n'); + + } + + catch ( Exception e) + + {} + + } + + // XhtmlDocument is just a convient wrapper for html call html.output + + html.output(out); + + } + + + + /** + + Write the container to the PrinteWriter + + */ + + public void output(PrintWriter out) + + { + + if (doctype != null) + + { + + doctype.output(out); + + try + + { + + out.write('\n'); + + } + + catch ( Exception e) + + {} + + } + + // XhtmlDocument is just a convient wrapper for html call html.output + + html.output(out); + + } + + + + /** + + Override the toString() method so that it prints something meaningful. + + */ + + public final String toString() + + { + + StringBuffer sb = new StringBuffer(); + + if ( getCodeset() != null ) + + { + + if (doctype != null) + + sb.append (doctype.toString(getCodeset())); + + sb.append (html.toString(getCodeset())); + + return (sb.toString()); + + } + + else + + { + + if (doctype != null) + + sb.append (doctype.toString()); + + sb.append (html.toString()); + + return(sb.toString()); + + } + + } + + + + /** + + Override the toString() method so that it prints something meaningful. + + */ + + public final String toString(String codeset) + + { + + StringBuffer sb = new StringBuffer(); + + if (doctype != null) + + sb.append (doctype.toString(getCodeset())); + + sb.append (html.toString(getCodeset())); + + return(sb.toString()); + + } + + + + /** + + Allows the document to be cloned. + + Doesn't return an instance of document returns instance of html. + + NOTE: If you have a doctype set, then it will be lost. Feel free + + to submit a patch to fix this. It isn't trivial. + + */ + + public Object clone() + + { + + return(html.clone()); + + } + +} + diff --git a/tools/src/org/apache/ecs/XhtmlFrameSetDocument.java b/tools/src/org/apache/ecs/XhtmlFrameSetDocument.java new file mode 100644 index 0000000000..74a6985fbf --- /dev/null +++ b/tools/src/org/apache/ecs/XhtmlFrameSetDocument.java @@ -0,0 +1,608 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs; + + + +import java.io.OutputStream; + +import java.io.PrintWriter; + +import java.io.Serializable; + +import org.apache.ecs.xhtml.html; + +import org.apache.ecs.xhtml.body; + +import org.apache.ecs.xhtml.title; + +import org.apache.ecs.xhtml.head; + +import org.apache.ecs.xhtml.frameset; + +import org.apache.ecs.xhtml.noframes; + + + +/** + + This class creates a XhtmlFrameSetDocument container, for convience. + + + + @version $Id: XhtmlFrameSetDocument.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class XhtmlFrameSetDocument implements Serializable,Cloneable + +{ + + /** @serial html html */ + + private html html; // this is the actual container for head and body + + /** @serial head head */ + + private head head; + + /** @serial body body */ + + private body body; + + /** @serial title title */ + + private title title; + + /** @serial frameset frameset */ + + private frameset frameset; + + /** @serial noframes frameset */ + + private noframes noframes; + + + + /** @serial codeset codeset */ + + private String codeset = null; + + + + { + + html = new html(); + + head = new head(); + + title = new title(); + + frameset = new frameset(); + + noframes = new noframes(); + + body = new body(); + + + + head.addElement(title); + + html.addElement(head); + + html.addElement(frameset); + + html.addElement(noframes); + + noframes.addElement(body); + + } + + + + /** + + Basic constructor. + + */ + + public XhtmlFrameSetDocument() + + { + + } + + + + /** + + Basic constructor. Sets the codeset for the page output. + + */ + + public XhtmlFrameSetDocument(String codeset) + + { + + setCodeset(codeset); + + } + + + + /** + + Get the html element for this document container. + + */ + + public html getHtml() + + { + + return(html); + + } + + + + /** + + Set the html element for this XhtmlFrameSetDocument container. + + */ + + public XhtmlFrameSetDocument setHtml(html set_html) + + { + + this.html = set_html; + + return(this); + + } + + + + /** + + Get the head element for this XhtmlFrameSetDocument container. + + */ + + public head getHead() + + { + + return(head); + + } + + + + /** + + Set the head element for this XhtmlFrameSetDocument container. + + */ + + public XhtmlFrameSetDocument setHead(head set_head) + + { + + this.head = set_head; + + return(this); + + } + + + + /** + + Append to the head element for this XhtmlFrameSetDocument container. + + @param value adds to the value between the head tags + + */ + + public XhtmlFrameSetDocument appendHead(Element value) + + { + + head.addElement(value); + + return(this); + + } + + + + /** + + Append to the head element for this XhtmlFrameSetDocument container. + + @param value adds to the value between the head tags + + */ + + public XhtmlFrameSetDocument appendHead(String value) + + { + + head.addElement(value); + + return(this); + + } + + + + /** + + Get the frameset element for this XhtmlFrameSetDocument container. + + */ + + public frameset getFrameSet() + + { + + return(frameset); + + } + + + + /** + + Set the frameset element for this XhtmlFrameSetDocument container. + + */ + + public XhtmlFrameSetDocument setHead(frameset set_frameset) + + { + + this.frameset = set_frameset; + + return(this); + + } + + + + /** + + Append to the head element for this FrameSetDocument container. + + @param value adds to the value between the head tags + + */ + + public XhtmlFrameSetDocument appendFrameSet(Element value) + + { + + frameset.addElement(value); + + return(this); + + } + + + + /** + + Append to the head element for this XhtmlFrameSetDocument container. + + @param value adds to the value between the head tags + + */ + + public XhtmlFrameSetDocument appendFrameSet(String value) + + { + + frameset.addElement(value); + + return(this); + + } + + /** + + Get the body element for this XhtmlFrameSetDocument container. + + */ + + public body getBody() + + { + + return(body); + + } + + + + /** + + Set the body element for this XhtmlFrameSetDocument container. + + */ + + public XhtmlFrameSetDocument setBody(body set_body) + + { + + this.body = set_body; + + return(this); + + } + + + + /** + + Append to the body element for this XhtmlFrameSetDocument container. + + @param value adds to the value between the body tags + + */ + + public XhtmlFrameSetDocument appendBody(Element value) + + { + + body.addElement(value); + + return(this); + + } + + + + /** + + Append to the body element for this XhtmlFrameSetDocument container. + + @param value adds to the value between the body tags + + */ + + public XhtmlFrameSetDocument appendBody(String value) + + { + + body.addElement(value); + + return(this); + + } + + + + /** + + Get the title element for this XhtmlFrameSetDocument container. + + */ + + public title getTitle() + + { + + return(title); + + } + + + + /** + + Set the title element for this XhtmlFrameSetDocument container. + + */ + + public XhtmlFrameSetDocument setTitle(title set_title) + + { + + this.title = set_title; + + return(this); + + } + + + + /** + + Append to the title element for this XhtmlFrameSetDocument container. + + @param value adds to the value between the title tags + + */ + + public XhtmlFrameSetDocument appendTitle(Element value) + + { + + title.addElement(value); + + return(this); + + } + + + + /** + + Append to the title element for this XhtmlFrameSetDocument container. + + @param value adds to the value between the title tags + + */ + + public XhtmlFrameSetDocument appendTitle(String value) + + { + + title.addElement(value); + + return(this); + + } + + + + /** + + * Sets the codeset for this XhtmlFrameSetDocument + + */ + + public void setCodeset ( String codeset ) + + { + + this.codeset = codeset; + + } + + + + /** + + * Gets the codeset for this XhtmlFrameSetDocument + + * + + * @return the codeset + + */ + + public String getCodeset() + + { + + return this.codeset; + + } + + + + /** + + Write the container to the OutputStream + + */ + + public void output(OutputStream out) + + { + + // XhtmlFrameSetDocument is just a convient wrapper for html call html.output + + html.output(out); + + } + + + + /** + + Write the container to the PrinteWriter + + */ + + public void output(PrintWriter out) + + { + + // XhtmlFrameSetDocument is just a convient wrapper for html call html.output + + html.output(out); + + } + + + + /** + + Override the toString() method so that it prints something meaningful. + + */ + + public final String toString() + + { + + if ( getCodeset() != null ) + + return (html.toString(getCodeset())); + + else + + return(html.toString()); + + } + + + + /** + + Override the toString() method so that it prints something meaningful. + + */ + + public final String toString(String codeset) + + { + + return(html.toString(codeset)); + + } + + /** + + Allows the XhtmlFrameSetDocument to be cloned. Doesn't return an instanceof XhtmlFrameSetDocument returns instance of html. + + + + */ + + + + public Object clone() + + { + + return(html.clone()); + + } + +} + diff --git a/tools/src/org/apache/ecs/ecs.properties b/tools/src/org/apache/ecs/ecs.properties new file mode 100644 index 0000000000..fdbd8114eb --- /dev/null +++ b/tools/src/org/apache/ecs/ecs.properties @@ -0,0 +1,16 @@ +filter_state=false +filter_attribute_state=false +attribute_equality_sign="=" +begin_start_modifier=" " +end_start_modifier=" " +begin_end_modifier=" " +end_end_modifier=" " +attribute_quote_char=" +attribute_quote=true +end_element=true +codeset=UTF-8 +position=4 +case_type=3 +start_tag=< +end_tag=> +pretty_print=true diff --git a/tools/src/org/apache/ecs/filter/CharacterFilter.java b/tools/src/org/apache/ecs/filter/CharacterFilter.java new file mode 100644 index 0000000000..a31eabc006 --- /dev/null +++ b/tools/src/org/apache/ecs/filter/CharacterFilter.java @@ -0,0 +1,131 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.filter; + +import org.apache.ecs.Filter; +import org.apache.ecs.Entities; +import java.text.StringCharacterIterator; +import java.text.CharacterIterator; +/** + This class creates a Filter object. The default characters filtered are:
+ " ' & < > +

+ For example: + +


+    Filter filter = new CharacterFilter();
+    filter.addAttribute("$","dollar");
+    filter.addAttribute("#",Entities.POUND);
+
+    P p = new P();
+    p.setFilter(filter);
+
+    Document doc = new Document();
+    doc.getBody().addElement(p);
+    
+ + The filter is applied when the addElement() method is called. + + @version $Id: CharacterFilter.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public class CharacterFilter extends java.util.Hashtable implements Filter +{ + /** + Private initializer. + " ' & < > are the default filters. + */ + { + addAttribute("\"",Entities.QUOT); + addAttribute("'",Entities.LSQUO); + addAttribute("&",Entities.AMP); + addAttribute("<",Entities.LT); + addAttribute(">",Entities.GT); + } + + public CharacterFilter() + { + super(4); + } + + /** Returns the name of the filter */ + public String getInfo() + { + return "CharacterFilter"; + } + + /** + Register things to be filtered. + */ + public Filter addAttribute(String name,Object attribute) + { + this.put(name,attribute); + return this; + } + + /** + Remove things to be filtered. + */ + public Filter removeAttribute(String name) + { + try + { + this.remove(name); + } + catch ( Exception e ) + { + } + return this; + } + + /** + Check to see if something is going to be filtered. + */ + public boolean hasAttribute(String key) + { + return(this.containsKey(key)); + } + + /** + Perform the filtering operation. + */ + public String process(String to_process) + { + if ( to_process == null || to_process.length() == 0 ) + return ""; + + StringBuffer bs = new StringBuffer(to_process.length() + 50); + StringCharacterIterator sci = new StringCharacterIterator(to_process); + String tmp = null; + + for (char c = sci.first(); c != CharacterIterator.DONE; c = sci.next()) + { + tmp = String.valueOf(c); + + if (hasAttribute(tmp)) + tmp = (String) this.get(tmp); + + int ii = c; + if (ii > 255) + tmp = "&#" + ii + ";"; + + bs.append(tmp); + } + return(bs.toString()); + } +} diff --git a/tools/src/org/apache/ecs/filter/NullFilter.java b/tools/src/org/apache/ecs/filter/NullFilter.java new file mode 100644 index 0000000000..15c0fca3be --- /dev/null +++ b/tools/src/org/apache/ecs/filter/NullFilter.java @@ -0,0 +1,49 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.filter; + +import org.apache.ecs.*; + + +/** +A filter for ECS that doesn't do anything. + +*/ + +public class NullFilter implements Filter { + + public Filter addAttribute(String name, Object attribute) { + return this; + } + + public Filter removeAttribute(String name) { + return this; + } + + public boolean hasAttribute(String name) { + return false; + } + + public String process(String to_process) { + return to_process; + } + + public String getInfo() { + return "info"; + } + +} diff --git a/tools/src/org/apache/ecs/filter/StringFilter.java b/tools/src/org/apache/ecs/filter/StringFilter.java new file mode 100644 index 0000000000..db1e0210d0 --- /dev/null +++ b/tools/src/org/apache/ecs/filter/StringFilter.java @@ -0,0 +1,145 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.filter; + +import org.apache.ecs.Filter; +import java.text.StringCharacterIterator; +import java.text.CharacterIterator; + +/** + Stupid implementation of Filter interface to demonstrate how easy
+ it is to create your own filters. This should NOT be used in/for
+ anything real. Anyone want to implement a regex filter? + + @version $Id: StringFilter.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public class StringFilter extends java.util.Hashtable implements Filter +{ + + public StringFilter() + { + super(4); + } + + /** Returns the name of the filter */ + public String getInfo() + { + return "StringFilter"; + } + + /** + this method actually performs the filtering. + */ + public String process(String to_process) + { System.out.println("\nString to Process in StringFilter = "+to_process); + String[] value = split(to_process); + StringBuffer new_value = new StringBuffer(); + for(int x = 0; x < value.length; x++) + { + if(hasAttribute(value[x])) + new_value.append((String)get(value[x])); + else + new_value.append(value[x]); + if(x != value.length - 1) + new_value.append(" "); + } + return(new_value.toString()); + } + + /** + Put a filter somewhere we can get to it. + */ + public Filter addAttribute(String attribute,Object entity) + { + put(attribute,entity); + return(this); + } + + /** + Get rid of a current filter. + */ + public Filter removeAttribute(String attribute) + { + try + { + remove(attribute); + } + catch(NullPointerException exc) + { // don't really care if this throws a null pointer exception + } + return(this); + } + + /** + Does the filter filter this? + */ + public boolean hasAttribute(String attribute) + { + return(containsKey(attribute)); + } + + /** + Need a way to parse the stream so we can do string comparisons instead + of character comparisons. + */ + private String[] split(String to_split) + { + + if ( to_split == null || to_split.length() == 0 ) + { + String[] array = new String[0]; + return array; + } + + StringBuffer sb = new StringBuffer(to_split.length()+50); + StringCharacterIterator sci = new StringCharacterIterator(to_split); + int length = 0; + + for (char c = sci.first(); c != CharacterIterator.DONE; c = sci.next()) + { + if(String.valueOf(c).equals(" ")) + length++; + else if(sci.getEndIndex()-1 == sci.getIndex()) + length++; + } + + String[] array = new String[length]; + length = 0; + String tmp = new String(); + for (char c = sci.first(); c!= CharacterIterator.DONE; c = sci.next()) + { + if(String.valueOf(c).equals(" ")) + { + array[length] = tmp; + tmp = new String(); + length++; + } + else if(sci.getEndIndex()-1 == sci.getIndex()) + { + tmp = tmp+String.valueOf(sci.last()); + array[length] = tmp; + tmp = new String(); + length++; + } + else + tmp += String.valueOf(c); + } + return(array); + } +} diff --git a/tools/src/org/apache/ecs/filter/WordFilter.java b/tools/src/org/apache/ecs/filter/WordFilter.java new file mode 100644 index 0000000000..5497690324 --- /dev/null +++ b/tools/src/org/apache/ecs/filter/WordFilter.java @@ -0,0 +1,112 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.filter; + +import org.apache.ecs.Filter; +import java.util.StringTokenizer; + +/** + This filter uses StringTokenizer to create "words" and allow + you to replace on those "words". A word is defined as anything + between two spaces. This filter should be relatively fast and + shows how easy it is to implement your own filters. + +

+    Filter filter = new WordFilter();
+    filter.addAttribute("there","where");
+    filter.addAttribute("it","is");
+    filter.addAttribute("goes","it");
+    P p = new P();
+    p.setFilter(filter);
+    p.addElement("there it goes");
+    System.out.println(p.toString());
+
+ + Produces: <p>where is it + + @version $Id: WordFilter.java,v 1.2 2006/07/30 00:54:03 jjanke Exp $ + @author Stephan Nagy + @author Jon S. Stevens +*/ +public class WordFilter extends java.util.Hashtable implements Filter +{ + public WordFilter() + { + super(4); + } + + /** Returns the name of the filter */ + public String getInfo() + { + return "WordFilter"; + } + + /** + this method actually performs the filtering. + */ + public String process(String to_process) + { + if ( to_process == null || to_process.length() == 0 ) + return ""; + + String tmp = ""; + // the true at the end is the key to making it work + StringTokenizer st = new StringTokenizer(to_process, " ", true); + StringBuffer newValue = new StringBuffer(to_process.length() + 50); + while ( st.hasMoreTokens() ) + { + tmp = st.nextToken(); + if (hasAttribute(tmp)) + newValue.append((String)get(tmp)); + else + newValue.append(tmp); + } + return newValue.toString(); + } + + /** + Put a filter somewhere we can get to it. + */ + public Filter addAttribute(String attribute,Object entity) + { + put(attribute,entity); + return(this); + } + + /** + Get rid of a current filter. + */ + public Filter removeAttribute(String attribute) + { + try + { + remove(attribute); + } + catch(NullPointerException exc) + { // don't really care if this throws a null pointer exception + } + return(this); + } + + /** + Does the filter filter this? + */ + public boolean hasAttribute(String attribute) + { + return(containsKey(attribute)); + } +} diff --git a/tools/src/org/apache/ecs/filter/package.html b/tools/src/org/apache/ecs/filter/package.html new file mode 100644 index 0000000000..37af5ac9a8 --- /dev/null +++ b/tools/src/org/apache/ecs/filter/package.html @@ -0,0 +1,2 @@ + + diff --git a/tools/src/org/apache/ecs/package.html b/tools/src/org/apache/ecs/package.html new file mode 100644 index 0000000000..218bd1d0db --- /dev/null +++ b/tools/src/org/apache/ecs/package.html @@ -0,0 +1,34 @@ + + + + + + + +Provides for.... + +

Package Specification

+ + + +

Related Documentation

+ +For overviews, tutorials, examples, guides, and tool documentation, please see: + + + + + + diff --git a/tools/src/org/apache/ecs/storage/Array.java b/tools/src/org/apache/ecs/storage/Array.java new file mode 100644 index 0000000000..bf2ed22e6b --- /dev/null +++ b/tools/src/org/apache/ecs/storage/Array.java @@ -0,0 +1,169 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.storage; + +import java.io.Serializable; + +public class Array implements java.util.Enumeration, Serializable +{ + private int current = 0; + private int size = 10; + private int grow = 2; + private int place = 0; + private Object[] elements = null; + private Object[] tmpElements = null; + + public Array() + { + init(); + } + + public Array(int size) + { + setSize(size); + init(); + } + + public Array(int size,int grow) + { + setSize(size); + setGrow(grow); + init(); + } + + private void init() + { + elements = new Object[size]; + } + + public Object nextElement() throws java.util.NoSuchElementException + { + if ( elements[place] != null && place != current) + { + place++; + return elements[place - 1]; + } + else + { + place = 0; + throw new java.util.NoSuchElementException(); + } + } + + public boolean hasMoreElements() + { + if( place < elements.length && current != place ) + return true; + return false; + } + + public void setSize(int size) + { + this.size = size; + } + + public int getCurrentSize() + { + return current; + } + + public void rehash() + { + tmpElements = new Object[size]; + int count = 0; + for ( int x = 0; x < elements.length; x++ ) + { + if( elements[x] != null ) + { + tmpElements[count] = elements[x]; + count++; + } + } + elements = (Object[])tmpElements.clone(); + tmpElements = null; + current = count; + } + + public void setGrow(int grow) + { + this.grow = grow; + } + + public void grow() + { + size = size+=(size/grow); + rehash(); + } + + public void add(Object o) + { + if( current == elements.length ) + grow(); + + try + { + elements[current] = o; + current++; + } + catch(java.lang.ArrayStoreException ase) + { + } + } + + public void add(int location,Object o) + { + try + { + elements[location] = o; + } + catch(java.lang.ArrayStoreException ase) + { + } + } + + public void remove(int location) + { + elements[location] = null; + } + + public int location(Object o) throws NoSuchObjectException + { + int loc = -1; + for ( int x = 0; x < elements.length; x++ ) + { + if((elements[x] != null && elements[x] == o )|| + (elements[x] != null && elements[x].equals(o))) + { + loc = x; + break; + } + } + if( loc == -1 ) + throw new NoSuchObjectException(); + return(loc); + } + + public Object get(int location) + { + return elements[location]; + } + + public java.util.Enumeration elements() + { + return this; + } +} diff --git a/tools/src/org/apache/ecs/storage/Hash.java b/tools/src/org/apache/ecs/storage/Hash.java new file mode 100644 index 0000000000..72f361c539 --- /dev/null +++ b/tools/src/org/apache/ecs/storage/Hash.java @@ -0,0 +1,129 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.storage; + +import java.util.Enumeration; + +public class Hash implements java.io.Serializable +{ + private Array keys = new Array(); + private Array elements = new Array(); + + public Hash() + { + } + + public void setSize(int newSize) + { + keys.setSize(newSize); + elements.setSize(newSize); + } + + public void setGrow(int growBy) + { + keys.setGrow(growBy); + elements.setGrow(growBy); + } + + public synchronized void put(String key,Object element) + { + try + { + if( containsKey(key) ) + { + elements.add(keys.location(key),element); + } + else + { + keys.add( key ); + elements.add(element); + } + } + catch(org.apache.ecs.storage.NoSuchObjectException nsoe) + { + } + } + + public synchronized void remove(String key) + { + try + { + if(containsKey(key)) + { + elements.remove(keys.location(key)); + elements.remove(elements.location(key)); + } + } + catch(org.apache.ecs.storage.NoSuchObjectException nsoe) + { + } + } + + public int size() + { + return keys.getCurrentSize(); + } + + public boolean contains(Object element) + { + try + { + elements.location(element); + return(true); + } + catch(org.apache.ecs.storage.NoSuchObjectException noSuchObject) + { + return false; + } + } + + public Enumeration keys() + { + return keys; + } + + public boolean containsKey(String key) + { + try + { + keys.location(key); + } + catch(org.apache.ecs.storage.NoSuchObjectException noSuchObject) + { + return false; + } + return(true); + } + + public Enumeration elements() + { + return elements; + } + + public Object get(String key) + { + try + { + if( containsKey(key) ) + return(elements.get(keys.location(key))); + } + catch(org.apache.ecs.storage.NoSuchObjectException nsoe) + { + } + return null; + } +} diff --git a/tools/src/org/apache/ecs/storage/NoSuchObjectException.java b/tools/src/org/apache/ecs/storage/NoSuchObjectException.java new file mode 100644 index 0000000000..69f97a58c6 --- /dev/null +++ b/tools/src/org/apache/ecs/storage/NoSuchObjectException.java @@ -0,0 +1,26 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.storage; + +public class NoSuchObjectException extends Exception +{ + + public NoSuchObjectException() + { + super("No such object found."); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/a.java b/tools/src/org/apache/ecs/xhtml/a.java new file mode 100644 index 0000000000..88a1758592 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/a.java @@ -0,0 +1,511 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates an <a> tag. + *

+ * Please refer to the TestBed.java file for example code usage. + * + * @version $Id: a.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class a extends MultiPartElement + implements Printable, FocusEvents, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("a"); + setCase (LOWERCASE); // XHTML specific + setAttributeQuote (true); // XHTML specific + setPrettyPrint(false); + } + + public static final String TARGET_BLANK = "_blank"; + public static final String TARGET_PARENT = "_parent"; + public static final String TARGET_SELF = "_self"; + public static final String TARGET_TOP = "_top"; + + /** + * Basic constructor. You need to set the attributes using the set* methods. + */ + public a () + { + } + + /** + * This constructor creates ah <a> tag. + * + * @param href + * the URI that goes between double quotes + */ + public a (String href) + { + setHref (href); + } + + /** + * This constructor creates an <a> tag. + * + * @param href + * the URI that goes between double quotes + * @param value + * what goes between <start_tag> <end_tag> + */ + public a (String href, String value) + { + setHref (href); + addElement (value); + } + + /** + * This constructor creates an <a> tag. + * + * @param href + * the URI that goes between double quotes + * @param value + * what goes between <start_tag> <end_tag> + */ + public a (String href, Element value) + { + setHref (href); + addElement (value); + } + + /** + * This constructor creates an <a> tag. + * + * @param href + * the URI that goes between double quotes + * @param name + * the name="" attribute + * @param value + * what goes between <start_tag> <end_tag> + */ + public a (String href, String name, String value) + { + setHref (href); + setName (name); + addElement (value); + } + + /** + * This constructor creates an <a> tag. + * + * @param href + * the URI that goes between double quotes + * @param name + * the name="" attribute + * @param value + * what goes between <start_tag> <end_tag> + */ + public a (String href, String name, Element value) + { + setHref (href); + setName (name); + addElement (value); + } + + /** + * This constructor creates an <a> tag. + * + * @param href + * the URI that goes between double quotes + * @param name + * the optional name="" attribute + * @param target + * the target="" attribute + * @param value + * the value that goes between <start_tag> <end_tag> + */ + public a (String href, String name, String target, Element value) + { + setHref (href); + if (name != null) + setName (name); + setTarget (target); + addElement (value); + } + + /** + * This constructor creates an <a> tag. + * + * @param href + * the URI that goes between double quotes + * @param name + * the optional name="" attribute + * @param target + * the optional target="" attribute + * @param value + * the value that goes between <start_tag> <end_tag> + */ + public a (String href, String name, String target, String value) + { + setHref (href); + if (name != null) + setName (name); + if (target != null) + setTarget (target); + addElement (value); + } + + /** + * This constructor creates an <a> tag. + * + * @param href + * the URI that goes between double quotes + * @param name + * the optional name="" attribute + * @param target + * the target="" attribute + * @param lang + * the lang="" and xml:lang="" attributes + * @param value + * the value that goes between <start_tag> <end_tag> + */ + public a (String href, String name, String target, String lang, String value) + { + setHref (href); + if (name != null) + setName (name); + setTarget (target); + setLang (lang); + addElement (value); + } + + /** + * This constructor creates an <a> tag. + * + * @param href + * the URI that goes between double quotes + * @param name + * the optional name="" attribute + * @param target + * the target="" attribute + * @param lang + * the lang="" and xml:lang="" attributes + * @param value + * the value that goes between <start_tag> <end_tag> + */ + public a (String href, String name, String target, String lang, Element value) + { + setHref (href); + if (name != null) + setName (name); + setTarget (target); + setLang (lang); + addElement (value); + } + + /** + * Sets the href="" attribute + * + * @param href + * the href="" attribute + */ + public a setHref (String href) + { + addAttribute ("href", href); + return this; + } + + /** + * Sets the name="" attribute + * + * @param name + * the name="" attribute + */ + public a setName (String name) + { + addAttribute ("name", name); + return this; + } + + /** + * Sets the target="" attribute + * + * @param target + * the target="" attribute + */ + public a setTarget (String target) + { + addAttribute ("target", target); + return this; + } + + /** + * Sets the rel="" attribute + * + * @param rel + * the rel="" attribute + */ + public a setRel (String rel) + { + addAttribute ("rel", rel); + return this; + } + + /** + * Sets the rev="" attribute + * + * @param rev + * the rev="" attribute + */ + public a setRev (String rev) + { + addAttribute ("rev", rev); + return this; + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public a addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public a addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public a addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public a addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public a removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onfocus event occurs when an element receives focus either by the + * pointing device or by tabbing navigation. This attribute may be used with + * the following elements: label, input, select, textarea, and button. + * + * @param script script + */ + public void setOnFocus (String script) + { + addAttribute ("onfocus", script); + } + + /** + * The onblur event occurs when an element loses focus either by the + * pointing device or by tabbing navigation. It may be used with the same + * elements as onfocus. + * + * @param script script + */ + public void setOnBlur (String script) + { + addAttribute ("onblur", script); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onnlouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } + + /** + * Determine if this element needs a line break, if pretty printing. + */ + public boolean getNeedLineBreak () + { + java.util.Enumeration en = elements (); + int i = 0; + int j = 0; + while (en.hasMoreElements ()) + { + j++; + Object obj = en.nextElement (); + if (obj instanceof img) + i++; + } + if (i == j) + return false; + return true; + } +} diff --git a/tools/src/org/apache/ecs/xhtml/abbr.java b/tools/src/org/apache/ecs/xhtml/abbr.java new file mode 100644 index 0000000000..5b05157174 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/abbr.java @@ -0,0 +1,259 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates an <abbr> tag. + *

+ * Please refer to the TestBed.java file for example code usage. + * + * @version $Id: abbr.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class abbr extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("abbr"); + setCase (LOWERCASE); // XHTML specific + setAttributeQuote (true); // XHTML specific + } + + /** + * Basic constructor. You need to set the attributes using the set* methods. + */ + public abbr () + { + } + + /** + * This constructor creates an <abbr> tag. + * + * @param element + * Adds an Element to the element. + */ + public abbr (Element element) + { + addElement (element); + } + + /** + * This constructor creates an <abbr> tag. + * + * @param element + * Adds an Element to the element. + */ + public abbr (String element) + { + addElement (element); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public abbr addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public abbr addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public abbr addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public abbr addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public abbr removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onomousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/acronym.java b/tools/src/org/apache/ecs/xhtml/acronym.java new file mode 100644 index 0000000000..1ce174ff46 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/acronym.java @@ -0,0 +1,257 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <acronym> tag. + * + * @version $Id: acronym.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class acronym extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("acronym"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic constructor. + */ + public acronym () + { + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + */ + public acronym (Element element) + { + addElement (element); + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + */ + public acronym (String element) + { + addElement (element); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public acronym addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public acronym addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public acronym addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public acronym addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public acronym removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/address.java b/tools/src/org/apache/ecs/xhtml/address.java new file mode 100644 index 0000000000..c9c627e11f --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/address.java @@ -0,0 +1,257 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <address> tag. + * + * @version $Id: address.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class address extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("address"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic constructor. You need to set the attributes using the set* methods. + */ + public address () + { + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param value + * set the value of <address>value</address> + */ + public address (String value) + { + addElement (value); + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param element + * set the value of <address>value</address> + */ + public address (span element) + { + addElement (element); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public address addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public address addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public address addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public address addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public address removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/applet.java b/tools/src/org/apache/ecs/xhtml/applet.java new file mode 100644 index 0000000000..c9462c62b9 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/applet.java @@ -0,0 +1,351 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates an <applet> tag. + * + * @version $Id: applet.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class applet extends MultiPartElement + implements Printable +{ + + /** + * Private initializer. + */ + { + setElementType ("applet"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Default constructor. Creates the <applet/> Element.
+ * use set* methods. + */ + public applet () + { + } + + /** + * Determines the base url for this applet. + * + * @param url + * base url for this applet. + */ + public applet setCodeBase (String url) + { + addAttribute ("codebase", url); + return (this); + } + + /** + * Comma seperated archive list. + * + * @param url + * Comma seperate archive list. + */ + public applet setArchive (String url) + { + addAttribute ("archive", url); + return (this); + } + + /** + * Applet class file. + * + * @param code + * applet class file. + */ + public applet setCode (String code) + { + addAttribute ("code", code); + return (this); + } + + /** + * Suggested height of applet. + * + * @param height + * suggested link height. + */ + public applet setHeight (String height) + { + addAttribute ("height", height); + return (this); + } + + /** + * Suggested height of applet. + * + * @param height + * suggested link height. + */ + public applet setHeight (int height) + { + addAttribute ("height", Integer.toString (height)); + return (this); + } + + /** + * Suggested height of applet. + * + * @param height + * suggested link height. + */ + public applet setHeight (double height) + { + addAttribute ("height", Double.toString (height)); + return (this); + } + + /** + * Suggested width of applet. + * + * @param width suggested link width. + */ + public applet setWidth (String width) + { + addAttribute ("width", width); + return (this); + } + + /** + * Suggested width of applet. + * + * @param width suggested link width. + */ + public applet setWidth (int width) + { + addAttribute ("width", Integer.toString (width)); + return (this); + } + + /** + * Suggested width of object. + * + * @param width suggested link width. + */ + public applet setWidth (double width) + { + addAttribute ("width", Double.toString (width)); + return (this); + } + + /** + * Suggested horizontal gutter. + * + * @param hspace + * suggested horizontal gutter. + */ + public applet setHSpace (String hspace) + { + addAttribute ("hspace", hspace); + return (this); + } + + /** + * Suggested horizontal gutter. + * + * @param hspace + * suggested horizontal gutter. + */ + public applet setHSpace (int hspace) + { + addAttribute ("hspace", Integer.toString (hspace)); + return (this); + } + + /** + * Suggested horizontal gutter. + * + * @param hspace + * suggested horizontal gutter. + */ + public applet setHSpace (double hspace) + { + addAttribute ("hspace", Double.toString (hspace)); + return (this); + } + + /** + * Suggested vertical gutter. + * + * @param vspace suggested vertical gutter. + */ + public applet setVSpace (String vspace) + { + addAttribute ("vspace", vspace); + return (this); + } + + /** + * Suggested vertical gutter. + * + * @param vspace suggested vertical gutter. + */ + public applet setVSpace (int vspace) + { + addAttribute ("vspace", Integer.toString (vspace)); + return (this); + } + + /** + * Suggested vertical gutter. + * + * @param vspace suggested vertical gutter. + */ + public applet setVSpace (double vspace) + { + addAttribute ("vspace", Double.toString (vspace)); + return (this); + } + + /** + * Set the horizontal or vertical alignment of this applet.
+ * Convience variables are in the AlignTypes interface. + * + * @param alignment + * Set the horizontal or vertical alignment of this applet.
+ * Convience variables are in the AlignTypes interface. + */ + public applet setAlign (String alignment) + { + addAttribute ("align", alignment); + return (this); + } + + /** + * Set the name of this applet. + * + * @param name + * set the name of this applet. + */ + public applet setName (String name) + { + addAttribute ("name", name); + return (this); + } + + /** + * Serialized applet file. + * + * @param object + * Serialized applet file. + */ + // someone give me a better description of what this does. + public applet setObject (String object) + { + addAttribute ("object", object); + return (this); + } + + /** + * Breif description, alternate text for the applet. + * + * @param alt + * alternat text. + */ + public applet setAlt (String alt) + { + addAttribute ("alt", alt); + return (this); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public applet addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public applet addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Add an element to the element + * + * @param element + * a string representation of the element + */ + public applet addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Add an element to the element + * + * @param element + * an element to add + */ + public applet addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public applet removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/area.java b/tools/src/org/apache/ecs/xhtml/area.java new file mode 100644 index 0000000000..6b8eec7536 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/area.java @@ -0,0 +1,443 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <area> tag. + * + * @version $Id: area.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class area extends SinglePartElement + implements Printable, FocusEvents, MouseEvents, KeyEvents +{ + + public static final String DEFAULT = "default"; + + public static final String rect = "rect"; + + public static final String circle = "circle"; + + public static final String poly = "poly"; + /** + * Private initialization routine. + */ + { + setElementType ("area"); + setCase (LOWERCASE); + setAttributeQuote (true); + setBeginEndModifier ('/'); + setNoHref (true); + } + + /** + * Basic constructor. Use the set* methods to set the values of the + * attributes. + */ + public area () + { + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param shape + * the shape="" attribute + */ + public area (String shape) + { + setShape (shape); + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param shape + * the shape="" attribute + * @param coords + * the coords="" attribute + */ + public area (String shape, String coords) + { + setShape (shape); + setCoords (coords); + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param shape + * the shape="" attribute + * @param coords + * the coords="" attribute + */ + public area (String shape, int[] coords) + { + setShape (shape); + setCoords (coords); + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param shape + * the shape="" attribute + * @param coords + * the coords="" attribute + * @param href + * the href="" attribute + */ + public area (String shape, String coords, String href) + { + setShape (shape); + setCoords (coords); + setHref (href); + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param shape + * the shape="" attribute + * @param coords + * the coords="" attribute + * @param href + * the href="" attribute + */ + public area (String shape, int[] coords, String href) + { + setShape (shape); + setCoords (coords); + setHref (href); + } + + /** + * Sets the shape="" attribute + * + * @param shape + * the shape="" attribute + */ + public area setShape (String shape) + { + addAttribute ("shape", shape); + return this; + } + + /** + * Sets the coords="" attribute + * + * @param coords + * the coords="" attribute + */ + public area setCoords (String coords) + { + addAttribute ("coords", coords); + return this; + } + + /** + * Sets the coords="" attribute + * + * @param coords + * the coords="" attribute + */ + public area setCoords (int[] coords) + { + addAttribute ("coords", coords[0] + "," + coords[1] + "," + coords[2] + + "," + coords[3]); + return this; + } + + /** + * Sets the href="" attribute + * + * @param href + * the href="" attribute + */ + public area setHref (String href) + { + addAttribute ("href", href); + setNoHref (false); + return this; + } + + /** + * Sets the alt="" attribute + * + * @param alt + * the alt="" attribute + */ + public area setAlt (String alt) + { + addAttribute ("alt", alt); + return this; + } + + /** + * Sets the tabindex="" attribute + * + * @param index + * the tabindex="" attribute + */ + public area setTabindex (String index) + { + addAttribute ("tabindex", index); + return this; + } + + /** + * Sets the tabindex="" attribute + * + * @param index + * the tabindex="" attribute + */ + public area setTabindex (int index) + { + setTabindex (Integer.toString (index)); + return this; + } + + /** + * Sets the nohref + * + * @param href + * true or false + */ + public area setNoHref (boolean href) + { + if (href == true) + addAttribute ("nohref", "nohref"); + else + removeAttribute ("nohref"); + return (this); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public area addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public area addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Add an element to the element + * + * @param element + * a string representation of the element + */ + public area addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Add an element to the element + * + * @param element + * an element to add + */ + public area addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public area removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onfocus event occurs when an element receives focus either by the + * pointing device or by tabbing navigation. This attribute may be used with + * the following elements: LABEL, INPUT, SELECT, TEXTAREA, and BUTTON. + * + * @param script The script + */ + public void setOnFocus (String script) + { + addAttribute ("onfocus", script); + } + + /** + * The onblur event occurs when an element loses focus either by the + * pointing device or by tabbing navigation. It may be used with the same + * elements as onfocus. + * + * @param script The script + */ + public void setOnBlur (String script) + { + addAttribute ("onblur", script); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/b.java b/tools/src/org/apache/ecs/xhtml/b.java new file mode 100644 index 0000000000..d524bb9442 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/b.java @@ -0,0 +1,258 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <b> tag. + * + * @version $Id: b.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class b extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("b"); + setCase (LOWERCASE); + setAttributeQuote (true); + setPrettyPrint(false); + } + + /** + * Basic constructor. + */ + public b () + { + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + */ + public b (Element element) + { + addElement (element); + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + */ + public b (String element) + { + addElement (element); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public b addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public b addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public b addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public b addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public b removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/base.java b/tools/src/org/apache/ecs/xhtml/base.java new file mode 100644 index 0000000000..213a48612f --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/base.java @@ -0,0 +1,175 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <base> tag. + * + * @version $Id: base.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class base extends SinglePartElement + implements Printable +{ + + /** + * Private initialization routine. + */ + { + setElementType ("base"); + setCase (LOWERCASE); + setAttributeQuote (true); + setBeginEndModifier ('/'); + } + + /** + * Basic constructor. + */ + public base () + { + } + + /** + * Basic constructor. + * + * @param href + * the URI that goes between double quotes + */ + public base (String href) + { + setHref (href); + } + + /** + * Basic constructor. + * + * @param href + * the URI that goes between double quotes + * @param target + * the target that goes between double quotes + */ + public base (String href, String target) + { + setHref (target); + setTarget (target); + } + + /** + * Sets the href="" attribute + * + * @param href + * the URI that goes between double quotes + */ + public base setHref (String href) + { + addAttribute ("href", href); + return this; + } + + /** + * Sets the target="" attribute + * + * @param target + * the URI that goes between double quotes + */ + public base setTarget (String target) + { + addAttribute ("target", target); + return this; + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public base addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public base addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public base addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public base addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public base removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/basefont.java b/tools/src/org/apache/ecs/xhtml/basefont.java new file mode 100644 index 0000000000..05131550f1 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/basefont.java @@ -0,0 +1,398 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <basefont> object. + + @version $Id: basefont.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class basefont extends SinglePartElement implements Printable + +{ + + + + /** + + Private initializer. + + */ + + { + + setElementType("basefont"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + setBeginEndModifier('/'); + + } + + + + /** + + Basic Constructor. use set* methods. + + */ + + public basefont() + + { + + } + + + + /** + + Basic constructor. + + @param face create new basefont object with this face. + + */ + + public basefont(String face) + + { + + setFace(face); + + } + + + + /** + + Basic constructor + + @param face + + @param color + + Create a new BaseFont object with the face abd color already set. Convience colors are defined in HtmlColor interface. + + */ + + public basefont(String face,String color) + + { + + setFace(face); + + setColor(color); + + } + + + + /** + + Basic constructor + + @param face + + @param color + + @param size + + Create a new basefont object with the face,color and size already set. Convience colors are defined in HtmlColor interface. + + */ + + public basefont(String face,String color,int size) + + { + + setFace(face); + + setColor(color); + + setSize(size); + + } + + + + /** + + Basic constructor + + @param size + + Create a new basefont object with the size already set. + + */ + + public basefont(int size,String face) + + { + + setSize(size); + + setFace(face); + + } + + + + /** + + Basic constructor + + @param color + + @param size + + Create a new BaseFont object with the size and color already set. + + */ + + public basefont(String color,int size) + + { + + setSize(size); + + setColor(color); + + } + + + + /** + + sets the face="" attribute. + + @param face sets the face="" attribute. + + */ + + public basefont setFace(String face) + + { + + addAttribute("face",face); + + return(this); + + } + + + + /** + + sets the color="" attribute. + + @param color sets the color="" attribute. Convience colors are defined in the HtmlColors interface. + + */ + + public basefont setColor(String color) + + { + + addAttribute("color",HtmlColor.convertColor(color)); + + return(this); + + } + + + + /** + + sets the size="" attribute. + + @param size sets the size="" attribute. + + */ + + public basefont setSize(int size) + + { + + addAttribute("size",Integer.toString(size)); + + return(this); + + } + + + + /** + + sets the size="" attribute. + + @param size sets the size="" attribute. + + */ + + public basefont setSize(String size) + + { + + addAttribute("size",size); + + return(this); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public basefont addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public basefont addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public basefont addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public basefont addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public basefont removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/bdo.java b/tools/src/org/apache/ecs/xhtml/bdo.java new file mode 100644 index 0000000000..03f51c723a --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/bdo.java @@ -0,0 +1,216 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <bdo></bdo> tag. + + + + @version $Id: bdo.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class bdo extends MultiPartElement implements Printable + +{ + + /** + + Private initialization routine. + + */ + + + + { + + setElementType("bdo"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + + + /** + + Basic Constructor use set* methods. + + */ + + public bdo() + + { + + } + + /** + + Basic Constructor sets the direction for the element. + + @param dir the direction the element should flow LTR|RTL + + */ + + public bdo(String dir) + + { + + setDir(dir); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public bdo addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public bdo addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public bdo addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public bdo addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public bdo removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/big.java b/tools/src/org/apache/ecs/xhtml/big.java new file mode 100644 index 0000000000..46b401fce8 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/big.java @@ -0,0 +1,257 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <big> tag. + * + * @version $Id: big.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class big extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("big"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic constructor. + */ + public big () + { + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + */ + public big (Element element) + { + addElement (element); + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + */ + public big (String element) + { + addElement (element); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public big addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public big addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public big addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public big addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public big removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/blink.java b/tools/src/org/apache/ecs/xhtml/blink.java new file mode 100644 index 0000000000..3cf8823896 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/blink.java @@ -0,0 +1,234 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <blink> tag. + + + + @version $Id: blink.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class blink extends MultiPartElement implements Printable + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("blink"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public blink() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public blink(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public blink(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public blink addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public blink addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public blink addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public blink addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public blink removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/blockquote.java b/tools/src/org/apache/ecs/xhtml/blockquote.java new file mode 100644 index 0000000000..93d8d8074f --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/blockquote.java @@ -0,0 +1,337 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <blockquote> tag. + * + * @version $Id: blockquote.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class blockquote extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("blockquote"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic constructor. + */ + public blockquote () + { + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + */ + public blockquote (Element element) + { + addElement (element); + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + */ + public blockquote (String element) + { + addElement (element); + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + * @param cite + * sets the cite="" attribute. + */ + public blockquote (Element element, String cite) + { + addElement (element); + setCite (cite); + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + * @param cite + * sets the cite="" attribute. + */ + public blockquote (String element, String cite) + { + addElement (element); + setCite (cite); + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + * @param cite + * sets the cite="" attribute. + */ + public blockquote (Element element, Element cite) + { + addElement (element); + setCite (cite); + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + * @param cite + * sets the cite="" attribute. + */ + public blockquote (String element, Element cite) + { + addElement (element); + setCite (cite); + } + + /** + * Sets the CITE="" attribute. + * + * @param cite + * sets the cite="" attribute. + */ + public blockquote setCite (String cite) + { + addAttribute ("cite", cite); + return (this); + } + + /** + * Sets the CITE="" attribute. + * + * @param cite + * sets the cite="" attribute. + */ + public blockquote setCite (Element cite) + { + addAttribute ("cite", cite); + return (this); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public blockquote addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public blockquote addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public blockquote addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public blockquote addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public blockquote removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/body.java b/tools/src/org/apache/ecs/xhtml/body.java new file mode 100644 index 0000000000..4ba6295439 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/body.java @@ -0,0 +1,353 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <body></body> tag. + * + * @version $Id: body.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class body extends MultiPartElement + implements Printable, PageEvents, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("body"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic constructor. Use the set* methods to set the values of the + * attributes. + */ + public body () + { + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param color + * the bgcolor="" attribute + */ + public body (String color) + { + setBgColor (color); + } + + /** + * Sets the bgcolor="" attribute + * + * @param color + * the bgcolor="" attribute + */ + public body setBgColor (String color) + { + addAttribute ("bgcolor", HtmlColor.convertColor (color)); + return this; + } + + /** + * Sets the background="" attribute + * + * @param url + * the background="" attribute + */ + public body setBackground (String url) + { + addAttribute ("background", url); + return this; + } + + /** + * Sets the text="" attribute + * + * @param text + * the text="" attribute + */ + public body setText (String text) + { + addAttribute ("text", text); + return this; + } + + /** + * Sets the link="" attribute + * + * @param color + * the link="" attribute + */ + public body setLink (String color) + { + addAttribute ("link", HtmlColor.convertColor (color)); + return this; + } + + /** + * Sets the vlink="" attribute + * + * @param color + * the vlink="" attribute + */ + public body setVlink (String color) + { + addAttribute ("vlink", HtmlColor.convertColor (color)); + return this; + } + + /** + * Sets the alink="" attribute + * + * @param color + * the alink="" attribute + */ + public body setAlink (String color) + { + addAttribute ("alink", HtmlColor.convertColor (color)); + return this; + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public body addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public body addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public body addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public body addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public body removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onload event occurs when the user agent finishes loading a window or + * all frames within a frameset. This attribute may be used with body and + * frameset elements. + * + * @param script script + */ + public void setOnLoad (String script) + { + addAttribute ("onload", script); + } + + /** + * On Blur + * + * @param script script + */ + public void setOnBlur (String script) + { + addAttribute ("onblur", script); + } + + /** + * The onunload event occurs when the user agent removes a document from a + * window or frame. This attribute may be used with body and frameset + * elements. + * + * @param script script + */ + public void setOnUnload (String script) + { + addAttribute ("onunload", script); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/br.java b/tools/src/org/apache/ecs/xhtml/br.java new file mode 100644 index 0000000000..17a2aee5e9 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/br.java @@ -0,0 +1,270 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <br> tag. + + + + @version $Id: br.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class br extends SinglePartElement implements Printable + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("br"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + setBeginEndModifier('/'); + + } + + + + /** + + Basic constructor. Use the set* methods to set the values + + of the attributes. + + */ + + public br() + + { + + } + + + + /** + + Use the set* methods to set the values + + of the attributes. + + + + @param clear_type the clear="" attribute + + */ + + public br(String clear_type) + + { + + setClear(clear_type); + + } + + + + /** + + Use the set* methods to set the values + + of the attributes. + + + + @param clear_type the clear="" attribute + + @param title the title="" attribute + + */ + + public br(String clear_type, String title) + + { + + setClear(clear_type); + + setTitle(title); + + } + + + + /** + + Sets the clear="" attribute + + @param clear_type the clear="" attribute + + */ + + public br setClear(String clear_type) + + { + + addAttribute("clear",clear_type); + + return this; + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public br addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public br addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public br addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public br addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public br removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/button.java b/tools/src/org/apache/ecs/xhtml/button.java new file mode 100644 index 0000000000..9991fa2c1a --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/button.java @@ -0,0 +1,337 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <button> tag. + * + * @version $Id: button.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class button extends MultiPartElement + implements Printable, FocusEvents, MouseEvents, KeyEvents +{ + + // convience variables + public final static String TYPE_RESET = "reset"; + + public final static String TYPE_SUBMIT = "submit"; + + public final static String TYPE_BUTTON = "button"; + + /** + * private initializaer. + */ + { + setElementType ("button"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + public button () + { + } + + /** + * Set the name of this button. + * + * @param name + * set the name of this button. + */ + public button setName (String name) + { + addAttribute ("name", name); + return (this); + } + + /** + * Set the value of this button. + * + * @param value + * set the value of this button. + */ + public button setValue (String value) + { + addAttribute ("value", value); + return (this); + } + + /** + * Set the type of button this is. Convience variables are
+ * button.submit
+ * button.reset
+ * button.button + * + * @param type type. + */ + public button setType (String type) + { + addAttribute ("type", type); + return (this); + } + + /** + * Is this button disabled? disabled true|false + */ + public button setDisabled (boolean disabled) + { + if (disabled) + addAttribute ("disabled", "disabled"); + else + removeAttribute ("disabled"); + return (this); + } + + /** + * Set the elements position in the tabbing order. + * + * @param number + * set the elements position in the tabbing order. + */ + public button setTabIndex (int number) + { + addAttribute ("tabindex", Integer.toString (number)); + return (this); + } + + /** + * Set the elements position in the tabbing order. + * + * @param number + * set the elements position in the tabbing order. + */ + public button setTabIndex (String number) + { + addAttribute ("tabindex", number); + return (this); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public button addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public button addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public button addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public button addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public button removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onfocus event occurs when an element receives focus either by the + * pointing device or by tabbing navigation. This attribute may be used with + * the following elements: LABEL, INPUT, SELECT, TEXTAREA, and BUTTON. + * + * @param script script + */ + public void setOnFocus (String script) + { + addAttribute ("onfocus", script); + } + + /** + * The onblur event occurs when an element loses focus either by the + * pointing device or by tabbing navigation. It may be used with the same + * elements as onfocus. + * + * @param script script + */ + public void setOnBlur (String script) + { + addAttribute ("onblur", script); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/caption.java b/tools/src/org/apache/ecs/xhtml/caption.java new file mode 100644 index 0000000000..26e16e7ab1 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/caption.java @@ -0,0 +1,247 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <caption> tag. + * + * @version $Id: caption.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class caption extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initializer. + */ + { + setElementType ("caption"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic construtor use set* methods. + */ + public caption () + { + } + + /** + * Set the align="" attribute. + * + * @param align + * set the align="" attribute + */ + public caption setAlign (String align) + { + addAttribute ("align", align); + return (this); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public caption addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public caption addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Add an element to the element + * + * @param element + * a string representation of the element + */ + public caption addElement (String element) + { + addElementToRegistry (Integer.toString (element.hashCode ()), element); + return (this); + } + + /** + * Add an element to the element + * + * @param element + * an element to add + */ + public caption addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public caption removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/center.java b/tools/src/org/apache/ecs/xhtml/center.java new file mode 100644 index 0000000000..651b5c1f07 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/center.java @@ -0,0 +1,440 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <center> tag. + + + + @version $Id: center.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class center extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("center"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public center() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public center(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public center(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public center addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public center addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public center addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public center addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public center removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/cite.java b/tools/src/org/apache/ecs/xhtml/cite.java new file mode 100644 index 0000000000..b83d64b25a --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/cite.java @@ -0,0 +1,440 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <cite> tag. + + + + @version $Id: cite.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class cite extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("cite"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public cite() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public cite(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public cite(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public cite addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public cite addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public cite addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public cite addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public cite removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/code.java b/tools/src/org/apache/ecs/xhtml/code.java new file mode 100644 index 0000000000..642181faf3 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/code.java @@ -0,0 +1,258 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <code> tag. + * + * @version $Id: code.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class code extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("code"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic constructor. + */ + public code () + { + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + */ + public code (Element element) + { + addElement (element); + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + */ + public code (String element) + { + addElement (element); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public code addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public code addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public code addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public code addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public code removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/col.java b/tools/src/org/apache/ecs/xhtml/col.java new file mode 100644 index 0000000000..ce8d04dc20 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/col.java @@ -0,0 +1,376 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <col> object. + + + + @version $Id: col.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class col extends SinglePartElement implements Printable + +{ + + /** + + private initializer. + + */ + + { + + setElementType("col"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + setBeginEndModifier('/'); + + } + + public col() + + { + + } + + + + /** + + Sets the span="" attribute. + + @param span sets the span="" attribute. + + */ + + public col setSpan(String span) + + { + + addAttribute("span",span); + + return(this); + + } + + + + /** + + Sets the span="" attribute. + + @param span sets the span="" attribute. + + */ + + public col setSpan(int span) + + { + + addAttribute("span",Integer.toString(span)); + + return(this); + + } + + + + /** + + Supplies user agents with a recommended cell width. (Pixel Values) + + @param width how many pixels to make cell + + */ + + public col setWidth(int width) + + { + + addAttribute("width",Integer.toString(width)); + + return(this); + + } + + + + /** + + Supplies user agents with a recommended cell width. (Pixel Values) + + @param width how many pixels to make cell + + */ + + public col setWidth(String width) + + { + + addAttribute("width",width); + + return(this); + + } + + + + /** + + Sets the align="" attribute convience variables are provided in the AlignType interface + + @param align Sets the align="" attribute + + */ + + public col setAlign(String align) + + { + + addAttribute("align",align); + + return(this); + + } + + + + /** + + Sets the valign="" attribute convience variables are provided in the AlignType interface + + @param valign Sets the valign="" attribute + + */ + + public col setVAlign(String valign) + + { + + addAttribute("valign",valign); + + return(this); + + } + + + + /** + + Sets the char="" attribute. + + @param character the character to use for alignment. + + */ + + public col setChar(String character) + + { + + addAttribute("char",character); + + return(this); + + } + + + + /** + + Sets the charoff="" attribute. + + @param char_off When present this attribute specifies the offset + + of the first occurrence of the alignment character on each line. + + */ + + public col setCharOff(int char_off) + + { + + addAttribute("charoff",Integer.toString(char_off)); + + return(this); + + } + + + + /** + + Sets the charoff="" attribute. + + @param char_off When present this attribute specifies the offset + + of the first occurrence of the alignment character on each line. + + */ + + public col setCharOff(String char_off) + + { + + addAttribute("charoff",char_off); + + return(this); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public col addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public col addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public col addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public col addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public col removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/colgroup.java b/tools/src/org/apache/ecs/xhtml/colgroup.java new file mode 100644 index 0000000000..e1796d79ea --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/colgroup.java @@ -0,0 +1,374 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <colgroup> object. + + + + @version $Id: colgroup.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class colgroup extends MultiPartElement implements Printable + +{ + + /** + + private initializer. + + */ + + { + + setElementType("colgroup"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + public colgroup() + + { + + } + + + + /** + + Sets the span="" attribute. + + @param span sets the span="" attribute. + + */ + + public colgroup setSpan(String span) + + { + + addAttribute("span",span); + + return(this); + + } + + + + /** + + Sets the span="" attribute. + + @param span sets the span="" attribute. + + */ + + public colgroup setSpan(int span) + + { + + addAttribute("span",Integer.toString(span)); + + return(this); + + } + + + + /** + + Supplies user agents with a recommended cell width. (Pixel Values) + + @param width how many pixels to make cell + + */ + + public colgroup setWidth(int width) + + { + + addAttribute("width",Integer.toString(width)); + + return(this); + + } + + + + /** + + Supplies user agents with a recommended cell width. (Pixel Values) + + @param width how many pixels to make cell + + */ + + public colgroup setWidth(String width) + + { + + addAttribute("width",width); + + return(this); + + } + + + + /** + + Sets the align="" attribute convience variables are provided in the AlignType interface + + @param align Sets the align="" attribute + + */ + + public colgroup setAlign(String align) + + { + + addAttribute("align",align); + + return(this); + + } + + + + /** + + Sets the valign="" attribute convience variables are provided in the AlignType interface + + @param valign Sets the valign="" attribute + + */ + + public colgroup setVAlign(String valign) + + { + + addAttribute("valign",valign); + + return(this); + + } + + + + /** + + Sets the char="" attribute. + + @param character the character to use for alignment. + + */ + + public colgroup setChar(String character) + + { + + addAttribute("char",character); + + return(this); + + } + + + + /** + + Sets the charoff="" attribute. + + @param char_off When present this attribute specifies the offset + + of the first occurrence of the alignment character on each line. + + */ + + public colgroup setCharOff(int char_off) + + { + + addAttribute("charoff",Integer.toString(char_off)); + + return(this); + + } + + + + /** + + Sets the charoff="" attribute. + + @param char_off When present this attribute specifies the offset + + of the first occurrence of the alignment character on each line. + + */ + + public colgroup setCharOff(String char_off) + + { + + addAttribute("charoff",char_off); + + return(this); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public colgroup addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public colgroup addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public colgroup addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public colgroup addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public colgroup removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/comment.java b/tools/src/org/apache/ecs/xhtml/comment.java new file mode 100644 index 0000000000..551e7fb5fb --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/comment.java @@ -0,0 +1,269 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * + * This class defines a comment <-- value --> Element. + * + * @version $Id: comment.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * + * @author Stephan Nagy + * + * @author Jon S. Stevens + * + * @author Bojan Smojver + * + */ + +public class comment extends MultiPartElement implements Printable +{ + + /** + * + * private initializer. + * + */ + + { + + setElementType("--"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + setBeginStartModifier('!'); + + } + + /** + * + * methods. + * + */ + + public comment() + { + + } + + /** + * + * Create a comment object containg this element. + * + */ + + public comment(String element) + { + + addElement(element); + + } + + /** + * + * Create a comment object containg this element. + * + */ + + public comment(Element element) + { + + addElement(element); + + } + + /** + * + * Sets the lang="" and xml:lang="" attributes + * + * @param lang the lang="" and xml:lang="" attributes + * + */ + + public Element setLang(String lang) + { + + addAttribute("lang", lang); + + addAttribute("xml:lang", lang); + + return this; + + } + + /** + * + * Adds an Element to the element. + * + * @param hashcode name of element for hash table + * + * @param element Adds an Element to the element. + * + */ + + public comment addElement(String hashcode, Element element) + { + + addElementToRegistry(hashcode, element); + + return (this); + + } + + /** + * + * Adds an Element to the element. + * + * @param hashcode name of element for hash table + * + * @param element Adds an Element to the element. + * + */ + + public comment addElement(String hashcode, String element) + { + + addElementToRegistry(hashcode, element); + + return (this); + + } + + /** + * + * Adds an Element to the element. + * + * @param element Adds an Element to the element. + * + */ + + public comment addElement(Element element) + { + + addElementToRegistry(element); + + return (this); + + } + + /** + * + * Adds an Element to the element. + * + * @param element Adds an Element to the element. + * + */ + + public comment addElement(String element) + { + + addElementToRegistry(element); + + return (this); + + } + + /** + * + * Removes an Element from the element. + * + * @param hashcode the name of the element to be removed. + * + */ + + public comment removeElement(String hashcode) + { + + removeElementFromRegistry(hashcode); + + return (this); + + } + + protected String createStartTag() + { + + setEndTagChar(' '); + + StringBuffer out = new StringBuffer(); + + out.append(getStartTagChar()); + + if (getBeginStartModifierDefined()) + { + + out.append(getBeginStartModifier()); + + } + + out.append(getElementType()); + + if (getBeginEndModifierDefined()) + { + + out.append(getBeginEndModifier()); + + } + + out.append(getEndTagChar()); + + setEndTagChar('>'); // put back the end tag character. + + return (out.toString()); + + } + + protected String createEndTag() + { + + StringBuffer out = new StringBuffer(); + + setStartTagChar(' '); + + setEndStartModifier(' '); + + out.append(getStartTagChar()); + + if (getEndStartModifierDefined()) + { + + out.append(getEndStartModifier()); + + } + + out.append(getElementType()); + + if (getEndEndModifierDefined()) + { + + out.append(getEndEndModifier()); + + } + + out.append(getEndTagChar()); + + setStartTagChar('<'); // put back the tag start character + + return (out.toString()); + + } + +} diff --git a/tools/src/org/apache/ecs/xhtml/dd.java b/tools/src/org/apache/ecs/xhtml/dd.java new file mode 100644 index 0000000000..bee6de048d --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/dd.java @@ -0,0 +1,420 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <dd> tag. + + + + @version $Id: dd.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class dd extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("dd"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. Use setValue() if needed. + + */ + + public dd() + + { + + } + + + + /** + + Sets the value after the <dd> tag + + @param value the value after the <dd> tag + + */ + + public dd(String value) + + { + + addElement(value); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public dd addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public dd addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public dd addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public dd addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public dd removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/del.java b/tools/src/org/apache/ecs/xhtml/del.java new file mode 100644 index 0000000000..bf04dce3d7 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/del.java @@ -0,0 +1,446 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <del> tag. + + + + @version $Id: del.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class del extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initializer. + + */ + + { + + setElementType("del"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + + + /** + + Default constructor use set* methods. + + */ + + public del() + + { + + } + + + + /** + + Set the url that designates a source doument or message. + + @param url set the url that designates a source document or message. + + */ + + public del setCite(String url) + + { + + addAttribute("cite",url); + + return(this); + + } + + + + /** + + Sets the date and time the change was made. + + @param datetime the date and time the change was made. + + */ + + public del setDateTime(String datetime) + + { + + addAttribute("datetime",datetime); + + return(this); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public del addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public del addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public del addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public del addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public del removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/dfn.java b/tools/src/org/apache/ecs/xhtml/dfn.java new file mode 100644 index 0000000000..74257e1710 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/dfn.java @@ -0,0 +1,440 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <dfn> tag. + + + + @version $Id: dfn.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class dfn extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("dfn"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public dfn() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public dfn(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public dfn(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public dfn addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public dfn addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public dfn addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public dfn addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public dfn removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/div.java b/tools/src/org/apache/ecs/xhtml/div.java new file mode 100644 index 0000000000..a2dd89611d --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/div.java @@ -0,0 +1,450 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <div> tag. + + + + @version $Id: div.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class div extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("div"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + + + /** + + Basic constructor. You need to set the attributes using the + + set* methods. + + */ + + public div() + + { + + } + + + + /** + + Use the set* methods to set the values + + of the attributes. + + @param value set the value of <div>value</div> + + */ + + public div(String value) + + { + + addElement(value); + + } + + + + /** + + Use the set* methods to set the values + + of the attributes. + + + + @param element set the value of <div>value</div> + + */ + + public div(span element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public div addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public div addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public div addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public div addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public div removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/dl.java b/tools/src/org/apache/ecs/xhtml/dl.java new file mode 100644 index 0000000000..eb272582ad --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/dl.java @@ -0,0 +1,406 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <dl> tag. + + + + @version $Id: dl.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class dl extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("dl"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + + + /** + + Basic constructor. + + */ + + public dl() + + { + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public dl addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public dl addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public dl addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public dl addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public dl removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/dt.java b/tools/src/org/apache/ecs/xhtml/dt.java new file mode 100644 index 0000000000..283ae49dd5 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/dt.java @@ -0,0 +1,424 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <dt> tag. + + + + @version $Id: dt.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class dt extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("dt"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + + + /** + + Basic constructor. Use setValue() if needed. + + */ + + public dt() + + { + + } + + + + /** + + Sets the value after the <dt> tag + + @param value the value after the <dt> tag + + */ + + public dt(String value) + + { + + addElement(value); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public dt addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public dt addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public dt addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public dt addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public dt removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/em.java b/tools/src/org/apache/ecs/xhtml/em.java new file mode 100644 index 0000000000..92cde99818 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/em.java @@ -0,0 +1,442 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates an <em> tag. + + + + @version $Id: em.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class em extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("em"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public em() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public em(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public em(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public em addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public em addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public em addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public em addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public em removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/fieldset.java b/tools/src/org/apache/ecs/xhtml/fieldset.java new file mode 100644 index 0000000000..929798d274 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/fieldset.java @@ -0,0 +1,442 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <fieldset> tag. + + + + @version $Id: fieldset.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class fieldset extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + private initializer. + + */ + + { + + setElementType("fieldset"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + + + /** + + Basic constructor. Use set* methods. + + */ + + public fieldset() + + { + + } + + + + /** + + Basic Constructor use set* methods. + + @param element an element to add + + */ + + public fieldset(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic Constructor use set* methods. + + @param element an element to add + + */ + + public fieldset(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public fieldset addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public fieldset addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public fieldset addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public fieldset addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public fieldset removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/font.java b/tools/src/org/apache/ecs/xhtml/font.java new file mode 100644 index 0000000000..1f45af899a --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/font.java @@ -0,0 +1,418 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <font> object. + + @version $Id: font.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class font extends MultiPartElement implements Printable + +{ + + + + /** + + Private initializer. + + */ + + { + + setElementType("font"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + + + /** + + Basic Constructor. use set* methods. + + */ + + public font() + + { + + } + + + + /** + + Basic constructor. + + @param face create new font object with this face. + + */ + + public font(String face) + + { + + setFace(face); + + } + + + + /** + + Basic constructor + + @param face + + @param color + + Create a new font object with the face abd color already set. Convience colors are defined in HtmlColor interface. + + */ + + public font(String face,String color) + + { + + setFace(face); + + setColor(color); + + } + + + + /** + + Basic constructor + + @param face + + @param color + + @param size + + Create a new font object with the face,color and size already set. Convience colors are defined in HtmlColor interface. + + */ + + public font(String face,String color,int size) + + { + + setFace(face); + + setColor(color); + + setSize(size); + + } + + + + /** + + Basic constructor + + @param size + + Create a new font object with the size already set. + + */ + + public font(int size) + + { + + setSize(size); + + } + + + + /** + + Basic constructor + + @param size + + @param face + + Create a new font object with the size and face already set. + + */ + + public font(int size,String face) + + { + + setSize(size); + + setFace(face); + + } + + + + /** + + Basic constructor + + @param color + + @param size + + Create a new font object with the size and color already set. + + */ + + public font(String color,int size) + + { + + setSize(size); + + setColor(color); + + } + + + + /** + + sets the face="" attribute. + + @param face sets the face="" attribute. + + */ + + public font setFace(String face) + + { + + addAttribute("face",face); + + return(this); + + } + + + + /** + + sets the color="" attribute. + + @param color sets the color="" attribute. Convience colors are defined in the HtmlColors interface. + + */ + + public font setColor(String color) + + { + + addAttribute("color",HtmlColor.convertColor(color)); + + return(this); + + } + + + + /** + + sets the size="" attribute. + + @param size sets the size="" attribute. + + */ + + public font setSize(int size) + + { + + addAttribute("size",Integer.toString(size)); + + return(this); + + } + + + + /** + + sets the size="" attribute. + + @param size sets the size="" attribute. + + */ + + public font setSize(String size) + + { + + addAttribute("size",size); + + return(this); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public font addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public font addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the Element. + + @param element adds and Element to the Element. + + */ + + public font addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the Element. + + @param element adds and Element to the Element. + + */ + + public font addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public font removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/form.java b/tools/src/org/apache/ecs/xhtml/form.java new file mode 100644 index 0000000000..0c0b3b8219 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/form.java @@ -0,0 +1,464 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <form> tag. + * + * @version $Id: form.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class form extends MultiPartElement + implements Printable, FormEvents, MouseEvents, KeyEvents +{ + + public static final String METHOD_GET = "get"; + + public static final String METHOD_POST = "post"; + + public static final String ENC_DEFAULT = "application/x-www-form-urlencoded"; + + public static final String ENC_UPLOAD = "multipart/form-data"; + /** + * Private initialization routine. + */ + { + setElementType ("form"); + setCase (LOWERCASE); + setAttributeQuote (true); + setEncType (ENC_DEFAULT); + setMethod(METHOD_POST); + // Only accepted by NN6 + // setAcceptCharset ("utf-8"); + } + + /** + * Default URL Encoded utf-8 Post form + * Basic constructor. You need to set the attributes using the set* methods. + */ + public form () + { + } + + /** + * Default URL Encoded utf-8 Post form + * Use the set* methods to set the values of the attributes. + * + * @param element + * set the value of <form>value</form> + */ + public form (Element element) + { + addElement (element); + } + + /** + * Default URL Encoded utf-8 Post form + * Use the set* methods to set the values of the attributes. + * + * @param action + * set the value of action="" + */ + public form (String action) + { + setAction (action); + } + + /** + * Default URL Encoded utf-8 Post form + * Use the set* methods to set the values of the attributes. + * + * @param element + * set the value of <form>value</form> + * @param action + * set the value of action="" + */ + public form (String action, Element element) + { + addElement (element); + setAction (action); + } + + /** + * Default URL Encoded utf-8 form + * Use the set* methods to set the values of the attributes. + * + * @param action + * set the value of action="" + * @param method + * set the value of method="" + * @param element + * set the value of <form>value</form> + */ + public form (String action, String method, Element element) + { + addElement (element); + setAction (action); + setMethod (method); + } + + /** + * Default URL Encoded utf-8 form + * Use the set* methods to set the values of the attributes. + * + * @param action + * set the value of action="" + * @param method + * set the value of method="" + */ + public form (String action, String method) + { + setAction (action); + setMethod (method); + } + + /** + * Default utf-8 form + * Use the set* methods to set the values of the attributes. + * + * @param action + * set the value of action="" + * @param method + * set the value of method="" + * @param enctype + * set the value of enctype="" + */ + public form (String action, String method, String enctype) + { + setAction (action); + setMethod (method); + setEncType (enctype); + } + + /** + * Sets the action="" attribute + * + * @param action + * the action="" attribute + */ + public form setAction (String action) + { + addAttribute ("action", action); + return this; + } + + /** + * Sets the method="" attribute + * + * @param method + * the method="" attribute + */ + public form setMethod (String method) + { + addAttribute ("method", method); + return this; + } + + /** + * Sets the enctype="" attribute + * + * @param enctype + * the enctype="" attribute + */ + public form setEncType (String enctype) + { + addAttribute ("enctype", enctype); + return this; + } + + /** + * Sets the accept="" attribute + * + * @param accept + * the accept="" attribute + */ + public form setAccept (String accept) + { + addAttribute ("accept", accept); + return this; + } + + /** + * Sets the name="" attribute + * + * @param name + * the name="" attribute + */ + public form setName (String name) + { + addAttribute ("name", name); + return this; + } + + /** + * Sets the target="" attribute + * + * @param target the target="" attribute + */ + public form setTarget (String target) + { + addAttribute ("target", target); + return this; + } + + /** + * Sets the accept-charset="" attribute + * Only NN + * + * @ p ara m accept the accept-charset="" attribute + * + public form setAcceptCharset (String acceptcharset) + { + addAttribute ("accept-charset", acceptcharset); + return this; + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public form addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public form addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public form addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public form addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public form removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onsubmit event occurs when a form is submitted. It only applies to + * the FORM element. + * + * @param script script + */ + public void setOnSubmit (String script) + { + addAttribute ("onsubmit", script); + } + + /** + * The onreset event occurs when a form is reset. It only applies to the + * FORM element. + * + * @param script script + */ + public void setOnReset (String script) + { + addAttribute ("onreset", script); + } + + /** + * The onselect event occurs when a user selects some text in a text field. + * This attribute may be used with the input and textarea elements. + * + * @param script script + */ + public void setOnSelect (String script) + { + addAttribute ("onselect", script); + } + + /** + * The onchange event occurs when a control loses the input focus and its + * value has been modified since gaining focus. This attribute applies to + * the following elements: input, select, and textarea. + * + * @param script script + */ + public void setOnChange (String script) + { + addAttribute ("onchange", script); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/frame.java b/tools/src/org/apache/ecs/xhtml/frame.java new file mode 100644 index 0000000000..f056c89a48 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/frame.java @@ -0,0 +1,554 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <frame> tag. + + + + @version $Id: frame.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class frame extends MultiPartElement implements Printable + +{ + + public final static String yes = "yes"; + + public final static String no = "no"; + + public final static String auto = "auto"; + + + + /** + + Private initialization routine. + + */ + + { + + setElementType("frame"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public frame() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public frame(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public frame(String element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + @param name the name="" attribute + + */ + + public frame(Element element, String name) + + { + + addElement(element); + + setName(name); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + @param name the name="" attribute + + */ + + public frame(String element, String name) + + { + + addElement(element); + + setName(name); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + @param name the nama="" attribute + + @param src the src="" attribute + + */ + + public frame(Element element, String name, String src) + + { + + addElement(element); + + setName(name); + + setSrc(src); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + @param name the name="" attribute + + @param src the src="" attribute + + */ + + public frame(String element, String name, String src) + + { + + addElement(element); + + setName(name); + + setSrc(src); + + } + + + + /** + + Sets the longdesc="" attribute + + @param longdesc the longdesc="" attribute + + */ + + public frame setLongDesc(String longdesc) + + { + + addAttribute("longdesc",longdesc); + + return this; + + } + + + + /** + + Sets the name="" attribute + + @param name the name="" attribute + + */ + + public frame setName(String name) + + { + + addAttribute("name",name); + + return this; + + } + + + + /** + + Sets the src="" attribute + + @param src the src="" attribute + + */ + + public frame setSrc(String src) + + { + + addAttribute("src",src); + + return this; + + } + + + + /** + + Sets the frameborder="" attribute + + @param frameborder the frameborder="" attribute + + */ + + public frame setFrameBorder(boolean frameborder) + + { + + if (frameborder) + + addAttribute("frameborder",Integer.toString(1)); + + else + + addAttribute("frameborder",Integer.toString(0)); + + return this; + + } + + + + /** + + Sets the marginwidth="" attribute + + @param marginwidth the marginwidth="" attribute + + */ + + public frame setMarginWidth(int marginwidth) + + { + + setMarginWidth(Integer.toString(marginwidth)); + + return this; + + } + + + + /** + + Sets the marginwidth="" attribute + + @param marginwidth the marginwidth="" attribute + + */ + + public frame setMarginWidth(String marginwidth) + + { + + addAttribute("marginwidth",marginwidth); + + return this; + + } + + + + /** + + Sets the marginheight="" attribute + + @param marginheight the marginheight="" attribute + + */ + + public frame setMarginHeight(int marginheight) + + { + + setMarginHeight(Integer.toString(marginheight)); + + return this; + + } + + + + /** + + Sets the marginheight="" attribute + + @param marginheight the marginheight="" attribute + + */ + + public frame setMarginHeight(String marginheight) + + { + + addAttribute("marginheight",marginheight); + + return this; + + } + + + + /** + + Sets the scrolling="" attribute + + @param scrolling the scrolling="" attribute + + */ + + public frame setScrolling(String scrolling) + + { + + addAttribute("scrolling",scrolling); + + return this; + + } + + + + /** + + Sets the noresize value + + @param noresize true or false + + */ + + public frame setNoResize(boolean noresize) + + { + + if ( noresize == true ) + + addAttribute("noresize", "noresize"); + + else + + removeAttribute("noresize"); + + + + return(this); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public frame addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public frame addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public frame addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public frame addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public frame removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/frameset.java b/tools/src/org/apache/ecs/xhtml/frameset.java new file mode 100644 index 0000000000..094cd910fb --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/frameset.java @@ -0,0 +1,436 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <frameset> tag. + + + + @version $Id: frameset.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class frameset extends MultiPartElement implements Printable, PageEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("frameset"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + + + /** + + Basic constructor. + + */ + + public frameset() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public frameset(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public frameset(String element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param rows Sets the rows="" attribute + + @param cols Sets the cols="" attribute + + */ + + public frameset(String rows, String cols) + + { + + setRows(rows); + + setCols(cols); + + } + + + + /** + + Basic constructor. + + @param rows Sets the rows="" attribute + + @param cols Sets the cols="" attribute + + @param element Adds an Element to the element. + + */ + + public frameset(String rows, String cols, Element element) + + { + + addElement(element); + + setRows(rows); + + setCols(cols); + + } + + + + /** + + Basic constructor. + + @param rows Sets the rows="" attribute + + @param cols Sets the cols="" attribute + + @param element Adds an Element to the element. + + */ + + public frameset(String rows, String cols, String element) + + { + + addElement(element); + + setRows(rows); + + setCols(cols); + + } + + + + /** + + Sets the rows="" attribute + + @param rows Sets the rows="" attribute + + */ + + public frameset setRows(int rows) + + { + + setRows(Integer.toString(rows)); + + return(this); + + } + + + + /** + + Sets the rows="" attribute + + @param rows Sets the rows="" attribute + + */ + + public frameset setRows(String rows) + + { + + addAttribute("rows",rows); + + return(this); + + } + + + + /** + + Sets the cols="" attribute + + @param cols Sets the cols="" attribute + + */ + + public frameset setCols(int cols) + + { + + setCols(Integer.toString(cols)); + + return(this); + + } + + + + /** + + Sets the cols="" attribute + + @param cols Sets the cols="" attribute + + */ + + public frameset setCols(String cols) + + { + + addAttribute("cols",cols); + + return(this); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public frameset addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public frameset addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public frameset addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public frameset addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public frameset removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onload event occurs when the user agent finishes loading a window + + or all frames within a frameset. This attribute may be used with body + + and frameset elements. + + + + @param The script + + */ + + public void setOnLoad(String script) + + { + + addAttribute ( "onload", script ); + + } + + + + /** + + The onunload event occurs when the user agent removes a document from a + + window or frame. This attribute may be used with body and frameset + + elements. + + + + @param The script + + */ + + public void setOnUnload(String script) + + { + + addAttribute ( "onunload", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/h1.java b/tools/src/org/apache/ecs/xhtml/h1.java new file mode 100644 index 0000000000..ad89bde9c8 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/h1.java @@ -0,0 +1,268 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <h1> tag. + * + * @version $Id: h1.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class h1 extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("h1"); + setCase (LOWERCASE); + setAttributeQuote (true); + setPrettyPrint (false); + } + + /** + * Basic constructor. You need to set the attributes using the set* methods. + */ + public h1 () + { + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param element + * set the value of <h1>value</h1> + */ + public h1 (Element element) + { + addElement (element); + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param value + * set the value of <h1>value</h1> + */ + public h1 (String value) + { + addElement (value); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public h1 addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public h1 addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public h1 addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public h1 addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public h1 removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/h2.java b/tools/src/org/apache/ecs/xhtml/h2.java new file mode 100644 index 0000000000..61236943ec --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/h2.java @@ -0,0 +1,268 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <h2> tag. + * + * @version $Id: h2.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class h2 extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("h2"); + setCase (LOWERCASE); + setAttributeQuote (true); + setPrettyPrint(false); + } + + /** + * Basic constructor. You need to set the attributes using the set* methods. + */ + public h2 () + { + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param value + * set the value of <h2>value</h2> + */ + public h2 (Element element) + { + addElement (element); + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param value + * set the value of <h1>value</h1> + */ + public h2 (String value) + { + addElement (value); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public h2 addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public h2 addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + public h2 addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public h2 addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public h2 removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/h3.java b/tools/src/org/apache/ecs/xhtml/h3.java new file mode 100644 index 0000000000..68d3d861e4 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/h3.java @@ -0,0 +1,268 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <h3> tag. + * + * @version $Id: h3.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class h3 extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("h3"); + setCase (LOWERCASE); + setAttributeQuote (true); + setPrettyPrint (false); + } + + /** + * Basic constructor. You need to set the attributes using the set* methods. + */ + public h3 () + { + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param element + * set the value of <h3>value</h3> + */ + public h3 (Element element) + { + addElement (element); + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param value + * set the value of <h3>value</h3> + */ + public h3 (String value) + { + addElement (value); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public h3 addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public h3 addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public h3 addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public h3 addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public h3 removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/h4.java b/tools/src/org/apache/ecs/xhtml/h4.java new file mode 100644 index 0000000000..8f0f61ade3 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/h4.java @@ -0,0 +1,268 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <h4> tag. + * + * @version $Id: h4.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class h4 extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("h4"); + setCase (LOWERCASE); + setAttributeQuote (true); + setPrettyPrint(false); + } + + /** + * Basic constructor. You need to set the attributes using the set* methods. + */ + public h4 () + { + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param element + * set the value of <h4>value</h4> + */ + public h4 (Element element) + { + addElement (element); + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param value + * set the value of <h4>value</h4> + */ + public h4 (String value) + { + addElement (value); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public h4 addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public h4 addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public h4 addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public h4 addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public h4 removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/h5.java b/tools/src/org/apache/ecs/xhtml/h5.java new file mode 100644 index 0000000000..9d86a49610 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/h5.java @@ -0,0 +1,450 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <h5> tag. + + + + @version $Id: h5.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class h5 extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("h5"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. You need to set the attributes using the + + set* methods. + + */ + + public h5() + + { + + } + + + + /** + + Use the set* methods to set the values + + of the attributes. + + + + @param element set the value of <h5>value</h5> + + */ + + public h5(Element element) + + { + + addElement(element); + + } + + + + /** + + Use the set* methods to set the values + + of the attributes. + + + + @param value set the value of <h5>value</h5> + + */ + + public h5(String value) + + { + + addElement(value); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public h5 addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public h5 addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public h5 addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public h5 addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public h5 removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/h6.java b/tools/src/org/apache/ecs/xhtml/h6.java new file mode 100644 index 0000000000..08b13ac877 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/h6.java @@ -0,0 +1,452 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <h6> tag. + + + + @version $Id: h6.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class h6 extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("h6"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. You need to set the attributes using the + + set* methods. + + */ + + public h6() + + { + + } + + + + /** + + Use the set* methods to set the values + + of the attributes. + + + + @param element set the value of <h6>value</h6> + + */ + + public h6(Element element) + + { + + addElement(element); + + } + + + + /** + + Use the set* methods to set the values + + of the attributes. + + + + @param value set the value of <h6>value</h6> + + */ + + public h6(String value) + + { + + addElement(value); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public h6 addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public h6 addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public h6 addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public h6 addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public h6 removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/head.java b/tools/src/org/apache/ecs/xhtml/head.java new file mode 100644 index 0000000000..fedf99b528 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/head.java @@ -0,0 +1,160 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <head></head> tag. + * + * @version $Id: head.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class head extends MultiPartElement + implements Printable +{ + + /** + * Private initialization routine. + */ + { + setElementType ("head"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic constructor. Use the set* methods to set the attibutes. + */ + public head () + { + } + + /** + * This method creates a <head> tag and sets it value + * + * @param value + * the value that goes between <start_tag> <end_tag> + */ + public head (String value) + { + addElement (value); + } + + /** + * This method creates a <head> tag and sets it value + * + * @param value + * the value that goes between <start_tag> <end_tag> + */ + public head (Element value) + { + addElement (value); + } + + /** + * Sets the PROFILE="" attribue + * + * @param profile + * the url to one or more meta data profiles seperated by + * whitespace + */ + public head setProfile (String profile) + { + addAttribute ("profile", profile); + return this; + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public head addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public head addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public head addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public head addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public head removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/hr.java b/tools/src/org/apache/ecs/xhtml/hr.java new file mode 100644 index 0000000000..5ad1ec2790 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/hr.java @@ -0,0 +1,422 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates an <hr> tag. + * + * @version $Id: hr.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class hr extends SinglePartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("hr"); + setCase (LOWERCASE); + setAttributeQuote (true); + setBeginEndModifier ('/'); + } + + /** + * methods to set the attibutes. + */ + public hr () + { + } + + /** + * Basic constructor + * + * @param width + * sets the width="" attribute + */ + public hr (String width) + { + setWidth (width); + } + + /** + * Basic constructor + * + * @param width + * sets the width="" attribute + */ + public hr (int width) + { + setWidth (width); + } + + /** + * Basic constructor + * + * @param width + * sets the width="" attribute + * @param align + * sets the align="" attribute + */ + public hr (String width, String align) + { + setWidth (width); + setAlign (align); + } + + /** + * Basic constructor + * + * @param width + * sets the width="" attribute + * @param align + * sets the align="" attribute + */ + public hr (int width, String align) + { + setWidth (width); + setAlign (align); + } + + /** + * Basic constructor + * + * @param width + * sets the width="" attribute + * @param align + * sets the align="" attribute + * @param size + * sets the size="" attribute + */ + public hr (String width, String align, String size) + { + setWidth (width); + setAlign (align); + setSize (size); + } + + /** + * Basic constructor + * + * @param width + * sets the width="" attribute + * @param align + * sets the align="" attribute + * @param size + * sets the size="" attribute + */ + public hr (String width, String align, int size) + { + setWidth (width); + setAlign (align); + setSize (size); + } + + /** + * Basic constructor + * + * @param width + * sets the width="" attribute + * @param align + * sets the align="" attribute + * @param size + * sets the size="" attribute + */ + public hr (int width, String align, int size) + { + setWidth (width); + setAlign (align); + setSize (size); + } + + /** + * Sets the width="" attribute + * + * @param width + * the width="" attribute + */ + public hr setWidth (String width) + { + addAttribute ("width", width); + return this; + } + + /** + * Sets the width="" attribute + * + * @param width + * the width="" attribute + */ + public hr setWidth (int width) + { + addAttribute ("width", Integer.toString (width)); + return this; + } + + /** + * Sets the align="" attribute + * + * @param align + * the align="" attribute + */ + public hr setAlign (String align) + { + addAttribute ("align", align); + return this; + } + + /** + * Sets the size="" attribute + * + * @param hspace + * the size="" attribute + */ + public hr setSize (String size) + { + addAttribute ("size", size); + return this; + } + + /** + * Sets the size="" attribute + * + * @param hspace + * the size="" attribute + */ + public hr setSize (int size) + { + addAttribute ("size", Integer.toString (size)); + return this; + } + + /** + * Sets the noshade + * + * @param shade + * true or false + */ + public hr setNoShade (boolean shade) + { + if (shade == true) + addAttribute ("noshade", "noshade"); + else + removeAttribute ("noshade"); + return (this); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public hr addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public hr addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public hr addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public hr addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public hr removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/html.java b/tools/src/org/apache/ecs/xhtml/html.java new file mode 100644 index 0000000000..812ec4ff21 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/html.java @@ -0,0 +1,144 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <html></html> tag. + * + * @version $Id: html.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class html extends MultiPartElement + implements Printable +{ + + public html () + { + setElementType ("html"); + setCase (LOWERCASE); + setAttributeQuote (true); + addAttribute ("xmlns", "http://www.w3.org/1999/xhtml"); + /** + + **/ + } + + /** + * This method creates a <html> tag and sets it value + * + * @param value + * the value that goes between <start_tag> <end_tag> + */ + public html (String value) + { + setElementType ("html"); + addElement (value); + } + + /** + * This method creates a <html> tag and sets it value + * + * @param value + * the value that goes between <start_tag> <end_tag> + */ + public html (Element value) + { + setElementType ("html"); + addElement (value); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public html addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public html addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public html addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public html addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public html removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/i.java b/tools/src/org/apache/ecs/xhtml/i.java new file mode 100644 index 0000000000..b51834c8b4 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/i.java @@ -0,0 +1,268 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <i> tag. + * + * @version $Id: i.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class i extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("i"); + setCase (LOWERCASE); + setAttributeQuote (true); + setPrettyPrint (false); + } + + /** + * Basic constructor. + */ + public i () + { + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + */ + public i (Element element) + { + addElement (element); + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + */ + public i (String element) + { + addElement (element); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public i addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public i addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public i addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public i addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public i removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/iframe.java b/tools/src/org/apache/ecs/xhtml/iframe.java new file mode 100644 index 0000000000..b26d2d72b7 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/iframe.java @@ -0,0 +1,630 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <iframe> tag. + + + + @version $Id: iframe.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class iframe extends MultiPartElement implements Printable + +{ + + public final static String yes = "yes"; + + public final static String no = "no"; + + public final static String auto = "auto"; + + + + /** + + Private initialization routine. + + */ + + { + + setElementType("iframe"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public iframe() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public iframe(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public iframe(String element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + @param name the name="" attribute + + */ + + public iframe(Element element, String name) + + { + + addElement(element); + + setName(name); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + @param name the name="" attribute + + */ + + public iframe(String element, String name) + + { + + addElement(element); + + setName(name); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + @param name the name="" attribute + + @param src the src="" attribute + + */ + + public iframe(Element element, String name, String src) + + { + + addElement(element); + + setName(name); + + setSrc(src); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + @param name the name="" attribute + + @param src the src="" attribute + + */ + + public iframe(String element, String name, String src) + + { + + addElement(element); + + setName(name); + + setSrc(src); + + } + + + + /** + + Sets the longdesc="" attribute + + @param longdesc the longdesc="" attribute + + */ + + public iframe setLongDesc(String longdesc) + + { + + addAttribute("longdesc",longdesc); + + return this; + + } + + + + /** + + Sets the name="" attribute + + @param name the name="" attribute + + */ + + public iframe setName(String name) + + { + + addAttribute("name",name); + + return this; + + } + + + + /** + + Sets the src="" attribute + + @param src the src="" attribute + + */ + + public iframe setSrc(String src) + + { + + addAttribute("src",src); + + return this; + + } + + + + /** + + Sets the frameborder="" attribute + + @param frameborder the frameborder="" attribute + + */ + + public iframe setFrameBorder(boolean frameborder) + + { + + if (frameborder) + + addAttribute("frameborder",Integer.toString(1)); + + else + + addAttribute("frameborder",Integer.toString(0)); + + return this; + + } + + + + /** + + Sets the marginwidth="" attribute + + @param marginwidth the marginwidth="" attribute + + */ + + public iframe setMarginWidth(int marginwidth) + + { + + setMarginWidth(Integer.toString(marginwidth)); + + return this; + + } + + + + /** + + Sets the marginwidth="" attribute + + @param marginwidth the marginwidth="" attribute + + */ + + public iframe setMarginWidth(String marginwidth) + + { + + addAttribute("marginwidth",marginwidth); + + return this; + + } + + + + + + /** + + Sets the height="" attribute + + @param height the height="" attribute + + */ + + public iframe setHeight(String height) + + { + + addAttribute("height",height); + + return this; + + } + + + + /** + + Sets the height="" attribute + + @param height the height="" attribute + + */ + + public iframe setHeight(int height) + + { + + addAttribute("height",Integer.toString(height)); + + return this; + + } + + + + /** + + Sets the width="" attribute + + @param width the width="" attribute + + */ + + public iframe setWidth(String width) + + { + + addAttribute("width",width); + + return this; + + } + + + + /** + + Sets the width="" attribute + + @param width the width="" attribute + + */ + + public iframe setWidth(int width) + + { + + addAttribute("width",Integer.toString(width)); + + return this; + + } + + + + /** + + Sets the marginheight="" attribute + + @param marginheight the marginheight="" attribute + + */ + + public iframe setMarginHeight(int marginheight) + + { + + setMarginHeight(Integer.toString(marginheight)); + + return this; + + } + + + + /** + + Sets the marginheight="" attribute + + @param marginheight the marginheight="" attribute + + */ + + public iframe setMarginHeight(String marginheight) + + { + + addAttribute("marginheight",marginheight); + + return this; + + } + + + + /** + + Sets the scrolling="" attribute + + @param scrolling the scrolling="" attribute + + */ + + public iframe setScrolling(String scrolling) + + { + + addAttribute("scrolling",scrolling); + + return this; + + } + + + + /** + + Sets the align="" attribute. + + + + @param align sets the align="" attribute. You can + + use the AlignType.* variables for convience. + + */ + + public iframe setAlign(String align) + + { + + addAttribute("align",align); + + return(this); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public iframe addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public iframe addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public iframe addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public iframe addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public iframe removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/img.java b/tools/src/org/apache/ecs/xhtml/img.java new file mode 100644 index 0000000000..657e3dbb14 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/img.java @@ -0,0 +1,816 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates an <img> tag. + + + + @version $Id: img.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class img extends SinglePartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + + + { + + setElementType("img"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + setBeginEndModifier('/'); + + } + + + + /** + + Basic constructor. Use the set* methods to set the attibutes. + + */ + + public img() + + { + + } + + + + /** + + Creates an img tag + + + + @param src the src="" attribute + + */ + + public img(String src) + + { + + setSrc(src); + + } + + + + /** + + Creates an img tag + + + + @param src the src="" attribute + + @param border the border="" attribute + + */ + + public img(String src, int border) + + { + + setSrc(src); + + setBorder(border); + + } + + + + /** + + Creates an img tag + + + + @param src the src="" attribute + + @param name the name="" attribute + + */ + + public img(String src, String name) + + { + + setSrc(src); + + setName(name); + + } + + + + /** + + Creates an img tag + + + + @param src the src="" attribute + + @param name the name="" attribute + + @param border the border="" attribute + + */ + + public img(String src, String name, int border) + + { + + setSrc(src); + + setName(name); + + setBorder(border); + + } + + + + /** + + Sets the src="" attribute + + @param src the src="" attribute + + */ + + public img setSrc(String src) + + { + + addAttribute("src",src); + + return this; + + } + + + + /** + + Sets the border="" attribute + + @param border the border="" attribute + + */ + + public img setBorder(int border) + + { + + addAttribute("border",Integer.toString(border)); + + return this; + + } + + + + /** + + Sets the name="" attribute + + @param name the name="" attribute + + */ + + public img setName(String name) + + { + + addAttribute("name",name); + + return this; + + } + + + + /** + + Sets the height="" attribute + + @param height the height="" attribute + + */ + + public img setHeight(String height) + + { + + addAttribute("height",height); + + return this; + + } + + + + /** + + Sets the height="" attribute + + @param height the height="" attribute + + */ + + public img setHeight(int height) + + { + + addAttribute("height",Integer.toString(height)); + + return this; + + } + + + + /** + + Sets the width="" attribute + + @param width the width="" attribute + + */ + + public img setWidth(String width) + + { + + addAttribute("width",width); + + return this; + + } + + + + /** + + Sets the width="" attribute + + @param width the width="" attribute + + */ + + public img setWidth(int width) + + { + + addAttribute("width",Integer.toString(width)); + + return this; + + } + + + + /** + + Sets the alt="" attribute + + @param alt the alt="" attribute + + */ + + public img setAlt(String alt) + + { + + addAttribute("alt",alt); + + return this; + + } + + + + /** + + Sets the ismap attribute + + @param ismap the ismap attribute + + */ + + public img setIsMap(boolean ismap) + + { + + if(ismap == true) + + addAttribute("ismap","ismap"); + + else + + removeAttribute("ismap"); + + + + return this; + + } + + + + /** + + Sets the usmap="" attribute + + @param usemap the usmap="" attribute + + */ + + public img setUseMap(String usemap) + + { + + addAttribute("usemap",usemap); + + return this; + + } + + + + /** + + Sets the align="" attribute + + @param align the align="" attribute + + */ + + public img setAlign(String align) + + { + + addAttribute("align",align); + + return this; + + } + + + + /** + + Sets the hspace="" attribute + + @param hspace the hspace="" attribute + + */ + + public img setHspace(String hspace) + + { + + addAttribute("hspace",hspace); + + return this; + + } + + + + /** + + Sets the hspace="" attribute + + @param hspace the hspace="" attribute + + */ + + public img setHspace(int hspace) + + { + + addAttribute("hspace",Integer.toString(hspace)); + + return this; + + } + + + + /** + + Sets the vspace="" attribute + + @param vspace the vspace="" attribute + + */ + + public img setVspace(String vspace) + + { + + addAttribute("vspace",vspace); + + return this; + + } + + + + /** + + Sets the vspace="" attribute + + @param vspace the vspace="" attribute + + */ + + public img setVspace(int vspace) + + { + + addAttribute("vspace",Integer.toString(vspace)); + + return this; + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public img addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public img addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public img addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public img addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public img removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/input.java b/tools/src/org/apache/ecs/xhtml/input.java new file mode 100644 index 0000000000..c3245b97a4 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/input.java @@ -0,0 +1,663 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <input> tag. + * + * @version $Id: input.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class input extends SinglePartElement + implements Printable, FormEvents, PageEvents, FocusEvents, MouseEvents, + KeyEvents +{ + + public static final String TYPE_TEXT = "text"; + + public static final String TYPE_PASSWORD = "password"; + + public static final String TYPE_CHECKBOX = "checkbox"; + + public static final String TYPE_RADIO = "radio"; + + public static final String TYPE_FILE = "file"; + + public static final String TYPE_BUTTON = "button"; + + public static final String TYPE_IMAGE = "image"; + + public static final String TYPE_HIDDEN = "hidden"; + + public static final String TYPE_SUBMIT = "submit"; + + public static final String TYPE_RESET = "reset"; + + + /** + * Private initialization routine. + */ + { + setElementType ("input"); + setCase (LOWERCASE); + setAttributeQuote (true); + setBeginEndModifier ('/'); + } + + /** + * Basic constructor. Use the set* methods to set the values of the + * attributes. + */ + public input () + { + } + + /** + * Basic constructor. Use the set* methods to set the values of the + * attributes. + */ + public input (String type, String name, String value) + { + setType (type); + setName (name); + setValue (value); + } + + /** + * Basic constructor. Use the set* methods to set the values of the + * attributes. + */ + public input (String type, String name, int value) + { + setType (type); + setName (name); + setValue (value); + } + + /** + * Basic constructor. Use the set* methods to set the values of the + * attributes. + */ + public input (String type, String name, Integer value) + { + setType (type); + setName (name); + setValue (value); + } + + /** + * Basic constructor. Use the set* methods to set the values of the + * attributes. + */ + public input (String type, String name, double value) + { + setType (type); + setName (name); + setValue (value); + } + + /** + * Sets the type="" attribute + * + * @param type + * the type="" attribute + */ + public input setType (String type) + { + addAttribute ("type", type); + return this; + } + + /** + * Sets the src="" attribute + * + * @param src + * the src="" attribute + */ + public input setSrc (String src) + { + addAttribute ("src", src); + return this; + } + + /** + * Sets the border="" attribute + * + * @param border + * the border="" attribute + */ + public input setBorder (int border) + { + addAttribute ("border", Integer.toString (border)); + return this; + } + + /** + * Sets the alt="" attribute + * + * @param alt + * the alt="" attribute + */ + public input setAlt (String alt) + { + addAttribute ("alt", alt); + return this; + } + + /** + * Sets the name="" attribute + * + * @param name + * the name="" attribute + */ + public input setName (String name) + { + addAttribute ("name", name); + return this; + } + + /** + * Sets the value="" attribute + * + * @param value + * the value="" attribute + */ + public input setValue (String value) + { + addAttribute ("value", value); + return this; + } + + /** + * Sets the value="" attribute + * + * @param value + * the value="" attribute + */ + public input setValue (int value) + { + addAttribute ("value", Integer.toString (value)); + return this; + } + + /** + * Sets the value="" attribute + * + * @param value + * the value="" attribute + */ + public input setValue (Integer value) + { + addAttribute ("value", value.toString ()); + return this; + } + + /** + * Sets the value="" attribute + * + * @param value + * the value="" attribute + */ + public input setValue (double value) + { + addAttribute ("value", Double.toString (value)); + return this; + } + + /** + * Sets the accept="" attribute + * + * @param accept + * the accept="" attribute + */ + public input setAccept (String accept) + { + addAttribute ("accept", accept); + return this; + } + + /** + * Sets the size="" attribute + * + * @param size + * the size="" attribute + */ + public input setSize (String size) + { + addAttribute ("size", size); + return this; + } + + /** + * Sets the size="" attribute + * + * @param size + * the size="" attribute + */ + public input setSize (int size) + { + setSize (Integer.toString (size)); + return this; + } + + /** + * Sets the maxlength="" attribute + * + * @param maxlength + * the maxlength="" attribute + */ + public input setMaxlength (String maxlength) + { + addAttribute ("maxlength", maxlength); + return this; + } + + /** + * Sets the maxlength="" attribute + * + * @param maxlength + * the maxlength="" attribute + */ + public input setMaxlength (int maxlength) + { + setMaxlength (Integer.toString (maxlength)); + return this; + } + + /** + * Sets the usemap="" attribute + * + * @param usemap + * the usemap="" attribute + */ + public input setUsemap (String usemap) + { + addAttribute ("usemap", usemap); + return this; + } + + /** + * Sets the tabindex="" attribute + * + * @param index + * the tabindex="" attribute + */ + public input setTabindex (String index) + { + addAttribute ("tabindex", index); + return this; + } + + /** + * Sets the tabindex="" attribute + * + * @param index + * the tabindex="" attribute + */ + public input setTabindex (int index) + { + setTabindex (Integer.toString (index)); + return this; + } + + /** + * Sets the checked value + * + * @param checked + * true or false + */ + public input setChecked (boolean checked) + { + if (checked == true) + addAttribute ("checked", "checked"); + else + removeAttribute ("checked"); + return (this); + } + + /** + * Sets the readonly value + * + * @param readonly + * true or false + */ + public input setReadOnly (boolean readonly) + { + if (readonly == true) + addAttribute ("readonly", "readonly"); + else + removeAttribute ("readonly"); + return (this); + } + + /** + * Sets the disabled value + * + * @param disabled + * true or false + */ + public input setDisabled (boolean disabled) + { + if (disabled == true) + addAttribute ("disabled", "disabled"); + else + removeAttribute ("disabled"); + return (this); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public input addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public input addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public input addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public input addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public input removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onsubmit event occurs when a form is submitted. It only applies to + * the FORM element. + * + * @param script + * script + */ + public void setOnSubmit (String script) + { + addAttribute ("onsubmit", script); + } + + /** + * The onreset event occurs when a form is reset. It only applies to the + * FORM element. + * + * @param script + * script + */ + public void setOnReset (String script) + { + addAttribute ("onreset", script); + } + + /** + * The onselect event occurs when a user selects some text in a text field. + * This attribute may be used with the INPUT and TEXTAREA elements. + * + * @param script + * script + */ + public void setOnSelect (String script) + { + addAttribute ("onselect", script); + } + + /** + * The onchange event occurs when a control loses the input focus and its + * value has been modified since gaining focus. This attribute applies to + * the following elements: INPUT, SELECT, and TEXTAREA. + * + * @param script + * script + */ + public void setOnChange (String script) + { + addAttribute ("onchange", script); + } + + /** + * The onload event occurs when the user agent finishes loading a window or + * all frames within a FRAMESET. This attribute may be used with BODY and + * FRAMESET elements. + * + * @param script + * script + */ + public void setOnLoad (String script) + { + addAttribute ("onload", script); + } + + /** + * The onunload event occurs when the user agent removes a document from a + * window or frame. This attribute may be used with BODY and FRAMESET + * elements. + * + * @param script + * script + */ + public void setOnUnload (String script) + { + addAttribute ("onunload", script); + } + + /** + * The onfocus event occurs when an element receives focus either by the + * pointing device or by tabbing navigation. This attribute may be used with + * the following elements: LABEL, INPUT, SELECT, TEXTAREA, and BUTTON. + * + * @param script + * script + */ + public void setOnFocus (String script) + { + addAttribute ("onfocus", script); + } + + /** + * The onblur event occurs when an element loses focus either by the + * pointing device or by tabbing navigation. It may be used with the same + * elements as onfocus. + * + * @param script + * script + */ + public void setOnBlur (String script) + { + addAttribute ("onblur", script); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/ins.java b/tools/src/org/apache/ecs/xhtml/ins.java new file mode 100644 index 0000000000..89e4626f98 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/ins.java @@ -0,0 +1,448 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <ins> tag. + + + + @version $Id: ins.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class ins extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initializer. + + */ + + { + + setElementType("ins"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + + + /** + + Default constructor use set* methods. + + */ + + public ins() + + { + + } + + + + /** + + Set the url that designates a source doument or message. + + @param url set the url that designates a source document or message. + + */ + + public ins setCite(String url) + + { + + addAttribute("cite",url); + + return(this); + + } + + + + /** + + Sets the date and time the change was made. + + @param datetime the date and time the change was made. + + */ + + public ins setDateTime(String datetime) + + { + + addAttribute("datetime",datetime); + + return(this); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public ins addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public ins addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public ins addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public ins addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public ins removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/kbd.java b/tools/src/org/apache/ecs/xhtml/kbd.java new file mode 100644 index 0000000000..67699ae0ab --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/kbd.java @@ -0,0 +1,442 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <kbd> tag. + + + + @version $Id: kbd.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class kbd extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("kbd"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public kbd() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public kbd(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public kbd(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public kbd addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public kbd addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public kbd addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public kbd addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public kbd removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/label.java b/tools/src/org/apache/ecs/xhtml/label.java new file mode 100644 index 0000000000..67990ffc00 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/label.java @@ -0,0 +1,326 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <label> tag. + * + * @version $Id: label.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class label extends MultiPartElement + implements Printable, PageEvents, MouseEvents, KeyEvents +{ + + /** + * private initializer. + */ + { + setElementType ("label"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic constructor. Use set* methods. + */ + public label () + { + } + + /** + * Basic Constructor use set* methods. + * + * @param setFor + * Sets the FOR="" attribute + */ + public label (String setFor) + { + setFor (setFor); + } + + /** + * Basic Constructor use set* methods. + * + * @param setFor + * Sets the for="" attribute + * @param accesskey + * sets the accesskey="" attribute. + */ + public label (String setFor, String accesskey) + { + setFor (setFor); + setAccessKey(accesskey); + } + + /** + * Basic Constructor use set* methods. + * + * @param setFor + * Sets the for="" attribute + * @param accesskey + * sets the optional accesskey="" attribute. + * @param value + * adds an element + */ + public label (String setFor, String accesskey, String value) + { + setFor (setFor); + if (accesskey != null) + setAccessKey(accesskey); + addElement(value); + } + + /** + * Sets the for="" attribute. + * + * @param value + * sets the for="" attribute. + */ + public label setFor (String value) + { + addAttribute ("for", value); + return (this); + } + + /** + * Sets the accesskey="" attribute. + * + * @param accesskey + * sets the accesskey="" attribute. + */ + public label setAccessKey (String accesskey) + { + addAttribute ("accesskey", accesskey); + return (this); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public label addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public label addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public label addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public label addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public label removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onload event occurs when the user agent finishes loading a window or + * all frames within a frameset. This attribute may be used with body and + * frameset elements. + * + * @param script The script + */ + public void setOnLoad (String script) + { + addAttribute ("onload", script); + } + + /** + * The onunload event occurs when the user agent removes a document from a + * window or frame. This attribute may be used with body and frameset + * elements. + * + * @param script The script + */ + public void setOnUnload (String script) + { + addAttribute ("onunload", script); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/legend.java b/tools/src/org/apache/ecs/xhtml/legend.java new file mode 100644 index 0000000000..243b9111bc --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/legend.java @@ -0,0 +1,297 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <legend> tag. + * + * @version $Id: legend.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class legend extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * private initializer. + */ + { + setElementType ("legend"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic constructor. Use set* methods. + */ + public legend () + { + } + + /** + * Basic Constructor use set* methods. + * + * @param value + * sets the value + */ + public legend (String value) + { + addElement (value); + } + + /** + * Basic Constructor use set* methods. + * + * @param value + * sets the value + */ + public legend (Element value) + { + addElement (value); + } + + /** + * Basic Constructor use set* methods. + * + * @param value + * sets the value + * @param accesskey + * sets the accesskey="" attribute. + */ + public legend (String value, String accesskey) + { + addElement (value); + setAccessKey (accesskey); + } + + /** + * Basic Constructor use set* methods. + * + * @param value + * sets the value + * @param accesskey + * sets the accesskey="" attribute. + */ + public legend (Element value, String accesskey) + { + addElement (value); + setAccessKey (accesskey); + } + + /** + * Sets the accesskey="" attribute. + * + * @param accesskey + * sets the accesskey="" attribute. + */ + public legend setAccessKey (String accesskey) + { + addAttribute ("accesskey", accesskey); + return (this); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public legend addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public legend addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public legend addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public legend addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public legend removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/li.java b/tools/src/org/apache/ecs/xhtml/li.java new file mode 100644 index 0000000000..c32e06eb83 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/li.java @@ -0,0 +1,276 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <li> tag. + *

+ * The li tag defaults to not having a closing </li> because it is + * optional in the spec. This can be overridden by setNeedClosingTag(true) + * + * @version $Id: li.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class li extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("li"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic constructor. Use setValue() if needed. + */ + public li () + { + } + + /** + * Sets the value after the <li> tag + * + * @param value + * the value after the <li> tag + */ + public li (String value) + { + addElement (value); + } + + /** + * Sets the value after the <li> tag + * + * @param element + * the value after the <li> tag + */ + public li (Element element) + { + addElement (element); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public li addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public li addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Mechanism for taking a list of Strings and creating a list of li objects. + * + * @param element + * list of Strings that need to be li objects + */ + public li[] addElement (String[] element) + { + li[] li = new li[element.length]; + for (int x = 0; x < element.length; x++) + { + li[x] = new li (element[x]); + } + return (li); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public li addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public li addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public li removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/link.java b/tools/src/org/apache/ecs/xhtml/link.java new file mode 100644 index 0000000000..c7f045a480 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/link.java @@ -0,0 +1,347 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <link> tag. + * + * @version $Id: link.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class link extends SinglePartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("link"); + setCase (LOWERCASE); + setAttributeQuote (true); + setBeginEndModifier ('/'); + } + + public static final String REL_STYLESHEET = "stylesheet"; + public static final String TYPE_CSS = "text/css"; + + + /** + * Basic constructor. You need to set the attributes using the set* methods. + */ + public link () + { + } + + /** + * Full Constructor + * @param href href + * @param rel rel + * @param type type + */ + public link (String href, String rel, String type) + { + this(); + setHref(href); + setRel(rel); + setType(type); + } // link + + /** + * Set Href + * @param href href + * @return this + */ + public link setHref (String href) + { + addAttribute ("href", href); + return this; + } // setHref + + /** + * Sets the target="" attribute + * + * @param target + * the target="" attribute + */ + public link setTarget (String target) + { + addAttribute ("target", target); + return this; + } + + /** + * Sets the rel="" attribute + * + * @param rel + * the rel="" attribute + */ + public link setRel (String rel) + { + addAttribute ("rel", rel); + return this; + } + + /** + * Sets the rev="" attribute + * + * @param rev + * the rev="" attribute + */ + public link setRev (String rev) + { + addAttribute ("rev", rev); + return this; + } + + /** + * Sets the charset="" attribute + * + * @param charset + * the charset="" attribute + */ + public link setCharset (String charset) + { + addAttribute ("charset", charset); + return this; + } + + /** + * Sets the type="" attribute + * + * @param type + * set the mime type of this link + */ + public link setType (String type) + { + addAttribute ("type", type); + return this; + } + + /** + * Sets the media="" attribute + * + * @param media + * the media="" attribute + */ + public link setMedia (String media) + { + addAttribute ("media", media); + return this; + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public link addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public link addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public link addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public link addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public link removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/map.java b/tools/src/org/apache/ecs/xhtml/map.java new file mode 100644 index 0000000000..50764ee2c6 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/map.java @@ -0,0 +1,556 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <map> tag. + + + + @version $Id: map.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class map extends MultiPartElement implements Printable, FocusEvents, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("map"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public map() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public map(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public map(String element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + @param name sets the name="" attribute + + */ + + public map(Element element, String name) + + { + + addElement(element); + + setName ( name ); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + @param name sets the name="" attribute + + */ + + public map(String element, String name) + + { + + addElement(element); + + setName ( name ); + + } + + + + /** + + Sets the name="" attribute + + @param name the name="" attribute + + */ + + public map setName(String name) + + { + + addAttribute("name",name); + + return this; + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public map addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public map addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public map addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public map addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public map removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onfocus event occurs when an element receives focus either by the + + pointing device or by tabbing navigation. This attribute may be used + + with the following elements: LABEL, INPUT, SELECT, TEXTAREA, and + + BUTTON. + + + + @param The script + + */ + + public void setOnFocus(String script) + + { + + addAttribute ( "onfocus", script ); + + } + + + + /** + + The onblur event occurs when an element loses focus either by the + + pointing device or by tabbing navigation. It may be used with the same + + elements as onfocus. + + + + @param The script + + */ + + public void setOnBlur(String script) + + { + + addAttribute ( "onblur", script ); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/meta.java b/tools/src/org/apache/ecs/xhtml/meta.java new file mode 100644 index 0000000000..4449ec3f42 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/meta.java @@ -0,0 +1,200 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <meta> tag. + * + * @version $Id: meta.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class meta extends SinglePartElement + implements Printable +{ + + /** + * Private initialization routine. + */ + { + setElementType ("meta"); + setCase (LOWERCASE); + setAttributeQuote (true); + setBeginEndModifier ('/'); + } + + /** + * This method creates a <meta> tag. + */ + public meta () + { + } + + /** + * Sets the content="" attribute. + * + * @param content + * the value that should go into the content attribute + */ + public meta setContent (String content) + { + addAttribute ("content", content); + return this; + } + + /** + * Sets the name="" attribute. + * + * @param content + * the value that should go into the name attribute + */ + public meta setName (String name) + { + addAttribute ("name", name); + return this; + } + + /** + * Sets the name="" attribute. + * + * @param content + * the value that should go into the name attribute + */ + public meta setName (String name, String content) + { + addAttribute ("name", name); + addAttribute ("content", content); + return this; + } + + /** + * Sets the scheme="" attribute. + * + * @param content + * the value that should go into the scheme attribute + */ + public meta setScheme (String scheme) + { + addAttribute ("scheme", scheme); + return this; + } + + /** + * Sets the http-equiv="" attribute. + * + * @param content + * the value that should go into the http-equiv attribute + */ + public meta setHttpEquiv (String http_equiv) + { + addAttribute ("http-equiv", http_equiv); + return this; + } + + /** + * Sets the http-equiv="" attribute. + * + * @param content + * the value that should go into the http-equiv attribute + */ + public meta setHttpEquiv (String http_equiv, String content) + { + addAttribute ("content", content); + addAttribute ("http-equiv", http_equiv); + return this; + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public meta addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public meta addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public meta addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public meta addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public meta removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/nobr.java b/tools/src/org/apache/ecs/xhtml/nobr.java new file mode 100644 index 0000000000..6b79ca3775 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/nobr.java @@ -0,0 +1,246 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <nobr> tag. + + + + @version $Id: nobr.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class nobr extends MultiPartElement implements Printable + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("nobr"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + + + /** + + Basic constructor. Use the set* methods to set the values + + of the attributes. + + */ + + public nobr() + + { + + } + + + + /** + + Use the set* methods to set the values + + of the attributes. + + + + @param element set the value of <nobr>value</nobr> + + */ + + public nobr(Element element) + + { + + addElement(element); + + } + + + + /** + + Use the set* methods to set the values + + of the attributes. + + + + @param value set the value of <nobr>value</nobr> + + */ + + public nobr(String value) + + { + + addElement(value); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public nobr addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public nobr addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public nobr addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public nobr addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public nobr removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/noframes.java b/tools/src/org/apache/ecs/xhtml/noframes.java new file mode 100644 index 0000000000..99c0234b98 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/noframes.java @@ -0,0 +1,442 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <noframes> tag. + + + + @version $Id: noframes.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class noframes extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("noframes"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public noframes() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public noframes(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public noframes(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public noframes addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public noframes addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public noframes addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public noframes addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public noframes removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/noscript.java b/tools/src/org/apache/ecs/xhtml/noscript.java new file mode 100644 index 0000000000..4c17c8732d --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/noscript.java @@ -0,0 +1,442 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <noscript> tag. + + + + @version $Id: noscript.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class noscript extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("noscript"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public noscript() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public noscript(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public noscript(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public noscript addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public noscript addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public noscript addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public noscript addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public noscript removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/object.java b/tools/src/org/apache/ecs/xhtml/object.java new file mode 100644 index 0000000000..897f08f40c --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/object.java @@ -0,0 +1,598 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates an <object> tag. + * + * @version $Id: object.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class object extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initializer. + */ + { + setElementType ("object"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Default constructor. Creates the <object/> element.
+ * use set* methods. + */ + public object () + { + } + + /** + * Sets the declare attribute. (declare this object but don't instantiate + * it. + * + * @param declare + * declare on or off + */ + public object setDeclare (boolean declare) + { + if (declare) + addAttribute ("declare", "declare"); + else + removeAttribute ("declare"); + return (this); + } + + /** + * Identifies an implementation. + * + * @param url + * location of classid. + */ + public object setClassId (String url) + { + addAttribute ("classid", url); + return (this); + } + + /** + * Sets the Internet content type for the code. + * + * @param codetype + * Sets the Internet content type for the code. + */ + public object setCodeType (String codetype) + { + addAttribute ("codetype", codetype); + return (this); + } + + /** + * Determines the base path to resolve relative urls specified by classid. + * + * @param url + * base path to resolve relative urls specified by classid. + */ + public object setCodeBase (String url) + { + addAttribute ("codebase", url); + return (this); + } + + /** + * This attribute specifies the location of the data to be rendered. + * + * @param url + * this attribute specifies the location of the data to be + * rendered. + */ + public object setData (String url) + { + addAttribute ("data", url); + return (this); + } + + /** + * This attribute specifies the Internet Media Type for the data specified + * by data.
+ * This should be a mime type. + * + * @param type + * a mime type for the data specifed by the data attribute. + */ + public object setType (String type) + { + addAttribute ("type", type); + return (this); + } + + /** + * Space seperated archive list. + * + * @param url + * Space seperate archive list. + */ + // Anyone know what the hell this is? the spec is rather vague in its + // definition. + public object setArchive (String url) + { + addAttribute ("archive", url); + return (this); + } + + /** + * Message to show while the object is loading. + * + * @param cdata + * the message to show while the object is loading. + */ + public object setStandBy (String cdata) + { + addAttribute ("standby", cdata); + return (this); + } + + /** + * Suggested link border width. + * + * @param border + * suggested link border width. + */ + public object setBorder (String border) + { + addAttribute ("border", border); + return (this); + } + + /** + * Suggested link border width. + * + * @param border + * suggested link border width. + */ + public object setBorder (int border) + { + addAttribute ("border", Integer.toString (border)); + return (this); + } + + /** + * Suggested link border width. + * + * @param border + * suggested link border width. + */ + public object setBorder (double border) + { + addAttribute ("border", Double.toString (border)); + return (this); + } + + /** + * Suggested height of object. + * + * @param height + * suggested link height. + */ + public object setHeight (String height) + { + addAttribute ("height", height); + return (this); + } + + /** + * Suggested height of object. + * + * @param height + * suggested link height. + */ + public object setHeight (int height) + { + addAttribute ("height", Integer.toString (height)); + return (this); + } + + /** + * Suggested height of object. + * + * @param height + * suggested link height. + */ + public object setHeight (double height) + { + addAttribute ("height", Double.toString (height)); + return (this); + } + + /** + * Suggested width of object. + * + * @param width + * suggested link width. + */ + public object setWidth (String width) + { + addAttribute ("width", width); + return (this); + } + + /** + * Suggested width of object. + * + * @param width + * suggested link width. + */ + public object setWidth (int width) + { + addAttribute ("width", Integer.toString (width)); + return (this); + } + + /** + * Suggested width of object. + * + * @param width + * suggested link width. + */ + public object setWidth (double width) + { + addAttribute ("width", Double.toString (width)); + return (this); + } + + /** + * Suggested horizontal gutter. + * + * @param hspace + * suggested horizontal gutter. + */ + public object setHSpace (String hspace) + { + addAttribute ("hspace", hspace); + return (this); + } + + /** + * Suggested horizontal gutter. + * + * @param hspace + * suggested horizontal gutter. + */ + public object setHSpace (int hspace) + { + addAttribute ("hspace", Integer.toString (hspace)); + return (this); + } + + /** + * Suggested horizontal gutter. + * + * @param hspace + * suggested horizontal gutter. + */ + public object setHSpace (double hspace) + { + addAttribute ("hspace", Double.toString (hspace)); + return (this); + } + + /** + * Suggested vertical gutter. + * + * @param vspace + * suggested vertical gutter. + */ + public object setVSpace (String vspace) + { + addAttribute ("vspace", vspace); + return (this); + } + + /** + * Suggested vertical gutter. + * + * @param vspace + * suggested vertical gutter. + */ + public object setVSpace (int vspace) + { + addAttribute ("vspace", Integer.toString (vspace)); + return (this); + } + + /** + * Suggested vertical gutter. + * + * @param vspace + * suggested vertical gutter. + */ + public object setVSpace (double vspace) + { + addAttribute ("vspace", Double.toString (vspace)); + return (this); + } + + /** + * Set the horizontal or vertical alignment of this object.
+ * Convience variables are in the AlignTypes interface. + * + * @param alignment + * Set the horizontal or vertical alignment of this object.
+ * Convience variables are in the AlignTypes interface. + */ + public object setAlign (String alignment) + { + addAttribute ("align", alignment); + return (this); + } + + /** + * Location of image map to use. + * + * @param url + * location of image map to use. + */ + public object setUseMap (String url) + { + addAttribute ("usemap", url); + return (this); + } + + /** + * Object has shaped hypertext links. + * + * @param shape + * does the object have shaped hypertext links? + */ + public object setShapes (boolean shape) + { + if (shape) + addAttribute ("shapes", "shapes"); + else + removeAttribute ("shapes"); + return (this); + } + + /** + * Set the name of this object. + * + * @param name + * set the name of this object. + */ + public object setName (String name) + { + addAttribute ("name", name); + return (this); + } + + /** + * Set the elements position in the tabbing order. + * + * @param number + * set the elements position in the tabbing order. + */ + public object setTabIndex (int number) + { + addAttribute ("tabindex", Integer.toString (number)); + return (this); + } + + /** + * Set the elements position in the tabbing order. + * + * @param number + * set the elements position in the tabbing order. + */ + public object setTabIndex (String number) + { + addAttribute ("tabindex", number); + return (this); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public object addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public object addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Add an element to the element + * + * @param element + * a string representation of the element + */ + public object addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Add an element to the element + * + * @param element + * an element to add + */ + public object addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public object removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/ol.java b/tools/src/org/apache/ecs/xhtml/ol.java new file mode 100644 index 0000000000..bd363eabf6 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/ol.java @@ -0,0 +1,286 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <ol> tag. + * + * @version $Id: ol.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class ol extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("ol"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic constructor, use set* methods. + */ + public ol () + { + } + + /** + * Basic constructor, use set* methods. + * + * @param list + * an array of li objects to be added to the ol element. + */ + public ol (li[] list) + { + addElement (list); + } + + /** + * Basic constructor, use set* methods. + * + * @param list + * an array of strings to be made into li objects and
+ * added to the ol element. + */ + public ol (String[] list) + { + addElement (list); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public ol addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public ol addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Add a list to the ul + * + * @param list + * a list of li objects. + */ + public ol addElement (li[] list) + { + for (int x = 0; x < list.length; x++) + { + addElement (list[x]); + } + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public ol addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public ol addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Add a list to the ol + * + * @param element + * a list of Strings to be converted to li objects. + */ + public ol addElement (String[] element) + { + li[] li = new li ().addElement (element); + addElement (li); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public ol removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/optgroup.java b/tools/src/org/apache/ecs/xhtml/optgroup.java new file mode 100644 index 0000000000..889106bee9 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/optgroup.java @@ -0,0 +1,371 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <optgroup> tag. + * + * @version $Id: optgroup.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class optgroup extends MultiPartElement + implements Printable, FocusEvents, FormEvents, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("optgroup"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic constructor. Use the set* methods to set the values of the + * attributes. + */ + public optgroup () + { + } + + /** + * Basic constructor. Use the set* methods to set the values of the + * attributes. + * + * @param label + * sets the attribute label="" + */ + public optgroup (String label) + { + setLabel (label); + } + + /** + * Basic constructor. Use the set* methods to set the values of the + * attributes. + * + * @param label + * sets the attribute label="" + * @param disabled + * sets the attribute disabled= + */ + public optgroup (String label, boolean disabled) + { + setLabel (label); + setDisabled (disabled); + } + + /** + * sets the label="" attribute + * + * @param label + * the label="" attribute + */ + public optgroup setLabel (String label) + { + addAttribute ("label", label); + return this; + } + + /** + * Sets the value="" attribute + * + * @param value + * the value="" attribute + */ + public optgroup setValue (String value) + { + addAttribute ("value", value); + return this; + } + + /** + * Sets the disabled value + * + * @param disabled + * true or false + */ + public optgroup setDisabled (boolean disabled) + { + if (disabled == true) + addAttribute ("disabled", "disabled"); + else + removeAttribute ("disabled"); + return (this); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public optgroup addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public optgroup addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public optgroup addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public optgroup addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public optgroup removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onfocus event occurs when an element receives focus either by the + * pointing device or by tabbing navigation. This attribute may be used with + * the following elements: label, input, select, textarea, and button. + * + * @param script The script + */ + public void setOnFocus (String script) + { + addAttribute ("onfocus", script); + } + + /** + * The onblur event occurs when an element loses focus either by the + * pointing device or by tabbing navigation. It may be used with the same + * elements as onfocus. + * + * @param script The script + */ + public void setOnBlur (String script) + { + addAttribute ("onblur", script); + } + + /** + * The onsubmit event occurs when a form is submitted. It only applies to + * the FORM element. + * + * @param script The script + */ + public void setOnSubmit (String script) + { + addAttribute ("onsubmit", script); + } + + /** + * The onreset event occurs when a form is reset. It only applies to the + * FORM element. + * + * @param script The script + */ + public void setOnReset (String script) + { + addAttribute ("onreset", script); + } + + /** + * The onselect event occurs when a user selects some text in a text field. + * This attribute may be used with the input and textarea elements. + * + * @param script The script + */ + public void setOnSelect (String script) + { + addAttribute ("onselect", script); + } + + /** + * The onchange event occurs when a control loses the input focus and its + * value has been modified since gaining focus. This attribute applies to + * the following elements: input, select, and textarea. + * + * @param script The script + */ + public void setOnChange (String script) + { + addAttribute ("onchange", script); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/option.java b/tools/src/org/apache/ecs/xhtml/option.java new file mode 100644 index 0000000000..7a0bd0903c --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/option.java @@ -0,0 +1,474 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <option> tag. The option tag defaults to not + * having a closing </option> because it is optional in the spec. This can + * be overridden by setNeedClosingTag(true) + * + * @version $Id: option.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class option extends MultiPartElement + implements Printable, FocusEvents, FormEvents, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("option"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic constructor. Use the set* methods to set the values of the + * attributes. + */ + public option () + { + } + + /** + * Basic constructor. Use the set* methods to set the values of the + * attributes. + * + * @param value + * sets the attribute value="" + */ + public option (String value) + { + setValue (value); + } + + /** + * Basic constructor. Use the set* methods to set the values of the + * attributes. + * + * @param label + * sets the attribute label="" + * @param value + * sets the attribute value="" + */ + public option (String label, String value) + { + setLabel (label); + setValue (value); + } + + /** + * Basic constructor. Use the set* methods to set the values of the + * attributes. + * + * @param label + * sets the attribute label="" + * @param value + * sets the attribute value="" + */ + public option (String label, int value) + { + setLabel (label); + setValue (value); + } + + /** + * Basic constructor. Use the set* methods to set the values of the + * attributes. + * + * @param label + * sets the attribute label="" + * @param value + * sets the attribute value="" + */ + public option (String label, double value) + { + setLabel (label); + setValue (value); + } + + /** + * Sets the label="" attribute + * + * @param label + * the label="" attribute + */ + public option setLabel (String label) + { + addAttribute ("label", label); + return this; + } + + /** + * Sets the value="" attribute + * + * @param value + * the value="" attribute + */ + public option setValue (String value) + { + addAttribute ("value", value); + return this; + } + + /** + * Sets the value="" attribute + * + * @param value + * the value="" attribute + */ + public option setValue (int value) + { + addAttribute ("value", Integer.toString (value)); + return this; + } + + /** + * Sets the value="" attribute + * + * @param value + * the value="" attribute + */ + public option setValue (double value) + { + addAttribute ("value", Double.toString (value)); + return this; + } + + /** + * Sets the selected value + * + * @param selected + * true or false + */ + public option setSelected (boolean selected) + { + if (selected == true) + addAttribute ("selected", "selected"); + else + removeAttribute ("selected"); + return (this); + } + + /** + * Sets the disabled value + * + * @param disabled + * true or false + */ + public option setDisabled (boolean disabled) + { + if (disabled == true) + addAttribute ("disabled", "disabled"); + else + removeAttribute ("disabled"); + return (this); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public option addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public option addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public option addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public option addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Creates a group of options. + * + * @param element + * a group of options. + */ + public option[] addElement (String[] element) + { + option[] option = new option[element.length]; + for (int x = 0; x < element.length; x++) + { + option[x] = new option ().addElement (element[x]); + } + return (option); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public option removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onfocus event occurs when an element receives focus either by the + * pointing device or by tabbing navigation. This attribute may be used with + * the following elements: label, input, select, textarea, and button. + * + * @param script + * script + */ + public void setOnFocus (String script) + { + addAttribute ("onfocus", script); + } + + /** + * The onblur event occurs when an element loses focus either by the + * pointing device or by tabbing navigation. It may be used with the same + * elements as onfocus. + * + * @param script + * script + */ + public void setOnBlur (String script) + { + addAttribute ("onblur", script); + } + + /** + * The onsubmit event occurs when a form is submitted. It only applies to + * the FORM element. + * + * @param script + * script + */ + public void setOnSubmit (String script) + { + addAttribute ("onsubmit", script); + } + + /** + * The onreset event occurs when a form is reset. It only applies to the + * FORM element. + * + * @param script + * script + */ + public void setOnReset (String script) + { + addAttribute ("onreset", script); + } + + /** + * The onselect event occurs when a user selects some text in a text field. + * This attribute may be used with the INPUT and TEXTAREA elements. + * + * @param script + * script + */ + public void setOnSelect (String script) + { + addAttribute ("onselect", script); + } + + /** + * The onchange event occurs when a control loses the input focus and its + * value has been modified since gaining focus. This attribute applies to + * the following elements: input, select, and textarea. + * + * @param script + * script + */ + public void setOnChange (String script) + { + addAttribute ("onchange", script); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script + * script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/p.java b/tools/src/org/apache/ecs/xhtml/p.java new file mode 100644 index 0000000000..077ff5b7bf --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/p.java @@ -0,0 +1,312 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <p> tag. + *

+ * The HTML <P> tag defaults to not having a closing </P> because it + * is optional in the spec. In XHTML this is not allowed, so ending </p> + * is enforced. + * + * @version $Id: p.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class p extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initialization routine. + */ + { + setElementType ("p"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic constructor. You need to set the attributes using the set* methods. + */ + public p () + { + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param align + * set the value of align="" + */ + public p (String align) + { + setAlign (align); + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param align + * set the value of align="" + * @param value + * set the text after the <P> tag + */ + public p (String value, String align) + { + addElement (value); + setAlign (align); + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param value + * set the text after the <P> tag + */ + public p (Element value) + { + addElement (value); + } + + /** + * Use the set* methods to set the values of the attributes. + * + * @param align + * set the value of align="" + * @param value + * set the text after the <P> tag + */ + public p (Element value, String align) + { + addElement (value); + setAlign (align); + } + + /** + * Sets the align="" attribute + * + * @param align + * the align="" attribute + */ + public p setAlign (String align) + { + addAttribute ("align", align); + return this; + } + + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public p addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public p addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public p addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public p addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public p removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/param.java b/tools/src/org/apache/ecs/xhtml/param.java new file mode 100644 index 0000000000..67eb088a85 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/param.java @@ -0,0 +1,296 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates an param Element + + + + @version $Id: param.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class param extends SinglePartElement implements Printable + +{ + + // Convience variables. + + + + public final static String ref = "ref"; + + public final static String data = "data"; + + public final static String object = "object"; + + + + /** + + private initializer. + + */ + + { + + setElementType("param"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + setBeginEndModifier('/'); + + } + + + + /** + + Default constructor. use set* methods. + + */ + + public param() + + { + + } + + + + /** + + Sets the name of this parameter. + + @param name sets the name of this parameter. + + */ + + public param setName(String name) + + { + + addAttribute("name",name); + + return(this); + + } + + + + /** + + Sets the value of this attribute. + + @param value sets the value attribute. + + */ + + public param setValue(String value) + + { + + addAttribute("value",value); + + return(this); + + } + + + + /** + + Sets the valuetype of this parameter. + + @param valuetype sets the name of this parameter.
+ + ref|data|object convience varaibles provided as param.ref,param.data,param.object + + */ + + public param setValueType(String valuetype) + + { + + addAttribute("value",valuetype); + + return(this); + + } + + + + /** + + Sets the mime type of this object + + @param the mime type of this object + + */ + + public param setType(String cdata) + + { + + addAttribute("type",cdata); + + return(this); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public param addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public param addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public param addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public param addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public param removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/pre.java b/tools/src/org/apache/ecs/xhtml/pre.java new file mode 100644 index 0000000000..9dd0af4cac --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/pre.java @@ -0,0 +1,574 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <pre> tag. + + + + @version $Id: pre.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class pre extends MultiPartElement implements MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("pre"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + setPrettyPrint(false); + + } + + + + /** + + Basic constructor. You need to set the attributes using the + + set* methods. + + */ + + public pre() + + { + + } + + + + /** + + Use the set* methods to set the values + + of the attributes. + + + + @param element set the value of <pre>value</pre> + + */ + + public pre(Element element) + + { + + addElement(element); + + } + + + + /** + + Use the set* methods to set the values + + of the attributes. + + + + @param value set the value of <pre>value</pre> + + @param width set the value of width="" + + */ + + public pre(String value, int width) + + { + + setWidth(width); + + addElement(value); + + } + + + + /** + + Use the set* methods to set the values + + of the attributes. + + + + @param element set the value of <pre>value</pre> + + @param width set the value of width="" + + */ + + public pre(Element element, int width) + + { + + setWidth(width); + + addElement(element); + + } + + + + /** + + Use the set* methods to set the values + + of the attributes. + + + + @param element set the value of <pre>value</pre> + + @param width set the value of width="" + + */ + + public pre(Element element, String width) + + { + + setWidth(width); + + addElement(element); + + } + + + + /** + + Use the set* methods to set the values + + of the attributes. + + + + @param value set the value of <pre>value</pre> + + */ + + public pre(String value) + + { + + addElement(value); + + } + + + + /** + + Sets the width="" attribute + + @param width the width="" attribute + + */ + + public pre setWidth(int width) + + { + + addAttribute("width",Integer.toString(width)); + + return this; + + } + + + + /** + + Sets the width="" attribute + + @param width the width="" attribute + + */ + + public pre setWidth(String width) + + { + + addAttribute("width",width); + + return this; + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public pre addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public pre addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public pre addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public pre addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public pre removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/q.java b/tools/src/org/apache/ecs/xhtml/q.java new file mode 100644 index 0000000000..df6c0f65e0 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/q.java @@ -0,0 +1,570 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <q> tag. + + + + @version $Id: q.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class q extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("q"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public q() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public q(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public q(String element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + @param cite sets the cite="" attribute. + + */ + + public q(Element element, String cite) + + { + + addElement(element); + + setCite(cite); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + @param cite sets the cite="" attribute. + + */ + + public q(String element, String cite) + + { + + addElement(element); + + setCite(cite); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + @param cite sets the cite="" attribute. + + */ + + public q(Element element, Element cite) + + { + + addElement(element); + + setCite(cite); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + @param cite sets the cite="" attribute. + + */ + + public q(String element, Element cite) + + { + + addElement(element); + + setCite(cite); + + } + + + + /** + + Sets the cite="" attribute. + + @param cite sets the cite="" attribute. + + */ + + public q setCite(String cite) + + { + + addAttribute("cite",cite); + + return(this); + + } + + + + /** + + Sets the cite="" attribute. + + @param cite sets the cite="" attribute. + + */ + + public q setCite(Element cite) + + { + + addAttribute("cite",cite); + + return(this); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public q addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public q addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public q addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public q addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public q removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/s.java b/tools/src/org/apache/ecs/xhtml/s.java new file mode 100644 index 0000000000..52bfb4084a --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/s.java @@ -0,0 +1,442 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <s> tag. + + + + @version $Id: s.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class s extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("s"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public s() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public s(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public s(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public s addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public s addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public s addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public s addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public s removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/samp.java b/tools/src/org/apache/ecs/xhtml/samp.java new file mode 100644 index 0000000000..267cf0031c --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/samp.java @@ -0,0 +1,442 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <samp> tag. + + + + @version $Id: samp.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class samp extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("samp"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public samp() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public samp(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public samp(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public samp addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public samp addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public samp addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public samp addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public samp removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/script.java b/tools/src/org/apache/ecs/xhtml/script.java new file mode 100644 index 0000000000..88b79814d0 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/script.java @@ -0,0 +1,295 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <script> tag. + *

+ * Note that XHTML script tag doesn't hide the script text withing comments like + * its HTML counterpart does. This difference is caused by the fact that XHTML + * is XML and XML parsers can throw the comments out. Use this tag with browsers + * that support scripting language(s). + * + * @version $Id: script.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class script extends MultiPartElement + implements Printable +{ + + /** + * Private initialization routine. + */ + { + setElementType ("script"); + setCase (LOWERCASE); + setAttributeQuote (true); + setLanguage ("JavaScript1.2"); + setType("text/javascript"); + } + + /** + * Basic constructor. + */ + public script () + { + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + */ + public script (Element element) + { + addElement (element); + } + + /** + * Basic constructor. + * + * @param element + * Optionally adds an Element to the element. + * @param src + * sets the src="" attribute + */ + public script (Element element, String src) + { + if (element != null) + addElement (element); + setSrc (src); + } + + /** + * Basic constructor. + * + * @param element + * Optionally adds an Element to the element. + * @param src + * sets the src="" attribute + * @param type + * sets the type="" attribute + */ + public script (Element element, String src, String type) + { + if (element != null) + addElement (element); + setSrc (src); + setType (type); + } + + /** + * Basic constructor. + * + * @param element + * Optionally adds an Element to the element. + * @param src + * sets the src="" attribute + * @param type + * sets the type="" attribute + * @param lang + * sets the language="" attribute + */ + public script (Element element, String src, String type, String lang) + { + if (element != null) + addElement (element); + setSrc (src); + setType (type); + setLanguage (lang); + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + */ + public script (String element) + { + addElement (element); + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + * @param src + * sets the src="" attribute + */ + public script (String element, String src) + { + addElement (element); + setSrc (src); + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + * @param src + * sets the src="" attribute + * @param type + * sets the type="" attribute + */ + public script (String element, String src, String type) + { + addElement (element); + setSrc (src); + setType (type); + } + + /** + * Basic constructor. + * + * @param element + * Adds an Element to the element. + * @param src + * sets the src="" attribute + * @param type + * sets the type="" attribute + * @param lang + * sets the language="" attribute + */ + public script (String element, String src, String type, String lang) + { + addElement (element); + setSrc (src); + setType (type); + setLanguage (lang); + } + + /** + * Sets the src="" attribute + * + * @param src + * the src="" attribute + */ + public script setSrc (String src) + { + addAttribute ("src", src); + return this; + } + + /** + * Sets the type="" attribute + * + * @param type + * the type="" attribute + */ + public script setType (String type) + { + addAttribute ("type", type); + return this; + } + + /** + * Sets the language="" attribute + * + * @param language + * the language="" attribute + */ + public script setLanguage (String language) + { + addAttribute ("language", language); + return this; + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public script addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public script addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public script addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public script addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public script removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/select.java b/tools/src/org/apache/ecs/xhtml/select.java new file mode 100644 index 0000000000..b74867b029 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/select.java @@ -0,0 +1,489 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <select> tag. + * + * @version $Id: select.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class select extends MultiPartElement + implements Printable, PageEvents, FormEvents, MouseEvents, KeyEvents +{ + + /** + * Private initializer + */ + { + setElementType ("select"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic constructor. Use the set* methods. + */ + public select () + { + } + + /** + * Basic Constructor. + * + * @param name + * set the NAME="" attribute + */ + public select (String name) + { + setName (name); + } + + /** + * Basic Constructor. + * + * @param name + * set the name="" attribute + * @param size + * set the size="" attribute + */ + public select (String name, String size) + { + setName (name); + setSize (size); + } + + /** + * Basic Constructor. + * + * @param name + * set the name="" attribute + * @param size + * set the size="" attribute + */ + public select (String name, int size) + { + setName (name); + setSize (size); + } + + /** + * Basic Constructor. + * + * @param name + * set the name="" attribute + * @param element + * provide a group of strings to be converted to options + * elements. + */ + public select (String name, String[] element) + { + setName (name); + addElement (element); + } + + /** + * Basic Constructor. + * + * @param name + * set the name="" attribute + * @param element + * provide a group of strings to be converted to options + * elements. + */ + public select (String name, option[] element) + { + setName (name); + addElement (element); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public select addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public select addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the Element. + * + * @param element + * adds and Element to the Element. + */ + public select addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds a group of elements to the select element. + * + * @param element + * adds a group of elements to the select element. + */ + public select addElement (option[] element) + { + for (int x = 0; x < element.length; x++) + { + addElementToRegistry (element[x]); + } + return (this); + } + + /** + * Adds an Element to the Element. + * + * @param element + * adds and Element to the Element. + */ + public select addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Creates a group of option elements and adds them to this select. + * + * @param element + * adds a group of option elements to this select. + */ + public select addElement (String[] element) + { + option[] options = new option ().addElement (element); + addElement (options); + return (this); + } + + /** + * Sets the name="" attribute + * + * @param name + * the name="" attribute + */ + public select setName (String name) + { + addAttribute ("name", name); + return this; + } + + /** + * Sets the size="" attribute + * + * @param size + * the size="" attribute + */ + public select setSize (String size) + { + addAttribute ("size", size); + return this; + } + + /** + * Sets the size="" attribute + * + * @param size + * the size="" attribute + */ + public select setSize (int size) + { + setSize (Integer.toString (size)); + return this; + } + + /** + * Sets the multiple value + * + * @param multiple + * true or false + */ + public select setMultiple (boolean multiple) + { + if (multiple == true) + addAttribute ("multiple", "multiple"); + else + removeAttribute ("multiple"); + return (this); + } + + /** + * Sets the tabindex="" attribute + * + * @param index the tabindex="" attribute + */ + public select setTabindex (String index) + { + addAttribute ("tabindex", index); + return this; + } + + /** + * Sets the tabindex="" attribute + * + * @param index the tabindex="" attribute + */ + public select setTabindex (int index) + { + setTabindex (Integer.toString (index)); + return this; + } + + /** + * Sets the disabled value + * + * @param disabled + * true or false + */ + public select setDisabled (boolean disabled) + { + if (disabled == true) + addAttribute ("disabled", "disabled"); + else + removeAttribute ("disabled"); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public select removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onload event occurs when the user agent finishes loading a window or + * all frames within a frameset. This attribute may be used with body and + * frameset elements. + * + * @param script The script + */ + public void setOnLoad (String script) + { + addAttribute ("onload", script); + } + + /** + * The onunload event occurs when the user agent removes a document from a + * window or frame. This attribute may be used with body and frameset + * elements. + * + * @param script The script + */ + public void setOnUnload (String script) + { + addAttribute ("onunload", script); + } + + /** + * The onsubmit event occurs when a form is submitted. It only applies to + * the FORM element. + * + * @param script The script + */ + public void setOnSubmit (String script) + { + addAttribute ("onsubmit", script); + } + + /** + * The onreset event occurs when a form is reset. It only applies to the + * FORM element. + * + * @param script The script + */ + public void setOnReset (String script) + { + addAttribute ("onreset", script); + } + + /** + * The onselect event occurs when a user selects some text in a text field. + * This attribute may be used with the input and textarea elements. + * + * @param script The script + */ + public void setOnSelect (String script) + { + addAttribute ("onselect", script); + } + + /** + * The onchange event occurs when a control loses the input focus and its + * value has been modified since gaining focus. This attribute applies to + * the following elements: input, select, and textarea. + * + * @param script The script + */ + public void setOnChange (String script) + { + addAttribute ("onchange", script); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/small.java b/tools/src/org/apache/ecs/xhtml/small.java new file mode 100644 index 0000000000..fdc62f2607 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/small.java @@ -0,0 +1,442 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <small> tag. + + + + @version $Id: small.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class small extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("small"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public small() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public small(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public small(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public small addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public small addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public small addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public small addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public small removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/span.java b/tools/src/org/apache/ecs/xhtml/span.java new file mode 100644 index 0000000000..407697570c --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/span.java @@ -0,0 +1,430 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <span> tag. + + + + @version $Id: span.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class span extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("span"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + + + /** + + Basic constructor. You need to set the attributes using the + + set* methods. + + */ + + public span() + + { + + } + + + + /** + + Use the set* methods to set the values + + of the attributes. + + + + @param value set the value of <span>value</span> + + */ + + public span(String value) + + { + + addElement(value); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public span addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public span addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public span addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public span addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public span removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/strike.java b/tools/src/org/apache/ecs/xhtml/strike.java new file mode 100644 index 0000000000..77dc6e6c55 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/strike.java @@ -0,0 +1,442 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <strike> tag. + + + + @version $Id: strike.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class strike extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("strike"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public strike() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public strike(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public strike(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public strike addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public strike addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public strike addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public strike addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public strike removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/strong.java b/tools/src/org/apache/ecs/xhtml/strong.java new file mode 100644 index 0000000000..9a977d7aea --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/strong.java @@ -0,0 +1,442 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <strong> tag. + + + + @version $Id: strong.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class strong extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initializer + + */ + + { + + setElementType("strong"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. Use the set* methods. + + */ + + public strong() + + { + + } + + + + /** + + Basic Constructor. Creats a strong object with its contents set. + + @param element set the content of the strong element + + */ + + public strong(String element) + + { + + addElement(element); + + } + + + + /** + + Basic Constructor. Creats a strong object with its contents set. + + @param element set the content of the strong element + + */ + + public strong(Element element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public strong addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public strong addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the Element. + + @param element adds and Element to the Element. + + */ + + public strong addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the Element. + + @param element adds and Element to the Element. + + */ + + public strong addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public strong removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/style.java b/tools/src/org/apache/ecs/xhtml/style.java new file mode 100644 index 0000000000..a9b68238b1 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/style.java @@ -0,0 +1,306 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <style> tag. + + + + @version $Id: style.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class style extends MultiPartElement implements Printable + +{ + + /** type=text/css */ + + public static final String css = "text/css"; + + + + /** + + Private initialization routine. + + */ + + { + + setElementType("style"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public style() + + { + + } + + + + /** + + Basic constructor. + + @param type the type="" attribute + + */ + + public style(String type) + + { + + setType(type); + + } + + + + /** + + Basic constructor. + + @param type the type="" attribute + + @param element Adds an Element to the element. + + */ + + public style(String type, Element element) + + { + + setType(type); + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param type the type="" attribute + + @param element Adds an Element to the element. + + */ + + public style(String type, String element) + + { + + setType(type); + + addElement(element); + + } + + + + /** + + Sets the type="" attribute + + @param type the type="" attribute + + */ + + public style setType(String type) + + { + + addAttribute("type",type); + + return this; + + } + + + + /** + + Sets the media="" attribute + + @param media the media="" attribute + + */ + + public style setMedia(String media) + + { + + addAttribute("media",media); + + return this; + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public style addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public style addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public style addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public style addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public style removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/sub.java b/tools/src/org/apache/ecs/xhtml/sub.java new file mode 100644 index 0000000000..c7402e95ba --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/sub.java @@ -0,0 +1,442 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <sub> tag. + + + + @version $Id: sub.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class sub extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("sub"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public sub() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public sub(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public sub(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public sub addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public sub addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public sub addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public sub addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public sub removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/sup.java b/tools/src/org/apache/ecs/xhtml/sup.java new file mode 100644 index 0000000000..d665279641 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/sup.java @@ -0,0 +1,442 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <sup> tag. + + + + @version $Id: sup.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class sup extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("sup"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public sup() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public sup(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public sup(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public sup addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public sup addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public sup addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public sup addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public sup removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/table.java b/tools/src/org/apache/ecs/xhtml/table.java new file mode 100644 index 0000000000..cb793721d3 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/table.java @@ -0,0 +1,509 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <table> object. + * + * @version $Id: table.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class table extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private iniitialization routine + */ + { + setElementType ("table"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + public table () + { + } + + /** + * Allows one to set the border size. + * + * @param border + * sets the border="" attribute. + */ + public table (int border) + { + setBorder (border); + } + + /** + * Allows one to set the border size. + * + * @param border + * sets the border="" attribute. + * @param cellSpacing + * sets the cellSpacing="" attribute. + * @param cellPadding + * sets the cellSPadding="" attribute. + * @param width + * optionally sets the width="" attribute. + * @param className + * optionally sets the class="" attribute. + */ + public table (String border, String cellSpacing, String cellPadding, + String width, String className) + { + setBorder (border); + setCellSpacing(cellSpacing); + setCellPadding(cellPadding); + if (width != null) + setWidth(width); + if (className != null) + setClass(className); + } + + /** + * Allows one to set the border size. + * + * @param border + * sets the border="" attribute. + */ + public table (String border) + { + setBorder (border); + } + + + + /** + * Set the summary="" attribue. + * + * @param summary + * sets the summary="" attribute. + */ + public table setSummary (String summary) + { + addAttribute ("summary", summary); + return (this); + } + + /** + * Sets the align="" attribute. + * + * @param align + * sets the align="" attribute. You can use the AlignType.* + * variables for convience. + */ + public table setAlign (String align) + { + addAttribute ("align", align); + return (this); + } + + /** + * Sets the width="" attribute. + * + * @param width + * sets the width="" attribute. + */ + public table setWidth (String width) + { + addAttribute ("width", width); + return (this); + } + + /** + * Sets the height="" attribute. + * + * @param width + * sets the height="" attribute. + */ + public table setHeight (String height) + { + addAttribute ("height", height); + return (this); + } + + /** + * Sets the width="" attribute. + * + * @param width + * sets the width="" attribute. + */ + public table setWidth (int width) + { + addAttribute ("width", Integer.toString (width)); + return (this); + } + + /** + * Sets the height="" attribute. + * + * @param width + * sets the height="" attribute. + */ + public table setHeight (int height) + { + addAttribute ("height", Integer.toString (height)); + return (this); + } + + /** + * Sets the cols="" attribute. + * + * @param width + * sets the cols="" attribute. + */ + public table setCols (int cols) + { + addAttribute ("cols", Integer.toString (cols)); + return (this); + } + + /** + * Sets the cols="" attribute. + * + * @param width + * sets the cols="" attribute. + */ + public table setCols (String cols) + { + addAttribute ("cols", cols); + return (this); + } + + /** + * Sets the cellpading="" attribute. + * + * @param cellpadding + * sets the cellpading="" attribute. + */ + public table setCellPadding (int cellpadding) + { + addAttribute ("cellpadding", Integer.toString (cellpadding)); + return (this); + } + + /** + * Sets the cellspacing="" attribute. + * + * @param spacing + * sets the cellspacing="" attribute. + */ + public table setCellSpacing (int cellspacing) + { + addAttribute ("cellspacing", Integer.toString (cellspacing)); + return (this); + } + + /** + * Sets the cellpading="" attribute. + * + * @param cellpadding + * sets the cellpading="" attribute. + */ + public table setCellPadding (String cellpadding) + { + addAttribute ("cellpadding", cellpadding); + return (this); + } + + /** + * Sets the cellspacing="" attribute. + * + * @param spacing + * sets the cellspacing="" attribute. + */ + public table setCellSpacing (String cellspacing) + { + addAttribute ("cellspacing", cellspacing); + return (this); + } + + /** + * Sets the border="" attribute. + * + * @param border + * sets the border="" attribute. + */ + public table setBorder (int border) + { + addAttribute ("border", Integer.toString (border)); + return (this); + } + + /** + * Sets the border="" attribute. + * + * @param border + * sets the border="" attribute. + */ + public table setBorder (String border) + { + addAttribute ("border", border); + return (this); + } + + /** + * Sets the frame="" attribute. + * + * @param frame + * sets the frame="" attribute. + */ + public table setFrame (String frame) + { + addAttribute ("frame", frame); + return (this); + } + + /** + * Sets the rules="" attribute. + * + * @param rules + * sets the rules="" attribute. + */ + public table setRules (String rules) + { + addAttribute ("rules", rules); + return (this); + } + + /** + * Sets the bordercolor="" attribute + * + * @param color + * the bgcolor="" attribute + */ + public table setBorderColor (String color) + { + addAttribute ("bordercolor", HtmlColor.convertColor (color)); + return this; + } + + /** + * Sets the bgcolor="" attribute + * + * @param color + * the bgcolor="" attribute + */ + public table setBgColor (String color) + { + addAttribute ("bgcolor", HtmlColor.convertColor (color)); + return this; + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public table addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public table addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public table addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public table addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public table removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/tbody.java b/tools/src/org/apache/ecs/xhtml/tbody.java new file mode 100644 index 0000000000..bdfde18fe9 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/tbody.java @@ -0,0 +1,582 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <tbody> object. + + @version $Id: tbody.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class tbody extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + private initializer. + + */ + + { + + setElementType("tbody"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + public tbody() + + { + + } + + + + /** + + Sets the span="" attribute. + + @param span sets the span="" attribute. + + */ + + public tbody setSpan(String span) + + { + + addAttribute("span",span); + + return(this); + + } + + + + /** + + Sets the span="" attribute. + + @param span sets the span="" attribute. + + */ + + public tbody setSpan(int span) + + { + + addAttribute("span",Integer.toString(span)); + + return(this); + + } + + + + /** + + Supplies user agents with a recommended cell width. (Pixel Values) + + @param width how many pixels to make cell + + */ + + public tbody setWidth(int width) + + { + + addAttribute("width",Integer.toString(width)); + + return(this); + + } + + + + /** + + Supplies user agents with a recommended cell width. (Pixel Values) + + @param width how many pixels to make cell + + */ + + public tbody setWidth(String width) + + { + + addAttribute("width",width); + + return(this); + + } + + + + /** + + Sets the align="" attribute convience variables are provided in the AlignType interface + + @param align Sets the align="" attribute + + */ + + public tbody setAlign(String align) + + { + + addAttribute("align",align); + + return(this); + + } + + + + /** + + Sets the valign="" attribute convience variables are provided in the AlignType interface + + @param valign Sets the valign="" attribute + + */ + + public tbody setVAlign(String valign) + + { + + addAttribute("valign",valign); + + return(this); + + } + + + + /** + + Sets the char="" attribute. + + @param character the character to use for alignment. + + */ + + public tbody setChar(String character) + + { + + addAttribute("char",character); + + return(this); + + } + + + + /** + + Sets the charoff="" attribute. + + @param char_off When present this attribute specifies the offset + + of the first occurrence of the alignment character on each line. + + */ + + public tbody setCharOff(int char_off) + + { + + addAttribute("charoff",Integer.toString(char_off)); + + return(this); + + } + + + + /** + + Sets the charoff="" attribute. + + @param char_off when present this attribute specifies the offset + + of the first occurrence of the alignment character on each line. + + */ + + public tbody setCharOff(String char_off) + + { + + addAttribute("charoff",char_off); + + return(this); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public tbody addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public tbody addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public tbody addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public tbody addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public tbody removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/td.java b/tools/src/org/apache/ecs/xhtml/td.java new file mode 100644 index 0000000000..97bdd93034 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/td.java @@ -0,0 +1,567 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <td> object. + * + * @version $Id: td.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class td extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * private initializer. + */ + { + setElementType ("td"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic Constructor use set* methods. + */ + public td () + { + } + + /** + * Constructor. + * + new td ("popupCenter", AlignType.CENTER, AlignType.MIDDLE, true); + * + * @param className class name + * @param hAlign horizontal - e.g. AlignType.LEFT + * @param vAlign vertical - e.g. AlignType.TOP + * @param nowrap no wrap + */ + public td (String className, String hAlign, String vAlign, boolean nowrap) + { + this(); + if (className != null) + setClass(className); + if (hAlign != null) + setAlign(hAlign); + if (vAlign != null) + setVAlign(vAlign); + setNoWrap(nowrap); + } // td + + /** + * Constructor + * @param className class name + * @param hAlign horizontal - e.g. AlignType.LEFT + * @param vAlign vertical - e.g. AlignType.TOP + * @param value added Element - if null nbsp is added + * @param nowrap no wrap + */ + public td (String className, String hAlign, String vAlign, + boolean nowrap, Element value) + { + this (className, hAlign, vAlign, nowrap); + if (value == null) + addElement(NBSP); + else + addElement(value); + } // td + + /** + * Basic Constructor with Element use set* methods. + * @param value added Element + */ + public td (Element value) + { + addElement (value); + } + + /** + * Basic Constructor with Element use set* methods. + * @param value added Element + */ + public td (String value) + { + addElement (value); + } + + /* + * Basic Constructor use set* methods. @param close. Print the closing tag + * or not. public td(boolean close) { setNeedClosingTag(close); } + */ + /** + * Sets the abbr="" attribute. + * + * @param cdata + * sets the abbr="" attribute. + */ + public td setAbbr (String cdata) + { + addAttribute ("abbr", cdata); + return (this); + } + + /** + * Sets the axis="" attribute + * + * @param cdata + * sets the axis="" attribute + */ + public td setAxis (String cdata) + { + addAttribute ("axis", cdata); + return (this); + } + + /** + * Sets the axes="" attribute + * + * @param id_refs + * list of id's for header cells + */ + public td setAxes (String id_refs) + { + addAttribute ("axes", id_refs); + return (this); + } + + /** + * Sets the rowspan="" attribute + * + * @param rowspan + * number of rows spaned by cell + */ + public td setRowSpan (int rowspan) + { + addAttribute ("rowspan", Integer.toString (rowspan)); + return (this); + } + + /** + * Sets the rowspan="" attribute + * + * @param rowspan + * number of rows spaned by cell + */ + public td setRowSpan (String rowspan) + { + addAttribute ("rowspan", rowspan); + return (this); + } + + /** + * Sets the colspan="" attribute + * + * @param colspan + * number of columns spanned by cell + */ + public td setColSpan (int colspan) + { + addAttribute ("colspan", Integer.toString (colspan)); + return (this); + } + + /** + * Sets the colspan="" attribute + * + * @param colspan + * number of columns spanned by cell + */ + public td setColSpan (String colspan) + { + addAttribute ("colspan", colspan); + return (this); + } + + /** + * Sets word wrap on or off. + * + * @param wrap + * turn word wrap on or off. + */ + public td setNoWrap (boolean wrap) + { + if (wrap == true) + addAttribute ("nowrap", "nowrap"); + else + removeAttribute ("nowrap"); + return (this); + } + + /** + * Supplies user agents with a recommended cell width. (Pixel Values) + * + * @param width + * how many pixels to make cell + */ + public td setWidth (int width) + { + addAttribute ("width", Integer.toString (width)); + return (this); + } + + /** + * Supplies user agents with a recommended cell width. (Pixel Values) + * + * @param width + * how many pixels to make cell + */ + public td setWidth (String width) + { + addAttribute ("width", width); + return (this); + } + + /** + * Supplies user agents with a recommended cell height. (Pixel Values) + * + * @param height + * how many pixels to make cell + */ + public td setHeight (int height) + { + addAttribute ("height", Integer.toString (height)); + return (this); + } + + /** + * Supplies user agents with a recommended cell height. (Pixel Values) + * + * @param height + * how many pixels to make cell + */ + public td setHeight (String height) + { + addAttribute ("height", height); + return (this); + } + + /** + * Sets the align="" attribute convience variables are provided in the + * AlignType interface + * + * @param hAlign + * Sets the align="" attribute + */ + public td setAlign (String hAlign) + { + if (hAlign == null + || hAlign.equals(AlignType.LEFT) + || hAlign.equals(AlignType.CENTER) + || hAlign.equals(AlignType.RIGHT)) + addAttribute ("align", hAlign); + else + throw new IllegalArgumentException (hAlign + + " - Illegal for Horizontal Align(left,center,right)"); + return (this); + } + + /** + * Sets the valign="" attribute convience variables are provided in the + * AlignType interface + * + * @param vAlign + * Sets the valign="" attribute + */ + public td setVAlign (String vAlign) + { + if (vAlign == null + || vAlign.equals(AlignType.TOP) + || vAlign.equals(AlignType.MIDDLE) + || vAlign.equals(AlignType.ABSMIDDLE) + || vAlign.equals(AlignType.BOTTOM) + || vAlign.equals(AlignType.ABSBOTTOM) + || vAlign.equals(AlignType.BASELINE)) + addAttribute ("valign", vAlign); + else + throw new IllegalArgumentException (vAlign + + " - Illegal for Vertical Align(top,middle,bottom..)"); + return (this); + } + + /** + * Sets the char="" attribute. + * + * @param character + * the character to use for alignment. + */ + public td setChar (String character) + { + addAttribute ("char", character); + return (this); + } + + /** + * Sets the charoff="" attribute. + * + * @param char_off + * When present this attribute specifies the offset of the first + * occurrence of the alignment character on each line. + */ + public td setCharOff (int char_off) + { + addAttribute ("charoff", Integer.toString (char_off)); + return (this); + } + + /** + * Sets the charoff="" attribute. + * + * @param char_off + * When present this attribute specifies the offset of the first + * occurrence of the alignment character on each line. + */ + public td setCharOff (String char_off) + { + addAttribute ("charoff", char_off); + return (this); + } + + /** + * Sets the bgcolor="" attribute + * + * @param color + * sets the background color of the cell. + */ + public td setBgColor (String color) + { + addAttribute ("bgcolor", HtmlColor.convertColor (color)); + return (this); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public td addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public td addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public td addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public td addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public td removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } + + /** + * Determine if this element needs a line break, if pretty printing. + */ + public boolean getNeedLineBreak () + { + java.util.Enumeration en = elements (); + int i = 0; + int j = 0; + while (en.hasMoreElements ()) + { + j++; + Object obj = en.nextElement (); + if (obj instanceof img || obj instanceof a) + i++; + } + if (i == j) + return false; + return true; + } +} diff --git a/tools/src/org/apache/ecs/xhtml/textarea.java b/tools/src/org/apache/ecs/xhtml/textarea.java new file mode 100644 index 0000000000..e328fa522d --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/textarea.java @@ -0,0 +1,495 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <textarea></textarea> tag. + * + * @version $Id: textarea.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class textarea extends MultiPartElement + implements PageEvents, FormEvents, MouseEvents, KeyEvents +{ + + public final static String off = "off"; + + public final static String physical = "physical"; + + public final static String virtual = "virtual"; + /** + * Private initializer. + */ + { + setElementType ("textarea"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic Constructor use set* methods. + */ + public textarea () + { + } + + /** + * Basic Constructor use set* methods. + * + * @param rows + * the rows="" attribute + * @param cols + * the cols="" attribute + */ + public textarea (int rows, int cols) + { + setRows (rows); + setCols (cols); + } + + /** + * Basic Constructor use set* methods. + * + * @param rows + * the rows="" attribute + * @param cols + * the cols="" attribute + */ + public textarea (String rows, String cols) + { + setRows (rows); + setCols (cols); + } + + /** + * Basic Constructor use set* methods. + * + * @param name + * the name="" attribute + * @param rows + * the rows="" attribute + * @param cols + * the cols="" attribute + */ + public textarea (String name, int rows, int cols) + { + setName (name); + setRows (rows); + setCols (cols); + } + + /** + * Basic Constructor use set* methods. + * + * @param name + * the name="" attribute + * @param rows + * the rows="" attribute + * @param cols + * the cols="" attribute + */ + public textarea (String name, String rows, String cols) + { + setName (name); + setRows (rows); + setCols (cols); + } + + /** + * Sets the rows="" attribute + * + * @param rows + * Sets the rows="" attribute + */ + public textarea setRows (int rows) + { + setRows (Integer.toString (rows)); + return (this); + } + + /** + * Sets the rows="" attribute + * + * @param rows + * Sets the rows="" attribute + */ + public textarea setRows (String rows) + { + addAttribute ("rows", rows); + return (this); + } + + /** + * Sets the wrap="" attribute + * + * @param wrap + * Sets the wrap="" attribute + */ + public textarea setWrap (String wrap) + { + addAttribute ("wrap", wrap); + return (this); + } + + /** + * Sets the cols="" attribute + * + * @param cols + * Sets the cols="" attribute + */ + public textarea setCols (int cols) + { + setCols (Integer.toString (cols)); + return (this); + } + + /** + * Sets the cols="" attribute + * + * @param cols + * Sets the cols="" attribute + */ + public textarea setCols (String cols) + { + addAttribute ("cols", cols); + return (this); + } + + /** + * Sets the name="" attribute + * + * @param name + * Sets the name="" attribute + */ + public textarea setName (String name) + { + addAttribute ("name", name); + return (this); + } + + /** + * Sets the tabindex="" attribute + * + * @param index the tabindex="" attribute + */ + public textarea setTabindex (String index) + { + addAttribute ("tabindex", index); + return this; + } + + /** + * Sets the tabindex="" attribute + * + * @param index the tabindex="" attribute + */ + public textarea setTabindex (int index) + { + setTabindex (Integer.toString (index)); + return this; + } + + /** + * Sets the readonly value + * + * @param readonly + * true or false + */ + public textarea setReadOnly (boolean readonly) + { + if (readonly == true) + addAttribute ("readonly", "readonly"); + else + removeAttribute ("readonly"); + return (this); + } + + /** + * Sets the disabled value + * + * @param disabled + * true or false + */ + public textarea setDisabled (boolean disabled) + { + if (disabled == true) + addAttribute ("disabled", "disabled"); + else + removeAttribute ("disabled"); + return (this); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public textarea addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public textarea addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public textarea addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public textarea addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public textarea removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onload event occurs when the user agent finishes loading a window or + * all frames within a frameset. This attribute may be used with body and + * frameset elements. + * + * @param script The script + */ + public void setOnLoad (String script) + { + addAttribute ("onload", script); + } + + /** + * The onunload event occurs when the user agent removes a document from a + * window or frame. This attribute may be used with body and frameset + * elements. + * + * @param script The script + */ + public void setOnUnload (String script) + { + addAttribute ("onunload", script); + } + + /** + * The onsubmit event occurs when a form is submitted. It only applies to + * the form element. + * + * @param script The script + */ + public void setOnSubmit (String script) + { + addAttribute ("onsubmit", script); + } + + /** + * The onreset event occurs when a form is reset. It only applies to the + * FORM element. + * + * @param script The script + */ + public void setOnReset (String script) + { + addAttribute ("onreset", script); + } + + /** + * The onselect event occurs when a user selects some text in a text field. + * This attribute may be used with the input and textarea elements. + * + * @param script The script + */ + public void setOnSelect (String script) + { + addAttribute ("onselect", script); + } + + /** + * The onchange event occurs when a control loses the input focus and its + * value has been modified since gaining focus. This attribute applies to + * the following elements: input, select, and textarea. + * + * @param script The script + */ + public void setOnChange (String script) + { + addAttribute ("onchange", script); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param script The script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/tfoot.java b/tools/src/org/apache/ecs/xhtml/tfoot.java new file mode 100644 index 0000000000..5d267a3111 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/tfoot.java @@ -0,0 +1,582 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <tfoot> object. + + @version $Id: tfoot.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class tfoot extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + private initializer. + + */ + + { + + setElementType("tfoot"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + public tfoot() + + { + + } + + + + /** + + Sets the span="" attribute. + + @param span sets the span="" attribute. + + */ + + public tfoot setSpan(String span) + + { + + addAttribute("span",span); + + return(this); + + } + + + + /** + + Sets the span="" attribute. + + @param span sets the span="" attribute. + + */ + + public tfoot setSpan(int span) + + { + + addAttribute("span",Integer.toString(span)); + + return(this); + + } + + + + /** + + Supplies user agents with a recommended cell width. (Pixel Values) + + @param width how many pixels to make cell + + */ + + public tfoot setWidth(int width) + + { + + addAttribute("width",Integer.toString(width)); + + return(this); + + } + + + + /** + + Supplies user agents with a recommended cell width. (Pixel Values) + + @param width how many pixels to make cell + + */ + + public tfoot setWidth(String width) + + { + + addAttribute("width",width); + + return(this); + + } + + + + /** + + Sets the align="" attribute convience variables are provided in the AlignType interface + + @param align Sets the align="" attribute + + */ + + public tfoot setAlign(String align) + + { + + addAttribute("align",align); + + return(this); + + } + + + + /** + + Sets the valign="" attribute convience variables are provided in the AlignType interface + + @param valign Sets the valign="" attribute + + */ + + public tfoot setVAlign(String valign) + + { + + addAttribute("valign",valign); + + return(this); + + } + + + + /** + + Sets the char="" attribute. + + @param character the character to use for alignment. + + */ + + public tfoot setChar(String character) + + { + + addAttribute("char",character); + + return(this); + + } + + + + /** + + Sets the charoff="" attribute. + + @param char_off When present this attribute specifies the offset + + of the first occurrence of the alignment character on each line. + + */ + + public tfoot setCharOff(int char_off) + + { + + addAttribute("charoff",Integer.toString(char_off)); + + return(this); + + } + + + + /** + + Sets the charoff="" attribute. + + @param char_off When present this attribute specifies the offset + + of the first occurrence of the alignment character on each line. + + */ + + public tfoot setCharOff(String char_off) + + { + + addAttribute("charoff",char_off); + + return(this); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public tfoot addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public tfoot addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public tfoot addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public tfoot addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public tfoot removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/th.java b/tools/src/org/apache/ecs/xhtml/th.java new file mode 100644 index 0000000000..840ff1d397 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/th.java @@ -0,0 +1,522 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <th> object. + * + * @version $Id: th.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class th extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * private initializer. + */ + { + setElementType ("th"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic constructor. Use set* methods. + */ + public th () + { + } + + /** + * Basic Constructor use set* methods. + */ + public th (Element element) + { + addElement (element); + } + + /** + * Basic Constructor use set* methods. + */ + public th (String element) + { + addElement (element); + } + + /** + * Constructor + * @param className class name + * @param hAlign horizontal - e.g. AlignType.LEFT + * @param vAlign vertical - e.g. AlignType.TOP + * @param nowrap no wrap + */ + public th (String className, String hAlign, String vAlign, boolean nowrap) + { + this(); + setClass(className); + setAlign(hAlign); + setVAlign(vAlign); + setNoWrap(nowrap); + } // th + + /** + * Constructor + * @param className class name + * @param hAlign horizontal - e.g. AlignType.LEFT + * @param vAlign vertical - e.g. AlignType.TOP + * @param value added Element - if null nbsp is added + * @param nowrap no wrap + */ + public th (String className, String hAlign, String vAlign, + boolean nowrap, Element value) + { + this(className, hAlign, vAlign, nowrap); + if (value == null) + addElement(NBSP); + else + addElement(value); + } // th + + /* + * Basic Constructor use set* methods. @param close. Print the closing tag + * or not. public th(boolean close) { setNeedClosingTag(close); } + */ + /** + * Sets the abbr="" attribute. + * + * @param cdata + * sets the abbr="" attribute. + */ + public th setAbbr (String cdata) + { + addAttribute ("abbr", cdata); + return (this); + } + + /** + * Sets the axis="" attribute + * + * @param cdata + * sets the axis="" attribute + */ + public th setAxis (String cdata) + { + addAttribute ("axis", cdata); + return (this); + } + + /** + * Sets the axes="" attribute + * + * @param id_refs + * list of id's for header cells + */ + public th setAxes (String id_refs) + { + addAttribute ("axes", id_refs); + return (this); + } + + /** + * Sets the rowspan="" attribute + * + * @param span + * number of rows spaned by cell + */ + public th setRowSpan (int span) + { + addAttribute ("rowspan", Integer.toString (span)); + return (this); + } + + /** + * Sets the rowspan="" attribute + * + * @param span + * number of rows spaned by cell + */ + public th setRowSpan (String span) + { + addAttribute ("rowspan", span); + return (this); + } + + /** + * Sets the colspan="" attribute + * + * @param span + * number of columns spanned by cell + */ + public th setColSpan (int span) + { + addAttribute ("colspan", Integer.toString (span)); + return (this); + } + + /** + * Sets the colspan="" attribute + * + * @param span + * number of columns spanned by cell + */ + public th setColSpan (String span) + { + addAttribute ("colspan", span); + return (this); + } + + /** + * Sets word wrap on or off. + * + * @param wrap + * turn word wrap on or off. + */ + public th setNoWrap (boolean wrap) + { + if (wrap == true) + addAttribute ("nowrap", "nowrap"); + else + removeAttribute ("nowrap"); + return (this); + } + + /** + * Supplies user agents with a recommended cell width. (Pixel Values) + * + * @param width + * how many pixels to make cell + */ + public th setWidth (int width) + { + addAttribute ("width", Integer.toString (width)); + return (this); + } + + /** + * Supplies user agents with a recommended cell width. (Pixel Values) + * + * @param width + * how many pixels to make cell + */ + public th setWidth (String width) + { + addAttribute ("width", width); + return (this); + } + + /** + * Supplies user agents with a recommended cell height. (Pixel Values) + * + * @param height + * how many pixels to make cell + */ + public th setHeight (int height) + { + addAttribute ("height", Integer.toString (height)); + return (this); + } + + /** + * Supplies user agents with a recommended cell height. (Pixel Values) + * + * @param height + * how many pixels to make cell + */ + public th setHeight (String height) + { + addAttribute ("height", height); + return (this); + } + + /** + * Sets the align="" attribute convience variables are provided in the + * AlignType interface + * + * @param align + * Sets the align="" attribute + */ + public th setAlign (String align) + { + addAttribute ("align", align); + return (this); + } + + /** + * Sets the valign="" attribute convience variables are provided in the + * AlignType interface + * + * @param valign + * Sets the valign="" attribute + */ + public th setVAlign (String valign) + { + addAttribute ("valign", valign); + return (this); + } + + /** + * Sets the char="" attribute. + * + * @param character + * the character to use for alignment. + */ + public th setChar (String character) + { + addAttribute ("char", character); + return (this); + } + + /** + * Sets the charoff="" attribute. + * + * @param char_off + * When present this attribute specifies the offset of the first + * occurrence of the alignment character on each line. + */ + public th setCharOff (int char_off) + { + addAttribute ("charoff", Integer.toString (char_off)); + return (this); + } + + /** + * Sets the charoff="" attribute. + * + * @param char_off + * When present this attribute specifies the offset of the first + * occurrence of the alignment character on each line. + */ + public th setCharOff (String char_off) + { + addAttribute ("charoff", char_off); + return (this); + } + + /** + * Sets the bgcolor="" attribute + * + * @param color + * sets the background color of the cell. + */ + public th setBgColor (String color) + { + addAttribute ("bgcolor", HtmlColor.convertColor (color)); + return (this); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public th addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public th addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public th addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public th addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public th removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/thead.java b/tools/src/org/apache/ecs/xhtml/thead.java new file mode 100644 index 0000000000..020683cee2 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/thead.java @@ -0,0 +1,582 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <thead> object. + + @version $Id: thead.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class thead extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + private initializer. + + */ + + { + + setElementType("thead"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + public thead() + + { + + } + + + + /** + + Sets the span="" attribute. + + @param span sets the span="" attribute. + + */ + + public thead setSpan(String span) + + { + + addAttribute("span",span); + + return(this); + + } + + + + /** + + Sets the span="" attribute. + + @param span sets the span="" attribute. + + */ + + public thead setSpan(int span) + + { + + addAttribute("span",Integer.toString(span)); + + return(this); + + } + + + + /** + + Supplies user agents with a recommended cell width. (Pixel Values) + + @param width how many pixels to make cell + + */ + + public thead setWidth(int width) + + { + + addAttribute("width",Integer.toString(width)); + + return(this); + + } + + + + /** + + Supplies user agents with a recommended cell width. (Pixel Values) + + @param width how many pixels to make cell + + */ + + public thead setWidth(String width) + + { + + addAttribute("width",width); + + return(this); + + } + + + + /** + + Sets the align="" attribute convience variables are provided in the AlignType interface + + @param align Sets the align="" attribute + + */ + + public thead setAlign(String align) + + { + + addAttribute("align",align); + + return(this); + + } + + + + /** + + Sets the valign="" attribute convience variables are provided in the AlignType interface + + @param valign Sets the valign="" attribute + + */ + + public thead setVAlign(String valign) + + { + + addAttribute("valign",valign); + + return(this); + + } + + + + /** + + Sets the char="" attribute. + + @param character the character to use for alignment. + + */ + + public thead setChar(String character) + + { + + addAttribute("char",character); + + return(this); + + } + + + + /** + + Sets the charoff="" attribute. + + @param char_off when present this attribute specifies the offset + + of the first occurrence of the alignment character on each line. + + */ + + public thead setCharOff(int char_off) + + { + + addAttribute("charoff",Integer.toString(char_off)); + + return(this); + + } + + + + /** + + Sets the charoff="" attribute. + + @param char_off When present this attribute specifies the offset + + of the first occurrence of the alignment character on each line. + + */ + + public thead setCharOff(String char_off) + + { + + addAttribute("charoff",char_off); + + return(this); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public thead addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public thead addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public thead addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public thead addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public thead removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/title.java b/tools/src/org/apache/ecs/xhtml/title.java new file mode 100644 index 0000000000..ffd6239a61 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/title.java @@ -0,0 +1,222 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <title></title> tag. + + + + @version $Id: title.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class title extends MultiPartElement implements Printable + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("title"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + + + /** + + Basic constructor. You need to set the attributes using the + + set* methods. + + */ + + public title() + + { + + } + + + + /** + + This method creates a <title> tag and sets the Element value. + + @param value what goes between <start_tag> <end_tag> + + */ + + public title(String title) + + { + + addElement(title); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public title addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public title addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public title addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public title addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public title removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + +} + diff --git a/tools/src/org/apache/ecs/xhtml/tr.java b/tools/src/org/apache/ecs/xhtml/tr.java new file mode 100644 index 0000000000..142bb3eedc --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/tr.java @@ -0,0 +1,341 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + +import org.apache.ecs.*; + +/** + * This class creates a <tr> object. + * + * @version $Id: tr.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + * @author Bojan Smojver + */ +public class tr extends MultiPartElement + implements Printable, MouseEvents, KeyEvents +{ + + /** + * Private initializer. + */ + { + setElementType ("tr"); + setCase (LOWERCASE); + setAttributeQuote (true); + } + + /** + * Basic Constructor use set* methods. + */ + public tr () + { + } + + /** + * Basic Constructor use set* methods. + */ + public tr (Element element) + { + addElement (element); + } + + /** + * Basic Constructor use set* methods. + */ + public tr (String element) + { + addElement (element); + } + + /* + * Basic Constructor use set* methods. @param close. Print the closing tag + * or not. public tr(boolean close) { setNeedClosingTag(close); } + */ + /** + * Sets the align="" attribute convience variables are provided in the + * AlignType interface + * + * @param align + * Sets the align="" attribute + */ + public tr setAlign (String align) + { + addAttribute ("align", align); + return (this); + } + + /** + * Sets the valign="" attribute convience variables are provided in the + * AlignType interface + * + * @param align + * Sets the valign="" attribute + */ + public tr setVAlign (String valign) + { + addAttribute ("valign", valign); + return (this); + } + + /** + * Sets the char="" attribute. + * + * @param character + * the character to use for alignment. + */ + public tr setChar (String character) + { + addAttribute ("char", character); + return (this); + } + + /** + * Sets the charoff="" attribute. + * + * @param char_off + * When present this attribute specifies the offset of the first + * occurrence of the alignment character on each line. + */ + public tr setCharOff (int char_off) + { + addAttribute ("charoff", Integer.toString (char_off)); + return (this); + } + + /** + * Sets the charoff="" attribute. + * + * @param char_off + * When present this attribute specifies the offset of the first + * occurrence of the alignment character on each line. + */ + public tr setCharOff (String char_off) + { + addAttribute ("charoff", char_off); + return (this); + } + + /** + * Sets the bgcolor="" attribute + * + * @param color + * sets the background color of the cell. + */ + public tr setBgColor (String color) + { + addAttribute ("bgcolor", HtmlColor.convertColor (color)); + return (this); + } + + /** + * Sets the lang="" and xml:lang="" attributes + * + * @param lang + * the lang="" and xml:lang="" attributes + */ + public Element setLang (String lang) + { + addAttribute ("lang", lang); + addAttribute ("xml:lang", lang); + return this; + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public tr addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public tr addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public tr addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param element + * Adds an Element to the element. + */ + public tr addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public tr removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + /** + * The onclick event occurs when the pointing device button is clicked over + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnClick (String script) + { + addAttribute ("onclick", script); + } + + /** + * The ondblclick event occurs when the pointing device button is double + * clicked over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnDblClick (String script) + { + addAttribute ("ondblclick", script); + } + + /** + * The onmousedown event occurs when the pointing device button is pressed + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseDown (String script) + { + addAttribute ("onmousedown", script); + } + + /** + * The onmouseup event occurs when the pointing device button is released + * over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseUp (String script) + { + addAttribute ("onmouseup", script); + } + + /** + * The onmouseover event occurs when the pointing device is moved onto an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOver (String script) + { + addAttribute ("onmouseover", script); + } + + /** + * The onmousemove event occurs when the pointing device is moved while it + * is over an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseMove (String script) + { + addAttribute ("onmousemove", script); + } + + /** + * The onmouseout event occurs when the pointing device is moved away from + * an element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnMouseOut (String script) + { + addAttribute ("onmouseout", script); + } + + /** + * The onkeypress event occurs when a key is pressed and released over an + * element. This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyPress (String script) + { + addAttribute ("onkeypress", script); + } + + /** + * The onkeydown event occurs when a key is pressed down over an element. + * This attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyDown (String script) + { + addAttribute ("onkeydown", script); + } + + /** + * The onkeyup event occurs when a key is released over an element. This + * attribute may be used with most elements. + * + * @param The + * script + */ + public void setOnKeyUp (String script) + { + addAttribute ("onkeyup", script); + } +} diff --git a/tools/src/org/apache/ecs/xhtml/tt.java b/tools/src/org/apache/ecs/xhtml/tt.java new file mode 100644 index 0000000000..c758488344 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/tt.java @@ -0,0 +1,444 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + + + +/** + + This class creates a <tt> tag. + + + + @version $Id: tt.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class tt extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("tt"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public tt() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public tt(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public tt(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public tt addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public tt addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public tt addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public tt addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public tt removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/u.java b/tools/src/org/apache/ecs/xhtml/u.java new file mode 100644 index 0000000000..943207959f --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/u.java @@ -0,0 +1,442 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <u> tag. + + + + @version $Id: u.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class u extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("u"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public u() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public u(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public u(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public u addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public u addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public u addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public u addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public u removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/ul.java b/tools/src/org/apache/ecs/xhtml/ul.java new file mode 100644 index 0000000000..96a3b95906 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/ul.java @@ -0,0 +1,490 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <ul> tag. + + + + @version $Id: ul.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class ul extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("ul"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor, use the set* methods. + + */ + + public ul() + + { + + } + + + + /** + + Basic constructor, use the set* methods. + + @param list an array of li elements. + + */ + + public ul(li[] list) + + { + + addElement(list); + + } + + + + /** + + Basic constructor, use the set* methods. + + @param list an array of string elements to be converted to li. + + */ + + public ul(String[] list) + + { + + addElement(list); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Add a list to the ul + + @param list a list of li objects. + + */ + + public ul addElement(li[] list) + + { + + for(int x = 0; x < list.length; x++) + + { + + addElement(list[x]); + + } + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public ul addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public ul addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public ul addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public ul addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Add a list to the ul + + @param list a list of Strings to be converted to li objects. + + */ + + public ul addElement(String[] element) + + { + + li[] li = new li().addElement(element); + + addElement(li); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public ul removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xhtml/var.java b/tools/src/org/apache/ecs/xhtml/var.java new file mode 100644 index 0000000000..32b1c93ad5 --- /dev/null +++ b/tools/src/org/apache/ecs/xhtml/var.java @@ -0,0 +1,442 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xhtml; + + + +import org.apache.ecs.*; + + + +/** + + This class creates a <var> tag. + + + + @version $Id: var.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + + @author Stephan Nagy + + @author Jon S. Stevens + + @author Bojan Smojver + +*/ + +public class var extends MultiPartElement implements Printable, MouseEvents, KeyEvents + +{ + + /** + + Private initialization routine. + + */ + + { + + setElementType("var"); + + setCase(LOWERCASE); + + setAttributeQuote(true); + + } + + /** + + Basic constructor. + + */ + + public var() + + { + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public var(Element element) + + { + + addElement(element); + + } + + + + /** + + Basic constructor. + + @param element Adds an Element to the element. + + */ + + public var(String element) + + { + + addElement(element); + + } + + + + /** + + Sets the lang="" and xml:lang="" attributes + + @param lang the lang="" and xml:lang="" attributes + + */ + + public Element setLang(String lang) + + { + + addAttribute("lang",lang); + + addAttribute("xml:lang",lang); + + return this; + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public var addElement(String hashcode,Element element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param hashcode name of element for hash table + + @param element Adds an Element to the element. + + */ + + public var addElement(String hashcode,String element) + + { + + addElementToRegistry(hashcode,element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public var addElement(Element element) + + { + + addElementToRegistry(element); + + return(this); + + } + + + + /** + + Adds an Element to the element. + + @param element Adds an Element to the element. + + */ + + public var addElement(String element) + + { + + addElementToRegistry(element); + + return(this); + + } + + /** + + Removes an Element from the element. + + @param hashcode the name of the element to be removed. + + */ + + public var removeElement(String hashcode) + + { + + removeElementFromRegistry(hashcode); + + return(this); + + } + + + + /** + + The onclick event occurs when the pointing device button is clicked + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnClick(String script) + + { + + addAttribute ( "onclick", script ); + + } + + /** + + The ondblclick event occurs when the pointing device button is double + + clicked over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnDblClick(String script) + + { + + addAttribute ( "ondblclick", script ); + + } + + /** + + The onmousedown event occurs when the pointing device button is pressed + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseDown(String script) + + { + + addAttribute ( "onmousedown", script ); + + } + + /** + + The onmouseup event occurs when the pointing device button is released + + over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseUp(String script) + + { + + addAttribute ( "onmouseup", script ); + + } + + /** + + The onmouseover event occurs when the pointing device is moved onto an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOver(String script) + + { + + addAttribute ( "onmouseover", script ); + + } + + /** + + The onmousemove event occurs when the pointing device is moved while it + + is over an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseMove(String script) + + { + + addAttribute ( "onmousemove", script ); + + } + + /** + + The onmouseout event occurs when the pointing device is moved away from + + an element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnMouseOut(String script) + + { + + addAttribute ( "onmouseout", script ); + + } + + + + /** + + The onkeypress event occurs when a key is pressed and released over an + + element. This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyPress(String script) + + { + + addAttribute ( "onkeypress", script ); + + } + + + + /** + + The onkeydown event occurs when a key is pressed down over an element. + + This attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyDown(String script) + + { + + addAttribute ( "onkeydown", script ); + + } + + + + /** + + The onkeyup event occurs when a key is released over an element. This + + attribute may be used with most elements. + + + + @param The script + + */ + + public void setOnKeyUp(String script) + + { + + addAttribute ( "onkeyup", script ); + + } + +} + diff --git a/tools/src/org/apache/ecs/xml/PI.java b/tools/src/org/apache/ecs/xml/PI.java new file mode 100644 index 0000000000..7d9573b179 --- /dev/null +++ b/tools/src/org/apache/ecs/xml/PI.java @@ -0,0 +1,138 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xml; + +import org.apache.ecs.ConcreteElement; +import org.apache.ecs.Element; +import org.apache.ecs.Printable; + +public class PI extends ConcreteElement implements Printable +{ + // Private initializer + { + setBeginStartModifier('?'); + setBeginEndModifier('?'); + setNeedClosingTag(false); + setElementType("xml"); + } + + public PI() + { + } + + /** + Set the version of this document. + @param version the version of this document. + */ + public PI setVersion(String version) + { + addAttribute("version",version); + return(this); + } + + /** + Set the version of this document. + @param version the version of this document. + */ + public PI setVersion(float version) + { + setVersion(Float.toString(version)); + return(this); + } + + /** + Set the version of this document. + @param version the version of this document. + */ + public PI setVersion(double version) + { + setVersion(Double.toString(version)); + return(this); + } + + /** + Sets the target of this document. + It is used to identigy the application + to which the instruction is directed. + @param target The target application. + */ + public PI setTarget(String target) + { + setElementType(target); + return(this); + } + + /** + * Add an additional instruction (which works like an XML + * attribute) to the PI + * + * @param name - Name of instruction (e.g. standalone) + * @param value - value of instruction (e.g. "no") + */ + public PI addInstruction(String name, String value) { + addAttribute(name, value); + return(this); + } + + /** + Adds an Element to the element. + @param hashcode name of element for hash table + @param element Adds an Element to the element. + */ + public PI addElement(String hashcode,Element element) + { + addElementToRegistry(hashcode,element); + return(this); + } + /** + Adds an Element to the element. + @param hashcode name of element for hash table + @param element Adds an Element to the element. + */ + public PI addElement(String hashcode,String element) + { + addElementToRegistry(hashcode,element); + return(this); + } + /** + Adds an Element to the element. + @param element Adds an Element to the element. + */ + public PI addElement(Element element) + { + addElementToRegistry(element); + return(this); + } + /** + Adds an Element to the element. + @param element Adds an Element to the element. + */ + public PI addElement(String element) + { + addElementToRegistry(element); + return(this); + } + /** + Removes an Element from the element. + @param hashcode the name of the element to be removed. + */ + public PI removeElement(String hashcode) + { + removeElementFromRegistry(hashcode); + return(this); + } +} diff --git a/tools/src/org/apache/ecs/xml/XML.java b/tools/src/org/apache/ecs/xml/XML.java new file mode 100644 index 0000000000..2c92ca8f5a --- /dev/null +++ b/tools/src/org/apache/ecs/xml/XML.java @@ -0,0 +1,223 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xml; + +import org.apache.ecs.*; + +/** + * This class creates a generic <> tag. + * + * @version $Id: XML.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ + * @author Stephan Nagy + * @author Jon S. Stevens + */ +public class XML extends MultiPartElement + implements Printable +{ + + /** + * Default constructor use set* Methods. With this name. + * + * @param element_type + * The name of this element. + */ + public XML (String element_type) + { + setElementType (element_type); + } + + /** + * Construct a new XML element with this name,
+ * and specify if it needs the element tag closed. + * + * @param element_type + * The name of this element. + * @param close + * Should it have a closing tag + */ + public XML (String element_type, boolean close) + { + setElementType (element_type); + setNeedClosingTag (close); + } + + /** + * Construct a new XML element with this name, and specify a filter for it. + * + * @param element_type + * The name of this element. + * @param filter + * a new Filter for this element override the default. + */ + public XML (String element_type, Filter filter) + { + setElementType (element_type); + setFilter (filter); + } + + /** + * Construct a new XML element with this name, and specify a filter for it. + * + * @param element_type + * The name of this element. + * @param close + * Should it have a closing tag + * @param filter + * Should this element be filtered? + */ + public XML (String element_type, boolean close, boolean filter) + { + setElementType (element_type); + setNeedClosingTag (close); + setFilterState (filter); + } + + /** + * Construct a new XML element with this name, and specify a filter for it. + * + * @param element_type + * The name of this element. + * @param close + * Should it have a closing tag + * @param filter + * a new Filter for this element override the default. + */ + public XML (String element_type, boolean close, Filter filter) + { + setElementType (element_type); + setNeedClosingTag (close); + setFilter (filter); + } + + /** + * Add a new attribute to this XML tag. + * + * @param attribute + * the attribute name + * @param attribute_value + * the value of the attribute set this to
+ * "ECS_NO_ATTRIBUTE_VALUE" if this attribute
+ * doesn't take a value. + */ + public XML addXMLAttribute (String attribute, String attribute_value) + { + addAttribute (attribute, attribute_value); + return (this); + } + + /** + * Add an element to the valuie of <>VALUE</> + * + * @param element + * the value of <>VALUE</> + */ + public XML addElement (String element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public XML addElement (String hashcode, Element element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Adds an Element to the element. + * + * @param hashcode + * name of element for hash table + * @param element + * Adds an Element to the element. + */ + public XML addElement (String hashcode, String element) + { + addElementToRegistry (hashcode, element); + return (this); + } + + /** + * Add an element to the valuie of <>VALUE</> + * + * @param element + * the value of <>VALUE</> + */ + public XML addElement (Element element) + { + addElementToRegistry (element); + return (this); + } + + /** + * Removes an Element from the element. + * + * @param hashcode + * the name of the element to be removed. + */ + public XML removeElement (String hashcode) + { + removeElementFromRegistry (hashcode); + return (this); + } + + public boolean getNeedLineBreak () + { + boolean linebreak = true; + + java.util.Enumeration en = elements (); + + // if this tag has one child, and it's a String, then don't + // do any linebreaks to preserve whitespace + + while (en.hasMoreElements ()) + { + Object obj = en.nextElement (); + if (obj instanceof StringElement) + { + linebreak = false; + break; + } + + } + + return linebreak; + } + + public boolean getBeginEndModifierDefined () + { + boolean answer = false; + + if (!this.getNeedClosingTag ()) + answer = true; + + return answer; + } + + public char getBeginEndModifier () + { + return '/'; + } +} diff --git a/tools/src/org/apache/ecs/xml/XMLDocument.java b/tools/src/org/apache/ecs/xml/XMLDocument.java new file mode 100644 index 0000000000..75c0011fa2 --- /dev/null +++ b/tools/src/org/apache/ecs/xml/XMLDocument.java @@ -0,0 +1,330 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.apache.ecs.xml; + +import java.io.Serializable; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.util.*; +import org.apache.ecs.ConcreteElement; +import org.apache.ecs.xml.XML; +import org.apache.ecs.xml.PI; + +/** + * XMLDocument This is the container for XML elements that can be used similar + * to org.apache.ecs.Document. However, it correctly handles XML elements and + * doesn't have any notion of a head, body, etc., that is associated with HTML + * documents. + * + * @author Brett McLaughlin + */ +public class XMLDocument + implements Serializable, Cloneable +{ + + /** Default Version */ + private static final float DEFAULT_XML_VERSION = 1.0f; + + /** Version Declaration - FIXME!! */ + private String versionDecl; + + /** Prolog */ + private Vector prolog; + + /** "Body" of document */ + private XML content; + + /** @serial codeset codeset */ + private String codeset = null; + + /** + * This sets the document up. Since an XML document can be pretty much + * anything you want, all it does is create an XML Instruction for the + * default version and sets the document to be standalone. + */ + public XMLDocument () + { + this (DEFAULT_XML_VERSION, true); + } + + /** + * This sets the document up. Since an XML document can be pretty much + * anything, all this does is create the XML Instruction for the version + * specified and set the document to be standalone. + * + * @param version - + * version of XML this document is + */ + public XMLDocument (double version) + { + this (version, true); + } + + /** + * This sets the document up. Since an XML document can be pretty much + * anything, all this does is create the XML Instruction with the version + * specified, and identifies the document as standalone if set + * + * @param version - + * version of XML document is + * @param standalone - + * boolean: true if standalone, else false + */ + public XMLDocument (double version, boolean standalone) + { + prolog = new Vector (2); + StringBuffer versionStr = new StringBuffer (); + versionStr.append (""); + else + versionStr.append ("no\"?>\n"); + this.versionDecl = versionStr.toString (); + /** + * FIXME: ECS currently does not do any ordering of attributes. Although + * about 99% of the time, this has no problems, in the initial XML + * declaration, it can be a problem in certain frameworks (e.g. + * Cocoon/Xerces/Xalan). So instead of adding an element here, we have + * to store this first command in a String and add it to the output at + * output time. + */ + /** + * PI versionDecl = new PI().setTarget("xml"); if (standalone) + * versionDecl.addInstruction("standalone", "yes"); else + * versionDecl.addInstruction("standalone", "no"); + * versionDecl.setVersion(version); prolog.addElement(versionDecl); + */ + } + + /** + * This sets the document up. Since an XML document can be pretty much + * anything, all this does is create the XML Instruction with the version + * specified, and identifies the document as standalone if set. This also + * allows the codeset to be set as well. + * + * @param version - + * version of XML document is + * @param standalone - + * boolean: truetext/xsl type. + * + * @param href = + * String reference to stylesheet + */ + public XMLDocument addStylesheet (String href) + { + return addStylesheet (href, "text/xsl"); + } + + /** + * This adds the specified element to the prolog of the document + * + * @param element - + * Element to add + */ + public XMLDocument addToProlog (ConcreteElement element) + { + prolog.addElement (element); + return (this); + } + + /** + * This adds an element to the XML document. If the document is empty, it + * sets the passed in element as the root element. + * + * @param element - + * XML Element to add + * @return XMLDocument - modified document + */ + public XMLDocument addElement (XML element) + { + if (content == null) + content = element; + else + content.addElement (element); + return (this); + } + + /** + * Write the document to the OutputStream + * + * @param out - + * OutputStream to write to + */ + public void output (OutputStream out) + { + /** + * FIXME: The other part of the version hack! Add the version + * declaration to the beginning of the document. + */ + try + { + out.write (versionDecl.getBytes ()); + } + catch (Exception e) + { + } + for (int i = 0; i < prolog.size (); i++) + { + ConcreteElement e = (ConcreteElement)prolog.elementAt (i); + e.output (out); + } + if (content != null) + content.output (out); + } + + /** + * Write the document to the PrinteWriter + * + * @param out - + * PrintWriter to write to + */ + public void output (PrintWriter out) + { + /** + * FIXME: The other part of the version hack! Add the version + * declaration to the beginning of the document. + */ + out.write (versionDecl); + for (int i = 0; i < prolog.size (); i++) + { + ConcreteElement e = (ConcreteElement)prolog.elementAt (i); + e.output (out); + } + if (content != null) + content.output (out); + } + + /** + * Override toString so it does something useful + * + * @return String - representation of the document + */ + public final String toString () + { + StringBuffer retVal = new StringBuffer (); + if (codeset != null) + { + for (int i = 0; i < prolog.size (); i++) + { + ConcreteElement e = (ConcreteElement)prolog.elementAt (i); + retVal.append (e.toString (getCodeset ()) + "\n"); + } + if (content != null) + retVal.append (content.toString (getCodeset ())); + } + else + { + for (int i = 0; i < prolog.size (); i++) + { + ConcreteElement e = (ConcreteElement)prolog.elementAt (i); + retVal.append (e.toString () + "\n"); + } + if (content != null) + retVal.append (content.toString ()); + } + /** + * FIXME: The other part of the version hack! Add the version + * declaration to the beginning of the document. + */ + return versionDecl + retVal.toString (); + } + + /** + * Override toString so it prints something useful + * + * @param codeset - + * String codeset to use + * @return String - representation of the document + */ + public final String toString (String codeset) + { + StringBuffer retVal = new StringBuffer (); + for (int i = 0; i < prolog.size (); i++) + { + ConcreteElement e = (ConcreteElement)prolog.elementAt (i); + retVal.append (e.toString (getCodeset ()) + "\n"); + } + if (content != null) + retVal.append (content.toString (getCodeset ()) + "\n"); + /** + * FIXME: The other part of the version hack! Add the version + * declaration to the beginning of the document. + */ + return versionDecl + retVal.toString (); + } + + /** + * Clone this document + * + * @return Object - cloned XMLDocument + */ + public Object clone () + { + return content.clone (); + } +} diff --git a/tools/src/org/apache/ecs/xml/package.html b/tools/src/org/apache/ecs/xml/package.html new file mode 100644 index 0000000000..37af5ac9a8 --- /dev/null +++ b/tools/src/org/apache/ecs/xml/package.html @@ -0,0 +1,2 @@ + +