You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by fe...@apache.org on 2011/08/25 17:07:42 UTC

svn commit: r1161597 - in /james/hupa/trunk: client/src/main/java/org/apache/hupa/client/bundles/ client/src/main/java/org/apache/hupa/client/dnd/ client/src/main/java/org/apache/hupa/client/mvp/ widgets/src/main/java/org/apache/hupa/widgets/editor/ wi...

Author: felixk
Date: Thu Aug 25 15:07:41 2011
New Revision: 1161597

URL: http://svn.apache.org/viewvc?rev=1161597&view=rev
Log:
Fix deprecated methods (HUPA-73)
RichTextArea.BasicFormatter, RichTextArea.ExtendedFormatter -> RichTextArea.Formatter
ImageBundle -> ClientBundle

Modified:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/bundles/HupaImageBundle.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/dnd/PagingScrollTableRowDragController.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageView.java
    james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/editor/Toolbar.java
    james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/editor/bundles/ToolbarImages.java

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/bundles/HupaImageBundle.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/bundles/HupaImageBundle.java?rev=1161597&r1=1161596&r2=1161597&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/bundles/HupaImageBundle.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/bundles/HupaImageBundle.java Thu Aug 25 15:07:41 2011
@@ -19,17 +19,17 @@
 
 package org.apache.hupa.client.bundles;
 
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.ImageBundle;
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ImageResource;
 
-public interface HupaImageBundle extends ImageBundle{
+public interface HupaImageBundle extends ClientBundle{
 
-    @Resource("attach.png")
-    public AbstractImagePrototype attachmentIcon();
+    @Source("attach.png")
+    ImageResource attachmentIcon();
     
-    @Resource("email_link.png")
-    public AbstractImagePrototype readyToMoveMailIcon();
+    @Source("email_link.png")
+    ImageResource readyToMoveMailIcon();
     
-    @Resource("email.png")
-    public AbstractImagePrototype moveMailIcon();
+    @Source("email.png")
+    ImageResource moveMailIcon();
 }

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/dnd/PagingScrollTableRowDragController.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/dnd/PagingScrollTableRowDragController.java?rev=1161597&r1=1161596&r2=1161597&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/dnd/PagingScrollTableRowDragController.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/dnd/PagingScrollTableRowDragController.java Thu Aug 25 15:07:41 2011
@@ -33,6 +33,7 @@ import com.google.gwt.gen2.table.client.
 import com.google.gwt.user.client.ui.AbsolutePanel;
 import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Image;
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.RootPanel;
 import com.google.gwt.user.client.ui.Widget;
@@ -130,7 +131,7 @@ public class PagingScrollTableRowDragCon
         public RowDragProxy() {
             RndPanel proxyPanel = new RndPanel();
             setIsValid(false);
-            proxy.add(bundle.moveMailIcon().createImage());
+            proxy.add(new Image(bundle.moveMailIcon()));
             proxy.add(new Label(" " + messages.moveMessage()));
             proxyPanel.add(proxy);
             proxyPanel.setWidth("150px");        

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java?rev=1161597&r1=1161596&r2=1161597&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java Thu Aug 25 15:07:41 2011
@@ -78,6 +78,7 @@ import com.google.gwt.user.client.ui.HTM
 import com.google.gwt.user.client.ui.HasValue;
 import com.google.gwt.user.client.ui.HorizontalPanel;
 import com.google.gwt.user.client.ui.Hyperlink;
+import com.google.gwt.user.client.ui.Image;
 import com.google.gwt.user.client.ui.ListBox;
 import com.google.gwt.user.client.ui.MultiWordSuggestOracle;
 import com.google.gwt.user.client.ui.SuggestBox;
@@ -151,7 +152,7 @@ public class IMAPMessageListView extends
         mailTable.setDragHandler(0,30, new DragHandlerFactory() {
 
             public Widget createHandler() {
-                return new HTML(imageBundle.readyToMoveMailIcon().getHTML());
+                return new Image(imageBundle.readyToMoveMailIcon());
             }
             
         });
@@ -318,7 +319,7 @@ public class IMAPMessageListView extends
                     ColumnDefinition<Message, Boolean> columnDef,
                     AbstractCellView<Message> view) {
                 if (columnDef.getCellValue(rowValue)) {
-                    view.setHTML(imageBundle.attachmentIcon().getHTML());
+                    view.setWidget(new Image(imageBundle.attachmentIcon()));
                 } else {
                     view.setHTML("&nbsp");
                 }

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageView.java?rev=1161597&r1=1161596&r2=1161597&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageView.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageView.java Thu Aug 25 15:07:41 2011
@@ -46,6 +46,7 @@ import com.google.gwt.user.client.ui.Flo
 import com.google.gwt.user.client.ui.HTML;
 import com.google.gwt.user.client.ui.HorizontalPanel;
 import com.google.gwt.user.client.ui.Hyperlink;
+import com.google.gwt.user.client.ui.Image;
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.RootPanel;
 import com.google.gwt.user.client.ui.ScrollPanel;
@@ -159,7 +160,7 @@ public class IMAPMessageView extends Com
                 });
                 HorizontalPanel aPanel = new HorizontalPanel();
                 aPanel.addStyleName(HupaCSS.C_attachment);
