r999 - xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes
Ludovic Dubost
ludovic at users.forge.objectweb.org
Tue Mar 28 13:10:40 CEST 2006
Author: ludovic
Date: 2006-03-28 13:10:39 +0200 (Tue, 28 Mar 2006)
New Revision: 999
Modified:
xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/ListClass.java
xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java
Log:
Default separator for list elements in forms should be |
Normal textarea should not fail without velocity
Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/ListClass.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/ListClass.java 2006-03-28 10:14:34 UTC (rev 998)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/ListClass.java 2006-03-28 11:10:39 UTC (rev 999)
@@ -120,7 +120,7 @@
lprop = new StringProperty();
if (isMultiSelect() && getDisplayType().equals("input")) {
- ((ListProperty)lprop).setFormStringSeparator(" ");
+ ((ListProperty)lprop).setFormStringSeparator("|");
}
Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java 2006-03-28 10:14:34 UTC (rev 998)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java 2006-03-28 11:10:39 UTC (rev 999)
@@ -1,25 +1,25 @@
-/*
- * Copyright 2006, XpertNet SARL, and individual contributors as indicated
- * by the contributors.txt.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
- * @author ludovic
- * @author sdumitriu
- */
+/*
+ * Copyright 2006, XpertNet SARL, and individual contributors as indicated
+ * by the contributors.txt.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ * @author ludovic
+ * @author sdumitriu
+ */
package com.xpn.xwiki.objects.classes;
@@ -63,13 +63,16 @@
}
public boolean isWysiwyg(XWikiContext context) {
- String editor = context.getRequest().get("xeditmode");
+ String editor = null;
+ if ((context!=null)&&(context.getRequest()!=null))
+ editor = context.getRequest().get("xeditmode");
+
if (editor!=null) {
- if (editor.equals("text"))
- return false;
- if (editor.equals("wysiwyg"))
- return true;
- }
+ if (editor.equals("text"))
+ return false;
+ if (editor.equals("wysiwyg"))
+ return true;
+ }
editor = getEditor();
@@ -80,7 +83,8 @@
return true;
}
- editor = context.getWiki().getEditorPreference(context);
+ if ((context!=null)&&(context.getWiki()!=null))
+ editor = context.getWiki().getEditorPreference(context);
if (editor!=null) {
if (editor.equals("text"))
@@ -116,10 +120,12 @@
context.put("editor_wysiwyg", wysiwyg);
} else {
VelocityContext vcontext = (VelocityContext) context.get("vcontext");
- vcontext.put("textareaName", tname);
- vcontext.put("textarea", textarea);
- String addscript = context.getWiki().parseTemplate("textarea_text.vm", context);
- buffer.append(addscript);
+ if (vcontext!=null) {
+ vcontext.put("textareaName", tname);
+ vcontext.put("textarea", textarea);
+ String addscript = context.getWiki().parseTemplate("textarea_text.vm", context);
+ buffer.append(addscript);
+ }
}
buffer.append(textarea.toString());
}
More information about the Xwiki-notifications
mailing list