X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=swt%2Forg.argeo.app.ui%2Fsrc%2Forg%2Fargeo%2Fapp%2Fui%2FSuiteUiUtils.java;h=c98847a0dd8b143f93c89fa63778d1c715fb6fd5;hb=429d8b4a26d3ca458d8e800fbec05e3ee23b65a5;hp=9d9395bb051950dbba4b6fde3f908b20a2ce420a;hpb=d917d2b10162a29cddaf8c81c362efa37abcaab9;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 9d9395b..c98847a 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 @@ -5,6 +5,8 @@ import java.io.InputStream; import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Paths; +import java.util.HashMap; +import java.util.Map; import java.util.Objects; import javax.jcr.Node; @@ -17,13 +19,12 @@ import org.argeo.api.cms.CmsEvent; import org.argeo.api.cms.ux.CmsEditable; import org.argeo.api.cms.ux.CmsIcon; import org.argeo.api.cms.ux.CmsStyle; -import org.argeo.api.cms.ux.CmsView; import org.argeo.app.api.EntityNames; import org.argeo.app.api.EntityType; -import org.argeo.app.api.SuiteRole; +import org.argeo.app.ux.SuiteStyle; +import org.argeo.app.ux.SuiteUxEvent; import org.argeo.cms.LocaleUtils; import org.argeo.cms.Localized; -import org.argeo.cms.auth.CurrentUser; import org.argeo.cms.jcr.acr.JcrContent; import org.argeo.cms.swt.CmsSwtTheme; import org.argeo.cms.swt.CmsSwtUtils; @@ -74,6 +75,10 @@ public class SuiteUiUtils { } } + public static Label addFormLabel(Composite parent, Localized msg) { + return addFormLabel(parent, msg.lead()); + } + public static Label addFormLabel(Composite parent, String label) { Label lbl = new Label(parent, SWT.WRAP); lbl.setText(label); @@ -241,7 +246,8 @@ public class SuiteUiUtils { boolean test = false; if (test) { try (InputStream in = JcrUtils.getFileAsStream(fileNode); - OutputStream out = Files.newOutputStream(Paths.get("/home/mbaudier/tmp/" + fileNode.getName()));) { + OutputStream out = Files.newOutputStream( + Paths.get(System.getProperty("user.home") + "/tmp/" + fileNode.getName()));) { // BufferedImage img = ImageIO.read(in); // System.out.println(fileNode.getName() + ": width=" + img.getWidth() + ", height=" + img.getHeight()); IOUtils.copy(in, out); @@ -381,7 +387,9 @@ public class SuiteUiUtils { Label lbl = new Label(parent, SWT.NONE); CmsSwtUtils.markup(lbl); StringBuilder txt = new StringBuilder(); - txt.append(" eventProperties(Node node) { + Map properties = new HashMap<>(); + String contentPath = '/' + Jcr.getWorkspaceName(node) + Jcr.getPath(node); + properties.put(SuiteUxEvent.CONTENT_PATH, contentPath); + return properties; + } + // public static String createAndConfigureEntity(Shell shell, Session referenceSession, String mainMixin, // String... additionnalProps) { //