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.jcr.acr.JcrContent;
import org.argeo.cms.swt.CmsSwtUtils;
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) -> {
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) -> {
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);
}
public static String toLink(Node node) {
- return node != null ? "#" + CmsSwtUtils.cleanPathForUrl(SwtArgeoApp.nodeToState(JcrContent.nodeToContent(node)))
- : null;
+ return node != null ? "#" + CmsSwtUtils.cleanPathForUrl(JcrContent.nodeToContent(node).getPath()) : null;
}
public static Control addLink(Composite parent, String label, Node node, CmsStyle style)