You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2007/07/30 14:33:17 UTC
svn commit: r560945 -
/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextScreenRenderer.java
Author: jacopoc
Date: Mon Jul 30 05:33:17 2007
New Revision: 560945
URL: http://svn.apache.org/viewvc?view=rev&rev=560945
Log:
Implemented widget screen renderer.
Added:
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextScreenRenderer.java (with props)
Added: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextScreenRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextScreenRenderer.java?view=auto&rev=560945
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextScreenRenderer.java (added)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextScreenRenderer.java Mon Jul 30 05:33:17 2007
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.widget.text;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.GeneralException;
+import org.ofbiz.base.util.UtilFormatOut;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilProperties;
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.entity.GenericDelegator;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.webapp.control.RequestHandler;
+import org.ofbiz.webapp.taglib.ContentUrlTag;
+import org.ofbiz.widget.WidgetContentWorker;
+import org.ofbiz.widget.screen.ModelScreenWidget;
+import org.ofbiz.widget.screen.ScreenStringRenderer;
+import org.ofbiz.service.LocalDispatcher;
+import javolution.util.FastMap;
+
+/**
+ * Widget Library - Text Screen Renderer implementation
+ */
+public class TextScreenRenderer implements ScreenStringRenderer {
+
+ public static final String module = TextScreenRenderer.class.getName();
+
+ public TextScreenRenderer() {}
+
+ public void renderSectionBegin(Writer writer, Map context, ModelScreenWidget.Section section) throws IOException {
+ // do nothing, this is just a place holder container for HTML
+ }
+ public void renderSectionEnd(Writer writer, Map context, ModelScreenWidget.Section section) throws IOException {
+ // do nothing, this is just a place holder container for HTML
+ }
+
+ public void renderContainerBegin(Writer writer, Map context, ModelScreenWidget.Container container) throws IOException {
+ }
+ public void renderContainerEnd(Writer writer, Map context, ModelScreenWidget.Container container) throws IOException {
+ appendWhitespace(writer);
+ }
+
+ public void renderLabel(Writer writer, Map context, ModelScreenWidget.Label label) throws IOException {
+ String labelText = label.getText(context);
+ if (UtilValidate.isEmpty(labelText)) {
+ // nothing to render
+ return;
+ }
+ writer.write(labelText);
+ appendWhitespace(writer);
+ }
+
+ public void renderLink(Writer writer, Map context, ModelScreenWidget.Link link) throws IOException {
+ // TODO: not implemented
+ }
+
+ public void renderImage(Writer writer, Map context, ModelScreenWidget.Image image) throws IOException {
+ // TODO: not implemented
+ }
+
+ public void renderContentBegin(Writer writer, Map context, ModelScreenWidget.Content content) throws IOException {
+ // TODO: not implemented
+ }
+
+ public void renderContentBody(Writer writer, Map context, ModelScreenWidget.Content content) throws IOException {
+ // TODO: not implemented
+ }
+
+ public void renderContentEnd(Writer writer, Map context, ModelScreenWidget.Content content) throws IOException {
+ // TODO: not implemented
+ }
+
+ public void renderContentFrame(Writer writer, Map context, ModelScreenWidget.Content content) throws IOException {
+ // TODO: not implemented
+ }
+
+ public void renderSubContentBegin(Writer writer, Map context, ModelScreenWidget.SubContent content) throws IOException {
+ // TODO: not implemented
+ }
+
+ public void renderSubContentBody(Writer writer, Map context, ModelScreenWidget.SubContent content) throws IOException {
+ // TODO: not implemented
+ }
+
+ public void renderSubContentEnd(Writer writer, Map context, ModelScreenWidget.SubContent content) throws IOException {
+ // TODO: not implemented
+ }
+
+ public void appendWhitespace(Writer writer) throws IOException {
+ // appending line ends for now, but this could be replaced with a simple space or something
+ writer.write("\r\n");
+ }
+}
Propchange: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextScreenRenderer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextScreenRenderer.java
------------------------------------------------------------------------------
svn:keywords = "Date Rev Author URL Id"
Propchange: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextScreenRenderer.java
------------------------------------------------------------------------------
svn:mime-type = text/plain