[SCM] simplyhtml packaging branch, master, updated. upstream/0.16.07-20-gf117466

Felix Natter fnatter at gmx.net
Sat Mar 2 12:51:15 UTC 2013


The following commit has been merged in the master branch:
commit dfb87eeefdfd3421f277fe975459a85bca72d853
Author: Felix Natter <fnatter at gmx.net>
Date:   Sat Mar 2 13:32:53 2013 +0100

    Imported Upstream version 0.16.07

diff --git a/src/build.xml b/src/build.xml
index 2f08058..a8ec43a 100644
--- a/src/build.xml
+++ b/src/build.xml
@@ -1,5 +1,5 @@
 <project name="SimplyHTML" default="dist" basedir=".">
-	<property name="version" value="0_16_05" />
+	<property name="version" value="0_16_07" />
 	<property name="src" value="." />
 	<property name="help" value="${src}/com/lightdev/app/shtm/help" />
 	<property name="lib" value="../lib" />
diff --git a/src/com/lightdev/app/shtm/FrmMain.java b/src/com/lightdev/app/shtm/FrmMain.java
index 0a16c78..dc374fc 100644
--- a/src/com/lightdev/app/shtm/FrmMain.java
+++ b/src/com/lightdev/app/shtm/FrmMain.java
@@ -51,7 +51,7 @@ import javax.swing.JFrame;
  */
 class FrmMain extends JFrame {
     public static final String APP_NAME = "SimplyHTML";
-    public static final String VERSION = "0.16.05";
+    public static final String VERSION = "0.16.07";
     /** static reference to this instance of class FrmMain */
     private SHTMLPanelImpl mainPane;
 
diff --git a/src/com/lightdev/app/shtm/SHTMLEditorPane.java b/src/com/lightdev/app/shtm/SHTMLEditorPane.java
index 3dff914..ac48db3 100644
--- a/src/com/lightdev/app/shtm/SHTMLEditorPane.java
+++ b/src/com/lightdev/app/shtm/SHTMLEditorPane.java
@@ -106,6 +106,9 @@ import javax.swing.text.html.HTMLDocument;
  */
 public class SHTMLEditorPane extends JEditorPane implements DropTargetListener, DragSourceListener, DragGestureListener {
 	
+	private static final String TAB = "\t";
+	private static final String TAB_REPLACEMENT = "    ";
+
 	public enum PasteMode
 	{
 		PASTE_HTML("Paste as HTML"), PASTE_PLAIN_TEXT("Paste as plain-text");
@@ -641,26 +644,6 @@ public class SHTMLEditorPane extends JEditorPane implements DropTargetListener,
         public void actionPerformed(final ActionEvent ae) {
             try {
                 final int caretPosition = getCaretPosition();
-                // Turn paragraph starting with "* " into a bullet list.
-                Element paragraphElement = getCurrentParagraphElement();
-                String content = elementToHTML(paragraphElement);
-                if (content.matches("(?ims)\\s*<p[^>]*>\\s*\\* .*</p>\\s*")) {
-                    final String newContent = "<ul><li>"
-                            + content.replaceAll("(?ims)\\s*<p[^>]*>\\s*\\* (.*)</p>\\s*", "$1") + "</li></ul>";
-                    getSHTMLDocument().setOuterHTML(paragraphElement, newContent);
-                    setCaretPosition(paragraphElement.getEndOffset() - 1);
-                    return;
-                }
-                // Turn paragraph starting with "1. " into a numbered list.
-                paragraphElement = getCurrentParagraphElement();
-                content = elementToHTML(paragraphElement);
-                if (content.matches("(?ims)\\s*<p[^>]*>\\s*1\\. .*</p>\\s*")) {
-                    final String newContent = "<ol><li>"
-                            + content.replaceAll("(?ims)\\s*<p[^>]*>\\s*1\\. (.*)</p>\\s*", "$1") + "</li></ol>";
-                    getSHTMLDocument().setOuterHTML(paragraphElement, newContent);
-                    setCaretPosition(paragraphElement.getEndOffset() - 1);
-                    return;
-                }
                 // if we are in a list, create a new item
                 final Element listItemElement = listManager.getListItemElement(caretPosition);
                 if (listItemElement != null) {
@@ -2001,8 +1984,20 @@ public class SHTMLEditorPane extends JEditorPane implements DropTargetListener,
     public Element getCurrentParagraphElement() {
         return getSHTMLDocument().getParagraphElement(getCaretPosition());
     }
+    
+    
+
+    @Override
+    public void replaceSelection(String content) {
+    	if(content != null){
+    		final String expandedContent = content.replaceAll(TAB, TAB_REPLACEMENT);
+    		super.replaceSelection(expandedContent);
+    	}
+    	else
+    		super.replaceSelection(content);
+    }
 
-    /* ---------- table cell navigation end --------------*/
+	/* ---------- table cell navigation end --------------*/
     /**
      * Replaces the currently selected content with new content
      * represented by the given <code>HTMLText</code>. If there is no selection

-- 
simplyhtml packaging



More information about the pkg-java-commits mailing list