X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=swt%2Forg.argeo.app.ui%2Fsrc%2Forg%2Fargeo%2Fapp%2Fui%2FSuiteUiUtils.java;h=62463c792eab8a2a666867e51c536d37fa26e563;hb=694aeb9ff865042652fe2a0e3443c914ede0cebd;hp=dce6d13822ef5dd0309b20f214f9c22a2679dd03;hpb=c0995155ef2c0c48830e4ff22a9a7b15bc070cca;p=gpl%2Fargeo-suite.git diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUiUtils.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUiUtils.java index dce6d13..62463c7 100644 --- a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUiUtils.java +++ b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUiUtils.java @@ -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)