[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-cvs
Subject:    [ jEdit-commits ] SF.net SVN: jedit:[23806] plugins/SideKick/trunk
From:       daleanson () users ! sourceforge ! net
Date:       2014-12-23 20:59:56
Message-ID: E1Y3WZ1-00069T-Lt () sfs-ml-2 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 23806
          http://sourceforge.net/p/jedit/svn/23806
Author:   daleanson
Date:     2014-12-23 20:59:56 +0000 (Tue, 23 Dec 2014)
Log Message:
-----------
Updates to ParseError and added SideKickPosition, which are used by a couple of \
sidekick parsers.

Modified Paths:
--------------
    plugins/SideKick/trunk/CHANGES.txt
    plugins/SideKick/trunk/sidekick/ExpansionModel.java
    plugins/SideKick/trunk/sidekick/util/ElementUtil.java
    plugins/SideKick/trunk/sidekick/util/ParseError.java

Added Paths:
-----------
    plugins/SideKick/trunk/sidekick/util/SideKickPosition.java

Modified: plugins/SideKick/trunk/CHANGES.txt
===================================================================
--- plugins/SideKick/trunk/CHANGES.txt	2014-12-22 05:29:15 UTC (rev 23805)
+++ plugins/SideKick/trunk/CHANGES.txt	2014-12-23 20:59:56 UTC (rev 23806)
@@ -4,6 +4,10 @@
     Version 1.7
         Fixed bug 1800, removed extraneous remove-marker menu item from tree popup \
menu.  (Dale Anson)
+        German language update (Robert Schwenn)
+        Fixed bad hyperlinks to API docs (Alan Ezust)
+        Added SideKickPosition and updated ParserError since these are used by \
several sidekick +        parsers (Dale Anson)
 
     Version 1.6 requires Java 1.6, jEdit 5.0, ErrorList 2.1, MarkerSets 0.8 \
                (optional)
         Better calculation of asset ranges which helps with sidekick folding mode.

Modified: plugins/SideKick/trunk/sidekick/ExpansionModel.java
===================================================================
--- plugins/SideKick/trunk/sidekick/ExpansionModel.java	2014-12-22 05:29:15 UTC (rev \
                23805)
+++ plugins/SideKick/trunk/sidekick/ExpansionModel.java	2014-12-23 20:59:56 UTC (rev \
23806) @@ -45,4 +45,17 @@
     public int getRow() {
         return row;
     }
+    
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder("ExpansionModel:[");
+        for (int i = 0; i < model.size(); i++) {
+            sb.append(model.get(i));
+            if (i < model.size() - 1) {
+                sb.append(',');   
+            }
+        }
+        sb.append(']');
+        return sb.toString();
+    }
 }
\ No newline at end of file

Modified: plugins/SideKick/trunk/sidekick/util/ElementUtil.java
===================================================================
--- plugins/SideKick/trunk/sidekick/util/ElementUtil.java	2014-12-22 05:29:15 UTC \
                (rev 23805)
+++ plugins/SideKick/trunk/sidekick/util/ElementUtil.java	2014-12-23 20:59:56 UTC \
(rev 23806) @@ -107,13 +107,7 @@
     }
 
     public static Position createPosition( int line_offset, int column_offset ) {
-        final int lo = line_offset;
-        final int co = column_offset;
-        return new Position() {
-                   public int getOffset() {
-                       return lo + co;
-                   }
-               };
+        return new SideKickPosition(line_offset + column_offset);
     }
 
     /**

Modified: plugins/SideKick/trunk/sidekick/util/ParseError.java
===================================================================
--- plugins/SideKick/trunk/sidekick/util/ParseError.java	2014-12-22 05:29:15 UTC (rev \
                23805)
+++ plugins/SideKick/trunk/sidekick/util/ParseError.java	2014-12-23 20:59:56 UTC (rev \
23806) @@ -36,6 +36,9 @@
 public class ParseError {
     public String message = "";   
     public Range range = null;
+    private int lineNumber;
+    private int column;
+    private int length;
     
     public ParseError(String message){
         this(message, new Range());
@@ -44,9 +47,42 @@
     public ParseError(String message, Range range) {
         this.message = message;
         this.range = range;
+        if (range != null) {
+            lineNumber = range.getStartLocation().line;
+            column = range.getStartLocation().column;
+            length = 1;
+        }
     }
     
+    public ParseError(String message, int lineNumber, int column, int length) {
+        this.message = message;
+        this.lineNumber = lineNumber;
+        this.column = column;
+        this.length = length;
+        this.range = new Range(new Location(lineNumber, column), new \
Location(lineNumber, column + length)); +    }
+    
+    public String getMessage() {
+        return message;   
+    }
+    
+    public int getLineNumber() {
+        return lineNumber;   
+    }
+    
+    public int getColumn() {
+        return column;   
+    }
+    
+    public int getLength() {
+        return length;   
+    }
+    
+    public Range getRange() {
+        return range;   
+    }
+    
     public String toString() {
-        return "ParseError:[message=" + message + ", " + range.toString() + "]";   
+        return "ParseError:[message=" + message + ", " + lineNumber + ':' + column + \
']';     }
 }

Added: plugins/SideKick/trunk/sidekick/util/SideKickPosition.java
===================================================================
--- plugins/SideKick/trunk/sidekick/util/SideKickPosition.java	                       \
                (rev 0)
+++ plugins/SideKick/trunk/sidekick/util/SideKickPosition.java	2014-12-23 20:59:56 \
UTC (rev 23806) @@ -0,0 +1,17 @@
+package sidekick.util;
+
+import javax.swing.text.Position;
+
+// a concrete implementation of Position
+public class SideKickPosition implements Position {
+    
+    private int offset;
+    
+    public SideKickPosition(int offset) {
+        this.offset = offset;   
+    }
+    
+    public int getOffset() {
+        return offset;   
+    }
+}
\ No newline at end of file

This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
jEdit-CVS mailing list
jEdit-CVS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic