Skip to content

Commit cb68a52

Browse files
javier-godoypaodb
authored andcommitted
refactor: replace TextArea with Div
1 parent 6799be8 commit cb68a52

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/main/java/com/flowingcode/vaadin/addons/errorwindow/ErrorWindow.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
import com.vaadin.flow.component.button.Button;
2626
import com.vaadin.flow.component.dependency.CssImport;
2727
import com.vaadin.flow.component.dialog.Dialog;
28+
import com.vaadin.flow.component.html.Div;
2829
import com.vaadin.flow.component.icon.VaadinIcon;
2930
import com.vaadin.flow.component.orderedlayout.FlexComponent.Alignment;
3031
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
3132
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
32-
import com.vaadin.flow.component.textfield.TextArea;
3333
import java.io.ByteArrayOutputStream;
3434
import java.io.PrintWriter;
3535
import java.util.UUID;
@@ -190,14 +190,15 @@ private VerticalLayout createExceptionTraceLayout() {
190190
}
191191

192192
protected Component createStackTraceArea() {
193-
final TextArea area = new TextArea();
193+
final Div area = new Div();
194+
area.setClassName("stacktrace");
194195
area.setWidthFull();
195196
area.setHeight("15em");
196197
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
197198
final PrintWriter pw = new PrintWriter(baos);
198199
cause.printStackTrace(pw);
199200
pw.flush();
200-
area.setValue(baos.toString());
201+
area.add(baos.toString());
201202
return area;
202203
}
203204

src/main/resources/META-INF/resources/frontend/flowingcode/error-window.css

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,15 @@
99
font-weight: 600;
1010
font-size: var(--lumo-font-size-l);
1111
margin-top: 1em;
12-
}
12+
}
13+
14+
[theme~="error-window"] .stacktrace {
15+
white-space: pre;
16+
background: rgba(26, 57, 96, 0.1);
17+
overflow: auto;
18+
padding: 0.25em 0.625em;
19+
border-radius: 4px;
20+
font-weight: 600;
21+
margin: 4px 0;
22+
box-sizing: border-box;
23+
}

0 commit comments

Comments
 (0)