myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r436980 - /myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojo/DojoUtils.java
Date Fri, 25 Aug 2006 22:22:05 GMT
Author: werpu
Date: Fri Aug 25 15:22:03 2006
New Revision: 436980

URL: http://svn.apache.org/viewvc?rev=436980&view=rev
Log:
trinidad fixup for the debug console it now works again

Modified:
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojo/DojoUtils.java

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojo/DojoUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojo/DojoUtils.java?rev=436980&r1=436979&r2=436980&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojo/DojoUtils.java
(original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/dojo/DojoUtils.java
Fri Aug 25 15:22:03 2006
@@ -29,6 +29,7 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
@@ -54,6 +55,15 @@
  * @version $Revision$ $Date$
  */
 public final class DojoUtils {
+    private static final String MYFACES_DOJO_DEBUGCONSOLE_ID = "myfaces_Dojo_Debugger";
+    private static final String DEBUG_CONSOLE_TYPE = "DebugConsole";
+    private static final String LAYOUT_ALIGN_ATTR = "layoutAlign";
+    private static final String DISPLAY_CLOSE_ACTION_ATTR = "displayCloseAction";
+    private static final String RESIZABLE_ATTR = "resizable";
+    private static final String HAS_SHADOW_ATTR = "hasShadow";
+    private static final String CONSTRAIN_TO_CONTAINER_ATTR = "constrainToContainer";
+    private static final String ICON_SRC_ATTR = "iconSrc";
+    private static final String TITLE_ATTR = "title";
     private static final String INCL_TYPE_REQ_KEY                = "DOJO_DEVELOPMENT_INCLUDE";
     private static final Log    log                              = LogFactory.getLog(DojoUtils.class);
     private static final String DOJO_PROVIDE                     = "dojo.provide:";
@@ -96,19 +106,20 @@
         //Since this is for debugging purposes only, we can live with it
 
         writer.startElement(HTML.DIV_ELEM, component);
-        writer.writeAttribute(HTML.ID_ATTR, "myfaces_Dojo_Debugger", null);
-        writer.writeAttribute("dojoType", "DebugConsole", null);
-        writer.writeAttribute("title", "MyFaces Dojo Debug console", null);
-        writer.writeAttribute("iconSrc", "images/flatScreen.gif", null);
-        writer.writeAttribute("constrainToContainer", "1", null);
-        writer.writeAttribute(HTML.STYLE_ATTR, "width: 400px; height: 500px; left: 200px;",
null);
-        writer.writeAttribute("hasShadow", "true", null);
-        writer.writeAttribute("resizable", "true", null);
-        writer.writeAttribute("displayCloseAction", "true", null);
-        writer.writeAttribute("layoutAlign", "client", null);
-
+        writer.writeAttribute(HTML.ID_ATTR, MYFACES_DOJO_DEBUGCONSOLE_ID, null);
+        writer.writeAttribute(HTML.STYLE_ATTR, "width: 400px; height: 500px; left: 200px;",null);
         writer.endElement(HTML.DIV_ELEM);
 
+        
+        Map attributeMap = new HashMap();
+        attributeMap.put(TITLE_ATTR, "MyFaces Dojo Debug console");
+        attributeMap.put(ICON_SRC_ATTR, "images/flatScreen.gif");
+        attributeMap.put(CONSTRAIN_TO_CONTAINER_ATTR, new Integer(1));
+        attributeMap.put(HAS_SHADOW_ATTR, new Boolean(true));
+        attributeMap.put(RESIZABLE_ATTR, new Boolean(true));
+        attributeMap.put(DISPLAY_CLOSE_ACTION_ATTR, new Boolean(true));
+        attributeMap.put(LAYOUT_ALIGN_ATTR, "client");
+        renderWidgetInitializationCode(writer, component, DEBUG_CONSOLE_TYPE,attributeMap,
MYFACES_DOJO_DEBUGCONSOLE_ID, true);
     }
 
     public static void addMainInclude(FacesContext facesContext, UIComponent component, String
javascriptLocation, DojoConfig config)



Mime
View raw message