Introduce Argeo Publishing.
[gpl/argeo-suite.git] / publishing / org.argeo.publishing.ui / src / org / argeo / cms / text / SectionTitle.java
diff --git a/publishing/org.argeo.publishing.ui/src/org/argeo/cms/text/SectionTitle.java b/publishing/org.argeo.publishing.ui/src/org/argeo/cms/text/SectionTitle.java
new file mode 100644 (file)
index 0000000..8bd68c4
--- /dev/null
@@ -0,0 +1,38 @@
+package org.argeo.cms.text;
+
+import javax.jcr.Property;
+import javax.jcr.RepositoryException;
+
+import org.argeo.cms.ui.viewers.EditablePart;
+import org.argeo.cms.ui.viewers.PropertyPart;
+import org.argeo.cms.ui.widgets.EditableText;
+import org.eclipse.swt.widgets.Composite;
+
+/** The title of a section. */
+public class SectionTitle extends EditableText implements EditablePart,
+               PropertyPart {
+       private static final long serialVersionUID = -1787983154946583171L;
+
+       private final TextSection section;
+
+       public SectionTitle(Composite parent, int swtStyle, Property title)
+                       throws RepositoryException {
+               super(parent, swtStyle, title);
+               section = (TextSection) TextSection.findSection(this);
+       }
+
+       public TextSection getSection() {
+               return section;
+       }
+
+       // @Override
+       // public Property getProperty() throws RepositoryException {
+       // return getSection().getNode().getProperty(Property.JCR_TITLE);
+       // }
+
+       @Override
+       public Property getItem() throws RepositoryException {
+               return getProperty();
+       }
+
+}