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() { public void updateStyle(boolean applyDictionaryStyle) {
applyLabelStyles(); applyLabelStyles(applyDictionaryStyle);
applyFieldStyles(); applyFieldStyles(applyDictionaryStyle);
} }
protected void applyLabelStyles() { public void updateStyle() {
applyLabelStyles(true);
applyFieldStyles(true);
}
protected void applyLabelStyles(boolean applyDictionaryStyle) {
if (label != null) { if (label != null) {
boolean zoomable = isZoomable(); boolean zoomable = isZoomable();
String style = (zoomable ? STYLE_ZOOMABLE_LABEL : "") + (isMandatoryStyle() ? STYLE_EMPTY_MANDATORY_LABEL : STYLE_NORMAL_LABEL); 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; 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()); String s = buildStyle(gridField.getAD_LabelStyle_ID());
if (!Util.isEmpty(s)) { if (!Util.isEmpty(s)) {
@ -593,12 +598,13 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
label.setStyle(style); label.setStyle(style);
} }
protected void applyFieldStyles() { protected void applyFieldStyles(boolean applyDictionaryStyle) {
if (gridField.getAD_FieldStyle_ID() > 0) String style = null;
if (applyDictionaryStyle && gridField.getAD_FieldStyle_ID() > 0)
{ {
String style = buildStyle(gridField.getAD_FieldStyle_ID()); style = buildStyle(gridField.getAD_FieldStyle_ID());
setFieldStyle(style);
} }
setFieldStyle(style);
} }
protected void setFieldStyle(String 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.setMandatory(false);
editor.setReadWrite(true); editor.setReadWrite(true);
editor.dynamicDisplay(); editor.dynamicDisplay();
editor.updateStyle(false);
editor.addValueChangeListener(this); editor.addValueChangeListener(this);
Label label = editor.getLabel(); Label label = editor.getLabel();
Component fieldEditor = editor.getComponent(); Component fieldEditor = editor.getComponent();
@ -1111,6 +1112,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
editorTo.setMandatory(false); editorTo.setMandatory(false);
editorTo.setReadWrite(true); editorTo.setReadWrite(true);
editorTo.dynamicDisplay(); editorTo.dynamicDisplay();
editorTo.updateStyle(false);
editorTo.addValueChangeListener(this); editorTo.addValueChangeListener(this);
// //
if (displayLength > 0) // set it back if (displayLength > 0) // set it back
@ -1146,6 +1148,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
m_sEditorsFlag.add(null); m_sEditorsFlag.add(null);
m_sEditorsTo.add(null); m_sEditorsTo.add(null);
editor.fillHorizontal(); editor.fillHorizontal();
editor.updateStyle(false);
} }
panel.appendChild(new Space()); panel.appendChild(new Space());
if (group != null) if (group != null)
@ -2010,6 +2013,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
editor.setReadWrite(enabled); editor.setReadWrite(enabled);
editor.setVisible(enabled); editor.setVisible(enabled);
editor.dynamicDisplay(); editor.dynamicDisplay();
editor.updateStyle(false);
if (editor instanceof WPaymentEditor) { if (editor instanceof WPaymentEditor) {
((WPaymentEditor)editor).getComponent().setEnabled(true, false); ((WPaymentEditor)editor).getComponent().setEnabled(true, false);
} }