IDEMPIERE-3614 styles on fields also apply in the find window

This commit is contained in:
Carlos Ruiz 2018-01-16 11:30:55 +01:00
parent ee233577c6
commit dc373fbb4e
2 changed files with 19 additions and 9 deletions

View File

@ -559,12 +559,17 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
}
}
public void updateStyle() {
applyLabelStyles();
applyFieldStyles();
public void updateStyle(boolean applyDictionaryStyle) {
applyLabelStyles(applyDictionaryStyle);
applyFieldStyles(applyDictionaryStyle);
}
protected void applyLabelStyles() {
public void updateStyle() {
applyLabelStyles(true);
applyFieldStyles(true);
}
protected void applyLabelStyles(boolean applyDictionaryStyle) {
if (label != null) {
boolean zoomable = isZoomable();
String style = (zoomable ? STYLE_ZOOMABLE_LABEL : "") + (isMandatoryStyle() ? STYLE_EMPTY_MANDATORY_LABEL : STYLE_NORMAL_LABEL);
@ -573,7 +578,7 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
style = style + STYLE_MOBILE_ZOOMABLE;
}
}
if (gridField.getAD_LabelStyle_ID() > 0)
if (applyDictionaryStyle && gridField.getAD_LabelStyle_ID() > 0)
{
String s = buildStyle(gridField.getAD_LabelStyle_ID());
if (!Util.isEmpty(s)) {
@ -593,12 +598,13 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
label.setStyle(style);
}
protected void applyFieldStyles() {
if (gridField.getAD_FieldStyle_ID() > 0)
protected void applyFieldStyles(boolean applyDictionaryStyle) {
String style = null;
if (applyDictionaryStyle && gridField.getAD_FieldStyle_ID() > 0)
{
String style = buildStyle(gridField.getAD_FieldStyle_ID());
setFieldStyle(style);
style = buildStyle(gridField.getAD_FieldStyle_ID());
}
setFieldStyle(style);
}
protected void setFieldStyle(String style) {

View File

@ -1093,6 +1093,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
editor.setMandatory(false);
editor.setReadWrite(true);
editor.dynamicDisplay();
editor.updateStyle(false);
editor.addValueChangeListener(this);
Label label = editor.getLabel();
Component fieldEditor = editor.getComponent();
@ -1111,6 +1112,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
editorTo.setMandatory(false);
editorTo.setReadWrite(true);
editorTo.dynamicDisplay();
editorTo.updateStyle(false);
editorTo.addValueChangeListener(this);
//
if (displayLength > 0) // set it back
@ -1146,6 +1148,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
m_sEditorsFlag.add(null);
m_sEditorsTo.add(null);
editor.fillHorizontal();
editor.updateStyle(false);
}
panel.appendChild(new Space());
if (group != null)
@ -2010,6 +2013,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
editor.setReadWrite(enabled);
editor.setVisible(enabled);
editor.dynamicDisplay();
editor.updateStyle(false);
if (editor instanceof WPaymentEditor) {
((WPaymentEditor)editor).getComponent().setEnabled(true, false);
}