]> git.argeo.org Git - lgpl/argeo-commons.git/blob - swt/org.argeo.cms.swt/src/org/argeo/cms/swt/acr/ContentComposite.java
Add account-related RFC 2307bis LDAP objects and attributes
[lgpl/argeo-commons.git] / swt / org.argeo.cms.swt / src / org / argeo / cms / swt / acr / ContentComposite.java
1 package org.argeo.cms.swt.acr;
2
3 import org.argeo.api.acr.Content;
4 import org.argeo.api.acr.spi.ProvidedContent;
5 import org.eclipse.swt.widgets.Composite;
6
7 /** A composite which can (optionally) manage a content. */
8 public class ContentComposite extends Composite {
9 private static final long serialVersionUID = -1447009015451153367L;
10
11 public ContentComposite(Composite parent, int style, Content item) {
12 super(parent, style);
13 setData(item);
14 }
15
16 public Content getContent() {
17 return (Content) getData();
18 }
19
20 @Deprecated
21 public Content getNode() {
22 return getContent();
23 }
24
25 protected ProvidedContent getProvidedContent() {
26 return (ProvidedContent) getContent();
27 }
28
29 public String getSessionLocalId() {
30 return getProvidedContent().getSessionLocalId();
31 }
32
33 protected void itemUpdated() {
34 layout();
35 }
36
37 public void setContent(Content content) {
38 setData(content);
39 itemUpdated();
40 }
41 }