diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index a4e6882dae..4f0360fe6f 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -81,6 +81,7 @@ As a result, the following maven modules have been deleted: `sirius-web-sample-a - https://github.com/eclipse-sirius/sirius-web/issues/3899[#3899] [diagram] Fix an issue when using alt-tab shortcut and trying to drag a node afterwards - https://github.com/eclipse-sirius/sirius-web/issues/3911[#3911] [diagram] Fix overflow issue with labels, ensuring proper wrapping and ellipsis. - https://github.com/eclipse-sirius/sirius-web/issues/3933[#3933] [vs-code] Fix explorer in vscode extension +- https://github.com/eclipse-sirius/sirius-web/issues/3920[#3920] [form] Fix DateTime widget default style not set === New Features diff --git a/packages/view/backend/sirius-components-view-form/src/main/java/org/eclipse/sirius/components/view/form/adapters/FormColorAdapter.java b/packages/view/backend/sirius-components-view-form/src/main/java/org/eclipse/sirius/components/view/form/adapters/FormColorAdapter.java index 9556eee586..b4e3c30ea4 100644 --- a/packages/view/backend/sirius-components-view-form/src/main/java/org/eclipse/sirius/components/view/form/adapters/FormColorAdapter.java +++ b/packages/view/backend/sirius-components-view-form/src/main/java/org/eclipse/sirius/components/view/form/adapters/FormColorAdapter.java @@ -19,6 +19,7 @@ import org.eclipse.sirius.components.view.form.ButtonDescriptionStyle; import org.eclipse.sirius.components.view.form.CheckboxDescription; import org.eclipse.sirius.components.view.form.CheckboxDescriptionStyle; +import org.eclipse.sirius.components.view.form.DateTimeDescriptionStyle; import org.eclipse.sirius.components.view.form.FormElementFor; import org.eclipse.sirius.components.view.form.FormElementIf; import org.eclipse.sirius.components.view.form.FormPackage; @@ -52,6 +53,9 @@ */ public class FormColorAdapter extends EContentAdapter { + private static final String TRANSPARENT = "transparent"; + + private static final String TEXT_PRIMARY = "theme.palette.text.primary"; private FormStyleSwitch formStyleSwitch; @@ -149,7 +153,7 @@ public Void caseCheckboxDescriptionStyle(CheckboxDescriptionStyle object) { @Override public Void caseLabelDescriptionStyle(LabelDescriptionStyle object) { if (object.getColor() == null) { - object.setColor(this.colorPaletteService.getColorFromPalette(object, "theme.palette.text.primary")); + object.setColor(this.colorPaletteService.getColorFromPalette(object, TEXT_PRIMARY)); } return null; } @@ -157,7 +161,7 @@ public Void caseLabelDescriptionStyle(LabelDescriptionStyle object) { @Override public Void caseLinkDescriptionStyle(LinkDescriptionStyle object) { if (object.getColor() == null) { - object.setColor(this.colorPaletteService.getColorFromPalette(object, "theme.palette.text.primary")); + object.setColor(this.colorPaletteService.getColorFromPalette(object, TEXT_PRIMARY)); } return null; } @@ -165,7 +169,7 @@ public Void caseLinkDescriptionStyle(LinkDescriptionStyle object) { @Override public Void caseListDescriptionStyle(ListDescriptionStyle object) { if (object.getColor() == null) { - object.setColor(this.colorPaletteService.getColorFromPalette(object, "theme.palette.text.primary")); + object.setColor(this.colorPaletteService.getColorFromPalette(object, TEXT_PRIMARY)); } return null; } @@ -173,10 +177,10 @@ public Void caseListDescriptionStyle(ListDescriptionStyle object) { @Override public Void caseMultiSelectDescriptionStyle(MultiSelectDescriptionStyle object) { if (object.getBackgroundColor() == null) { - object.setBackgroundColor(this.colorPaletteService.getColorFromPalette(object, "transparent")); + object.setBackgroundColor(this.colorPaletteService.getColorFromPalette(object, TRANSPARENT)); } if (object.getForegroundColor() == null) { - object.setForegroundColor(this.colorPaletteService.getColorFromPalette(object, "theme.palette.text.primary")); + object.setForegroundColor(this.colorPaletteService.getColorFromPalette(object, TEXT_PRIMARY)); } return null; } @@ -192,10 +196,10 @@ public Void caseRadioDescriptionStyle(RadioDescriptionStyle object) { @Override public Void caseSelectDescriptionStyle(SelectDescriptionStyle object) { if (object.getBackgroundColor() == null) { - object.setBackgroundColor(this.colorPaletteService.getColorFromPalette(object, "transparent")); + object.setBackgroundColor(this.colorPaletteService.getColorFromPalette(object, TRANSPARENT)); } if (object.getForegroundColor() == null) { - object.setForegroundColor(this.colorPaletteService.getColorFromPalette(object, "theme.palette.text.primary")); + object.setForegroundColor(this.colorPaletteService.getColorFromPalette(object, TEXT_PRIMARY)); } return null; } @@ -203,10 +207,10 @@ public Void caseSelectDescriptionStyle(SelectDescriptionStyle object) { @Override public Void caseTextareaDescriptionStyle(TextareaDescriptionStyle object) { if (object.getBackgroundColor() == null) { - object.setBackgroundColor(this.colorPaletteService.getColorFromPalette(object, "transparent")); + object.setBackgroundColor(this.colorPaletteService.getColorFromPalette(object, TRANSPARENT)); } if (object.getForegroundColor() == null) { - object.setForegroundColor(this.colorPaletteService.getColorFromPalette(object, "theme.palette.text.primary")); + object.setForegroundColor(this.colorPaletteService.getColorFromPalette(object, TEXT_PRIMARY)); } return null; } @@ -214,10 +218,21 @@ public Void caseTextareaDescriptionStyle(TextareaDescriptionStyle object) { @Override public Void caseTextfieldDescriptionStyle(TextfieldDescriptionStyle object) { if (object.getBackgroundColor() == null) { - object.setBackgroundColor(this.colorPaletteService.getColorFromPalette(object, "transparent")); + object.setBackgroundColor(this.colorPaletteService.getColorFromPalette(object, TRANSPARENT)); + } + if (object.getForegroundColor() == null) { + object.setForegroundColor(this.colorPaletteService.getColorFromPalette(object, TEXT_PRIMARY)); + } + return null; + } + + @Override + public Void caseDateTimeDescriptionStyle(DateTimeDescriptionStyle object) { + if (object.getBackgroundColor() == null) { + object.setBackgroundColor(this.colorPaletteService.getColorFromPalette(object, TRANSPARENT)); } if (object.getForegroundColor() == null) { - object.setForegroundColor(this.colorPaletteService.getColorFromPalette(object, "theme.palette.text.primary")); + object.setForegroundColor(this.colorPaletteService.getColorFromPalette(object, TEXT_PRIMARY)); } return null; }