Remove CMS Text package.
[gpl/argeo-suite.git] / publishing / org.argeo.publishing.ui / src / org / argeo / docbook / ui / DbkContextMenu.java
index ef2695a778831db7518994d820472bd3fa286bd0..57c835608c31f2c744a55b8a31ad23c7145ea5d9 100644 (file)
@@ -5,8 +5,6 @@ import java.util.List;
 
 import javax.jcr.Node;
 
-import org.argeo.cms.text.Paragraph;
-import org.argeo.cms.text.TextSection;
 import org.argeo.cms.ui.CmsEditable;
 import org.argeo.cms.ui.util.CmsUiUtils;
 import org.argeo.cms.ui.viewers.EditablePart;
@@ -66,6 +64,7 @@ class DbkContextMenu {
                        Img img = (Img) editablePart;
                        deletePartB(parent, DbkMsg.deleteMedia.lead(), img);
                        insertMediaB(parent, DbkMsg.insertMedia.lead(), img);
+                       insertParagraphB(parent, DbkMsg.insertParagraph.lead(), img);
 
                } else if (editablePart instanceof DocBookSectionTitle) {
                        DocBookSectionTitle sectionTitle = (DocBookSectionTitle) editablePart;
@@ -145,6 +144,15 @@ class DbkContextMenu {
 
        }
 
+       protected void insertParagraphB(Composite parent, String msg, SectionPart sectionPart) {
+               Label insertMediaB = new Label(parent, SWT.NONE);
+               insertMediaB.setText(msg);
+               insertMediaB.addMouseListener((MouseDown) (e) -> {
+                       textViewer.addParagraph(sectionPart, null);
+                       hide();
+               });
+       }
+
        protected void deletePartB(Composite parent, String msg, SectionPart sectionPart) {
                Label deleteB = new Label(shell, SWT.NONE);
                deleteB.setText(msg);