I want to share the following code with multiple screens. How do I do that ?
Do I put the code in its own class ? and if so, what would that class look like ?
public Component generateUrgencyHtml(Visit entity){
String html;
if (entity.getUrgencyLevel() == null)
return null;
html = entity.getUrgencyLevel() == null ? "": entity.getUrgencyLevel().getHtml();
Label<String> label = uiComponents.create(Label.TYPE_STRING);
label.setValue(html);
label.setHtmlEnabled(true);
return label;
}