X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=publishing%2Forg.argeo.publishing.ui%2Fsrc%2Forg%2Fargeo%2Fdocbook%2Fui%2FDbkContextMenu.java;h=77248d6f140fa065ed6a30e7c7f4bcfedea449d5;hb=44909f08709dd0bde1284e203a2495f03a613ed8;hp=24a759c60ff06c963f2511da6e3fcd1f09ef99a6;hpb=06db6a211a46ba994d007e30f62704165c413177;p=gpl%2Fargeo-suite.git diff --git a/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/DbkContextMenu.java b/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/DbkContextMenu.java index 24a759c..77248d6 100644 --- a/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/DbkContextMenu.java +++ b/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/DbkContextMenu.java @@ -15,7 +15,6 @@ import org.argeo.cms.ui.viewers.Section; import org.argeo.cms.ui.viewers.SectionPart; import org.argeo.cms.ui.widgets.EditableText; import org.argeo.cms.ui.widgets.Img; -import org.argeo.cms.ui.widgets.TextStyles; import org.argeo.docbook.DbkMsg; import org.argeo.docbook.DbkUtils; import org.argeo.eclipse.ui.MouseDown; @@ -33,7 +32,7 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; /** Dialog to edit a text part. */ -class DbkContextMenu implements TextStyles { +class DbkContextMenu { private final AbstractDbkViewer textViewer; private Shell shell; @@ -67,6 +66,7 @@ class DbkContextMenu implements TextStyles { 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; @@ -146,6 +146,15 @@ class DbkContextMenu implements TextStyles { } + 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);