Author: adubovsky
Date: 2008-11-27 05:49:35 -0500 (Thu, 27 Nov 2008)
New Revision: 11404
Modified:
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java
trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml
trunk/test-applications/seamApp/web/src/main/webapp/Editor/EditorProperty.xhtml
Log:
+ seamTextSupport in editor
Modified:
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java
===================================================================
---
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java 2008-11-26
19:22:55 UTC (rev 11403)
+++
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java 2008-11-27
10:49:35 UTC (rev 11404)
@@ -12,8 +12,10 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.richfaces.component.html.HtmlEditor;
-import org.richfaces.helloworld.domain.util.componentInfo.ComponentInfo;;
+import org.richfaces.helloworld.domain.util.componentInfo.ComponentInfo;
+;
+
@Name("editor")
@Scope(ScopeType.SESSION)
public class Editor {
@@ -33,10 +35,11 @@
private String dialogType;
private String language;
private boolean configuration;
+
// private String skin;
public Editor() {
- value = "Collaboration-oriented websites require a human-friendly markup language
for easy entry of formatted text in forum posts, wiki pages, blogs, comments, etc. Seam
provides the <s:formattedText/> control for display of formatted text that
conforms to the Seam Text language. Seam Text is implemented using an ANTLR-based parser.
You don't need to know anything about ANTLR to use it, however.";
+ value = "It's easy to make *bold text*, /italic text/, |monospace|,-deleted
text-, super^scripts^ or _underlines_.";
width = "400";
height = "200";
theme = "simple";
@@ -44,7 +47,7 @@
immediate = false;
rendered = true;
required = false;
- useSeamText = false;
+ useSeamText = true;
viewMode = "visual";
readonly = false;
tabindex = "1";
@@ -53,8 +56,19 @@
// skin = "default";
configuration = false;
}
-
+
/*
+ * delete custom converter
+ */
+ public void useSeamTextLis(ValueChangeEvent e) {
+// if (useSeamText) {
+// htmlEditor.setConverter(convert);
+// } else {
+// htmlEditor.setConverter(null);
+// }
+ }
+
+ /*
* attach config file to editor
*/
public void useConfigFile(ValueChangeEvent e) {
@@ -64,7 +78,7 @@
htmlEditor.setConfiguration(null);
}
}
-
+
/*
* Custom valueChangeListener
*/
@@ -75,39 +89,39 @@
/*
* Custom Converter for editor
*/
- public Converter getConvert() {
- return new Converter() {
- public Object getAsObject(FacesContext context,
- UIComponent component, String newValue)
- throws ConverterException {
+// private Converter convert = new Converter() {
+// public Object getAsObject(FacesContext context, UIComponent component,
+// String newValue) throws ConverterException {
+//
+// System.out.println("!!! getAsObject work !!!");
+//
+// if (false)
+// throw new ConverterException(new FacesMessage(
+// FacesMessage.SEVERITY_ERROR, "Converter error",
+// "Error while convert to Object"));
+//
+// return newValue;
+// }
+//
+// public String getAsString(FacesContext context, UIComponent component,
+// Object value) throws ConverterException {
+//
+// System.out.println("!!! getAsString work !!!");
+//
+// if (false)
+// throw new ConverterException(new FacesMessage(
+// FacesMessage.SEVERITY_ERROR, "Converter error",
+// "Error while convert to String"));
+//
+// String result = (value == null) ? "" : value.toString();
+// return result;
+// }
+// };
- System.out.println("!!! getAsObject work !!!");
+// public Converter getConvert() {
+// return convert;
+// }
- if (false)
- throw new ConverterException(new FacesMessage(
- FacesMessage.SEVERITY_ERROR, "Converter error",
- "Error while convert to Object"));
-
- return newValue;
- }
-
- public String getAsString(FacesContext context,
- UIComponent component, Object value)
- throws ConverterException {
-
- System.out.println("!!! getAsString work !!!");
-
- if (false)
- throw new ConverterException(new FacesMessage(
- FacesMessage.SEVERITY_ERROR, "Converter error",
- "Error while convert to String"));
-
- String result = (value == null) ? "" : value.toString();
- return result;
- }
- };
- }
-
/*
* Custom Validator for Editor
*/
Modified: trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml 2008-11-26
19:22:55 UTC (rev 11403)
+++ trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml 2008-11-27
10:49:35 UTC (rev 11404)
@@ -11,16 +11,16 @@
height="#{editor.height}" theme="#{editor.theme}"
onchange="#{event.onchange}" oninit="#{event.oninit}"
onsave="#{event.onsave}" onsetup="#{event.onsetup}"
- autoResize="#{editor.autoResize}" converter="#{editor.convert}"
- converterMessage="converterMessage"
immediate="#{editor.immediate}"
- rendered="#{editor.rendered}" required="#{editor.required}"
- requiredMessage="requiredMessage"
useSeamText="#{editor.useSeamText}"
- validator="#{editor.validate}"
validatorMessage="validatorMessage"
+ autoResize="#{editor.autoResize}"
converterMessage="converterMessage"
+ immediate="#{editor.immediate}" rendered="#{editor.rendered}"
+ required="#{editor.required}" requiredMessage="requiredMessage"
+ useSeamText="#{editor.useSeamText}"
validator="#{editor.validate}"
+ validatorMessage="validatorMessage"
valueChangeListener="#{editor.valueChangeListener}"
viewMode="#{editor.viewMode}" readonly="#{editor.readonly}"
tabindex="#{editor.tabindex}" dialogType="#{editor.dialogType}"
- language="#{editor.language}" styleClass="EditorStyleClass" >
-
+ language="#{editor.language}" styleClass="EditorStyleClass">
+
<f:param name="theme_advanced_resizing" value="true" />
<f:param name="theme_advanced_statusbar_location" value="top"
/>
</rich:editor>
Modified: trunk/test-applications/seamApp/web/src/main/webapp/Editor/EditorProperty.xhtml
===================================================================
---
trunk/test-applications/seamApp/web/src/main/webapp/Editor/EditorProperty.xhtml 2008-11-26
19:22:55 UTC (rev 11403)
+++
trunk/test-applications/seamApp/web/src/main/webapp/Editor/EditorProperty.xhtml 2008-11-27
10:49:35 UTC (rev 11404)
@@ -39,7 +39,7 @@
<h:outputText value="useSeamText (work only with Seam libraries):
"></h:outputText>
<h:selectBooleanCheckbox value="#{editor.useSeamText}"
- onchange="submit();" />
+ valueChangeListener="#{editor.useSeamTextLis}"
onchange="submit();" />
<h:outputText value="readonly: "></h:outputText>
<h:selectBooleanCheckbox value="#{editor.readonly}"
@@ -66,7 +66,7 @@
<f:selectItem itemValue="de" itemLabel="de" />
<f:selectItem itemValue="ru" itemLabel="ru" />
</h:selectOneRadio>
-
+
<h:outputText value="use configuration file: "></h:outputText>
<h:selectBooleanCheckbox value="#{editor.configuration}"
onchange="submit();" valueChangeListener="#{editor.useConfigFile}"
/>
Show replies by date