asdf - 2011-01-28

Bonjour,

here is a patch that will allow the XML view to scroll horizontally (and not wrap around lines, which I find very confusing):

diff -rupN jaxe-source/source//jaxe/JaxeFrame.java jaxe-source.new/source//jaxe/JaxeFrame.java
--- jaxe-source/source//jaxe/JaxeFrame.java 2010-06-02 11:51:48.000000000 +0200
+++ jaxe-source.new/source//jaxe/JaxeFrame.java 2011-01-27 14:31:14.000000000 +0100
@@ -375,6 +375,7 @@ public class JaxeFrame extends JFrame im
         //textPane.setStyledDocument(doc);
         paneScrollPane = new JScrollPane(textPane);
         paneScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
+        paneScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
         paneScrollPane.setPreferredSize(new Dimension(500, 400));
         paneScrollPane.setMinimumSize(new Dimension(100, 50));

Binary files jaxe-source/source//jaxe/.JaxeFrame.java.swp and jaxe-source.new/source//jaxe/.JaxeFrame.java.swp differ
diff -rupN jaxe-source/source//jaxe/JaxeTextPane.java jaxe-source.new/source//jaxe/JaxeTextPane.java
--- jaxe-source/source//jaxe/JaxeTextPane.java  2010-06-02 11:51:48.000000000 +0200
+++ jaxe-source.new/source//jaxe/JaxeTextPane.java  2011-01-27 14:38:53.000000000 +0100
@@ -58,6 +58,9 @@ import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.ProcessingInstruction;

+import javax.swing.plaf.ComponentUI;
+import java.awt.Component;
+

 /**
  * Zone de texte éditable correspondant à un document XML. Peut être utilisée
@@ -785,4 +788,13 @@ public class JaxeTextPane extends JTextP
         doLayout();
     }
     
+    // Override getScrollableTracksViewportWidth
+    // to preserve the full width of the text
+    public boolean getScrollableTracksViewportWidth() {
+        Component parent = getParent();
+        ComponentUI ui = getUI();
+
+        return parent != null ? (ui.getPreferredSize(this).width <= parent.getSize().width) : true;
+    }
+        
 }