Revision: 22826
http://jedit.svn.sourceforge.net/jedit/?rev=22826&view=rev
Author: synh
Date: 2013-03-03 12:07:16 +0000 (Sun, 03 Mar 2013)
Log Message:
-----------
Remade ANSI escape code parser's options: migration from values based on String to ones based on int.
Modified Paths:
--------------
plugins/Console/trunk/Console.props
plugins/Console/trunk/console/AnsiEscapeParser.java
plugins/Console/trunk/console/options/GeneralOptionPane.java
plugins/Console/trunk/docs/CHANGELOG.txt
plugins/Console/trunk/lang_de.properties
Modified: plugins/Console/trunk/Console.props
===================================================================
--- plugins/Console/trunk/Console.props 2013-03-01 23:18:53 UTC (rev 22825)
+++ plugins/Console/trunk/Console.props 2013-03-03 12:07:16 UTC (rev 22826)
@@ -505,15 +505,13 @@
options.console.errors.reset-confirm.message=Resets error matchers list to factory default. Are you sure?
### ANSI escape sequencies
-options.ansi-escape.behaviour-caption=Parser behaviour:
-options.ansi-escape.mode-caption=Representation's mode:
-
-# The below strings should NOT be internationlized (yet) since they are also hardcoded:
-options.ansi-escape.mode-values=7bit 8bit
-options.ansi-escape.behaviour-values=ignore remove parse
-# default value
-options.ansi-escape.behaviour=parse
-options.ansi-escape.mode=7bit
+ansi-escape.title=ANSI escape sequencies parser
+ansi-escape.behaviour-caption=Parser behaviour:
+ansi-escape.behaviour-names=ignore;remove;parse
+ansi-escape.behaviour=2
+ansi-escape.mode-caption=Representation's mode:
+ansi-escape.mode-names=7bit;8bit
+ansi-escape.mode=0
# parsed control functions, see standart ECMA-48, section "Control functions"
-options.ansi-escape.func-list-values=sgr
-options.ansi-escape.func-list=sgr
+ansi-escape.func-list-values=sgr
+ansi-escape.func-list=sgr
Modified: plugins/Console/trunk/console/AnsiEscapeParser.java
===================================================================
--- plugins/Console/trunk/console/AnsiEscapeParser.java 2013-03-01 23:18:53 UTC (rev 22825)
+++ plugins/Console/trunk/console/AnsiEscapeParser.java 2013-03-03 12:07:16 UTC (rev 22826)
@@ -93,27 +93,44 @@
public AnsiEscapeParser(Color defFColor, Color defBColor)
{
// choose matcher's mode
- int ansi_mode = Sequences.MODE_7BIT;
- if ( jEdit.getProperty("options.ansi-escape.mode").contentEquals("8bit") )
+ int ansi_mode = jEdit.getIntegerProperty("ansi-escape.mode", Sequences.MODE_7BIT);
+ switch (ansi_mode)
{
- ansi_mode = Sequences.MODE_8BIT;
+ case Sequences.MODE_7BIT:
+ break;
+
+ case Sequences.MODE_8BIT:
+ break;
+
+ default:
+ ansi_mode = Sequences.MODE_7BIT;
}
// define matcher's behaviour
- Behaviour behaviour = Behaviour.IGNORE_ALL;
- String str = jEdit.getProperty("options.ansi-escape.behaviour");
- if ( str.contentEquals("remove") )
+ Behaviour behaviour = Behaviour.PARSE;
+ int bhvr = jEdit.getIntegerProperty("ansi-escape.behaviour", 2);
+ switch (bhvr)
{
- behaviour = Behaviour.REMOVE_ALL;
+ case 0:
+ behaviour = Behaviour.IGNORE_ALL;
+ break;
+
+ case 1:
+ behaviour = Behaviour.REMOVE_ALL;
+ break;
+
+ case 2:
+ behaviour = Behaviour.PARSE;
+ break;
+
+ default:
+ behaviour = Behaviour.PARSE;
}
- else if ( str.contentEquals("parse") )
- {
- behaviour = Behaviour.PARSE;
- }
// fill parsing control function's list
- StringList funcs = StringList.split( jEdit.getProperty("options.ansi-escape.func-list").toLowerCase(), "\\s+");
- String avaible_funcs = jEdit.getProperty("options.ansi-escape.func-list-values");
+ StringList funcs = StringList.split( jEdit.getProperty("ansi-escape.func-list").toLowerCase(), "\\s+");
+ String avaible_funcs = jEdit.getProperty("ansi-escape.func-list-values");
+ String str = "";
int i = 0;
while ( i < funcs.size() )
Modified: plugins/Console/trunk/console/options/GeneralOptionPane.java
===================================================================
--- plugins/Console/trunk/console/options/GeneralOptionPane.java 2013-03-01 23:18:53 UTC (rev 22825)
+++ plugins/Console/trunk/console/options/GeneralOptionPane.java 2013-03-03 12:07:16 UTC (rev 22826)
@@ -148,25 +148,44 @@
addComponent( Box.createVerticalStrut(15) );
JPanel ansiEscape = new JPanel();
- ansiEscape.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "ANSI escape sequencies parser"));
+ ansiEscape.setBorder(
+ BorderFactory.createTitledBorder(
+ BorderFactory.createEtchedBorder(),
+ jEdit.getProperty("ansi-escape.title")
+ )
+ );
ansiEscape.setLayout(new BoxLayout(ansiEscape, BoxLayout.Y_AXIS) );
- ArrayList<String> al = new ArrayList<String>( StringList.split( jEdit.getProperty("options.ansi-escape.behaviour-values"), "\\s+") );
+ ArrayList<String> al = new ArrayList<String>(
+ StringList.split( jEdit.getProperty("ansi-escape.behaviour-names"), ";")
+ );
ansiBehaviour = new JComboBox( al.toArray() );
- ansiBehaviour.setSelectedItem( jEdit.getProperty("options.ansi-escape.behaviour") );
+ int index = jEdit.getIntegerProperty("ansi-escape.behaviour", 2);
+ index = Math.min(
+ Math.max( 0, index),
+ al.size()-1
+ );
+ ansiBehaviour.setSelectedIndex(index);
al.clear();
- al.addAll( StringList.split( jEdit.getProperty("options.ansi-escape.mode-values"), "\\s+") );
+ al.addAll(
+ StringList.split( jEdit.getProperty("ansi-escape.mode-names"), ";")
+ );
+
ansiMode = new JComboBox( al.toArray() );
- ansiMode.setSelectedItem( jEdit.getProperty("options.ansi-escape.mode") );
+ index = Math.min(
+ Math.max( 0, jEdit.getIntegerProperty("ansi-escape.mode", 0) ),
+ al.size()-1
+ );
+ ansiMode.setSelectedIndex(index);
JPanel UpperPanel = new JPanel();
UpperPanel.setLayout(new GridLayout(2, 2, 2, 2) );
- UpperPanel.add(new JLabel( jEdit.getProperty("options.ansi-escape.behaviour-caption") ));
+ UpperPanel.add(new JLabel( jEdit.getProperty("ansi-escape.behaviour-caption") ));
UpperPanel.add( ansiBehaviour );
- UpperPanel.add(new JLabel( jEdit.getProperty("options.ansi-escape.mode-caption") ));
+ UpperPanel.add(new JLabel( jEdit.getProperty("ansi-escape.mode-caption") ));
UpperPanel.add( ansiMode );
ansiEscape.add( UpperPanel );
@@ -216,8 +235,8 @@
jEdit.setColorProperty("console.errorColor",
errorColor.getBackground());
- jEdit.setProperty("options.ansi-escape.behaviour", (String)ansiBehaviour.getSelectedItem() );
- jEdit.setProperty("options.ansi-escape.mode" , (String)ansiMode.getSelectedItem() );
+ jEdit.setProperty("ansi-escape.behaviour", String.valueOf( ansiBehaviour.getSelectedIndex() ) );
+ jEdit.setProperty("ansi-escape.mode" , String.valueOf( ansiMode.getSelectedIndex() ) );
}
//}}}
Modified: plugins/Console/trunk/docs/CHANGELOG.txt
===================================================================
--- plugins/Console/trunk/docs/CHANGELOG.txt 2013-03-01 23:18:53 UTC (rev 22825)
+++ plugins/Console/trunk/docs/CHANGELOG.txt 2013-03-03 12:07:16 UTC (rev 22826)
@@ -7,7 +7,9 @@
[Alan Ezust]
#3589470 Revisited: Brought back old "generic" error pattern, and added gcc pattern.
Fix #3605191: Exception after node selected on windows.
-
+ [Artem Bryantsev]
+ Remade ANSI escape code parser's options: migration from values based on String to ones based on int.
+
Version 5.1 Requires jEdit 5.0, Java 1.6, ErrorList 2.1, and ProjectViewer 3.5 (optional).
[Artem Bryantsev]
FR #3472822 - Console + Task Monitor
Modified: plugins/Console/trunk/lang_de.properties
===================================================================
--- plugins/Console/trunk/lang_de.properties 2013-03-01 23:18:53 UTC (rev 22825)
+++ plugins/Console/trunk/lang_de.properties 2013-03-03 12:07:16 UTC (rev 22826)
@@ -317,12 +317,8 @@
options.console.errors.reset-confirm.message=Alle Fehlermuster werden auf den Standard zurückgesetzt. Sind Sie sicher?
### ANSI escape sequencies
-options.ansi-escape.behaviour-caption=Parser Verhalten:
-#options.ansi-escape.behaviour-values=ignorieren entfernen parsen
-#options.ansi-escape.behaviour=ignorieren
-options.ansi-escape.mode-caption=Repräsentations-Modus:
-#options.ansi-escape.mode-values=7bit 8bit
-#options.ansi-escape.mode=7bit
-# parsed control functions, see standart ECMA-48, section "Control functions"
-#options.ansi-escape.func-list-values=sgr
-#options.ansi-escape.func-list=sgr
+ansi-escape.title=ANSI escape sequencies parser
+ansi-escape.behaviour-caption=Parser Verhalten:
+ansi-escape.behaviour-names=ignorieren;entfernen;parsen
+ansi-escape.mode-caption=Repräsentations-Modus:
+ansi-escape.mode-names=7bit;8bit
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|