// SERVICES
void exception(Throwable e);
- CmsImageManager<?, ?> getImageManager();
+ <V,M> CmsImageManager<V, M> getImageManager();
boolean isAnonymous();
public interface ContentPart {
Content getContent();
- @Deprecated
- default Content getNode() {
- return getContent();
- }
+// @Deprecated
+// default Content getNode() {
+// return getContent();
+// }
}
import javax.security.auth.Subject;
-import org.argeo.api.acr.Content;
-import org.argeo.api.acr.ContentSession;
-import org.argeo.api.acr.spi.ProvidedContent;
import org.argeo.api.cms.CmsLog;
import org.argeo.api.cms.ux.CmsEditable;
import org.argeo.cms.CurrentUser;
throw new IllegalStateException("Edited should not be null or disposed at this stage");
}
- /** Persist all changes. */
- protected void persistChanges(ContentSession session) {
-// session.save();
-// session.refresh(false);
- // TODO notify that changes have been persisted
- }
-
- /** Convenience method using a Node in order to save the underlying session. */
- protected void persistChanges(Content anyNode) {
- persistChanges(((ProvidedContent) anyNode).getSession());
- }
+// /** Persist all changes. */
+// protected void persistChanges(ContentSession session) {
+//// session.save();
+//// session.refresh(false);
+// // TODO notify that changes have been persisted
+// }
+//
+// /** Convenience method using a Node in order to save the underlying session. */
+// protected void persistChanges(Content anyNode) {
+// persistChanges(((ProvidedContent) anyNode).getSession());
+// }
/** Notify edition exception */
protected void notifyEditionException(Throwable e) {
import org.argeo.api.acr.Content;
import org.argeo.api.acr.spi.ProvidedContent;
+import org.argeo.cms.ux.acr.ContentPart;
import org.eclipse.swt.widgets.Composite;
/** A composite which can (optionally) manage a content. */
-public class ContentComposite extends Composite {
+public class ContentComposite extends Composite implements ContentPart {
private static final long serialVersionUID = -1447009015451153367L;
public ContentComposite(Composite parent, int style, Content item) {
return getData() instanceof Content;
}
+ @Override
public Content getContent() {
return (Content) getData();
}
--- /dev/null
+package org.argeo.cms.swt.acr;
+
+import org.argeo.api.acr.Content;
+import org.argeo.cms.swt.widgets.StyledControl;
+import org.argeo.cms.ux.acr.ContentPart;
+import org.eclipse.swt.widgets.Composite;
+
+public abstract class ContentStyledControl extends StyledControl implements ContentPart {
+
+ private static final long serialVersionUID = -5714246408818696583L;
+
+ public ContentStyledControl(Composite parent, int swtStyle, Content content) {
+ super(parent, swtStyle);
+ setData(content);
+ }
+
+ @Override
+ public Content getContent() {
+ return (Content) getData();
+ }
+
+}
CmsImageManager<Control, Content> imageManager) {
super(parent, swtStyle, preferredImageSize);
this.section = section;
- this.imageManager = imageManager != null ? imageManager
- : (CmsImageManager<Control, Content>) CmsSwtUtils.getCmsView(section).getImageManager();
+ this.imageManager = imageManager != null ? imageManager : CmsSwtUtils.getCmsView(section).getImageManager();
// CmsSwtUtils.style(this, TextStyles.TEXT_IMG);
setData(imgNode);
}