/[gzz]/gzz/lava/gzz/potion/potions/ViewContainedText.java
ViewVC logotype

Diff of /gzz/lava/gzz/potion/potions/ViewContainedText.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by benja, Mon Jan 6 13:04:15 2003 UTC revision 1.3 by benja, Thu Jan 16 13:42:59 2003 UTC
# Line 8  import gzz.zzutil.*; Line 8  import gzz.zzutil.*;
8    
9  public class ViewContainedText extends AbstractHead implements Command {  public class ViewContainedText extends AbstractHead implements Command {
10                    
11          public ViewContainedText() {      public ViewContainedText() {
12              super(new Object[] {          super(new Object[] {
13              "View the text in ", Types.CELL});              "View the text in ", Types.CELL});
14          }      }
15                    
16          public void execute(List[] params, Map context) {      public void execute(List[] params, Map context) {
17              for(Iterator i=params[0].iterator(); i.hasNext();) {          for(Iterator i=params[0].iterator(); i.hasNext();) {
18                  Cell c = (Cell)i.next();              Cell c = (Cell)i.next();
19                  String s =                StringBuffer buf = new StringBuffer();
20                      "Attention! The text below CANNOT be edited!\n" +              buf.append(
21                      "All changes WILL BE LOST!\n\n" +                  "Attention! The text below CANNOT be edited!\n" +
22                      Containment.getContainedText(c);                  "All changes WILL BE LOST!\n\n");
23                  DefaultBinder.execExternalEditor(s);              String s =  
24                    Containment.getContainedText(c);
25                int old = 0;
26                int pos = s.indexOf('\r');
27                while(pos >= 0) {
28                    buf.append(s.substring(old, pos));
29                    old = pos+1;
30                    pos = s.indexOf('\r', old);
31              }              }
32                        buf.append(s.substring(old));
33                        DefaultBinder.execExternalEditor(buf.toString());
34          }          }
35        }
36  }  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26