From: Mathieu Baudier Date: Thu, 15 Jul 2021 09:40:41 +0000 (+0200) Subject: Justify multi terms part. X-Git-Tag: argeo-suite-2.3.1~21 X-Git-Url: https://git.argeo.org/?p=gpl%2Fargeo-suite.git;a=commitdiff_plain;h=958070869dd6785411d0a1f284ac438da606cd10 Justify multi terms part. --- diff --git a/core/org.argeo.entity.ui/src/org/argeo/entity/ui/forms/MultiTermsPart.java b/core/org.argeo.entity.ui/src/org/argeo/entity/ui/forms/MultiTermsPart.java index af8df82..67a4ede 100644 --- a/core/org.argeo.entity.ui/src/org/argeo/entity/ui/forms/MultiTermsPart.java +++ b/core/org.argeo.entity.ui/src/org/argeo/entity/ui/forms/MultiTermsPart.java @@ -20,7 +20,9 @@ import org.argeo.jcr.Jcr; import org.eclipse.swt.SWT; import org.eclipse.swt.events.FocusEvent; import org.eclipse.swt.events.FocusListener; +import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.layout.RowData; import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; @@ -44,10 +46,11 @@ public class MultiTermsPart extends AbstractTermsPart { boolean vertical = SWT.VERTICAL == (getStyle() & SWT.VERTICAL); RowLayout rl = new RowLayout(vertical ? SWT.VERTICAL : SWT.HORIZONTAL); - rl.wrap = true; +// rl.wrap = true; + rl.justify = true; placeholder.setLayout(rl); List currentValue = getValue(); - if (currentValue != null && !currentValue.isEmpty()) + if (currentValue != null && !currentValue.isEmpty()) { for (Term value : currentValue) { Composite block = new Composite(placeholder, SWT.NONE); block.setLayout(CmsUiUtils.noSpaceGridLayout(3)); @@ -79,7 +82,7 @@ public class MultiTermsPart extends AbstractTermsPart { } } - else {// empty + } else {// empty if (isEditable() && !isEditing()) { ToolBar toolBar = new ToolBar(placeholder, SWT.HORIZONTAL); ToolItem addItem = new ToolItem(toolBar, SWT.FLAT);