X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=swt%2Forg.argeo.app.swt%2Fsrc%2Forg%2Fargeo%2Fapp%2Fswt%2Fux%2FSuiteSwtUtils.java;h=dbcb3d8cd21c76be3410404ab7a49a640c8d121f;hb=c7c3c8577b45434bfbe247a97aec08cd4e5d922a;hp=36e018ea4411785dfa818aecefe653664c354c33;hpb=57c4d4af5d0bb2d52524719c7034822362cd87e8;p=gpl%2Fargeo-suite.git diff --git a/swt/org.argeo.app.swt/src/org/argeo/app/swt/ux/SuiteSwtUtils.java b/swt/org.argeo.app.swt/src/org/argeo/app/swt/ux/SuiteSwtUtils.java index 36e018e..dbcb3d8 100644 --- a/swt/org.argeo.app.swt/src/org/argeo/app/swt/ux/SuiteSwtUtils.java +++ b/swt/org.argeo.app.swt/src/org/argeo/app/swt/ux/SuiteSwtUtils.java @@ -7,11 +7,13 @@ import javax.xml.namespace.QName; import org.argeo.api.acr.Content; import org.argeo.api.acr.QNamed; import org.argeo.api.cms.ux.CmsEditable; +import org.argeo.api.cms.ux.CmsStyle; import org.argeo.app.ux.SuiteStyle; import org.argeo.cms.Localized; import org.argeo.cms.swt.CmsSwtUtils; import org.argeo.cms.swt.dialogs.CmsFeedback; import org.argeo.cms.swt.widgets.EditableText; +import org.argeo.cms.swt.widgets.CmsLink; import org.argeo.eclipse.ui.EclipseUiUtils; import org.eclipse.swt.SWT; import org.eclipse.swt.events.FocusEvent; @@ -317,6 +319,13 @@ public class SuiteSwtUtils { return txt; } + /** Add a link to an internal content. */ + public static Control addLink(Composite parent, String label, Content node, CmsStyle style) { + String target = toLink(node); + CmsLink link = new CmsLink(label, target, style); + return link.createUi(parent); + } + /** singleton */ private SuiteSwtUtils() { }