Commits

sk  committed 9917121

- Added read state.

  • Participants
  • Parent commits 54c78e0

Comments (0)

Files changed (4)

File src/org/lispdev/console/ConsoleEnterTrigger.java

  */
 public class ConsoleEnterTrigger extends ConsoleInputTrigger
 {
-  private final int stateMask;
-  private final boolean doit;
+  private int stateMask;
+  private boolean doit;
 
   /**
    * @param r - repl to connect with
     this.doit = doit;
   }
 
+  public void setStateMask(int stateMask)
+  {
+    this.stateMask = stateMask;
+  }
+
+  public void setDoIt(boolean doit)
+  {
+    this.doit = doit;
+  }
+
   /* (non-Javadoc)
    * @see org.lispdev.views.repl.ReplInputTrigger#check(org.eclipse.swt.events.VerifyEvent)
    */

File src/org/lispdev/console/LispConsole.java

       logTrace("startEdit: called in edit mode",7);
       stopEdit();
     }
-    appendText(prompt.prompt, prompt.partition.clone(), prompt.onNewLine);
+    appendText(prompt.prompt,prompt.partition.clone(),prompt.onNewLine);
     connectUndoManager();
     setEditModeFlag(true);
     editPartition = new PartitionData(getEditOffset(),0,

File src/org/lispdev/console/PartitionData.java

 /**
- * 
+ *
  */
 package org.lispdev.console;
 
 
 /**
  * @author sk
- * 
+ *
  */
 public class PartitionData
 {
     this.actionOverCtrl = actionOverCtrl;
     this.children = null;
   }
-  
+
+  @Override
   public PartitionData clone()
   {
     StyleRange[] new_originalStyle = null;
     }
     return pd;
   }
-  
+
+  @Override
   public String toString()
   {
     String res = "{"+context+","+String.valueOf(id)+","
     +String.valueOf(children)+"}";
     return res;
   }
-  
+
   private boolean styleRangesSanityCheck(StyleRange[] sr)
   {
     if( sr == null )
     }
     return true;
   }
-  
+
   public boolean sanityCheck()
   {
-    if( length <= 0 )
+    if( length < 0 )
       return false;
     if( !styleRangesSanityCheck(originalStyle) )
       return false;
           if( pd.start + pd.length > start + length )
             return false;
           if( !pd.sanityCheck() )
-            return false;          
+            return false;
         }
       }
     }
     return true;
   }
-  
+
 }

File src/org/lispdev/console/Prompt.java

 
 public class Prompt
 {
-  public String prompt;
-  public PartitionData partition;
-  public boolean onNewLine;
-  
+  final public String prompt;
+  final public PartitionData partition;
+  final public boolean onNewLine;
+
   public Prompt(String prompt, String promptContext, String id,
       Color foreground, Color background, int fontStyle, boolean onNewLine)
   {
         new StyleRange[]{new StyleRange(0,prompt.length(),foreground,
             background,fontStyle)});
   }
-  
+
   public Prompt(String prompt, String promptContext, String id,
-      StyleRange[] style)
+      StyleRange[] style, boolean onNewLine)
   {
     this.prompt = prompt;
     this.partition = new PartitionData(0,prompt.length(),
         promptContext,id,style);
-    
+    this.onNewLine = onNewLine;
+
   }
-  
+
   public Prompt(String prompt, PartitionData partition, boolean onNewLine)
   {
     this.prompt = prompt;
     this.partition = partition;
     this.onNewLine = onNewLine;
   }
-  
+
+  @Override
   public String toString()
   {
     return "{\""+prompt+"\","+partition+","