Map feature popup
[gpl/argeo-suite.git] / swt / org.argeo.app.ui / src / org / argeo / app / ui / SuiteUiUtils.java
index dce6d13822ef5dd0309b20f214f9c22a2679dd03..62463c792eab8a2a666867e51c536d37fa26e563 100644 (file)
@@ -18,8 +18,8 @@ import org.argeo.api.cms.ux.CmsStyle;
 import org.argeo.app.api.EntityNames;
 import org.argeo.app.api.EntityType;
 import org.argeo.app.swt.ux.SuiteSwtUtils;
-import org.argeo.app.swt.ux.SwtArgeoApp;
 import org.argeo.app.ux.SuiteUxEvent;
+import org.argeo.cms.acr.ContentUtils;
 import org.argeo.cms.jcr.acr.JcrContent;
 import org.argeo.cms.swt.CmsSwtUtils;
 import org.argeo.cms.swt.dialogs.LightweightDialog;
@@ -41,13 +41,13 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 
 /** UI utilities around SWT and JCR. */
+@Deprecated
 public class SuiteUiUtils {
        public static Text addFormLine(Composite parent, String label, Node node, String property,
                        CmsEditable cmsEditable) {
                Composite lineComposite = SuiteSwtUtils.addLineComposite(parent, 2);
                SuiteSwtUtils.addFormLabel(lineComposite, label);
                String text = Jcr.get(node, property);
-//             int style = cmsEditable.isEditing() ? SWT.WRAP : SWT.WRAP;
                Text txt = SuiteSwtUtils.addFormTextField(lineComposite, text, null, SWT.WRAP);
                if (cmsEditable != null && cmsEditable.isEditing()) {
                        txt.addModifyListener((e) -> {
@@ -63,12 +63,8 @@ public class SuiteUiUtils {
 
        public static Text addFormColumn(Composite parent, String label, Node node, String property,
                        CmsEditable cmsEditable) {
-//             Composite columnComposite = new Composite(parent, SWT.NONE);
-//             columnComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-//             columnComposite.setLayout(new GridLayout(1, false));
                SuiteSwtUtils.addFormLabel(parent, label);
                String text = Jcr.get(node, property);
-//             int style = cmsEditable.isEditing() ? SWT.WRAP : SWT.WRAP;
                Text txt = SuiteSwtUtils.addFormTextField(parent, text, null, SWT.WRAP);
                if (cmsEditable != null && cmsEditable.isEditing()) {
                        txt.addModifyListener((e) -> {
@@ -82,12 +78,12 @@ public class SuiteUiUtils {
                return txt;
        }
 
-       public static Label addFormPicture(Composite parent, String label, Node fileNode) throws RepositoryException {
-               Composite lineComposite = SuiteSwtUtils.addLineComposite(parent, 2);
-               SuiteSwtUtils.addFormLabel(lineComposite, label);
-
-               return addPicture(lineComposite, fileNode);
-       }
+//     public static Label addFormPicture(Composite parent, String label, Node fileNode) throws RepositoryException {
+//             Composite lineComposite = SuiteSwtUtils.addLineComposite(parent, 2);
+//             SuiteSwtUtils.addFormLabel(lineComposite, label);
+//
+//             return addPicture(lineComposite, fileNode);
+//     }
 
        public static Label addPicture(Composite parent, Node fileNode) throws RepositoryException {
                return addPicture(parent, fileNode, null);
@@ -225,8 +221,7 @@ public class SuiteUiUtils {
        }
 
        public static String toLink(Node node) {
-               return node != null ? "#" + CmsSwtUtils.cleanPathForUrl(SwtArgeoApp.nodeToState(JcrContent.nodeToContent(node)))
-                               : null;
+               return node != null ? "#" + ContentUtils.cleanPathForUrl(JcrContent.nodeToContent(node).getPath()) : null;
        }
 
        public static Control addLink(Composite parent, String label, Node node, CmsStyle style)