Author: adubovsky
Date: 2008-11-25 09:24:07 -0500 (Tue, 25 Nov 2008)
New Revision: 11357
Modified:
trunk/test-applications/jsp/src/main/java/editor/Editor.java
trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp
trunk/test-applications/jsp/src/main/webapp/Editor/EditorProperty.jsp
trunk/test-applications/jsp/src/main/webapp/styles/styles.css
Log:
1) changes in editor
2) add style for editor
Modified: trunk/test-applications/jsp/src/main/java/editor/Editor.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/editor/Editor.java 2008-11-25 13:56:26 UTC
(rev 11356)
+++ trunk/test-applications/jsp/src/main/java/editor/Editor.java 2008-11-25 14:24:07 UTC
(rev 11357)
@@ -16,21 +16,43 @@
private String width;
private String height;
private String theme;
+ private boolean autoResize;
+ private boolean immediate;
+ private boolean rendered;
+ private boolean required;
+ private boolean useSeamText;
+ private String viewMode;
+ private boolean readonly;
+ private String tabindex;
+ private String dialogType;
+ private String language;
+ // 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.";
width = "400";
height = "200";
theme = "simple";
+ autoResize = false;
+ immediate = false;
+ rendered = true;
+ required = false;
+ useSeamText = false;
+ viewMode = "visual";
+ readonly = false;
+ tabindex = "1";
+ dialogType = "window";
+ language = "en";
+ // skin = "default";
}
-
+
/*
* Custom valueChangeListener
*/
public void valueChangeListener(ValueChangeEvent e) {
System.out.println("!!! valueChangeListener work !!!");
}
-
+
/*
* Custom Converter for editor
*/
@@ -39,9 +61,9 @@
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",
@@ -55,27 +77,27 @@
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();
+ String result = (value == null) ? "" : value.toString();
return result;
}
};
}
-
+
/*
* Custom Validator for Editor
*/
public void validate(FacesContext context, UIComponent component,
Object value) throws ValidatorException {
-
+
System.out.println("!!! Validator work !!!");
if (value != null) {
-
+
if (false) {
throw new ValidatorException(new FacesMessage(
FacesMessage.SEVERITY_ERROR, "Validation error",
@@ -83,7 +105,7 @@
}
}
}
-
+
/*
* Add test via reflection
*/
@@ -91,7 +113,7 @@
ComponentInfo info = ComponentInfo.getInstance();
info.addField(htmlEditor);
}
-
+
public String getValue() {
return value;
}
@@ -123,7 +145,7 @@
public void setHtmlEditor(HtmlEditor htmlEditor) {
this.htmlEditor = htmlEditor;
}
-
+
public String getTheme() {
return theme;
}
@@ -131,4 +153,92 @@
public void setTheme(String theme) {
this.theme = theme;
}
+
+ public boolean isAutoResize() {
+ return autoResize;
+ }
+
+ public void setAutoResize(boolean autoResize) {
+ this.autoResize = autoResize;
+ }
+
+ public boolean isImmediate() {
+ return immediate;
+ }
+
+ public void setImmediate(boolean immediate) {
+ this.immediate = immediate;
+ }
+
+ public boolean isRendered() {
+ return rendered;
+ }
+
+ public void setRendered(boolean rendered) {
+ this.rendered = rendered;
+ }
+
+ public boolean isRequired() {
+ return required;
+ }
+
+ public void setRequired(boolean required) {
+ this.required = required;
+ }
+
+ public boolean isUseSeamText() {
+ return useSeamText;
+ }
+
+ public void setUseSeamText(boolean useSeamText) {
+ this.useSeamText = useSeamText;
+ }
+
+ public String getViewMode() {
+ return viewMode;
+ }
+
+ public void setViewMode(String viewMode) {
+ this.viewMode = viewMode;
+ }
+
+ public boolean isReadonly() {
+ return readonly;
+ }
+
+ public void setReadonly(boolean readonly) {
+ this.readonly = readonly;
+ }
+
+ public String getTabindex() {
+ return tabindex;
+ }
+
+ public void setTabindex(String tabindex) {
+ this.tabindex = tabindex;
+ }
+
+ public String getDialogType() {
+ return dialogType;
+ }
+
+ public void setDialogType(String dialogType) {
+ this.dialogType = dialogType;
+ }
+
+ public String getLanguage() {
+ return language;
+ }
+
+ public void setLanguage(String language) {
+ this.language = language;
+ }
+
+ // public String getSkin() {
+ // return skin;
+ // }
+ //
+ // public void setSkin(String skin) {
+ // this.skin = skin;
+ // }
}
Modified: trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp 2008-11-25 13:56:26 UTC
(rev 11356)
+++ trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp 2008-11-25 14:24:07 UTC
(rev 11357)
@@ -11,18 +11,23 @@
height="#{editor.height}" theme="#{editor.theme}"
onchange="#{event.onchange}" oninit="#{event.oninit}"
onsave="#{event.onsave}" onsetup="#{event.onsetup}"
- autoResize="false"
- converter="#{editor.convert}"
+ autoResize="#{editor.autoResize}"
+ converter="#{editor.convert}"
converterMessage="converterMessage"
- immediate="false"
- rendered="true"
- required="false"
+ immediate="#{editor.immediate}"
+ rendered="#{editor.rendered}"
+ required="#{editor.required}"
requiredMessage="requiredMessage"
- useSeamText="false"
+ useSeamText="#{editor.useSeamText}"
validator="#{editor.validate}"
validatorMessage="validatorMessage"
valueChangeListener="#{editor.valueChangeListener}"
- viewMode=""></rich:editor>
+ viewMode="#{editor.viewMode}"
+ readonly="#{editor.readonly}"
+ tabindex="#{editor.tabindex}"
+ dialogType="#{editor.dialogType}"
+ language="#{editor.language}"
+ styleClass="EditorStyleClass" ></rich:editor>
<h:panelGrid columns="1">
<f:facet name="header">
Modified: trunk/test-applications/jsp/src/main/webapp/Editor/EditorProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Editor/EditorProperty.jsp 2008-11-25
13:56:26 UTC (rev 11356)
+++ trunk/test-applications/jsp/src/main/webapp/Editor/EditorProperty.jsp 2008-11-25
14:24:07 UTC (rev 11357)
@@ -8,18 +8,74 @@
<f:facet name="header">
<h:outputText value="List of Attributes" />
</f:facet>
-
+
<h:outputText value="height: "></h:outputText>
- <h:inputText value="#{editor.height}" onchange="submit();"
></h:inputText>
+ <h:inputText value="#{editor.height}"
onchange="submit();"></h:inputText>
<h:outputText value="width: "></h:outputText>
- <h:inputText value="#{editor.width}" onchange="submit();"
></h:inputText>
-
+ <h:inputText value="#{editor.width}"
onchange="submit();"></h:inputText>
+
<h:outputText value="theme: "></h:outputText>
<h:selectOneRadio value="#{editor.theme}"
onchange="submit();">
<f:selectItem itemValue="simple" itemLabel="simple" />
<f:selectItem itemValue="advanced" itemLabel="advanced" />
</h:selectOneRadio>
+
+ <h:outputText value="autoResize: "></h:outputText>
+ <h:selectBooleanCheckbox value="#{editor.autoResize}"
+ onchange="submit();" />
+
+ <h:outputText value="immediate: "></h:outputText>
+ <h:selectBooleanCheckbox value="#{editor.immediate}"
+ onchange="submit();" />
+
+ <h:outputText value="rendered: "></h:outputText>
+ <h:selectBooleanCheckbox value="#{editor.rendered}"
+ onchange="submit();" />
+
+ <h:outputText value="required: "></h:outputText>
+ <h:selectBooleanCheckbox value="#{editor.required}"
+ onchange="submit();" />
+
+ <h:outputText value="useSeamText (work only with Seam libraries):
"></h:outputText>
+ <h:selectBooleanCheckbox value="#{editor.useSeamText}"
+ onchange="submit();" />
+
+ <h:outputText value="readonly: "></h:outputText>
+ <h:selectBooleanCheckbox value="#{editor.readonly}"
+ onchange="submit();" />
+
+ <h:outputText value="viewMode: "></h:outputText>
+ <h:selectOneRadio value="#{editor.viewMode}"
onchange="submit();">
+ <f:selectItem itemValue="visual" itemLabel="visual" />
+ <f:selectItem itemValue="source" itemLabel="source" />
+ </h:selectOneRadio>
+
+ <h:outputText value="tabindex: "></h:outputText>
+ <h:inputText value="#{editor.tabindex}"
onchange="submit();"></h:inputText>
+
+ <h:outputText value="dialogType: "></h:outputText>
+ <h:selectOneRadio value="#{editor.dialogType}"
onchange="submit();">
+ <f:selectItem itemValue="window" itemLabel="window" />
+ <f:selectItem itemValue="modal" itemLabel="modal" />
+ </h:selectOneRadio>
+
+ <h:outputText value="language: "></h:outputText>
+ <h:selectOneRadio value="#{editor.language}"
onchange="submit();">
+ <f:selectItem itemValue="en" itemLabel="en" />
+ <f:selectItem itemValue="de" itemLabel="de" />
+ <f:selectItem itemValue="ru" itemLabel="ru" />
+ </h:selectOneRadio>
+
+ <%--
+ <h:outputText value="skin: "></h:outputText>
+ <h:selectOneRadio value="#{editor.skin}"
onchange="submit();">
+ <f:selectItem itemValue="default" itemLabel="default" />
+ <f:selectItem itemValue="o2k7" itemLabel="o2k7" />
+ <f:selectItem itemValue="null" itemLabel="rich" />
+ </h:selectOneRadio>
+ --%>
+
</h:panelGrid>
<h:commandButton value="add test"
action="#{editor.addHtmlEditor}"></h:commandButton>
</f:subview>
\ No newline at end of file
Modified: trunk/test-applications/jsp/src/main/webapp/styles/styles.css
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/styles/styles.css 2008-11-25 13:56:26 UTC
(rev 11356)
+++ trunk/test-applications/jsp/src/main/webapp/styles/styles.css 2008-11-25 14:24:07 UTC
(rev 11357)
@@ -3,6 +3,11 @@
float: right;
}
+/* Editor */
+.EditorStyleClass {
+
+}
+
/* Suggestion Box */
.entryClass {
color: red;
@@ -15,7 +20,7 @@
/* Message and messages */
.rich-message-label {
- padding: 0px 10px;
+ padding: 0px 10px;
}
.rich-messages-label {
@@ -272,6 +277,7 @@
.body {
background-color: purple;
}
-.test{
- color: green;
+
+.test {
+ color: green;
}
\ No newline at end of file
Show replies by date