]> git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.cms.ui/src/org/argeo/cms/text/CustomTextEditor.java
Add JGit to client.
[lgpl/argeo-commons.git] / org.argeo.cms.ui / src / org / argeo / cms / text / CustomTextEditor.java
1 package org.argeo.cms.text;
2
3 import static org.argeo.cms.util.CmsUtils.fillWidth;
4
5 import javax.jcr.Node;
6 import javax.jcr.RepositoryException;
7
8 import org.argeo.cms.ui.CmsEditable;
9 import org.argeo.cms.ui.internal.text.AbstractTextViewer;
10 import org.argeo.cms.viewers.Section;
11 import org.eclipse.swt.widgets.Composite;
12
13 /**
14 * Manages hardcoded sections as an arbitrary hierarchy under the main section,
15 * which contains no text and no title.
16 */
17 public class CustomTextEditor extends AbstractTextViewer {
18 private static final long serialVersionUID = 5277789504209413500L;
19
20 public CustomTextEditor(Composite parent, int style, Node textNode,
21 CmsEditable cmsEditable) throws RepositoryException {
22 this(new Section(parent, style, textNode), style, cmsEditable);
23 }
24
25 public CustomTextEditor(Section mainSection, int style,
26 CmsEditable cmsEditable) throws RepositoryException {
27 super(mainSection, style, cmsEditable);
28 mainSection.setLayoutData(fillWidth());
29 }
30
31 @Override
32 public Section getMainSection() {
33 return super.getMainSection();
34 }
35 }