[simplyhtml] 01/09: Imported Upstream version 0.16.11

Felix Natter fnatter-guest at moszumanska.debian.org
Sun Dec 20 11:11:10 UTC 2015


This is an automated email from the git hooks/post-receive script.

fnatter-guest pushed a commit to branch master
in repository simplyhtml.

commit 1db9e2960ae13495d720c95d2cb3eae6187f4b28
Author: Felix Natter <fnatter at gmx.net>
Date:   Sun Dec 20 10:38:09 2015 +0100

    Imported Upstream version 0.16.11
---
 src/build.xml                                      | 15 ++++++++---
 src/com/lightdev/app/shtm/FrmMain.java             |  2 +-
 .../lightdev/app/shtm/SHTMLEditorKitActions.java   |  4 ++-
 src/com/lightdev/app/shtm/SHTMLEditorPane.java     | 31 +++++++++++++++++-----
 4 files changed, 40 insertions(+), 12 deletions(-)

diff --git a/src/build.xml b/src/build.xml
index eb0c2ac..19c4a28 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_08" />
+	<property name="version" value="0_16_11" />
 	<property name="src" value="." />
 	<property name="help" value="${src}/com/lightdev/app/shtm/help" />
 	<property name="lib" value="../lib" />
@@ -12,15 +12,22 @@
 	<property name="dist.lib" value="${dist}/lib" />
 	<property name="SimplyHTML.jar" value="${dist.lib}/SimplyHTML.jar"/>
 	<property name="SimplyHTMLHelp.jar" value="${dist.lib}/SimplyHTMLHelp.jar"/>
+	<property name="SimplyHTMLsources.jar" value="${dist.lib}/SimplyHTML-sources.jar"/>
 	<property name="post" value="../post" />
 	<property name="debug" value="on" />
-	<property name="java_source_version" value="1.5" />
-	<property name="java_target_version" value="1.5" />
+	<property name="java_source_version" value="1.6" />
+	<property name="java_target_version" value="1.6" />
 	<property name="build.compiler" value="modern" />
 	<property name="jhall.jar" value="..\lib\jhall.jar" />
 	<property name="gnu-regexp.jar" value="..\lib\gnu-regexp-1.1.4.jar" />
 	<property name="classpath" value="${jhall.jar}:${gnu-regexp.jar}"/>
 
+	<target name="srcjar">
+		<jar jarfile="${SimplyHTMLsources.jar}" basedir="${src}"
+				update="false" includes="de/**,com/**">
+		</jar>
+	</target>
+
 	<target name="build" depends="clean">
 		<mkdir dir="${build}"/>
 		<javac	srcdir="${src}"
@@ -37,7 +44,7 @@
 		</javac>
 	</target>
 
-	<target name="dist" depends="jar,help, dist-src"/>
+	<target name="dist" depends="jar,help, dist-src, srcjar"/>
 	<target name="full-dist" depends="dist,javadoc"/>
 	<target name="dist-src">
 		<mkdir dir="${dist.src}" />
diff --git a/src/com/lightdev/app/shtm/FrmMain.java b/src/com/lightdev/app/shtm/FrmMain.java
index 8e54a5a..cabdf0a 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.08";
+    public static final String VERSION = "0.16.11";
     /** static reference to this instance of class FrmMain */
     private SHTMLPanelImpl mainPane;
 
diff --git a/src/com/lightdev/app/shtm/SHTMLEditorKitActions.java b/src/com/lightdev/app/shtm/SHTMLEditorKitActions.java
index 30444c5..7f5c40c 100644
--- a/src/com/lightdev/app/shtm/SHTMLEditorKitActions.java
+++ b/src/com/lightdev/app/shtm/SHTMLEditorKitActions.java
@@ -26,6 +26,7 @@ import java.awt.Container;
 import java.awt.Frame;
 import java.awt.datatransfer.DataFlavor;
 import java.awt.event.ActionEvent;
+import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
@@ -2458,7 +2459,8 @@ class SHTMLEditorKitActions {
             this.panel = panel;
             
             updateActionName(PasteMode.getValueFromPrefs().invert());
-            //putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_MASK));
+            putValue(AbstractAction.ACCELERATOR_KEY,
+            		KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_MASK | InputEvent.SHIFT_DOWN_MASK));
         }
         
         public void updateActionName(final PasteMode pm)
diff --git a/src/com/lightdev/app/shtm/SHTMLEditorPane.java b/src/com/lightdev/app/shtm/SHTMLEditorPane.java
index ac48db3..1c14ad4 100644
--- a/src/com/lightdev/app/shtm/SHTMLEditorPane.java
+++ b/src/com/lightdev/app/shtm/SHTMLEditorPane.java
@@ -109,6 +109,24 @@ public class SHTMLEditorPane extends JEditorPane implements DropTargetListener,
 	private static final String TAB = "\t";
 	private static final String TAB_REPLACEMENT = "    ";
 
+	private static DataFlavor getSupportedHtmlFlavor(Transferable t) {
+		try {
+//			final DataFlavor prototypeFlavor = new DataFlavor(com.lightdev.app.shtm.HTMLText.class, "HTMLText");
+			final DataFlavor prototypeFlavor = new DataFlavor("text/html; class=java.lang.String");
+
+			for (DataFlavor dataFlavor : t.getTransferDataFlavors())
+				if(dataFlavor.getPrimaryType().equals(prototypeFlavor.getPrimaryType()) 
+				&& dataFlavor.getSubType().equals(prototypeFlavor.getSubType())
+				&& dataFlavor.getRepresentationClass().equals(prototypeFlavor.getRepresentationClass())
+				)
+					return dataFlavor;
+		} catch (ClassNotFoundException e) {
+			throw new RuntimeException("Couldn't fetch appropriate text/html DataFlavor!");
+		}
+		return null;
+	}
+
+
 	public enum PasteMode
 	{
 		PASTE_HTML("Paste as HTML"), PASTE_PLAIN_TEXT("Paste as plain-text");
@@ -3366,10 +3384,10 @@ public class SHTMLEditorPane extends JEditorPane implements DropTargetListener,
                         result = true;
                     }
                     else {
-                        final DataFlavor htmlFlavor = new DataFlavor("text/html; class=java.lang.String");
+                        final DataFlavor htmlFlavor = getSupportedHtmlFlavor(transferable);
                         String stringContent = null;
                         String htmlContent = null;
-                        if (transferable.isDataFlavorSupported(htmlFlavor)
+                        if (htmlFlavor != null
                                 && transferable.isDataFlavorSupported(DataFlavor.stringFlavor)) {
                             htmlContent = (String) transferable.getTransferData(htmlFlavor);
                             if (htmlContent.charAt(0) == 65533) {
@@ -3705,8 +3723,9 @@ public class SHTMLEditorPane extends JEditorPane implements DropTargetListener,
         setCaretPosition(originalCaretPosition);
         return false;
     }
-    /* (non-Javadoc)
-     * @see javax.swing.JComponent#getTransferHandler()
-     */
-    /* ---------- class fields end -------------- */
+
+	@Override
+	public String getSelectedText() {
+		return super.getSelectedText().replace('\u00a0', ' ');
+	}
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/simplyhtml.git



More information about the pkg-java-commits mailing list