summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TWebControlAdapter.php
diff options
context:
space:
mode:
authorxue <>2006-02-15 05:30:58 +0000
committerxue <>2006-02-15 05:30:58 +0000
commitd653bda6c6217f160a4de77e3f2f0ee62096be67 (patch)
tree782018a54c25c0266f12528e5b18e9db71f9ae5b /framework/Web/UI/WebControls/TWebControlAdapter.php
parent2b194248b9bbd75887c1d5f991dca1f3fd441dd5 (diff)
Added TControlAdapter and TWebControlAdapter and their support in TControl and TWebControl.
Diffstat (limited to 'framework/Web/UI/WebControls/TWebControlAdapter.php')
-rw-r--r--framework/Web/UI/WebControls/TWebControlAdapter.php72
1 files changed, 72 insertions, 0 deletions
diff --git a/framework/Web/UI/WebControls/TWebControlAdapter.php b/framework/Web/UI/WebControls/TWebControlAdapter.php
new file mode 100644
index 00000000..23205bba
--- /dev/null
+++ b/framework/Web/UI/WebControls/TWebControlAdapter.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * TWebControlAdapter class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Revision: $ $Date: $
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TWebControlAdapter class
+ *
+ * TWebControlAdapter is the base class for adapters that customize
+ * rendering for the Web control to which the adapter is attached.
+ * It may be used to modify the default markup or behavior for specific
+ * browsers.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @version $Revision: $ $Date: $
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TWebControlAdapter extends TControlAdapter
+{
+ /**
+ * Renders the control to which the adapter is attached.
+ * It calls {@link renderBeginTag}, {@link renderContents} and
+ * {@link renderEndTag} in order.
+ * @param THtmlWriter writer for the rendering purpose
+ */
+ public function render($writer)
+ {
+ $this->renderBeginTag($writer);
+ $this->renderContents($writer);
+ $this->renderEndTag($writer);
+ }
+
+ /**
+ * Renders the openning tag for the attached control.
+ * Default implementation calls the attached control's corresponding method.
+ * @param THtmlWriter writer for the rendering purpose
+ */
+ public function renderBeginTag($writer)
+ {
+ $this->getControl()->renderBeginTag($writer);
+ }
+
+ /**
+ * Renders the body contents within the attached control tag.
+ * Default implementation calls the attached control's corresponding method.
+ * @param THtmlWriter writer for the rendering purpose
+ */
+ public function renderContents($writer)
+ {
+ $this->getControl()->renderContents($writer);
+ }
+
+ /**
+ * Renders the closing tag for the attached control.
+ * Default implementation calls the attached control's corresponding method.
+ * @param THtmlWriter writer for the rendering purpose
+ */
+ public function renderEndTag($writer)
+ {
+ $this->getControl()->renderEndTag($writer);
+ }
+}
+
+?> \ No newline at end of file