mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-03 03:38:33 +08:00
Multiple spaces between words in 'Label' trimmed to single space #PL-5024
This commit is contained in:
parent
5606c3812e
commit
875f08d45f
@ -38,17 +38,7 @@ public class CubaLabelConnector extends LabelConnector {
|
||||
break;
|
||||
|
||||
case TEXT:
|
||||
// clear existing content
|
||||
getWidget().setHTML("");
|
||||
// set multiline text if needed
|
||||
// Haulmont API
|
||||
String text = getState().text;
|
||||
if (text != null && text.contains("\n")) {
|
||||
text = Util.escapeHTML(text).replace("\n", "<br/>");
|
||||
getWidget().setHTML(text);
|
||||
} else {
|
||||
getWidget().setText(text);
|
||||
}
|
||||
getWidget().setText(getState().text);
|
||||
break;
|
||||
|
||||
case HTML:
|
||||
|
@ -47,6 +47,7 @@ public class WebLabel extends WebAbstractComponent<com.vaadin.ui.Label> implemen
|
||||
|
||||
public WebLabel() {
|
||||
component = new CubaLabel();
|
||||
component.setContentMode(ContentMode.PREFORMATTED);
|
||||
|
||||
component.setSizeUndefined();
|
||||
}
|
||||
@ -215,6 +216,6 @@ public class WebLabel extends WebAbstractComponent<com.vaadin.ui.Label> implemen
|
||||
|
||||
@Override
|
||||
public void setHtmlEnabled(boolean htmlEnabled) {
|
||||
component.setContentMode(htmlEnabled ? ContentMode.HTML : ContentMode.TEXT);
|
||||
component.setContentMode(htmlEnabled ? ContentMode.HTML : ContentMode.PREFORMATTED);
|
||||
}
|
||||
}
|
@ -42,6 +42,7 @@ public class WebLabel extends WebAbstractComponent<com.vaadin.ui.Label> implemen
|
||||
|
||||
public WebLabel() {
|
||||
component = new com.vaadin.ui.Label();
|
||||
component.setContentMode(com.vaadin.ui.Label.CONTENT_PREFORMATTED);
|
||||
|
||||
component.setSizeUndefined();
|
||||
}
|
||||
@ -182,6 +183,6 @@ public class WebLabel extends WebAbstractComponent<com.vaadin.ui.Label> implemen
|
||||
|
||||
@Override
|
||||
public void setHtmlEnabled(boolean htmlEnabled) {
|
||||
component.setContentMode(htmlEnabled ? com.vaadin.ui.Label.CONTENT_XHTML : com.vaadin.ui.Label.CONTENT_TEXT);
|
||||
component.setContentMode(htmlEnabled ? com.vaadin.ui.Label.CONTENT_XHTML : com.vaadin.ui.Label.CONTENT_PREFORMATTED);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user