Author: adubovsky
Date: 2008-11-27 11:39:42 -0500 (Thu, 27 Nov 2008)
New Revision: 11415
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:
changes in editor (seam text)
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-27
16:37:04 UTC (rev 11414)
+++
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java 2008-11-27
16:39:42 UTC (rev 11415)
@@ -12,6 +12,7 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.richfaces.component.html.HtmlEditor;
+import org.richfaces.convert.seamtext.DefaultSeamTextConverter;
import org.richfaces.helloworld.domain.util.componentInfo.ComponentInfo;
;
@@ -39,7 +40,10 @@
// private String skin;
public Editor() {
- value = "It's easy to make *bold text*, /italic text/, |monospace|,-deleted
text-, super^scripts^ or _underlines_.";
+ // value = "It's easy to make *emphasis*, |monospace|, ~deleted text~,
+ // super^scripts^ or _underlines_.";
+ // value = "This is a |<tag attribute=\"value\" />|
example.";
+ 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.";
width = "400";
height = "200";
theme = "simple";
@@ -47,7 +51,7 @@
immediate = false;
rendered = true;
required = false;
- useSeamText = true;
+ useSeamText = false;
viewMode = "visual";
readonly = false;
tabindex = "1";
@@ -58,17 +62,6 @@
}
/*
- * 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) {
@@ -89,39 +82,39 @@
/*
* Custom Converter for editor
*/
-// 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;
-// }
-// };
+ private Converter convert = new Converter() {
+ public Object getAsObject(FacesContext context, UIComponent component,
+ String newValue) throws ConverterException {
-// public Converter getConvert() {
-// return convert;
-// }
+ 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;
+ }
+ };
+
+ public Converter getConvert() {
+ return convert;
+ }
+
/*
* 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-27
16:37:04 UTC (rev 11414)
+++ trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml 2008-11-27
16:39:42 UTC (rev 11415)
@@ -11,11 +11,10 @@
height="#{editor.height}" theme="#{editor.theme}"
onchange="#{event.onchange}" oninit="#{event.oninit}"
onsave="#{event.onsave}" onsetup="#{event.onsetup}"
- autoResize="#{editor.autoResize}"
converterMessage="converterMessage"
- immediate="#{editor.immediate}" rendered="#{editor.rendered}"
- required="#{editor.required}" requiredMessage="requiredMessage"
- useSeamText="#{editor.useSeamText}"
validator="#{editor.validate}"
- validatorMessage="validatorMessage"
+ autoResize="#{editor.autoResize}" 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}"
@@ -26,11 +25,11 @@
</rich:editor>
<h:panelGrid columns="1">
- <f:facet name="header">
- <h:outputText value="Results" />
- </f:facet>
+ <div style="color: red; font-style: italic">Bean Value (escape
+ = false):</div>
<h:outputText value="#{editor.value}" escape="false" />
- <div style="color: red; font-style: italic">HTML code:</div>
+ <div style="color: red; font-style: italic">Bean Value (escape
+ = true):</div>
<h:outputText value="#{editor.value}"
style="font-style: italic; color: gray" />
</h:panelGrid>
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-27
16:37:04 UTC (rev 11414)
+++
trunk/test-applications/seamApp/web/src/main/webapp/Editor/EditorProperty.xhtml 2008-11-27
16:39:42 UTC (rev 11415)
@@ -39,7 +39,7 @@
<h:outputText value="useSeamText (work only with Seam libraries):
"></h:outputText>
<h:selectBooleanCheckbox value="#{editor.useSeamText}"
- valueChangeListener="#{editor.useSeamTextLis}"
onchange="submit();" />
+ onchange="submit();" />
<h:outputText value="readonly: "></h:outputText>
<h:selectBooleanCheckbox value="#{editor.readonly}"