Author: [email protected]
Date: Wed Jun 24 11:59:19 2009
New Revision: 5630
Modified:
trunk/user/src/com/google/gwt/user/client/ui/RichTextArea.java
trunk/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplStandard.java
Log:
Adds full justification, undo, and redo options to RichTextArea. These
options are widely supported in all modern browsers.
Patch by: jlabanca
Review by: jgw
Issue: 1211, 2185
Modified: trunk/user/src/com/google/gwt/user/client/ui/RichTextArea.java
==============================================================================
--- trunk/user/src/com/google/gwt/user/client/ui/RichTextArea.java
(original)
+++ trunk/user/src/com/google/gwt/user/client/ui/RichTextArea.java Wed Jun
24 11:59:19 2009
@@ -215,6 +215,11 @@
void leftIndent();
/**
+ * Redo an action that was just undone.
+ */
+ void redo();
+
+ /**
* Removes all formatting on the selected text.
*/
void removeFormat();
@@ -233,6 +238,11 @@
* Toggles strikethrough.
*/
void toggleStrikethrough();
+
+ /**
+ * Undo the last action.
+ */
+ void undo();
}
/**
@@ -307,6 +317,11 @@
* Center justification.
*/
public static final Justification CENTER = new Justification("Center");
+
+ /**
+ * Full justification.
+ */
+ public static final Justification FULL = new Justification("Full");
/**
* Left justification.
Modified:
trunk/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplStandard.java
==============================================================================
---
trunk/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplStandard.java
(original)
+++
trunk/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplStandard.java
Wed Jun 24 11:59:19 2009
@@ -138,6 +138,10 @@
execCommand("Outdent", null);
}
+ public void redo() {
+ execCommand("Redo", "false");
+ }
+
public void removeFormat() {
execCommand("RemoveFormat", null);
}
@@ -191,6 +195,8 @@
public void setJustification(Justification justification) {
if (justification == Justification.CENTER) {
execCommand("JustifyCenter", null);
+ } else if (justification == Justification.FULL) {
+ execCommand("JustifyFull", null);
} else if (justification == Justification.LEFT) {
execCommand("JustifyLeft", null);
} else if (justification == Justification.RIGHT) {
@@ -229,6 +235,10 @@
public void toggleUnderline() {
execCommand("Underline", "False");
+ }
+
+ public void undo() {
+ execCommand("Undo", "false");
}
@Override
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---