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 |
} |
} |