Skip to content
Browse files

- PrintWidget now accepts SafeHtml

  • Loading branch information...
1 parent a76deb2 commit ab5a2132996e1fdea535c944a903bba3abfbb583 @alexbiehl alexbiehl committed Apr 2, 2013
View
8 src/main/java/org/fhw/asta/kasse/client/widget/print/PrintWidget.java
@@ -1,10 +1,18 @@
package org.fhw.asta.kasse.client.widget.print;
+import org.fhw.asta.kasse.client.common.HTMLTableBuilder;
+
+import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.user.client.ui.IsWidget;
public interface PrintWidget extends IsWidget {
public void clear();
+
public void addHtml(String html);
+ public void addHtml(SafeHtml safeHtml);
+
+ public void addHtml(HTMLTableBuilder htmlTable);
+
}
View
19 src/main/java/org/fhw/asta/kasse/client/widget/print/PrintWidgetImpl.java
@@ -1,6 +1,9 @@
package org.fhw.asta.kasse.client.widget.print;
+import org.fhw.asta.kasse.client.common.HTMLTableBuilder;
+
import com.google.gwt.core.client.GWT;
+import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
@@ -23,14 +26,22 @@ public PrintWidgetImpl() {
@Override
public void clear() {
- htmlWidget.setHTML("");
-
+ htmlWidget.setHTML("");
}
@Override
public void addHtml(String html) {
- htmlWidget.setHTML(htmlWidget.getHTML()+html);
-
+ htmlWidget.setHTML(htmlWidget.getHTML()+html);
+ }
+
+ @Override
+ public void addHtml(HTMLTableBuilder htmlTable) {
+ addHtml(htmlTable.toString());
+ }
+
+ @Override
+ public void addHtml(SafeHtml safeHtml) {
+ addHtml(safeHtml.asString());
}
}

0 comments on commit ab5a213

Please sign in to comment.
Something went wrong with that request. Please try again.