]> git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.cms.ui/src/org/argeo/cms/text/Paragraph.java
Better distinguish when admin login failed because there was no such JCR
[lgpl/argeo-commons.git] / org.argeo.cms.ui / src / org / argeo / cms / text / Paragraph.java
1 package org.argeo.cms.text;
2
3 import javax.jcr.Node;
4 import javax.jcr.RepositoryException;
5
6 import org.argeo.cms.util.CmsUtils;
7 import org.argeo.cms.viewers.Section;
8 import org.argeo.cms.viewers.SectionPart;
9 import org.argeo.cms.widgets.EditableText;
10
11 public class Paragraph extends EditableText implements SectionPart {
12 private static final long serialVersionUID = 3746457776229542887L;
13
14 private final TextSection section;
15
16 public Paragraph(TextSection section, int style, Node node)
17 throws RepositoryException {
18 super(section, style, node);
19 this.section = section;
20 CmsUtils.style(this, TextStyles.TEXT_PARAGRAPH);
21 }
22
23 public Section getSection() {
24 return section;
25 }
26
27 @Override
28 public String getPartId() {
29 return getNodeId();
30 }
31
32 @Override
33 public Node getItem() throws RepositoryException {
34 return getNode();
35 }
36
37 @Override
38 public String toString() {
39 return "Paragraph #" + getPartId();
40 }
41 }