Multiple spaces between words in 'Label' trimmed to single space #PL-5024

This commit is contained in:
Yuriy Artamonov 2015-03-17 08:49:58 +00:00
parent 5606c3812e
commit 875f08d45f
3 changed files with 5 additions and 13 deletions

View File

@ -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:

View File

@ -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);
}
}

View File

@ -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);
}
}