jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1747562 - in /jmeter/trunk: src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java xdocs/changes.xml xdocs/usermanual/properties_reference.xml
Date Thu, 09 Jun 2016 16:33:45 GMT
Author: fschumacher
Date: Thu Jun  9 16:33:45 2016
New Revision: 1747562

URL: http://svn.apache.org/viewvc?rev=1747562&view=rev
Log:
Only set font in JSyntaxTextArea, when property jsyntaxtextarea.font.family is set.

Bugzilla Id: 59657

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java
    jmeter/trunk/xdocs/changes.xml
    jmeter/trunk/xdocs/usermanual/properties_reference.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java?rev=1747562&r1=1747561&r2=1747562&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java Thu Jun  9 16:33:45
2016
@@ -23,6 +23,8 @@ import java.awt.HeadlessException;
 import java.util.Properties;
 
 import org.apache.jmeter.util.JMeterUtils;
+import org.apache.jorphan.logging.LoggingManager;
+import org.apache.log.Logger;
 import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
 import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
 import org.fife.ui.rtextarea.RUndoManager;
@@ -43,8 +45,9 @@ public class JSyntaxTextArea extends RSy
     private static final boolean LINE_WRAP       = JMeterUtils.getPropDefault("jsyntaxtextarea.linewrap",
true);
     private static final boolean CODE_FOLDING    = JMeterUtils.getPropDefault("jsyntaxtextarea.codefolding",
true);
     private static final int MAX_UNDOS           = JMeterUtils.getPropDefault("jsyntaxtextarea.maxundos",
50);
-    private static final String USER_FONT_FAMILY = JMeterUtils.getPropDefault("jsyntaxtextarea.font.family",
RSyntaxTextArea.getDefaultFont().getName());
-    private static final int USER_FONT_SIZE      = JMeterUtils.getPropDefault("jsyntaxtextarea.font.size",
RSyntaxTextArea.getDefaultFont().getSize());
+    private static final String USER_FONT_FAMILY = JMeterUtils.getPropDefault("jsyntaxtextarea.font.family",
null);
+    private static final int USER_FONT_SIZE      = JMeterUtils.getPropDefault("jsyntaxtextarea.font.size",
-1);
+    private static final Logger log              = LoggingManager.getLoggerForClass();
 
     /**
      * Creates the default syntax highlighting text area. The following are set:
@@ -175,7 +178,13 @@ public class JSyntaxTextArea extends RSy
         super.setLineWrap(LINE_WRAP);
         super.setWrapStyleWord(WRAP_STYLE_WORD);
         this.disableUndo = disableUndo;
-        setFont(new Font(USER_FONT_FAMILY, Font.PLAIN, USER_FONT_SIZE));
+        if (USER_FONT_FAMILY != null) {
+            int fontSize = USER_FONT_SIZE > 0 ? USER_FONT_SIZE : getFont().getSize();
+            setFont(new Font(USER_FONT_FAMILY, Font.PLAIN, fontSize));
+            if (log.isDebugEnabled()) {
+                log.debug("Font is set to: " + getFont());
+            }
+        }
         if(disableUndo) {
             // We need to do this to force recreation of undoManager which
             // will use the disableUndo otherwise it would always be false

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1747562&r1=1747561&r2=1747562&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Thu Jun  9 16:33:45 2016
@@ -152,6 +152,7 @@ Summary
 <ul>
     <li><bug>59607</bug>JMeter crashes when reading large test plan (greater
than 2g). Based on fix by Felix Draxler (felix.draxler at sap.com)</li>
     <li><bug>59621</bug>Error count in report dashboard is one off.</li>
+    <li><bug>59657</bug>Only set font in JSyntaxTextArea, when property
<code>jsyntaxtextarea.font.family</code> is set.</li>
 </ul>
 
  <!--  =================== Thanks =================== -->

Modified: jmeter/trunk/xdocs/usermanual/properties_reference.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/properties_reference.xml?rev=1747562&r1=1747561&r2=1747562&view=diff
==============================================================================
--- jmeter/trunk/xdocs/usermanual/properties_reference.xml (original)
+++ jmeter/trunk/xdocs/usermanual/properties_reference.xml Thu Jun  9 16:33:45 2016
@@ -615,7 +615,7 @@ Uncomment this line if you put anything
 <property name="jsyntaxtextarea.codefolding">, defaults to:true</property>
 <property name="jsyntaxtextarea.maxundos"> Set 0 to disable undo feature in JSyntaxTextArea<br/>,
defaults to:50</property>
 <property name="jsyntaxtextarea.font.family"> Change the font on the (JSyntax) Text
Areas. (Useful for HiDPI screens)<br/>, defaults to:Hack</property>
-<property name="jsyntaxtextarea.font.size">, defaults to:14</property>
+<property name="jsyntaxtextarea.font.size">Change the size of the (JSyntax) Text Areas.
Will be used only, when <code>jsyntaxtextarea.font.family</code> is set, defaults
to:14</property>
 <property name="loggerpanel.usejsyntaxtext"> Set this to false to disable the use of
JSyntaxTextArea for the Console Logger panel <br/>, defaults to:true</property>
 <property name=" Maximum size of HTML page that can be displayed; default">, defaults
to:10 mbytes</property>
 <property name="view.results.tree.max_size"> Set to 0 to disable the size check and
display the whole response<br/>, defaults to:10485760</property>



Mime
View raw message