-                aPanel.add(imageBundle.attachmentIcon().createImage());
+                aPanel.add(new Image(imageBundle.attachmentIcon()));
                 aPanel.add(link);
                 attachments.add(aPanel);
             }

Modified: james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/editor/Toolbar.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/editor/Toolbar.java?rev=1161597&r1=1161596&r2=1161597&view=diff
==============================================================================
--- james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/editor/Toolbar.java (original)
+++ james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/editor/Toolbar.java Thu Aug 25 15:07:41 2011
@@ -38,11 +38,12 @@ import com.google.gwt.event.dom.client.K
 import com.google.gwt.event.dom.client.KeyUpHandler;
 import com.google.gwt.event.logical.shared.ValueChangeEvent;
 import com.google.gwt.event.logical.shared.ValueChangeHandler;
+import com.google.gwt.resources.client.ImageResource;
 import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
 import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.HTML;
 import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Image;
 import com.google.gwt.user.client.ui.PushButton;
 import com.google.gwt.user.client.ui.RichTextArea;
 import com.google.gwt.user.client.ui.ToggleButton;
@@ -53,7 +54,6 @@ import com.google.gwt.user.client.ui.Wid
  * rich text formatting, dynamically displayed only for the available
  * functionality.
  */
-@SuppressWarnings("deprecation")
 public class Toolbar extends Composite {
 
     private class EventHandler implements ClickHandler, KeyUpHandler, KeyDownHandler {
@@ -62,47 +62,47 @@ public class Toolbar extends Composite {
             Widget sender = (Widget) event.getSource();
 
             if (sender == bold) {
-                basic.toggleBold();
+                formatter.toggleBold();
             } else if (sender == italic) {
-                basic.toggleItalic();
+                formatter.toggleItalic();
             } else if (sender == underline) {
-                basic.toggleUnderline();
+                formatter.toggleUnderline();
             } else if (sender == subscript) {
-                basic.toggleSubscript();
+                formatter.toggleSubscript();
             } else if (sender == superscript) {
-                basic.toggleSuperscript();
+                formatter.toggleSuperscript();
             } else if (sender == strikethrough) {
-                extended.toggleStrikethrough();
+                formatter.toggleStrikethrough();
             } else if (sender == indent) {
-                extended.rightIndent();
+                formatter.rightIndent();
             } else if (sender == outdent) {
-                extended.leftIndent();
+                formatter.leftIndent();
             } else if (sender == justifyLeft) {
-                basic.setJustification(RichTextArea.Justification.LEFT);
+                formatter.setJustification(RichTextArea.Justification.LEFT);
             } else if (sender == justifyCenter) {
-                basic.setJustification(RichTextArea.Justification.CENTER);
+                formatter.setJustification(RichTextArea.Justification.CENTER);
             } else if (sender == justifyRight) {
-                basic.setJustification(RichTextArea.Justification.RIGHT);
+                formatter.setJustification(RichTextArea.Justification.RIGHT);
             } else if (sender == insertImage) {
                 String url = Window.prompt("Enter an image URL:", "http://");
                 if (url != null) {
-                    extended.insertImage(url);
+                    formatter.insertImage(url);
                 }
             } else if (sender == createLink) {
                 String url = Window.prompt("Enter a link URL:", "http://");
                 if (url != null) {
-                    extended.createLink(url);
+                    formatter.createLink(url);
                 }
             } else if (sender == removeLink) {
-                extended.removeLink();
+                formatter.removeLink();
             } else if (sender == hr) {
-                extended.insertHorizontalRule();
+                formatter.insertHorizontalRule();
             } else if (sender == ol) {
-                extended.insertOrderedList();
+                formatter.insertOrderedList();
             } else if (sender == ul) {
-                extended.insertUnorderedList();
+                formatter.insertUnorderedList();
             } else if (sender == removeFormat) {
-                extended.removeFormat();
+                formatter.removeFormat();
             } else if (sender == richText) {
                 updateStatus();
             } else if (sender == backColors) {
@@ -136,9 +136,9 @@ public class Toolbar extends Composite {
         public void onValueChange(ValueChangeEvent<ColorPicker> event) {
             ColorPicker sender = event.getValue();
             if (sender == backColorsPicker) {
-                basic.setBackColor(sender.getColor());
+                formatter.setBackColor(sender.getColor());
             } else if (sender == foreColorsPicker) {
-                basic.setForeColor(sender.getColor());
+                formatter.setForeColor(sender.getColor());
             }
             sender.hide();
         }
@@ -147,9 +147,9 @@ public class Toolbar extends Composite {
         public void onValueChange(ValueChangeEvent<FontPicker> event) {
             FontPicker sender = event.getValue();
             if (sender == fontFamilyPicker) {
-               basic.setFontName(sender.getFontName());
+               formatter.setFontName(sender.getFontName());
             } else if (sender == fontSizePicker) {
-               basic.setFontSize(sender.getFontSize());
+               formatter.setFontSize(sender.getFontSize());
             }
             sender.hide();
         }
@@ -160,8 +160,7 @@ public class Toolbar extends Composite {
     
 
     private RichTextArea richText;
-    private RichTextArea.BasicFormatter basic;
-    private RichTextArea.ExtendedFormatter extended;
+    private RichTextArea.Formatter formatter;
 
     private HorizontalPanel topPanel = new HorizontalPanel();
     private ToggleButton bold;
@@ -201,8 +200,8 @@ public class Toolbar extends Composite {
      */
     public Toolbar(RichTextArea richText, ToolbarConstants strings) {
         this.richText = richText;
-        this.basic = richText.getBasicFormatter();
-        this.extended = richText.getExtendedFormatter();
+        this.formatter = richText.getFormatter();
+//        this.extended = richText.getFormatter();
 
         topPanel.setWidth("100%");
 
@@ -210,7 +209,7 @@ public class Toolbar extends Composite {
         setStyleName("gwt-RichTextToolbar");
         richText.addStyleName("hasRichTextToolbar");
 
-        if (basic != null) {
+        if (formatter != null) {
             topPanel.add(bold = createToggleButton(images.bold(), strings.editor_bold()));
             topPanel.add(italic = createToggleButton(images.italic(), strings.editor_italic()));
             topPanel.add(underline = createToggleButton(images.underline(), strings.editor_underline()));
@@ -225,7 +224,7 @@ public class Toolbar extends Composite {
             topPanel.add(justifyRight = createPushButton(images.justifyRight(), strings.editor_justifyRight()));
         }
 
-        if (extended != null) {
+        if (formatter != null) {
             topPanel.add(strikethrough = createToggleButton(images.strikeThrough(), strings.editor_strikeThrough()));
             topPanel.add(indent = createPushButton(images.indent(), strings.editor_indent()));
             topPanel.add(outdent = createPushButton(images.outdent(), strings.editor_outdent()));
@@ -252,15 +251,15 @@ public class Toolbar extends Composite {
         fontSizePicker.addValueChangeHandler(fontHandler);
     }
 
-    private PushButton createPushButton(AbstractImagePrototype img, String tip) {
-        PushButton pb = new PushButton(img.createImage());
+    private PushButton createPushButton(ImageResource img, String tip) {
+        PushButton pb = new PushButton(new Image(img));
         pb.addClickHandler(handler);
         pb.setTitle(tip);
         return pb;
     }
 
-    private ToggleButton createToggleButton(AbstractImagePrototype img, String tip) {
-        ToggleButton tb = new ToggleButton(img.createImage());
+    private ToggleButton createToggleButton(ImageResource img, String tip) {
+        ToggleButton tb = new ToggleButton(new Image(img));
         tb.addClickHandler(handler);
         tb.setTitle(tip);
         return tb;
@@ -270,20 +269,20 @@ public class Toolbar extends Composite {
      * Updates the status of all the stateful buttons.
      */
     private void updateStatus() {
-        if (basic != null) {
-            bold.setDown(basic.isBold());
-            italic.setDown(basic.isItalic());
-            underline.setDown(basic.isUnderlined());
-            subscript.setDown(basic.isSubscript());
-            superscript.setDown(basic.isSuperscript());
+        if (formatter != null) {
+            bold.setDown(formatter.isBold());
+            italic.setDown(formatter.isItalic());
+            underline.setDown(formatter.isUnderlined());
+            subscript.setDown(formatter.isSubscript());
+            superscript.setDown(formatter.isSuperscript());
             foreColorsPicker.hide();
             backColorsPicker.hide();
             fontFamilyPicker.hide();
             fontSizePicker.hide();
         }
 
-        if (extended != null) {
-            strikethrough.setDown(extended.isStrikethrough());
+        if (formatter != null) {
+            strikethrough.setDown(formatter.isStrikethrough());
         }
     }
 }

Modified: james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/editor/bundles/ToolbarImages.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/editor/bundles/ToolbarImages.java?rev=1161597&r1=1161596&r2=1161597&view=diff
==============================================================================
--- james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/editor/bundles/ToolbarImages.java (original)
+++ james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/editor/bundles/ToolbarImages.java Thu Aug 25 15:07:41 2011
@@ -19,61 +19,61 @@
 
 package org.apache.hupa.widgets.editor.bundles;
 
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.ImageBundle;
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ImageResource;
 
 
 
 
     /**
-     * This {@link ImageBundle} is used for all the button icons. Using an image
+     * This {@link ClientBundle} is used for all the button icons. Using an image
      * bundle allows all of these images to be packed into a single image, which
      * saves a lot of HTTP requests, drastically improving startup time.
      */
-    public interface ToolbarImages extends ImageBundle {
+    public interface ToolbarImages extends ClientBundle {
 
-        AbstractImagePrototype bold();
+        ImageResource bold();
 
-        AbstractImagePrototype createLink();
+        ImageResource createLink();
 
-        AbstractImagePrototype hr();
+        ImageResource hr();
 
-        AbstractImagePrototype indent();
+        ImageResource indent();
 
-        AbstractImagePrototype insertImage();
+        ImageResource insertImage();
 
-        AbstractImagePrototype italic();
+        ImageResource italic();
 
-        AbstractImagePrototype justifyCenter();
+        ImageResource justifyCenter();
 
-        AbstractImagePrototype justifyLeft();
+        ImageResource justifyLeft();
 
-        AbstractImagePrototype justifyRight();
+        ImageResource justifyRight();
 
-        AbstractImagePrototype ol();
+        ImageResource ol();
 
-        AbstractImagePrototype outdent();
+        ImageResource outdent();
 
-        AbstractImagePrototype removeFormat();
+        ImageResource removeFormat();
 
-        AbstractImagePrototype removeLink();
+        ImageResource removeLink();
 
-        AbstractImagePrototype strikeThrough();
+        ImageResource strikeThrough();
 
-        AbstractImagePrototype subscript();
+        ImageResource subscript();
 
-        AbstractImagePrototype superscript();
+        ImageResource superscript();
 
-        AbstractImagePrototype ul();
+        ImageResource ul();
 
-        AbstractImagePrototype underline();
+        ImageResource underline();
         
-        AbstractImagePrototype backColors();
+        ImageResource backColors();
         
-        AbstractImagePrototype foreColors();
+        ImageResource foreColors();
         
-        AbstractImagePrototype fonts();
+        ImageResource fonts();
         
-        AbstractImagePrototype fontSizes();
+        ImageResource fontSizes();
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org