Skip to content

Commit

Permalink
Updated log viewer to display HTML text properly
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalidze committed May 22, 2015
1 parent 012099b commit c899ddb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
11 changes: 10 additions & 1 deletion src/main/java/org/traccar/web/client/view/LogViewDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@
package org.traccar.web.client.view;

import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.Widget;
import com.sencha.gxt.widget.core.client.Window;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
Expand All @@ -41,7 +44,10 @@ interface LogViewDialogUiBinder extends UiBinder<Widget, LogViewDialog> {
Window window;

@UiField
TextArea logArea;
ScrollPanel logScroll;

@UiField
HTML logArea;

@UiField(provided = true)
String log;
Expand All @@ -50,6 +56,9 @@ public LogViewDialog(String log) {
this.log = log;

uiBinder.createAndBindUi(this);

logScroll.getElement().getStyle().setBackgroundColor("white");
logArea.getElement().getStyle().setPadding(2, Style.Unit.PX);
}

public void show() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@
<ui:with field='log' type='java.lang.String' />

<gxt:Window ui:field="window" pixelSize="640, 480" modal="true" headingText="{i18n.log}">
<container:VerticalLayoutContainer>
<container:child layoutData="{textAreaLayoutData}">
<form:TextArea ui:field="logArea" value="{log}" readOnly="true" />
</container:child>
</container:VerticalLayoutContainer>

<g:ScrollPanel ui:field="logScroll">
<g:HTML ui:field="logArea" HTML="{log}" />
</g:ScrollPanel>
<gxt:button>
<button:TextButton ui:field="closeButton" text="{i18n.close}" />
</gxt:button>
Expand Down

0 comments on commit c899ddb

Please sign in to comment.