Massive Argeo APIs refactoring
[gpl/argeo-suite.git] / org.argeo.entity.ui / src / org / argeo / entity / ui / forms / MultiTermsPart.java
index 8d407638626ecc8885b08b2b78d53b47f86bc591..e75a9160e5c6cbcf844873fd04ba3842d3fafd43 100644 (file)
@@ -5,15 +5,14 @@ import java.util.List;
 
 import javax.jcr.Item;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.argeo.api.cms.CmsLog;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.MouseDoubleClick;
+import org.argeo.cms.swt.MouseDown;
+import org.argeo.cms.swt.Selected;
 import org.argeo.cms.ui.forms.FormStyle;
-import org.argeo.cms.ui.util.CmsUiUtils;
 import org.argeo.cms.ui.viewers.EditablePart;
 import org.argeo.cms.ui.widgets.ContextOverlay;
-import org.argeo.eclipse.ui.MouseDoubleClick;
-import org.argeo.eclipse.ui.MouseDown;
-import org.argeo.eclipse.ui.Selected;
 import org.argeo.entity.Term;
 import org.argeo.entity.TermsManager;
 import org.argeo.jcr.Jcr;
@@ -32,7 +31,7 @@ import org.eclipse.swt.widgets.ToolItem;
 /** {@link EditablePart} for multiple terms. */
 public class MultiTermsPart extends AbstractTermsPart {
        private static final long serialVersionUID = -4961135649177920808L;
-       private final static Log log = LogFactory.getLog(MultiTermsPart.class);
+       private final static CmsLog log = CmsLog.getLog(MultiTermsPart.class);
 
        public MultiTermsPart(Composite parent, int style, Item item, TermsManager termsManager, String typology) {
                super(parent, style, item, termsManager, typology);
@@ -44,7 +43,7 @@ public class MultiTermsPart extends AbstractTermsPart {
 
                boolean vertical = SWT.VERTICAL == (getStyle() & SWT.VERTICAL);
                RowLayout rl = new RowLayout(vertical ? SWT.VERTICAL : SWT.HORIZONTAL);
-               rl = CmsUiUtils.noMarginsRowLayout(rl);
+               rl = CmsSwtUtils.noMarginsRowLayout(rl);
 //             rl.wrap = true;
 //             rl.justify = true;
                placeholder.setLayout(rl);
@@ -52,11 +51,11 @@ public class MultiTermsPart extends AbstractTermsPart {
                if (currentValue != null && !currentValue.isEmpty()) {
                        for (Term value : currentValue) {
                                Composite block = new Composite(placeholder, SWT.NONE);
-                               block.setLayout(CmsUiUtils.noSpaceGridLayout(3));
+                               block.setLayout(CmsSwtUtils.noSpaceGridLayout(3));
                                Label lbl = new Label(block, SWT.NONE);
                                String display = getTermLabel(value);
                                lbl.setText(display);
-                               CmsUiUtils.style(lbl, style == null ? FormStyle.propertyText.style() : style);
+                               CmsSwtUtils.style(lbl, style == null ? FormStyle.propertyText.style() : style);
                                processTermListLabel(value, lbl);
                                if (isEditable())
                                        lbl.addMouseListener((MouseDoubleClick) (e) -> {
@@ -94,15 +93,15 @@ public class MultiTermsPart extends AbstractTermsPart {
 
                if (isEditing()) {
                        Composite block = new Composite(placeholder, SWT.NONE);
-                       block.setLayout(CmsUiUtils.noSpaceGridLayout(3));
+                       block.setLayout(CmsSwtUtils.noSpaceGridLayout(3));
 
                        createHighlight(block);
 
                        Text txt = new Text(block, SWT.SINGLE | SWT.BORDER);
-                       txt.setLayoutData(CmsUiUtils.fillWidth());
+                       txt.setLayoutData(CmsSwtUtils.fillWidth());
 //                     txt.setMessage("[new]");
 
-                       CmsUiUtils.style(txt, style == null ? FormStyle.propertyText.style() : style);
+                       CmsSwtUtils.style(txt, style == null ? FormStyle.propertyText.style() : style);
 
                        ToolBar toolBar = new ToolBar(block, SWT.HORIZONTAL);
                        ToolItem cancelItem = new ToolItem(toolBar, SWT.FLAT);
@@ -151,7 +150,7 @@ public class MultiTermsPart extends AbstractTermsPart {
 
        @Override
        protected void refresh(ContextOverlay contextArea, String filter, Text txt) {
-               CmsUiUtils.clear(contextArea);
+               CmsSwtUtils.clear(contextArea);
                List<? extends Term> terms = termsManager.listAllTerms(typology.getId());
                List<Term> currentValue = getValue();
                terms: for (Term term : terms) {